@divriots/pdfjs-dist 3.10.111-divriots2.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/CODE_OF_CONDUCT.md +15 -0
- package/LICENSE +177 -0
- package/README.md +14 -0
- package/build/pdf.js +18009 -0
- package/build/pdf.js.map +1 -0
- package/build/pdf.min.js +22 -0
- package/build/pdf.sandbox.js +280 -0
- package/build/pdf.sandbox.js.map +1 -0
- package/build/pdf.sandbox.min.js +22 -0
- package/build/pdf.worker.entry.js +19 -0
- package/build/pdf.worker.js +57863 -0
- package/build/pdf.worker.js.map +1 -0
- package/build/pdf.worker.min.js +22 -0
- package/cmaps/78-EUC-H.bcmap +0 -0
- package/cmaps/78-EUC-V.bcmap +0 -0
- package/cmaps/78-H.bcmap +0 -0
- package/cmaps/78-RKSJ-H.bcmap +0 -0
- package/cmaps/78-RKSJ-V.bcmap +0 -0
- package/cmaps/78-V.bcmap +0 -0
- package/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/cmaps/Add-H.bcmap +0 -0
- package/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/cmaps/Add-V.bcmap +0 -0
- package/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/cmaps/B5-H.bcmap +0 -0
- package/cmaps/B5-V.bcmap +0 -0
- package/cmaps/B5pc-H.bcmap +0 -0
- package/cmaps/B5pc-V.bcmap +0 -0
- package/cmaps/CNS-EUC-H.bcmap +0 -0
- package/cmaps/CNS-EUC-V.bcmap +0 -0
- package/cmaps/CNS1-H.bcmap +0 -0
- package/cmaps/CNS1-V.bcmap +0 -0
- package/cmaps/CNS2-H.bcmap +0 -0
- package/cmaps/CNS2-V.bcmap +3 -0
- package/cmaps/ETHK-B5-H.bcmap +0 -0
- package/cmaps/ETHK-B5-V.bcmap +0 -0
- package/cmaps/ETen-B5-H.bcmap +0 -0
- package/cmaps/ETen-B5-V.bcmap +0 -0
- package/cmaps/ETenms-B5-H.bcmap +3 -0
- package/cmaps/ETenms-B5-V.bcmap +0 -0
- package/cmaps/EUC-H.bcmap +0 -0
- package/cmaps/EUC-V.bcmap +0 -0
- package/cmaps/Ext-H.bcmap +0 -0
- package/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/cmaps/Ext-V.bcmap +0 -0
- package/cmaps/GB-EUC-H.bcmap +0 -0
- package/cmaps/GB-EUC-V.bcmap +0 -0
- package/cmaps/GB-H.bcmap +4 -0
- package/cmaps/GB-V.bcmap +0 -0
- package/cmaps/GBK-EUC-H.bcmap +0 -0
- package/cmaps/GBK-EUC-V.bcmap +0 -0
- package/cmaps/GBK2K-H.bcmap +0 -0
- package/cmaps/GBK2K-V.bcmap +0 -0
- package/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/cmaps/GBT-EUC-H.bcmap +0 -0
- package/cmaps/GBT-EUC-V.bcmap +0 -0
- package/cmaps/GBT-H.bcmap +0 -0
- package/cmaps/GBT-V.bcmap +0 -0
- package/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/cmaps/H.bcmap +0 -0
- package/cmaps/HKdla-B5-H.bcmap +0 -0
- package/cmaps/HKdla-B5-V.bcmap +0 -0
- package/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/cmaps/HKm314-B5-H.bcmap +0 -0
- package/cmaps/HKm314-B5-V.bcmap +0 -0
- package/cmaps/HKm471-B5-H.bcmap +0 -0
- package/cmaps/HKm471-B5-V.bcmap +0 -0
- package/cmaps/HKscs-B5-H.bcmap +0 -0
- package/cmaps/HKscs-B5-V.bcmap +0 -0
- package/cmaps/Hankaku.bcmap +0 -0
- package/cmaps/Hiragana.bcmap +0 -0
- package/cmaps/KSC-EUC-H.bcmap +0 -0
- package/cmaps/KSC-EUC-V.bcmap +0 -0
- package/cmaps/KSC-H.bcmap +0 -0
- package/cmaps/KSC-Johab-H.bcmap +0 -0
- package/cmaps/KSC-Johab-V.bcmap +0 -0
- package/cmaps/KSC-V.bcmap +0 -0
- package/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/cmaps/Katakana.bcmap +0 -0
- package/cmaps/LICENSE +36 -0
- package/cmaps/NWP-H.bcmap +0 -0
- package/cmaps/NWP-V.bcmap +0 -0
- package/cmaps/RKSJ-H.bcmap +0 -0
- package/cmaps/RKSJ-V.bcmap +0 -0
- package/cmaps/Roman.bcmap +0 -0
- package/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/cmaps/V.bcmap +0 -0
- package/cmaps/WP-Symbol.bcmap +0 -0
- package/image_decoders/pdf.image_decoders.js +7490 -0
- package/image_decoders/pdf.image_decoders.js.map +1 -0
- package/image_decoders/pdf.image_decoders.min.js +22 -0
- package/legacy/build/pdf.d.ts +1 -0
- package/legacy/build/pdf.js +22941 -0
- package/legacy/build/pdf.js.map +1 -0
- package/legacy/build/pdf.min.js +22 -0
- package/legacy/build/pdf.sandbox.js +3274 -0
- package/legacy/build/pdf.sandbox.js.map +1 -0
- package/legacy/build/pdf.sandbox.min.js +22 -0
- package/legacy/build/pdf.worker.entry.js +19 -0
- package/legacy/build/pdf.worker.js +62058 -0
- package/legacy/build/pdf.worker.js.map +1 -0
- package/legacy/build/pdf.worker.min.js +22 -0
- package/legacy/image_decoders/pdf.image_decoders.js +10615 -0
- package/legacy/image_decoders/pdf.image_decoders.js.map +1 -0
- package/legacy/image_decoders/pdf.image_decoders.min.js +22 -0
- package/legacy/web/images/annotation-check.svg +11 -0
- package/legacy/web/images/annotation-comment.svg +16 -0
- package/legacy/web/images/annotation-help.svg +26 -0
- package/legacy/web/images/annotation-insert.svg +10 -0
- package/legacy/web/images/annotation-key.svg +11 -0
- package/legacy/web/images/annotation-newparagraph.svg +11 -0
- package/legacy/web/images/annotation-noicon.svg +7 -0
- package/legacy/web/images/annotation-note.svg +42 -0
- package/legacy/web/images/annotation-paperclip.svg +6 -0
- package/legacy/web/images/annotation-paragraph.svg +16 -0
- package/legacy/web/images/annotation-pushpin.svg +7 -0
- package/legacy/web/images/loading-icon.gif +0 -0
- package/legacy/web/pdf_viewer.css +1375 -0
- package/legacy/web/pdf_viewer.d.ts +1 -0
- package/legacy/web/pdf_viewer.js +10502 -0
- package/legacy/web/pdf_viewer.js.map +1 -0
- package/package.json +35 -0
- package/standard_fonts/FoxitDingbats.pfb +0 -0
- package/standard_fonts/FoxitFixed.pfb +0 -0
- package/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/standard_fonts/FoxitSerif.pfb +0 -0
- package/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/standard_fonts/FoxitSymbol.pfb +0 -0
- package/standard_fonts/LICENSE_FOXIT +27 -0
- package/standard_fonts/LICENSE_LIBERATION +102 -0
- package/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/types/external/webL10n/l10n.d.ts +0 -0
- package/types/src/display/annotation_layer.d.ts +203 -0
- package/types/src/display/annotation_storage.d.ts +89 -0
- package/types/src/display/api.d.ts +1592 -0
- package/types/src/display/base_factory.d.ts +54 -0
- package/types/src/display/canvas.d.ts +208 -0
- package/types/src/display/display_utils.d.ts +277 -0
- package/types/src/display/editor/annotation_editor_layer.d.ts +196 -0
- package/types/src/display/editor/editor.d.ts +325 -0
- package/types/src/display/editor/freetext.d.ts +72 -0
- package/types/src/display/editor/ink.d.ts +95 -0
- package/types/src/display/editor/stamp.d.ts +28 -0
- package/types/src/display/editor/tools.d.ts +349 -0
- package/types/src/display/font_loader.d.ts +43 -0
- package/types/src/display/metadata.d.ts +11 -0
- package/types/src/display/optional_content_config.d.ts +13 -0
- package/types/src/display/pattern_helper.d.ts +73 -0
- package/types/src/display/text_layer.d.ts +151 -0
- package/types/src/display/transport_stream.d.ts +68 -0
- package/types/src/display/worker_options.d.ts +27 -0
- package/types/src/display/xfa_layer.d.ts +46 -0
- package/types/src/display/xfa_text.d.ts +19 -0
- package/types/src/pdf.d.ts +62 -0
- package/types/src/shared/image_utils.d.ts +17 -0
- package/types/src/shared/message_handler.d.ts +43 -0
- package/types/src/shared/murmurhash3.d.ts +7 -0
- package/types/src/shared/scripting_utils.d.ts +16 -0
- package/types/src/shared/util.d.ts +398 -0
- package/types/web/annotation_editor_layer_builder.d.ts +50 -0
- package/types/web/annotation_layer_builder.d.ts +83 -0
- package/types/web/app_options.d.ts +14 -0
- package/types/web/download_manager.d.ts +14 -0
- package/types/web/event_utils.d.ts +75 -0
- package/types/web/generic_scripting.d.ts +8 -0
- package/types/web/genericl10n.d.ts +13 -0
- package/types/web/interfaces.d.ts +163 -0
- package/types/web/l10n_utils.d.ts +7 -0
- package/types/web/pdf_find_controller.d.ts +108 -0
- package/types/web/pdf_find_utils.d.ts +16 -0
- package/types/web/pdf_history.d.ts +168 -0
- package/types/web/pdf_link_service.d.ts +243 -0
- package/types/web/pdf_page_view.d.ts +209 -0
- package/types/web/pdf_rendering_queue.d.ts +53 -0
- package/types/web/pdf_scripting_manager.component.d.ts +5 -0
- package/types/web/pdf_scripting_manager.d.ts +61 -0
- package/types/web/pdf_single_page_viewer.d.ts +7 -0
- package/types/web/pdf_thumbnail_view.d.ts +131 -0
- package/types/web/pdf_thumbnail_viewer.d.ts +104 -0
- package/types/web/pdf_viewer.component.d.ts +24 -0
- package/types/web/pdf_viewer.d.ts +455 -0
- package/types/web/struct_tree_layer_builder.d.ts +7 -0
- package/types/web/text_accessibility.d.ts +42 -0
- package/types/web/text_highlighter.d.ts +63 -0
- package/types/web/text_layer_builder.d.ts +64 -0
- package/types/web/ui_utils.d.ts +288 -0
- package/types/web/xfa_layer_builder.d.ts +41 -0
- package/web/images/annotation-check.svg +11 -0
- package/web/images/annotation-comment.svg +16 -0
- package/web/images/annotation-help.svg +26 -0
- package/web/images/annotation-insert.svg +10 -0
- package/web/images/annotation-key.svg +11 -0
- package/web/images/annotation-newparagraph.svg +11 -0
- package/web/images/annotation-noicon.svg +7 -0
- package/web/images/annotation-note.svg +42 -0
- package/web/images/annotation-paperclip.svg +6 -0
- package/web/images/annotation-paragraph.svg +16 -0
- package/web/images/annotation-pushpin.svg +7 -0
- package/web/images/loading-icon.gif +0 -0
- package/web/pdf_viewer.css +1375 -0
- package/web/pdf_viewer.d.ts +1 -0
- package/web/pdf_viewer.js +7752 -0
- package/web/pdf_viewer.js.map +1 -0
- package/webpack.js +26 -0
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;
|
|
2
|
+
export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
|
|
3
|
+
export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
4
|
+
export type OptionalContentConfig = import("../src/display/optional_content_config").OptionalContentConfig;
|
|
5
|
+
export type EventBus = import("./event_utils").EventBus;
|
|
6
|
+
export type IDownloadManager = import("./interfaces").IDownloadManager;
|
|
7
|
+
export type IL10n = import("./interfaces").IL10n;
|
|
8
|
+
export type IPDFLinkService = import("./interfaces").IPDFLinkService;
|
|
9
|
+
export type PDFViewerOptions = {
|
|
10
|
+
/**
|
|
11
|
+
* - The container for the viewer element.
|
|
12
|
+
*/
|
|
13
|
+
container: HTMLDivElement;
|
|
14
|
+
/**
|
|
15
|
+
* - The viewer element.
|
|
16
|
+
*/
|
|
17
|
+
viewer?: HTMLDivElement | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* - The application event bus.
|
|
20
|
+
*/
|
|
21
|
+
eventBus: EventBus;
|
|
22
|
+
/**
|
|
23
|
+
* - The navigation/linking service.
|
|
24
|
+
*/
|
|
25
|
+
linkService?: import("./interfaces").IPDFLinkService | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* - The download manager
|
|
28
|
+
* component.
|
|
29
|
+
*/
|
|
30
|
+
downloadManager?: import("./interfaces").IDownloadManager | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* - The find controller
|
|
33
|
+
* component.
|
|
34
|
+
*/
|
|
35
|
+
findController?: any;
|
|
36
|
+
/**
|
|
37
|
+
* - The scripting manager
|
|
38
|
+
* component.
|
|
39
|
+
*/
|
|
40
|
+
scriptingManager?: any;
|
|
41
|
+
/**
|
|
42
|
+
* - The rendering queue object.
|
|
43
|
+
*/
|
|
44
|
+
renderingQueue?: PDFRenderingQueue | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* - Removes the border shadow around
|
|
47
|
+
* the pages. The default value is `false`.
|
|
48
|
+
*/
|
|
49
|
+
removePageBorders?: boolean | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* - Controls if the text layer used for
|
|
52
|
+
* selection and searching is created. The constants from {TextLayerMode}
|
|
53
|
+
* should be used. The default value is `TextLayerMode.ENABLE`.
|
|
54
|
+
*/
|
|
55
|
+
textLayerMode?: number | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* - Controls if the annotation layer is
|
|
58
|
+
* created, and if interactive form elements or `AnnotationStorage`-data are
|
|
59
|
+
* being rendered. The constants from {@link AnnotationMode } should be used;
|
|
60
|
+
* see also {@link RenderParameters } and {@link GetOperatorListParameters }.
|
|
61
|
+
* The default value is `AnnotationMode.ENABLE_FORMS`.
|
|
62
|
+
*/
|
|
63
|
+
annotationMode?: number | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* - Enables the creation and editing
|
|
66
|
+
* of new Annotations. The constants from {@link AnnotationEditorType } should
|
|
67
|
+
* be used. The default value is `AnnotationEditorType.NONE`.
|
|
68
|
+
*/
|
|
69
|
+
annotationEditorMode?: number | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* - Path for image resources, mainly
|
|
72
|
+
* mainly for annotation icons. Include trailing slash.
|
|
73
|
+
*/
|
|
74
|
+
imageResourcesPath?: string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* - Enables automatic rotation of
|
|
77
|
+
* landscape pages upon printing. The default is `false`.
|
|
78
|
+
*/
|
|
79
|
+
enablePrintAutoRotate?: boolean | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* - Allows to use an
|
|
82
|
+
* OffscreenCanvas if needed.
|
|
83
|
+
*/
|
|
84
|
+
isOffscreenCanvasSupported?: boolean | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* - The maximum supported canvas size in
|
|
87
|
+
* total pixels, i.e. width * height. Use `-1` for no limit, or `0` for
|
|
88
|
+
* CSS-only zooming. The default value is 4096 * 4096 (16 mega-pixels).
|
|
89
|
+
*/
|
|
90
|
+
maxCanvasPixels?: number | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* - Localization service.
|
|
93
|
+
*/
|
|
94
|
+
l10n?: import("./interfaces").IL10n | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* - Enables PDF document permissions,
|
|
97
|
+
* when they exist. The default value is `false`.
|
|
98
|
+
*/
|
|
99
|
+
enablePermissions?: boolean | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* - Overwrites background and foreground colors
|
|
102
|
+
* with user defined ones in order to improve readability in high contrast
|
|
103
|
+
* mode.
|
|
104
|
+
*/
|
|
105
|
+
pageColors?: Object | undefined;
|
|
106
|
+
};
|
|
107
|
+
export namespace PagesCountLimit {
|
|
108
|
+
let FORCE_SCROLL_MODE_PAGE: number;
|
|
109
|
+
let FORCE_LAZY_PAGE_INIT: number;
|
|
110
|
+
let PAUSE_EAGER_PAGE_INIT: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* @typedef {Object} PDFViewerOptions
|
|
114
|
+
* @property {HTMLDivElement} container - The container for the viewer element.
|
|
115
|
+
* @property {HTMLDivElement} [viewer] - The viewer element.
|
|
116
|
+
* @property {EventBus} eventBus - The application event bus.
|
|
117
|
+
* @property {IPDFLinkService} [linkService] - The navigation/linking service.
|
|
118
|
+
* @property {IDownloadManager} [downloadManager] - The download manager
|
|
119
|
+
* component.
|
|
120
|
+
* @property {PDFFindController} [findController] - The find controller
|
|
121
|
+
* component.
|
|
122
|
+
* @property {PDFScriptingManager} [scriptingManager] - The scripting manager
|
|
123
|
+
* component.
|
|
124
|
+
* @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object.
|
|
125
|
+
* @property {boolean} [removePageBorders] - Removes the border shadow around
|
|
126
|
+
* the pages. The default value is `false`.
|
|
127
|
+
* @property {number} [textLayerMode] - Controls if the text layer used for
|
|
128
|
+
* selection and searching is created. The constants from {TextLayerMode}
|
|
129
|
+
* should be used. The default value is `TextLayerMode.ENABLE`.
|
|
130
|
+
* @property {number} [annotationMode] - Controls if the annotation layer is
|
|
131
|
+
* created, and if interactive form elements or `AnnotationStorage`-data are
|
|
132
|
+
* being rendered. The constants from {@link AnnotationMode} should be used;
|
|
133
|
+
* see also {@link RenderParameters} and {@link GetOperatorListParameters}.
|
|
134
|
+
* The default value is `AnnotationMode.ENABLE_FORMS`.
|
|
135
|
+
* @property {number} [annotationEditorMode] - Enables the creation and editing
|
|
136
|
+
* of new Annotations. The constants from {@link AnnotationEditorType} should
|
|
137
|
+
* be used. The default value is `AnnotationEditorType.NONE`.
|
|
138
|
+
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
|
139
|
+
* mainly for annotation icons. Include trailing slash.
|
|
140
|
+
* @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of
|
|
141
|
+
* landscape pages upon printing. The default is `false`.
|
|
142
|
+
* @property {boolean} [isOffscreenCanvasSupported] - Allows to use an
|
|
143
|
+
* OffscreenCanvas if needed.
|
|
144
|
+
* @property {number} [maxCanvasPixels] - The maximum supported canvas size in
|
|
145
|
+
* total pixels, i.e. width * height. Use `-1` for no limit, or `0` for
|
|
146
|
+
* CSS-only zooming. The default value is 4096 * 4096 (16 mega-pixels).
|
|
147
|
+
* @property {IL10n} [l10n] - Localization service.
|
|
148
|
+
* @property {boolean} [enablePermissions] - Enables PDF document permissions,
|
|
149
|
+
* when they exist. The default value is `false`.
|
|
150
|
+
* @property {Object} [pageColors] - Overwrites background and foreground colors
|
|
151
|
+
* with user defined ones in order to improve readability in high contrast
|
|
152
|
+
* mode.
|
|
153
|
+
*/
|
|
154
|
+
export class PDFPageViewBuffer {
|
|
155
|
+
constructor(size: any);
|
|
156
|
+
push(view: any): void;
|
|
157
|
+
/**
|
|
158
|
+
* After calling resize, the size of the buffer will be `newSize`.
|
|
159
|
+
* The optional parameter `idsToKeep` is, if present, a Set of page-ids to
|
|
160
|
+
* push to the back of the buffer, delaying their destruction. The size of
|
|
161
|
+
* `idsToKeep` has no impact on the final size of the buffer; if `idsToKeep`
|
|
162
|
+
* is larger than `newSize`, some of those pages will be destroyed anyway.
|
|
163
|
+
*/
|
|
164
|
+
resize(newSize: any, idsToKeep?: null): void;
|
|
165
|
+
has(view: any): boolean;
|
|
166
|
+
[Symbol.iterator](): IterableIterator<any>;
|
|
167
|
+
#private;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Simple viewer control to display PDF content/pages.
|
|
171
|
+
*/
|
|
172
|
+
export class PDFViewer {
|
|
173
|
+
/**
|
|
174
|
+
* @param {PDFViewerOptions} options
|
|
175
|
+
*/
|
|
176
|
+
constructor(options: PDFViewerOptions);
|
|
177
|
+
container: HTMLDivElement;
|
|
178
|
+
viewer: Element | null;
|
|
179
|
+
eventBus: import("./event_utils").EventBus;
|
|
180
|
+
linkService: import("./interfaces").IPDFLinkService | SimpleLinkService;
|
|
181
|
+
downloadManager: import("./interfaces").IDownloadManager | null;
|
|
182
|
+
findController: any;
|
|
183
|
+
_scriptingManager: any;
|
|
184
|
+
imageResourcesPath: string;
|
|
185
|
+
enablePrintAutoRotate: boolean;
|
|
186
|
+
removePageBorders: boolean | undefined;
|
|
187
|
+
isOffscreenCanvasSupported: boolean;
|
|
188
|
+
maxCanvasPixels: number | undefined;
|
|
189
|
+
l10n: {
|
|
190
|
+
getLanguage(): Promise<string>;
|
|
191
|
+
getDirection(): Promise<string>;
|
|
192
|
+
get(key: any, args?: null, fallback?: any): Promise<any>;
|
|
193
|
+
translate(element: any): Promise<void>;
|
|
194
|
+
};
|
|
195
|
+
pageColors: Object | null;
|
|
196
|
+
defaultRenderingQueue: boolean;
|
|
197
|
+
renderingQueue: PDFRenderingQueue | undefined;
|
|
198
|
+
scroll: {
|
|
199
|
+
right: boolean;
|
|
200
|
+
down: boolean;
|
|
201
|
+
lastX: any;
|
|
202
|
+
lastY: any;
|
|
203
|
+
_eventHandler: (evt: any) => void;
|
|
204
|
+
};
|
|
205
|
+
presentationModeState: number;
|
|
206
|
+
_onBeforeDraw: ((evt: any) => void) | null;
|
|
207
|
+
_onAfterDraw: any;
|
|
208
|
+
get pagesCount(): number;
|
|
209
|
+
getPageView(index: any): any;
|
|
210
|
+
getCachedPageViews(): Set<any>;
|
|
211
|
+
/**
|
|
212
|
+
* @type {boolean} - True if all {PDFPageView} objects are initialized.
|
|
213
|
+
*/
|
|
214
|
+
get pageViewsReady(): boolean;
|
|
215
|
+
/**
|
|
216
|
+
* @type {boolean}
|
|
217
|
+
*/
|
|
218
|
+
get renderForms(): boolean;
|
|
219
|
+
/**
|
|
220
|
+
* @type {boolean}
|
|
221
|
+
*/
|
|
222
|
+
get enableScripting(): boolean;
|
|
223
|
+
/**
|
|
224
|
+
* @param {number} val - The page number.
|
|
225
|
+
*/
|
|
226
|
+
set currentPageNumber(arg: number);
|
|
227
|
+
/**
|
|
228
|
+
* @type {number}
|
|
229
|
+
*/
|
|
230
|
+
get currentPageNumber(): number;
|
|
231
|
+
/**
|
|
232
|
+
* @returns {boolean} Whether the pageNumber is valid (within bounds).
|
|
233
|
+
* @private
|
|
234
|
+
*/
|
|
235
|
+
private _setCurrentPageNumber;
|
|
236
|
+
_currentPageNumber: any;
|
|
237
|
+
/**
|
|
238
|
+
* @param {string} val - The page label.
|
|
239
|
+
*/
|
|
240
|
+
set currentPageLabel(arg: string | null);
|
|
241
|
+
/**
|
|
242
|
+
* @type {string|null} Returns the current page label, or `null` if no page
|
|
243
|
+
* labels exist.
|
|
244
|
+
*/
|
|
245
|
+
get currentPageLabel(): string | null;
|
|
246
|
+
/**
|
|
247
|
+
* @param {number} val - Scale of the pages in percents.
|
|
248
|
+
*/
|
|
249
|
+
set currentScale(arg: number);
|
|
250
|
+
/**
|
|
251
|
+
* @type {number}
|
|
252
|
+
*/
|
|
253
|
+
get currentScale(): number;
|
|
254
|
+
/**
|
|
255
|
+
* @param val - The scale of the pages (in percent or predefined value).
|
|
256
|
+
*/
|
|
257
|
+
set currentScaleValue(arg: string);
|
|
258
|
+
/**
|
|
259
|
+
* @type {string}
|
|
260
|
+
*/
|
|
261
|
+
get currentScaleValue(): string;
|
|
262
|
+
/**
|
|
263
|
+
* @param {number} rotation - The rotation of the pages (0, 90, 180, 270).
|
|
264
|
+
*/
|
|
265
|
+
set pagesRotation(arg: number);
|
|
266
|
+
/**
|
|
267
|
+
* @type {number}
|
|
268
|
+
*/
|
|
269
|
+
get pagesRotation(): number;
|
|
270
|
+
_pagesRotation: any;
|
|
271
|
+
get firstPagePromise(): any;
|
|
272
|
+
get onePageRendered(): any;
|
|
273
|
+
get pagesPromise(): any;
|
|
274
|
+
getAllText(): Promise<string | null>;
|
|
275
|
+
/**
|
|
276
|
+
* @param {PDFDocumentProxy} pdfDocument
|
|
277
|
+
*/
|
|
278
|
+
setDocument(pdfDocument: PDFDocumentProxy): void;
|
|
279
|
+
pdfDocument: import("../src/display/api").PDFDocumentProxy | undefined;
|
|
280
|
+
_scrollMode: any;
|
|
281
|
+
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null | undefined;
|
|
282
|
+
/**
|
|
283
|
+
* @param {Array|null} labels
|
|
284
|
+
*/
|
|
285
|
+
setPageLabels(labels: any[] | null): void;
|
|
286
|
+
_pageLabels: any[] | null | undefined;
|
|
287
|
+
_resetView(): void;
|
|
288
|
+
_pages: any[] | undefined;
|
|
289
|
+
_currentScale: any;
|
|
290
|
+
_currentScaleValue: any;
|
|
291
|
+
_location: {
|
|
292
|
+
pageNumber: any;
|
|
293
|
+
scale: any;
|
|
294
|
+
top: number;
|
|
295
|
+
left: number;
|
|
296
|
+
rotation: any;
|
|
297
|
+
pdfOpenParams: string;
|
|
298
|
+
} | null | undefined;
|
|
299
|
+
_firstPageCapability: any;
|
|
300
|
+
_onePageRenderedCapability: any;
|
|
301
|
+
_pagesCapability: any;
|
|
302
|
+
_previousScrollMode: any;
|
|
303
|
+
_spreadMode: any;
|
|
304
|
+
_scrollUpdate(): void;
|
|
305
|
+
/**
|
|
306
|
+
* @param {string} label - The page label.
|
|
307
|
+
* @returns {number|null} The page number corresponding to the page label,
|
|
308
|
+
* or `null` when no page labels exist and/or the input is invalid.
|
|
309
|
+
*/
|
|
310
|
+
pageLabelToPageNumber(label: string): number | null;
|
|
311
|
+
/**
|
|
312
|
+
* @typedef {Object} ScrollPageIntoViewParameters
|
|
313
|
+
* @property {number} pageNumber - The page number.
|
|
314
|
+
* @property {Array} [destArray] - The original PDF destination array, in the
|
|
315
|
+
* format: <page-ref> </XYZ|/FitXXX> <args..>
|
|
316
|
+
* @property {boolean} [allowNegativeOffset] - Allow negative page offsets.
|
|
317
|
+
* The default value is `false`.
|
|
318
|
+
* @property {boolean} [ignoreDestinationZoom] - Ignore the zoom argument in
|
|
319
|
+
* the destination array. The default value is `false`.
|
|
320
|
+
*/
|
|
321
|
+
/**
|
|
322
|
+
* Scrolls page into view.
|
|
323
|
+
* @param {ScrollPageIntoViewParameters} params
|
|
324
|
+
*/
|
|
325
|
+
scrollPageIntoView({ pageNumber, destArray, allowNegativeOffset, ignoreDestinationZoom, }: {
|
|
326
|
+
/**
|
|
327
|
+
* - The page number.
|
|
328
|
+
*/
|
|
329
|
+
pageNumber: number;
|
|
330
|
+
/**
|
|
331
|
+
* - The original PDF destination array, in the
|
|
332
|
+
* format: <page-ref> </XYZ|/FitXXX> <args..>
|
|
333
|
+
*/
|
|
334
|
+
destArray?: any[] | undefined;
|
|
335
|
+
/**
|
|
336
|
+
* - Allow negative page offsets.
|
|
337
|
+
* The default value is `false`.
|
|
338
|
+
*/
|
|
339
|
+
allowNegativeOffset?: boolean | undefined;
|
|
340
|
+
/**
|
|
341
|
+
* - Ignore the zoom argument in
|
|
342
|
+
* the destination array. The default value is `false`.
|
|
343
|
+
*/
|
|
344
|
+
ignoreDestinationZoom?: boolean | undefined;
|
|
345
|
+
}): void;
|
|
346
|
+
_updateLocation(firstPage: any): void;
|
|
347
|
+
update(): void;
|
|
348
|
+
containsElement(element: any): boolean;
|
|
349
|
+
focus(): void;
|
|
350
|
+
get _isContainerRtl(): boolean;
|
|
351
|
+
get isInPresentationMode(): boolean;
|
|
352
|
+
get isChangingPresentationMode(): boolean;
|
|
353
|
+
get isHorizontalScrollbarEnabled(): boolean;
|
|
354
|
+
get isVerticalScrollbarEnabled(): boolean;
|
|
355
|
+
_getVisiblePages(): Object;
|
|
356
|
+
cleanup(): void;
|
|
357
|
+
/**
|
|
358
|
+
* @private
|
|
359
|
+
*/
|
|
360
|
+
private _cancelRendering;
|
|
361
|
+
forceRendering(currentlyVisiblePages: any): boolean;
|
|
362
|
+
/**
|
|
363
|
+
* @type {boolean} Whether all pages of the PDF document have identical
|
|
364
|
+
* widths and heights.
|
|
365
|
+
*/
|
|
366
|
+
get hasEqualPageSizes(): boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Returns sizes of the pages.
|
|
369
|
+
* @returns {Array} Array of objects with width/height/rotation fields.
|
|
370
|
+
*/
|
|
371
|
+
getPagesOverview(): any[];
|
|
372
|
+
/**
|
|
373
|
+
* @param {Promise<OptionalContentConfig>} promise - A promise that is
|
|
374
|
+
* resolved with an {@link OptionalContentConfig} instance.
|
|
375
|
+
*/
|
|
376
|
+
set optionalContentConfigPromise(arg: Promise<import("../src/display/optional_content_config").OptionalContentConfig | null>);
|
|
377
|
+
/**
|
|
378
|
+
* @type {Promise<OptionalContentConfig | null>}
|
|
379
|
+
*/
|
|
380
|
+
get optionalContentConfigPromise(): Promise<import("../src/display/optional_content_config").OptionalContentConfig | null>;
|
|
381
|
+
/**
|
|
382
|
+
* @param {number} mode - The direction in which the document pages should be
|
|
383
|
+
* laid out within the scrolling container.
|
|
384
|
+
* The constants from {ScrollMode} should be used.
|
|
385
|
+
*/
|
|
386
|
+
set scrollMode(arg: number);
|
|
387
|
+
/**
|
|
388
|
+
* @type {number} One of the values in {ScrollMode}.
|
|
389
|
+
*/
|
|
390
|
+
get scrollMode(): number;
|
|
391
|
+
_updateScrollMode(pageNumber?: null): void;
|
|
392
|
+
/**
|
|
393
|
+
* @param {number} mode - Group the pages in spreads, starting with odd- or
|
|
394
|
+
* even-number pages (unless `SpreadMode.NONE` is used).
|
|
395
|
+
* The constants from {SpreadMode} should be used.
|
|
396
|
+
*/
|
|
397
|
+
set spreadMode(arg: number);
|
|
398
|
+
/**
|
|
399
|
+
* @type {number} One of the values in {SpreadMode}.
|
|
400
|
+
*/
|
|
401
|
+
get spreadMode(): number;
|
|
402
|
+
_updateSpreadMode(pageNumber?: null): void;
|
|
403
|
+
/**
|
|
404
|
+
* @private
|
|
405
|
+
*/
|
|
406
|
+
private _getPageAdvance;
|
|
407
|
+
/**
|
|
408
|
+
* Go to the next page, taking scroll/spread-modes into account.
|
|
409
|
+
* @returns {boolean} Whether navigation occurred.
|
|
410
|
+
*/
|
|
411
|
+
nextPage(): boolean;
|
|
412
|
+
/**
|
|
413
|
+
* Go to the previous page, taking scroll/spread-modes into account.
|
|
414
|
+
* @returns {boolean} Whether navigation occurred.
|
|
415
|
+
*/
|
|
416
|
+
previousPage(): boolean;
|
|
417
|
+
/**
|
|
418
|
+
* @typedef {Object} ChangeScaleOptions
|
|
419
|
+
* @property {number} [drawingDelay]
|
|
420
|
+
* @property {number} [scaleFactor]
|
|
421
|
+
* @property {number} [steps]
|
|
422
|
+
*/
|
|
423
|
+
/**
|
|
424
|
+
* Increase the current zoom level one, or more, times.
|
|
425
|
+
* @param {ChangeScaleOptions} [options]
|
|
426
|
+
*/
|
|
427
|
+
increaseScale({ drawingDelay, scaleFactor, steps }?: {
|
|
428
|
+
drawingDelay?: number | undefined;
|
|
429
|
+
scaleFactor?: number | undefined;
|
|
430
|
+
steps?: number | undefined;
|
|
431
|
+
} | undefined): void;
|
|
432
|
+
/**
|
|
433
|
+
* Decrease the current zoom level one, or more, times.
|
|
434
|
+
* @param {ChangeScaleOptions} [options]
|
|
435
|
+
*/
|
|
436
|
+
decreaseScale({ drawingDelay, scaleFactor, steps }?: {
|
|
437
|
+
drawingDelay?: number | undefined;
|
|
438
|
+
scaleFactor?: number | undefined;
|
|
439
|
+
steps?: number | undefined;
|
|
440
|
+
} | undefined): void;
|
|
441
|
+
get containerTopLeft(): number[];
|
|
442
|
+
/**
|
|
443
|
+
* @param {number} mode - AnnotationEditor mode (None, FreeText, Ink, ...)
|
|
444
|
+
*/
|
|
445
|
+
set annotationEditorMode(arg: number);
|
|
446
|
+
/**
|
|
447
|
+
* @type {number}
|
|
448
|
+
*/
|
|
449
|
+
get annotationEditorMode(): number;
|
|
450
|
+
set annotationEditorParams(arg: any);
|
|
451
|
+
refresh(noUpdate?: boolean, updateArgs?: any): void;
|
|
452
|
+
#private;
|
|
453
|
+
}
|
|
454
|
+
import { PDFRenderingQueue } from "./pdf_rendering_queue.js";
|
|
455
|
+
import { SimpleLinkService } from "./pdf_link_service.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This class aims to provide some methods:
|
|
3
|
+
* - to reorder elements in the DOM with respect to the visual order;
|
|
4
|
+
* - to create a link, using aria-owns, between spans in the textLayer and
|
|
5
|
+
* annotations in the annotationLayer. The goal is to help to know
|
|
6
|
+
* where the annotations are in the text flow.
|
|
7
|
+
*/
|
|
8
|
+
export class TextAccessibilityManager {
|
|
9
|
+
/**
|
|
10
|
+
* Compare the positions of two elements, it must correspond to
|
|
11
|
+
* the visual ordering.
|
|
12
|
+
*
|
|
13
|
+
* @param {HTMLElement} e1
|
|
14
|
+
* @param {HTMLElement} e2
|
|
15
|
+
* @returns {number}
|
|
16
|
+
*/
|
|
17
|
+
static "__#45@#compareElementPositions"(e1: HTMLElement, e2: HTMLElement): number;
|
|
18
|
+
setTextMapping(textDivs: any): void;
|
|
19
|
+
/**
|
|
20
|
+
* Function called when the text layer has finished rendering.
|
|
21
|
+
*/
|
|
22
|
+
enable(): void;
|
|
23
|
+
disable(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Remove an aria-owns id from a node in the text layer.
|
|
26
|
+
* @param {HTMLElement} element
|
|
27
|
+
*/
|
|
28
|
+
removePointerInTextLayer(element: HTMLElement): void;
|
|
29
|
+
/**
|
|
30
|
+
* Find the text node which is the nearest and add an aria-owns attribute
|
|
31
|
+
* in order to correctly position this editor in the text flow.
|
|
32
|
+
* @param {HTMLElement} element
|
|
33
|
+
* @param {boolean} isRemovable
|
|
34
|
+
*/
|
|
35
|
+
addPointerInTextLayer(element: HTMLElement, isRemovable: boolean): void;
|
|
36
|
+
/**
|
|
37
|
+
* Move a div in the DOM in order to respect the visual order.
|
|
38
|
+
* @param {HTMLDivElement} element
|
|
39
|
+
*/
|
|
40
|
+
moveElementInDOM(container: any, element: HTMLDivElement, contentElement: any, isRemovable: any): void;
|
|
41
|
+
#private;
|
|
42
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export type EventBus = import("./event_utils").EventBus;
|
|
2
|
+
export type PDFFindController = import("./pdf_find_controller").PDFFindController;
|
|
3
|
+
export type TextHighlighterOptions = {
|
|
4
|
+
findController: PDFFindController;
|
|
5
|
+
/**
|
|
6
|
+
* - The application event bus.
|
|
7
|
+
*/
|
|
8
|
+
eventBus: EventBus;
|
|
9
|
+
/**
|
|
10
|
+
* - The page index.
|
|
11
|
+
*/
|
|
12
|
+
pageIndex: number;
|
|
13
|
+
};
|
|
14
|
+
/** @typedef {import("./event_utils").EventBus} EventBus */
|
|
15
|
+
/** @typedef {import("./pdf_find_controller").PDFFindController} PDFFindController */
|
|
16
|
+
/**
|
|
17
|
+
* @typedef {Object} TextHighlighterOptions
|
|
18
|
+
* @property {PDFFindController} findController
|
|
19
|
+
* @property {EventBus} eventBus - The application event bus.
|
|
20
|
+
* @property {number} pageIndex - The page index.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* TextHighlighter handles highlighting matches from the FindController in
|
|
24
|
+
* either the text layer or XFA layer depending on the type of document.
|
|
25
|
+
*/
|
|
26
|
+
export class TextHighlighter {
|
|
27
|
+
/**
|
|
28
|
+
* @param {TextHighlighterOptions} options
|
|
29
|
+
*/
|
|
30
|
+
constructor({ findController, eventBus, pageIndex }: TextHighlighterOptions);
|
|
31
|
+
findController: import("./pdf_find_controller").PDFFindController;
|
|
32
|
+
matches: any[];
|
|
33
|
+
eventBus: import("./event_utils").EventBus;
|
|
34
|
+
pageIdx: number;
|
|
35
|
+
_onUpdateTextLayerMatches: ((evt: any) => void) | null;
|
|
36
|
+
textDivs: Node[] | null;
|
|
37
|
+
textContentItemsStr: string[] | null;
|
|
38
|
+
enabled: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Store two arrays that will map DOM nodes to text they should contain.
|
|
41
|
+
* The arrays should be of equal length and the array element at each index
|
|
42
|
+
* should correspond to the other. e.g.
|
|
43
|
+
* `items[0] = "<span>Item 0</span>" and texts[0] = "Item 0";
|
|
44
|
+
*
|
|
45
|
+
* @param {Array<Node>} divs
|
|
46
|
+
* @param {Array<string>} texts
|
|
47
|
+
*/
|
|
48
|
+
setTextMapping(divs: Array<Node>, texts: Array<string>): void;
|
|
49
|
+
/**
|
|
50
|
+
* Start listening for events to update the highlighter and check if there are
|
|
51
|
+
* any current matches that need be highlighted.
|
|
52
|
+
*/
|
|
53
|
+
enable(): void;
|
|
54
|
+
disable(): void;
|
|
55
|
+
_convertMatches(matches: any, matchesLength: any): {
|
|
56
|
+
begin: {
|
|
57
|
+
divIdx: number;
|
|
58
|
+
offset: number;
|
|
59
|
+
};
|
|
60
|
+
}[];
|
|
61
|
+
_renderMatches(matches: any): void;
|
|
62
|
+
_updateMatches(reset?: boolean): void;
|
|
63
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
2
|
+
export type TextContent = import("../src/display/api").TextContent;
|
|
3
|
+
export type TextHighlighter = import("./text_highlighter").TextHighlighter;
|
|
4
|
+
export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
|
|
5
|
+
export type TextLayerBuilderOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* - Optional object that will handle
|
|
8
|
+
* highlighting text from the find controller.
|
|
9
|
+
*/
|
|
10
|
+
highlighter: TextHighlighter;
|
|
11
|
+
accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* - Allows to use an
|
|
14
|
+
* OffscreenCanvas if needed.
|
|
15
|
+
*/
|
|
16
|
+
isOffscreenCanvasSupported?: boolean | undefined;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @typedef {Object} TextLayerBuilderOptions
|
|
20
|
+
* @property {TextHighlighter} highlighter - Optional object that will handle
|
|
21
|
+
* highlighting text from the find controller.
|
|
22
|
+
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
23
|
+
* @property {boolean} [isOffscreenCanvasSupported] - Allows to use an
|
|
24
|
+
* OffscreenCanvas if needed.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The text layer builder provides text selection functionality for the PDF.
|
|
28
|
+
* It does this by creating overlay divs over the PDF's text. These divs
|
|
29
|
+
* contain text that matches the PDF text they are overlaying.
|
|
30
|
+
*/
|
|
31
|
+
export class TextLayerBuilder {
|
|
32
|
+
constructor({ highlighter, accessibilityManager, isOffscreenCanvasSupported, enablePermissions, }: {
|
|
33
|
+
highlighter?: null | undefined;
|
|
34
|
+
accessibilityManager?: null | undefined;
|
|
35
|
+
isOffscreenCanvasSupported?: boolean | undefined;
|
|
36
|
+
enablePermissions?: boolean | undefined;
|
|
37
|
+
});
|
|
38
|
+
textContentItemsStr: any[];
|
|
39
|
+
renderingDone: boolean;
|
|
40
|
+
textDivs: any[];
|
|
41
|
+
textDivProperties: WeakMap<object, any>;
|
|
42
|
+
textLayerRenderTask: any;
|
|
43
|
+
highlighter: any;
|
|
44
|
+
accessibilityManager: any;
|
|
45
|
+
isOffscreenCanvasSupported: boolean;
|
|
46
|
+
div: HTMLDivElement;
|
|
47
|
+
get numTextDivs(): number;
|
|
48
|
+
/**
|
|
49
|
+
* Renders the text layer.
|
|
50
|
+
* @param {PageViewport} viewport
|
|
51
|
+
*/
|
|
52
|
+
render(viewport: PageViewport): Promise<void>;
|
|
53
|
+
hide(): void;
|
|
54
|
+
show(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Cancel rendering of the text layer.
|
|
57
|
+
*/
|
|
58
|
+
cancel(): void;
|
|
59
|
+
/**
|
|
60
|
+
* @param {ReadableStream | TextContent} source
|
|
61
|
+
*/
|
|
62
|
+
setTextContentSource(source: ReadableStream | TextContent): void;
|
|
63
|
+
#private;
|
|
64
|
+
}
|