forked from mozilla/pdf.js
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
53 lines (49 loc) · 1.59 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
window.SystemJS = {
import: function(path) {
console.log("SystemJS stub: would process import path:", path)
}
}
let versionInfo = require('./dist/version.json')
window.PDFJSDev = {
test: function(str) {
return str.indexOf( "PRODUCTION") >= 0 || str.indexOf("GENERIC") >= 0
},
eval: function(str) {
if (str == "BUNDLE_VERSION") // MH CDL: Must update these when updating pdf.js worker version
return versionInfo.version
else if (str == "BUNDLE_BUILD")
return versionInfo.build
else
return null // not 'undefined'
},
json: function(str) {
// MH CDL: Had to add second clause here to avoid a log msg
if (str == "$ROOT/web/default_preferences.json" || str == "$ROOT/build/default_preferences.json")
return {
"showPreviousViewOnLoad": true,
"defaultZoomValue": "",
"sidebarViewOnLoad": 0,
"enableHandToolOnLoad": false,
"cursorToolOnLoad": 0,
"enableWebGL": false,
"pdfBugEnabled": false,
"disableRange": false,
"disableStream": false,
"disableAutoFetch": true, // MH CDL: avoid giant PDFs eating all memory
"disableFontFace": false,
"disableTextLayer": false,
"useOnlyCssZoom": false,
"externalLinkTarget": 0,
"enhanceTextSelection": false,
"renderer": "canvas",
"renderInteractiveForms": false,
"enablePrintAutoRotate": false,
"disablePageMode": false,
"disablePageLabels": false
}
else
console.log("hmm, PDFJSDev.json str=", str)
return null
}
}
require("./web/viewer.js");