Repository navigation
Expand file tree
/
Copy pathpdfjsAttributes.js
More file actions
181 lines (180 loc) · 6 KB
/
Copy pathpdfjsAttributes.js
File metadata and controls
181 lines (180 loc) · 6 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// Attributes of <pdfjs-viewer-element>, rendered as the reference tables and the playground.
// `update`: live = applies immediately, load = applies to the next document load,
// init = read only when the viewer is built, so set it before the element is connected,
// none = has no effect.
const samples = "/pdfjs-viewer/samples/";
export default [
{
name: "src",
group: "document",
description: "PDF file URL, relative to the page or absolute. Cross-origin URLs need CORS headers on the server. An empty value keeps the current document.",
update: "live",
playground: {
type: "select",
options: [
[`${samples}sample-pdf-with-images.pdf`, "Images, 4 MB"],
[`${samples}sample-pdf-file.pdf`, "Text, 1.7 MB"],
["https://alekswebnet.github.io/sample-pdf-10MB.pdf", "Large, cross-origin, 10.6 MB"],
],
},
},
{
name: "page",
group: "document",
description: "Page number to show.",
update: "live",
playground: { type: "number", min: 1, placeholder: "1" },
},
{
name: "zoom",
group: "document",
description: "`auto`, `page-fit`, `page-width`, `page-actual`, or a percentage such as `200`.",
update: "live",
playground: { type: "select", options: ["", "auto", "page-fit", "page-width", "page-actual", "50", "100", "200"] },
},
{
name: "pagemode",
group: "document",
description: "Sidebar: `none`, `thumbs`, `bookmarks`, `attachments` or `layers`.",
default: "`none`",
update: "live",
playground: { type: "select", options: ["none", "thumbs", "bookmarks", "attachments", "layers"] },
},
{
name: "search",
group: "document",
description: "Text to search for and highlight.",
update: "live",
playground: { type: "search", placeholder: "e.g. egestas" },
},
{
name: "phrase",
group: "document",
description: "`true` matches `search` as a whole phrase instead of separate words.",
update: "live",
playground: { type: "checkbox" },
},
{
name: "viewer-css-theme",
group: "interface",
description: "`AUTOMATIC` follows the system color scheme, `LIGHT` and `DARK` force one.",
default: "`AUTOMATIC`",
update: "live",
playground: { type: "select", options: ["AUTOMATIC", "LIGHT", "DARK"] },
},
{
name: "locale",
group: "interface",
description: "Interface language, such as `de`, `uk` or `ja`. Codes outside the [PDF.js locale list](https://github.com/mozilla/pdf.js/tree/master/l10n) are ignored.",
update: "live",
playground: {
type: "select",
options: [["", "(unset, English)"], "de", "fr", "it", "nl", "pl", "uk", "tr", "ja", "ko", ["ar", "ar (right-to-left)"], ["he", "he (right-to-left)"]],
},
},
{
name: "locale-src-template",
group: "interface",
description: "Absolute URL of the locale file, with a `{locale}` placeholder. Use it to self-host locales. Read when the viewer is built and when `locale` changes.",
default: "`https://cdn.jsdelivr.net/gh/mozilla-l10n/firefox-l10n@main/{locale}/toolkit/toolkit/pdfviewer/viewer.ftl`",
update: "init",
},
{
name: "iframe-title",
group: "interface",
description: "Accessible name of the internal `iframe`. Describe the document.",
default: "`PDF viewer window`",
update: "live",
},
{
name: "assets-base",
group: "files",
description: "Folder URL holding the five runtime files. Only needed when your bundler doesn't emit them, or to load them from a CDN. See [Bundlers](#bundlers-and-assets-base).",
default: "Folder of `pdfjs-viewer-element.js`",
update: "init",
},
{
name: "worker-src",
group: "files",
description: "PDF.js worker module URL. Must match the bundled PDF.js version.",
default: "Bundled `pdf.worker.min.mjs`",
update: "load",
},
{
name: "pdfjs-lib-src",
group: "files",
description: "PDF.js library module URL.",
default: "Bundled `pdf.mjs`",
update: "init",
},
{
name: "viewer-src",
group: "files",
description: "PDF.js viewer module URL.",
default: "Bundled `viewer.mjs`",
update: "init",
},
{
name: "viewer-css-src",
group: "files",
description: "PDF.js viewer stylesheet URL.",
default: "Bundled `viewer.css`",
update: "init",
},
{
name: "theme-css-src",
group: "files",
description: "Paper & Ink theme stylesheet URL.",
default: "Bundled `paper-and-ink.css`",
update: "init",
},
{
name: "c-map-url",
group: "resources",
description: "Absolute URL of the CMaps folder, ending in `/`. Needed for some CJK text.",
default: "`../web/cmaps/`",
update: "load",
},
{
name: "standard-font-data-url",
group: "resources",
description: "Absolute URL of the standard fonts folder, ending in `/`. For PDFs that use non-embedded base fonts.",
default: "`../web/standard_fonts/`",
update: "load",
},
{
name: "wasm-url",
group: "resources",
description: "Absolute URL of the WASM image decoders folder (JPEG 2000, JBIG2), ending in `/`.",
default: "`../web/wasm/`",
update: "load",
},
{
name: "icc-url",
group: "resources",
description: "Absolute URL of the ICC color profiles folder, ending in `/`.",
default: "`../web/iccs/`",
update: "load",
},
{
name: "image-resources-path",
group: "resources",
description: "Folder of annotation icons (`annotation-*.svg`), shipped in the package as `dist/images/`. The default is relative to your page, so set this or `assets-base`.",
default: "`./images/`, or `assets-base` + `images/`",
update: "init",
},
{
name: "sandbox-bundle-src",
group: "resources",
description: "PDF.js scripting sandbox URL, for PDFs with JavaScript (forms).",
default: "`../build/pdf.sandbox.mjs`",
update: "load",
},
{
name: "debugger-src",
group: "resources",
description: "PDF.js debugger script URL. It has no effect: the debugger isn't shipped in the package, and the element offers no way to turn it on.",
default: "`./debugger.mjs`",
update: "none",
},
];