@vaadin-component-factory/vcf-pdf-viewer 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/pdfjs/dist/display_utils.js +714 -714
- package/pdfjs/dist/fetch_stream.js +293 -293
- package/pdfjs/dist/l10n_utils.js +122 -122
- package/pdfjs/dist/message_handler.js +524 -524
- package/pdfjs/dist/network.js +552 -552
- package/pdfjs/dist/network_utils.js +309 -309
- package/pdfjs/dist/node_stream.js +481 -481
- package/pdfjs/dist/pdf.js +11687 -11687
- package/pdfjs/dist/pdf_link_service.js +534 -534
- package/pdfjs/dist/pdf_rendering_queue.js +154 -154
- package/pdfjs/dist/pdf_thumbnail_viewer.js +738 -738
- package/pdfjs/dist/pdf_viewer.js +3207 -3207
- package/pdfjs/dist/ui_utils.js +881 -881
- package/pdfjs/dist/util.js +991 -991
- package/pdfjs/dist/worker.js +60846 -60846
- package/src/vcf-pdf-viewer.js +46 -5
package/pdfjs/dist/l10n_utils.js
CHANGED
|
@@ -11,130 +11,130 @@
|
|
|
11
11
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
* See the License for the specific language governing permissions and
|
|
13
13
|
* limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
16
|
/**
|
|
17
17
|
* A subset of the l10n strings in the `l10n/en-US/viewer.properties` file.
|
|
18
|
-
*/
|
|
19
|
-
const DEFAULT_L10N_STRINGS = {
|
|
20
|
-
of_pages: "of {{pagesCount}}",
|
|
21
|
-
page_of_pages: "({{pageNumber}} of {{pagesCount}})",
|
|
22
|
-
document_properties_kb: "{{size_kb}} KB ({{size_b}} bytes)",
|
|
23
|
-
document_properties_mb: "{{size_mb}} MB ({{size_b}} bytes)",
|
|
24
|
-
document_properties_date_string: "{{date}}, {{time}}",
|
|
25
|
-
document_properties_page_size_unit_inches: "in",
|
|
26
|
-
document_properties_page_size_unit_millimeters: "mm",
|
|
27
|
-
document_properties_page_size_orientation_portrait: "portrait",
|
|
28
|
-
document_properties_page_size_orientation_landscape: "landscape",
|
|
29
|
-
document_properties_page_size_name_a3: "A3",
|
|
30
|
-
document_properties_page_size_name_a4: "A4",
|
|
31
|
-
document_properties_page_size_name_letter: "Letter",
|
|
32
|
-
document_properties_page_size_name_legal: "Legal",
|
|
33
|
-
document_properties_page_size_dimension_string: "{{width}} × {{height}} {{unit}} ({{orientation}})",
|
|
34
|
-
document_properties_page_size_dimension_name_string: "{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",
|
|
35
|
-
document_properties_linearized_yes: "Yes",
|
|
36
|
-
document_properties_linearized_no: "No",
|
|
37
|
-
print_progress_percent: "{{progress}}%",
|
|
38
|
-
"toggle_sidebar.title": "Toggle Sidebar",
|
|
39
|
-
"toggle_sidebar_notification2.title": "Toggle Sidebar (document contains outline/attachments/layers)",
|
|
40
|
-
additional_layers: "Additional Layers",
|
|
41
|
-
page_landmark: "Page {{page}}",
|
|
42
|
-
thumb_page_title: "Page {{page}}",
|
|
43
|
-
thumb_page_canvas: "Thumbnail of Page {{page}}",
|
|
44
|
-
find_reached_top: "Reached top of document, continued from bottom",
|
|
45
|
-
find_reached_bottom: "Reached end of document, continued from top",
|
|
46
|
-
"find_match_count[one]": "{{current}} of {{total}} match",
|
|
47
|
-
"find_match_count[other]": "{{current}} of {{total}} matches",
|
|
48
|
-
"find_match_count_limit[one]": "More than {{limit}} match",
|
|
49
|
-
"find_match_count_limit[other]": "More than {{limit}} matches",
|
|
50
|
-
find_not_found: "Phrase not found",
|
|
51
|
-
error_version_info: "PDF.js v{{version}} (build: {{build}})",
|
|
52
|
-
error_message: "Message: {{message}}",
|
|
53
|
-
error_stack: "Stack: {{stack}}",
|
|
54
|
-
error_file: "File: {{file}}",
|
|
55
|
-
error_line: "Line: {{line}}",
|
|
56
|
-
rendering_error: "An error occurred while rendering the page.",
|
|
57
|
-
page_scale_width: "Page Width",
|
|
58
|
-
page_scale_fit: "Page Fit",
|
|
59
|
-
page_scale_auto: "Automatic Zoom",
|
|
60
|
-
page_scale_actual: "Actual Size",
|
|
61
|
-
page_scale_percent: "{{scale}}%",
|
|
62
|
-
loading: "Loading…",
|
|
63
|
-
loading_error: "An error occurred while loading the PDF.",
|
|
64
|
-
invalid_file_error: "Invalid or corrupted PDF file.",
|
|
65
|
-
missing_file_error: "Missing PDF file.",
|
|
66
|
-
unexpected_response_error: "Unexpected server response.",
|
|
67
|
-
printing_not_supported: "Warning: Printing is not fully supported by this browser.",
|
|
68
|
-
printing_not_ready: "Warning: The PDF is not fully loaded for printing.",
|
|
69
|
-
web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts."
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
function getL10nFallback(key, args) {
|
|
73
|
-
switch (key) {
|
|
74
|
-
case "find_match_count":
|
|
75
|
-
key = `find_match_count[${args.total === 1 ? "one" : "other"}]`;
|
|
76
|
-
break;
|
|
77
|
-
|
|
78
|
-
case "find_match_count_limit":
|
|
79
|
-
key = `find_match_count_limit[${args.limit === 1 ? "one" : "other"}]`;
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return DEFAULT_L10N_STRINGS[key] || "";
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const PARTIAL_LANG_CODES = {
|
|
87
|
-
en: "en-US",
|
|
88
|
-
es: "es-ES",
|
|
89
|
-
fy: "fy-NL",
|
|
90
|
-
ga: "ga-IE",
|
|
91
|
-
gu: "gu-IN",
|
|
92
|
-
hi: "hi-IN",
|
|
93
|
-
hy: "hy-AM",
|
|
94
|
-
nb: "nb-NO",
|
|
95
|
-
ne: "ne-NP",
|
|
96
|
-
nn: "nn-NO",
|
|
97
|
-
pa: "pa-IN",
|
|
98
|
-
pt: "pt-PT",
|
|
99
|
-
sv: "sv-SE",
|
|
100
|
-
zh: "zh-CN"
|
|
101
|
-
}; // Try to support "incompletely" specified language codes (see issue 13689).
|
|
102
|
-
|
|
103
|
-
function fixupLangCode(langCode) {
|
|
104
|
-
return PARTIAL_LANG_CODES[langCode === null || langCode === void 0 ? void 0 : langCode.toLowerCase()] || langCode;
|
|
105
|
-
} // Replaces {{arguments}} with their values.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
function formatL10nValue(text, args) {
|
|
109
|
-
if (!args) {
|
|
110
|
-
return text;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return text.replace(/\{\{\s*(\w+)\s*\}\}/g, (all, name) => {
|
|
114
|
-
return name in args ? args[name] : "{{" + name + "}}";
|
|
115
|
-
});
|
|
116
|
-
}
|
|
18
|
+
*/
|
|
19
|
+
const DEFAULT_L10N_STRINGS = {
|
|
20
|
+
of_pages: "of {{pagesCount}}",
|
|
21
|
+
page_of_pages: "({{pageNumber}} of {{pagesCount}})",
|
|
22
|
+
document_properties_kb: "{{size_kb}} KB ({{size_b}} bytes)",
|
|
23
|
+
document_properties_mb: "{{size_mb}} MB ({{size_b}} bytes)",
|
|
24
|
+
document_properties_date_string: "{{date}}, {{time}}",
|
|
25
|
+
document_properties_page_size_unit_inches: "in",
|
|
26
|
+
document_properties_page_size_unit_millimeters: "mm",
|
|
27
|
+
document_properties_page_size_orientation_portrait: "portrait",
|
|
28
|
+
document_properties_page_size_orientation_landscape: "landscape",
|
|
29
|
+
document_properties_page_size_name_a3: "A3",
|
|
30
|
+
document_properties_page_size_name_a4: "A4",
|
|
31
|
+
document_properties_page_size_name_letter: "Letter",
|
|
32
|
+
document_properties_page_size_name_legal: "Legal",
|
|
33
|
+
document_properties_page_size_dimension_string: "{{width}} × {{height}} {{unit}} ({{orientation}})",
|
|
34
|
+
document_properties_page_size_dimension_name_string: "{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",
|
|
35
|
+
document_properties_linearized_yes: "Yes",
|
|
36
|
+
document_properties_linearized_no: "No",
|
|
37
|
+
print_progress_percent: "{{progress}}%",
|
|
38
|
+
"toggle_sidebar.title": "Toggle Sidebar",
|
|
39
|
+
"toggle_sidebar_notification2.title": "Toggle Sidebar (document contains outline/attachments/layers)",
|
|
40
|
+
additional_layers: "Additional Layers",
|
|
41
|
+
page_landmark: "Page {{page}}",
|
|
42
|
+
thumb_page_title: "Page {{page}}",
|
|
43
|
+
thumb_page_canvas: "Thumbnail of Page {{page}}",
|
|
44
|
+
find_reached_top: "Reached top of document, continued from bottom",
|
|
45
|
+
find_reached_bottom: "Reached end of document, continued from top",
|
|
46
|
+
"find_match_count[one]": "{{current}} of {{total}} match",
|
|
47
|
+
"find_match_count[other]": "{{current}} of {{total}} matches",
|
|
48
|
+
"find_match_count_limit[one]": "More than {{limit}} match",
|
|
49
|
+
"find_match_count_limit[other]": "More than {{limit}} matches",
|
|
50
|
+
find_not_found: "Phrase not found",
|
|
51
|
+
error_version_info: "PDF.js v{{version}} (build: {{build}})",
|
|
52
|
+
error_message: "Message: {{message}}",
|
|
53
|
+
error_stack: "Stack: {{stack}}",
|
|
54
|
+
error_file: "File: {{file}}",
|
|
55
|
+
error_line: "Line: {{line}}",
|
|
56
|
+
rendering_error: "An error occurred while rendering the page.",
|
|
57
|
+
page_scale_width: "Page Width",
|
|
58
|
+
page_scale_fit: "Page Fit",
|
|
59
|
+
page_scale_auto: "Automatic Zoom",
|
|
60
|
+
page_scale_actual: "Actual Size",
|
|
61
|
+
page_scale_percent: "{{scale}}%",
|
|
62
|
+
loading: "Loading…",
|
|
63
|
+
loading_error: "An error occurred while loading the PDF.",
|
|
64
|
+
invalid_file_error: "Invalid or corrupted PDF file.",
|
|
65
|
+
missing_file_error: "Missing PDF file.",
|
|
66
|
+
unexpected_response_error: "Unexpected server response.",
|
|
67
|
+
printing_not_supported: "Warning: Printing is not fully supported by this browser.",
|
|
68
|
+
printing_not_ready: "Warning: The PDF is not fully loaded for printing.",
|
|
69
|
+
web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts."
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
function getL10nFallback(key, args) {
|
|
73
|
+
switch (key) {
|
|
74
|
+
case "find_match_count":
|
|
75
|
+
key = `find_match_count[${args.total === 1 ? "one" : "other"}]`;
|
|
76
|
+
break;
|
|
77
|
+
|
|
78
|
+
case "find_match_count_limit":
|
|
79
|
+
key = `find_match_count_limit[${args.limit === 1 ? "one" : "other"}]`;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return DEFAULT_L10N_STRINGS[key] || "";
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const PARTIAL_LANG_CODES = {
|
|
87
|
+
en: "en-US",
|
|
88
|
+
es: "es-ES",
|
|
89
|
+
fy: "fy-NL",
|
|
90
|
+
ga: "ga-IE",
|
|
91
|
+
gu: "gu-IN",
|
|
92
|
+
hi: "hi-IN",
|
|
93
|
+
hy: "hy-AM",
|
|
94
|
+
nb: "nb-NO",
|
|
95
|
+
ne: "ne-NP",
|
|
96
|
+
nn: "nn-NO",
|
|
97
|
+
pa: "pa-IN",
|
|
98
|
+
pt: "pt-PT",
|
|
99
|
+
sv: "sv-SE",
|
|
100
|
+
zh: "zh-CN"
|
|
101
|
+
}; // Try to support "incompletely" specified language codes (see issue 13689).
|
|
102
|
+
|
|
103
|
+
function fixupLangCode(langCode) {
|
|
104
|
+
return PARTIAL_LANG_CODES[langCode === null || langCode === void 0 ? void 0 : langCode.toLowerCase()] || langCode;
|
|
105
|
+
} // Replaces {{arguments}} with their values.
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
function formatL10nValue(text, args) {
|
|
109
|
+
if (!args) {
|
|
110
|
+
return text;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return text.replace(/\{\{\s*(\w+)\s*\}\}/g, (all, name) => {
|
|
114
|
+
return name in args ? args[name] : "{{" + name + "}}";
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
117
|
/**
|
|
118
118
|
* No-op implementation of the localization service.
|
|
119
119
|
* @implements {IL10n}
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const NullL10n = {
|
|
124
|
-
async getLanguage() {
|
|
125
|
-
return "en-us";
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
async getDirection() {
|
|
129
|
-
return "ltr";
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
async get(key, args = null, fallback = getL10nFallback(key, args)) {
|
|
133
|
-
return formatL10nValue(fallback, args);
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
async translate(element) {}
|
|
137
|
-
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export { NullL10n, fixupLangCode, getL10nFallback };
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
const NullL10n = {
|
|
124
|
+
async getLanguage() {
|
|
125
|
+
return "en-us";
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
async getDirection() {
|
|
129
|
+
return "ltr";
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
async get(key, args = null, fallback = getL10nFallback(key, args)) {
|
|
133
|
+
return formatL10nValue(fallback, args);
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
async translate(element) {}
|
|
137
|
+
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export { NullL10n, fixupLangCode, getL10nFallback };
|