Commit 0a0b442f authored by Mike Greiling's avatar Mike Greiling

Merge branch 'sh-add-cmaps-for-pdfjs' into 'master'

Make pdf.js render CJK characters

Closes #62152

See merge request gitlab-org/gitlab-ce!31220
parents 91c6f132 cb3290a1
......@@ -34,7 +34,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(pages => {
this.pages = pages;
......
---
title: Make pdf.js render CJK characters
merge_request: 31220
author:
type: fixed
......@@ -6,6 +6,7 @@ const StatsWriterPlugin = require('webpack-stats-plugin').StatsWriterPlugin;
const CompressionPlugin = require('compression-webpack-plugin');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ROOT_PATH = path.resolve(__dirname, '..');
const CACHE_PATH = process.env.WEBPACK_CACHE_PATH || path.join(ROOT_PATH, 'tmp/cache');
......@@ -278,6 +279,13 @@ module.exports = {
}
}),
new CopyWebpackPlugin([
{
from: path.join(ROOT_PATH, 'node_modules/pdfjs-dist/cmaps/'),
to: path.join(ROOT_PATH, 'public/assets/webpack/cmaps/'),
},
]),
// compression can require a lot of compute time and is disabled in CI
IS_PRODUCTION && !NO_COMPRESSION && new CompressionPlugin(),
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment