summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-27 22:53:24 -0700
committerStan Hu <stanhu@gmail.com>2019-07-28 00:28:33 -0700
commitcb3290a1a3deed5db6a5361ef3963a5eb83ef2aa (patch)
tree984cfd784f85c29a0b7c64a3e1049b3bdfa06430 /app/assets
parent5861b9fd32435a0e691646e7ffef19dec2561ecf (diff)
downloadgitlab-ce-cb3290a1a3deed5db6a5361ef3963a5eb83ef2aa.tar.gz
Make pdf.js render CJK characterssh-add-cmaps-for-pdfjs
As mentioned in https://github.com/wojtekmaj/react-pdf/blob/master/README.md, pdf.js needs the bundled cMaps files to work. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/62152
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/pdf/index.vue6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/pdf/index.vue b/app/assets/javascripts/pdf/index.vue
index 6d39abd4a1f..75feeb1ba04 100644
--- a/app/assets/javascripts/pdf/index.vue
+++ b/app/assets/javascripts/pdf/index.vue
@@ -35,7 +35,11 @@ export default {
load() {
this.pages = [];
return pdfjsLib
- .getDocument(this.document)
+ .getDocument({
+ url: this.document,
+ cMapUrl: '/assets/webpack/cmaps/',
+ cMapPacked: true,
+ })
.then(this.renderPages)
.then(() => this.$emit('pdflabload'))
.catch(error => this.$emit('pdflaberror', error))