Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Fix Cmaps path for future versions of PDF.js #582

Merged
merged 2 commits into from
Aug 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/views/project/editor.pug
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ block requirejs
//- don't use cdn for workers
- var aceWorkerPath = buildJsPath(lib('ace'), {cdn:false,fingerprint:false})
- var pdfWorkerPath = buildJsPath('/libs/' + lib('pdfjs') + '/pdf.worker', {cdn:false,fingerprint:false})
- var pdfCMapsPath = buildJsPath('/libs/' + lib('pdfjs') + '/bcmaps/', {cdn:false,fingerprint:false})

//- We need to do .replace(/\//g, '\\/') do that '</script>' -> '<\/script>'
//- and doesn't prematurely end the script tag.
Expand Down Expand Up @@ -154,6 +155,7 @@ block requirejs
};
window.aceFingerprint = "#{fingerprint(jsPath + lib('ace') + '/ace.js')}"
window.aceWorkerPath = "#{aceWorkerPath}";
window.pdfCMapsPath = "#{pdfCMapsPath}"

script(
data-main=buildJsPath("ide.js", {fingerprint:false}),
Expand Down
2 changes: 1 addition & 1 deletion public/coffee/ide/pdfng/directives/pdfRenderer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ define [

constructor: (@url, @options) ->
# set up external character mappings - needed for Japanese etc
window.PDFJS.cMapUrl = './bcmaps/'
window.PDFJS.cMapUrl = window.pdfCMapsPath # injected in editor.pug
window.PDFJS.cMapPacked = true

if window.location?.search?.indexOf("disable-font-face=true") >= 0
Expand Down