Repository navigation
Expand file tree
/
Copy pathpdfjsAttributes.js
More file actions
173 lines (172 loc) · 5.78 KB
/
Copy pathpdfjsAttributes.js
File metadata and controls
173 lines (172 loc) · 5.78 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
// 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.
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`, `ja` or `pt-BR`, in any case. 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", "pt-BR", "zh-CN", ["ar", "ar (right-to-left)"], ["he", "he (right-to-left)"]],
},
},
{
name: "locale-src-template",
group: "interface",
description: "URL of the locale file, with a `{locale}` placeholder that's replaced with the locale's folder name, such as `pt-BR`. 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 of the package's `dist` files: the five runtime files and the PDF.js data folders. Needed when your bundler doesn't emit the files, when a bundled app's documents need the data, or to load everything 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: "CMaps folder, needed for some CJK text.",
default: "`cmaps/` next to `viewer.mjs`",
update: "load",
},
{
name: "standard-font-data-url",
group: "resources",
description: "Standard fonts folder, for PDFs that use non-embedded base fonts.",
default: "`standard_fonts/` next to `viewer.mjs`",
update: "load",
},
{
name: "wasm-url",
group: "resources",
description: "WASM folder: the JPEG 2000 and JBIG2 image decoders, and the engine the scripting sandbox runs on.",
default: "`wasm/` next to `viewer.mjs`",
update: "load",
},
{
name: "icc-url",
group: "resources",
description: "ICC color profiles folder.",
default: "`iccs/` next to `viewer.mjs`",
update: "load",
},
{
name: "image-resources-path",
group: "resources",
description: "Annotation icons folder (`annotation-*.svg`).",
default: "`images/` next to `viewer.mjs`",
update: "load",
},
{
name: "sandbox-bundle-src",
group: "resources",
description: "Scripting sandbox module, which runs the JavaScript in PDFs, such as form calculations.",
default: "`pdf.sandbox.mjs` next to `pdf.mjs`",
update: "load",
},
];