diff options
author | Stan Hu <stanhu@gmail.com> | 2019-07-28 08:53:24 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-07-28 10:28:33 +0300 |
commit | cb3290a1a3deed5db6a5361ef3963a5eb83ef2aa (patch) | |
tree | 984cfd784f85c29a0b7c64a3e1049b3bdfa06430 /app/assets/javascripts/pdf | |
parent | 5861b9fd32435a0e691646e7ffef19dec2561ecf (diff) |
Make pdf.js render CJK characters
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/javascripts/pdf')
-rw-r--r-- | app/assets/javascripts/pdf/index.vue | 6 |
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)) |