pdfjs-viewer-element 2.3.2 → 2.3.3
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/README.md +6 -8
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/build/pdf.js +6116 -4479
- package/dist/pdfjs-3.9.179-dist/build/pdf.js.map +1 -0
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/build/pdf.sandbox.js +8 -6
- package/dist/pdfjs-3.9.179-dist/build/pdf.sandbox.js.map +1 -0
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/build/pdf.worker.js +14005 -20081
- package/dist/pdfjs-3.9.179-dist/build/pdf.worker.js.map +1 -0
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/debugger.css +3 -9
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/debugger.js +11 -11
- package/dist/pdfjs-3.9.179-dist/web/images/gv-toolbarButton-download.svg +3 -0
- package/dist/pdfjs-3.9.179-dist/web/images/gv-toolbarButton-openinapp.svg +11 -0
- package/dist/pdfjs-3.9.179-dist/web/images/toolbarButton-editorStamp.svg +8 -0
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ach/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/af/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/an/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ar/viewer.properties +2 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ast/viewer.properties +0 -22
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/az/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/be/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/bg/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/bn/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/bo/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/br/viewer.properties +2 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/brx/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/bs/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ca/viewer.properties +29 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/cak/viewer.properties +28 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ckb/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/cs/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/cy/viewer.properties +10 -28
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/da/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/de/viewer.properties +8 -26
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/dsb/viewer.properties +9 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/el/viewer.properties +9 -28
- package/dist/{pdfjs/web/locale/en-US → pdfjs-3.9.179-dist/web/locale/en-CA}/viewer.properties +5 -3
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/en-GB/viewer.properties +7 -25
- package/dist/{pdfjs/web/locale/en-CA → pdfjs-3.9.179-dist/web/locale/en-US}/viewer.properties +16 -27
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/eo/viewer.properties +7 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/es-AR/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/es-CL/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/es-ES/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/es-MX/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/et/viewer.properties +2 -35
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/eu/viewer.properties +5 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/fa/viewer.properties +28 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ff/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/fi/viewer.properties +8 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/fr/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/fur/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/fy-NL/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ga-IE/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/gd/viewer.properties +32 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/gl/viewer.properties +44 -34
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/gn/viewer.properties +7 -27
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/gu-IN/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/he/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/hi-IN/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/hr/viewer.properties +0 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/hsb/viewer.properties +7 -27
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/hu/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/hy-AM/viewer.properties +18 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/hye/viewer.properties +2 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ia/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/id/viewer.properties +0 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/is/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/it/viewer.properties +8 -15
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ja/viewer.properties +9 -2
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ka/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/kab/viewer.properties +6 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/kk/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/km/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/kn/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ko/viewer.properties +13 -31
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/lij/viewer.properties +2 -23
- package/dist/pdfjs-3.9.179-dist/web/locale/lo/viewer.properties +257 -0
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/lt/viewer.properties +2 -33
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ltg/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/lv/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/meh/viewer.properties +0 -5
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/mk/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/mr/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ms/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/my/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/nb-NO/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ne-NP/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/nl/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/nn-NO/viewer.properties +5 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/oc/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/pa-IN/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/pl/viewer.properties +6 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/pt-BR/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/pt-PT/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/rm/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ro/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ru/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/sat/viewer.properties +83 -22
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/sc/viewer.properties +4 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/sco/viewer.properties +2 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/si/viewer.properties +9 -31
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/sk/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/skr/viewer.properties +4 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/sl/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/son/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/sq/viewer.properties +0 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/sr/viewer.properties +6 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/sv-SE/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/szl/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ta/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/te/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/tg/viewer.properties +8 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/th/viewer.properties +7 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/tl/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/tr/viewer.properties +8 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/trs/viewer.properties +0 -22
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/uk/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/ur/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/uz/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/vi/viewer.properties +4 -24
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/wo/viewer.properties +2 -21
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/xh/viewer.properties +2 -23
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/zh-CN/viewer.properties +10 -28
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/zh-TW/viewer.properties +7 -25
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/viewer.css +442 -353
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/viewer.html +7 -5
- package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/viewer.js +1126 -1254
- package/dist/pdfjs-3.9.179-dist/web/viewer.js.map +1 -0
- package/dist/pdfjs-viewer-element.js +60 -27
- package/package.json +10 -3
- package/types/pdfjs-viewer-element.d.ts +4 -3
- package/dist/pdfjs/build/pdf.js.map +0 -1
- package/dist/pdfjs/build/pdf.sandbox.js.map +0 -1
- package/dist/pdfjs/build/pdf.worker.js.map +0 -1
- package/dist/pdfjs/web/locale/lo/viewer.properties +0 -145
- package/dist/pdfjs/web/standard_fonts/FoxitSans.pfb +0 -0
- package/dist/pdfjs/web/standard_fonts/FoxitSansBold.pfb +0 -0
- package/dist/pdfjs/web/standard_fonts/FoxitSansBoldItalic.pfb +0 -0
- package/dist/pdfjs/web/standard_fonts/FoxitSansItalic.pfb +0 -0
- package/dist/pdfjs/web/viewer.js.map +0 -1
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/LICENSE +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/78-EUC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/78-EUC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/78-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/78-RKSJ-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/78-RKSJ-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/78-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/78ms-RKSJ-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/78ms-RKSJ-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/83pv-RKSJ-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/90ms-RKSJ-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/90ms-RKSJ-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/90msp-RKSJ-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/90msp-RKSJ-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/90pv-RKSJ-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/90pv-RKSJ-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Add-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Add-RKSJ-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Add-RKSJ-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Add-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-CNS1-0.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-CNS1-1.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-CNS1-2.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-CNS1-3.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-CNS1-4.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-CNS1-5.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-CNS1-6.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-GB1-0.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-GB1-1.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-GB1-2.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-GB1-3.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-GB1-4.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-GB1-5.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Japan1-0.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Japan1-1.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Japan1-2.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Japan1-3.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Japan1-4.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Japan1-5.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Japan1-6.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Korea1-0.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Korea1-1.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Korea1-2.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/B5-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/B5-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/B5pc-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/B5pc-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/CNS-EUC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/CNS-EUC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/CNS1-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/CNS1-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/CNS2-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/CNS2-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/ETHK-B5-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/ETHK-B5-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/ETen-B5-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/ETen-B5-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/ETenms-B5-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/ETenms-B5-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/EUC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/EUC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Ext-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Ext-RKSJ-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Ext-RKSJ-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Ext-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GB-EUC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GB-EUC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GB-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GB-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBK-EUC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBK-EUC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBK2K-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBK2K-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBKp-EUC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBKp-EUC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBT-EUC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBT-EUC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBT-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBT-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBTpc-EUC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBTpc-EUC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBpc-EUC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/GBpc-EUC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKdla-B5-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKdla-B5-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKdlb-B5-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKdlb-B5-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKgccs-B5-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKgccs-B5-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKm314-B5-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKm314-B5-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKm471-B5-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKm471-B5-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKscs-B5-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/HKscs-B5-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Hankaku.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Hiragana.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSC-EUC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSC-EUC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSC-Johab-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSC-Johab-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSCms-UHC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSCms-UHC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSCpc-EUC-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/KSCpc-EUC-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Katakana.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/LICENSE +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/NWP-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/NWP-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/RKSJ-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/RKSJ-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/Roman.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniGB-UCS2-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniGB-UCS2-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniGB-UTF16-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniGB-UTF16-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniGB-UTF32-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniGB-UTF32-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniGB-UTF8-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniGB-UTF8-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniKS-UCS2-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniKS-UCS2-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniKS-UTF16-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniKS-UTF16-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniKS-UTF32-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniKS-UTF32-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniKS-UTF8-H.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/UniKS-UTF8-V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/V.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/cmaps/WP-Symbol.bcmap +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/compressed.tracemonkey-pldi-09.pdf +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/annotation-check.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/annotation-comment.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/annotation-help.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/annotation-insert.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/annotation-key.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/annotation-newparagraph.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/annotation-noicon.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/annotation-note.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/annotation-paperclip.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/annotation-paragraph.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/annotation-pushpin.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/cursor-editorFreeText.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/cursor-editorInk.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/findbarButton-next.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/findbarButton-previous.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/loading-dark.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/loading-icon.gif +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/loading.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-documentProperties.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-firstPage.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-handTool.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-lastPage.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-rotateCcw.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-rotateCw.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-scrollHorizontal.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-scrollPage.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-scrollVertical.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-scrollWrapped.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-selectTool.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-spreadEven.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-spreadNone.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/secondaryToolbarButton-spreadOdd.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-bookmark.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-currentOutlineItem.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-download.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-editorFreeText.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-editorInk.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-menuArrow.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-openFile.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-pageDown.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-pageUp.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-presentationMode.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-print.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-search.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-secondaryToolbarToggle.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-sidebarToggle.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-viewAttachments.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-viewLayers.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-viewOutline.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-viewThumbnail.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-zoomIn.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/toolbarButton-zoomOut.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/treeitem-collapsed.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/images/treeitem-expanded.svg +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/locale.properties +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/locale/scn/viewer.properties +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/FoxitDingbats.pfb +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/FoxitFixed.pfb +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/FoxitFixedBold.pfb +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/FoxitFixedItalic.pfb +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/FoxitSerif.pfb +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/FoxitSerifBold.pfb +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/FoxitSerifItalic.pfb +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/FoxitSymbol.pfb +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/LICENSE_FOXIT +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/LICENSE_LIBERATION +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/LiberationSans-Bold.ttf +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/LiberationSans-Italic.ttf +0 -0
- /package/dist/{pdfjs → pdfjs-3.9.179-dist}/web/standard_fonts/LiberationSans-Regular.ttf +0 -0
|
@@ -34,10 +34,10 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
34
34
|
}));
|
|
35
35
|
exports.GenericCom = void 0;
|
|
36
36
|
var _app = __webpack_require__(2);
|
|
37
|
-
var _preferences = __webpack_require__(
|
|
38
|
-
var _download_manager = __webpack_require__(
|
|
39
|
-
var _genericl10n = __webpack_require__(
|
|
40
|
-
var _generic_scripting = __webpack_require__(
|
|
37
|
+
var _preferences = __webpack_require__(41);
|
|
38
|
+
var _download_manager = __webpack_require__(42);
|
|
39
|
+
var _genericl10n = __webpack_require__(43);
|
|
40
|
+
var _generic_scripting = __webpack_require__(45);
|
|
41
41
|
;
|
|
42
42
|
const GenericCom = {};
|
|
43
43
|
exports.GenericCom = GenericCom;
|
|
@@ -99,12 +99,11 @@ var _webPdf_presentation_mode = __webpack_require__(22);
|
|
|
99
99
|
var _pdf_rendering_queue = __webpack_require__(23);
|
|
100
100
|
var _pdf_scripting_manager = __webpack_require__(24);
|
|
101
101
|
var _webPdf_sidebar = __webpack_require__(25);
|
|
102
|
-
var
|
|
103
|
-
var
|
|
104
|
-
var
|
|
105
|
-
var
|
|
106
|
-
var
|
|
107
|
-
var _view_history = __webpack_require__(41);
|
|
102
|
+
var _webPdf_thumbnail_viewer = __webpack_require__(26);
|
|
103
|
+
var _pdf_viewer = __webpack_require__(28);
|
|
104
|
+
var _webSecondary_toolbar = __webpack_require__(38);
|
|
105
|
+
var _webToolbar = __webpack_require__(39);
|
|
106
|
+
var _view_history = __webpack_require__(40);
|
|
108
107
|
const FORCE_PAGES_LOADED_TIMEOUT = 10000;
|
|
109
108
|
const WHEEL_ZOOM_DISABLED_TIMEOUT = 1000;
|
|
110
109
|
const ViewOnLoad = {
|
|
@@ -158,11 +157,17 @@ class DefaultExternalServices {
|
|
|
158
157
|
static updateEditorStates(data) {
|
|
159
158
|
throw new Error("Not implemented: updateEditorStates");
|
|
160
159
|
}
|
|
160
|
+
static get canvasMaxAreaInBytes() {
|
|
161
|
+
return (0, _pdfjsLib.shadow)(this, "canvasMaxAreaInBytes", -1);
|
|
162
|
+
}
|
|
163
|
+
static getNimbusExperimentData() {
|
|
164
|
+
return (0, _pdfjsLib.shadow)(this, "getNimbusExperimentData", Promise.resolve(null));
|
|
165
|
+
}
|
|
161
166
|
}
|
|
162
167
|
exports.DefaultExternalServices = DefaultExternalServices;
|
|
163
168
|
const PDFViewerApplication = {
|
|
164
169
|
initialBookmark: document.location.hash.substring(1),
|
|
165
|
-
_initializedCapability:
|
|
170
|
+
_initializedCapability: new _pdfjsLib.PromiseCapability(),
|
|
166
171
|
appConfig: null,
|
|
167
172
|
pdfDocument: null,
|
|
168
173
|
pdfLoadingTask: null,
|
|
@@ -175,7 +180,6 @@ const PDFViewerApplication = {
|
|
|
175
180
|
pdfLinkService: null,
|
|
176
181
|
pdfHistory: null,
|
|
177
182
|
pdfSidebar: null,
|
|
178
|
-
pdfSidebarResizer: null,
|
|
179
183
|
pdfOutlineViewer: null,
|
|
180
184
|
pdfAttachmentViewer: null,
|
|
181
185
|
pdfLayerViewer: null,
|
|
@@ -213,6 +217,7 @@ const PDFViewerApplication = {
|
|
|
213
217
|
_printAnnotationStoragePromise: null,
|
|
214
218
|
_touchInfo: null,
|
|
215
219
|
_isCtrlKeyDown: false,
|
|
220
|
+
_nimbusDataPromise: null,
|
|
216
221
|
async initialize(appConfig) {
|
|
217
222
|
this.preferences = this.externalServices.createPreferences();
|
|
218
223
|
this.appConfig = appConfig;
|
|
@@ -311,9 +316,7 @@ const PDFViewerApplication = {
|
|
|
311
316
|
const enabled = params.get("pdfbug").split(",");
|
|
312
317
|
try {
|
|
313
318
|
await loadPDFBug(this);
|
|
314
|
-
this._PDFBug.init(
|
|
315
|
-
OPS: _pdfjsLib.OPS
|
|
316
|
-
}, mainContainer, enabled);
|
|
319
|
+
this._PDFBug.init(mainContainer, enabled);
|
|
317
320
|
} catch (ex) {
|
|
318
321
|
console.error(`_parseHashParams: "${ex.message}".`);
|
|
319
322
|
}
|
|
@@ -359,7 +362,8 @@ const PDFViewerApplication = {
|
|
|
359
362
|
async _initializeViewerComponents() {
|
|
360
363
|
const {
|
|
361
364
|
appConfig,
|
|
362
|
-
externalServices
|
|
365
|
+
externalServices,
|
|
366
|
+
l10n
|
|
363
367
|
} = this;
|
|
364
368
|
const eventBus = externalServices.isInAutomation ? new _event_utils.AutomationEventBus() : new _event_utils.EventBus();
|
|
365
369
|
this.eventBus = eventBus;
|
|
@@ -385,18 +389,19 @@ const PDFViewerApplication = {
|
|
|
385
389
|
const pdfScriptingManager = new _pdf_scripting_manager.PDFScriptingManager({
|
|
386
390
|
eventBus,
|
|
387
391
|
sandboxBundleSrc: _app_options.AppOptions.get("sandboxBundleSrc"),
|
|
388
|
-
|
|
389
|
-
|
|
392
|
+
externalServices,
|
|
393
|
+
docProperties: this._scriptingDocProperties.bind(this)
|
|
390
394
|
});
|
|
391
395
|
this.pdfScriptingManager = pdfScriptingManager;
|
|
392
396
|
const container = appConfig.mainContainer,
|
|
393
397
|
viewer = appConfig.viewerContainer;
|
|
394
398
|
const annotationEditorMode = _app_options.AppOptions.get("annotationEditorMode");
|
|
399
|
+
const isOffscreenCanvasSupported = _app_options.AppOptions.get("isOffscreenCanvasSupported") && _pdfjsLib.FeatureTest.isOffscreenCanvasSupported;
|
|
395
400
|
const pageColors = _app_options.AppOptions.get("forcePageColors") || window.matchMedia("(forced-colors: active)").matches ? {
|
|
396
401
|
background: _app_options.AppOptions.get("pageColorsBackground"),
|
|
397
402
|
foreground: _app_options.AppOptions.get("pageColorsForeground")
|
|
398
403
|
} : null;
|
|
399
|
-
|
|
404
|
+
const pdfViewer = new _pdf_viewer.PDFViewer({
|
|
400
405
|
container,
|
|
401
406
|
viewer,
|
|
402
407
|
eventBus,
|
|
@@ -405,28 +410,28 @@ const PDFViewerApplication = {
|
|
|
405
410
|
downloadManager,
|
|
406
411
|
findController,
|
|
407
412
|
scriptingManager: _app_options.AppOptions.get("enableScripting") && pdfScriptingManager,
|
|
408
|
-
|
|
409
|
-
l10n: this.l10n,
|
|
413
|
+
l10n,
|
|
410
414
|
textLayerMode: _app_options.AppOptions.get("textLayerMode"),
|
|
411
415
|
annotationMode: _app_options.AppOptions.get("annotationMode"),
|
|
412
416
|
annotationEditorMode,
|
|
413
417
|
imageResourcesPath: _app_options.AppOptions.get("imageResourcesPath"),
|
|
414
418
|
enablePrintAutoRotate: _app_options.AppOptions.get("enablePrintAutoRotate"),
|
|
415
|
-
|
|
416
|
-
isOffscreenCanvasSupported: _app_options.AppOptions.get("isOffscreenCanvasSupported"),
|
|
419
|
+
isOffscreenCanvasSupported,
|
|
417
420
|
maxCanvasPixels: _app_options.AppOptions.get("maxCanvasPixels"),
|
|
418
421
|
enablePermissions: _app_options.AppOptions.get("enablePermissions"),
|
|
419
422
|
pageColors
|
|
420
423
|
});
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
+
this.pdfViewer = pdfViewer;
|
|
425
|
+
pdfRenderingQueue.setViewer(pdfViewer);
|
|
426
|
+
pdfLinkService.setViewer(pdfViewer);
|
|
427
|
+
pdfScriptingManager.setViewer(pdfViewer);
|
|
424
428
|
if (appConfig.sidebar?.thumbnailView) {
|
|
425
429
|
this.pdfThumbnailViewer = new _webPdf_thumbnail_viewer.PDFThumbnailViewer({
|
|
426
430
|
container: appConfig.sidebar.thumbnailView,
|
|
431
|
+
eventBus,
|
|
427
432
|
renderingQueue: pdfRenderingQueue,
|
|
428
433
|
linkService: pdfLinkService,
|
|
429
|
-
l10n
|
|
434
|
+
l10n,
|
|
430
435
|
pageColors
|
|
431
436
|
});
|
|
432
437
|
pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer);
|
|
@@ -439,10 +444,13 @@ const PDFViewerApplication = {
|
|
|
439
444
|
pdfLinkService.setHistory(this.pdfHistory);
|
|
440
445
|
}
|
|
441
446
|
if (!this.supportsIntegratedFind && appConfig.findBar) {
|
|
442
|
-
this.findBar = new _webPdf_find_bar.PDFFindBar(appConfig.findBar, eventBus,
|
|
447
|
+
this.findBar = new _webPdf_find_bar.PDFFindBar(appConfig.findBar, eventBus, l10n);
|
|
443
448
|
}
|
|
444
449
|
if (appConfig.annotationEditorParams) {
|
|
445
450
|
if (annotationEditorMode !== _pdfjsLib.AnnotationEditorType.DISABLE) {
|
|
451
|
+
if (_app_options.AppOptions.get("enableStampEditor") && isOffscreenCanvasSupported) {
|
|
452
|
+
appConfig.toolbar?.editorStampButton?.classList.remove("hidden");
|
|
453
|
+
}
|
|
446
454
|
this.annotationEditorParams = new _webAnnotation_editor_params.AnnotationEditorParams(appConfig.annotationEditorParams, eventBus);
|
|
447
455
|
} else {
|
|
448
456
|
for (const id of ["editorModeButtons", "editorModeSeparator"]) {
|
|
@@ -451,9 +459,7 @@ const PDFViewerApplication = {
|
|
|
451
459
|
}
|
|
452
460
|
}
|
|
453
461
|
if (appConfig.documentProperties) {
|
|
454
|
-
this.pdfDocumentProperties = new _webPdf_document_properties.PDFDocumentProperties(appConfig.documentProperties, this.overlayManager, eventBus,
|
|
455
|
-
return this._docFilename;
|
|
456
|
-
});
|
|
462
|
+
this.pdfDocumentProperties = new _webPdf_document_properties.PDFDocumentProperties(appConfig.documentProperties, this.overlayManager, eventBus, l10n, () => this._docFilename);
|
|
457
463
|
}
|
|
458
464
|
if (appConfig.secondaryToolbar?.cursorHandToolButton) {
|
|
459
465
|
this.pdfCursorTools = new _webPdf_cursor_tools.PDFCursorTools({
|
|
@@ -463,20 +469,20 @@ const PDFViewerApplication = {
|
|
|
463
469
|
});
|
|
464
470
|
}
|
|
465
471
|
if (appConfig.toolbar) {
|
|
466
|
-
this.toolbar = new _webToolbar.Toolbar(appConfig.toolbar, eventBus,
|
|
472
|
+
this.toolbar = new _webToolbar.Toolbar(appConfig.toolbar, eventBus, l10n);
|
|
467
473
|
}
|
|
468
474
|
if (appConfig.secondaryToolbar) {
|
|
469
|
-
this.secondaryToolbar = new _webSecondary_toolbar.SecondaryToolbar(appConfig.secondaryToolbar, eventBus,
|
|
475
|
+
this.secondaryToolbar = new _webSecondary_toolbar.SecondaryToolbar(appConfig.secondaryToolbar, eventBus, externalServices);
|
|
470
476
|
}
|
|
471
477
|
if (this.supportsFullscreen && appConfig.secondaryToolbar?.presentationModeButton) {
|
|
472
478
|
this.pdfPresentationMode = new _webPdf_presentation_mode.PDFPresentationMode({
|
|
473
479
|
container,
|
|
474
|
-
pdfViewer
|
|
480
|
+
pdfViewer,
|
|
475
481
|
eventBus
|
|
476
482
|
});
|
|
477
483
|
}
|
|
478
484
|
if (appConfig.passwordOverlay) {
|
|
479
|
-
this.passwordPrompt = new _password_prompt.PasswordPrompt(appConfig.passwordOverlay, this.overlayManager,
|
|
485
|
+
this.passwordPrompt = new _password_prompt.PasswordPrompt(appConfig.passwordOverlay, this.overlayManager, l10n, this.isViewerEmbedded);
|
|
480
486
|
}
|
|
481
487
|
if (appConfig.sidebar?.outlineView) {
|
|
482
488
|
this.pdfOutlineViewer = new _webPdf_outline_viewer.PDFOutlineViewer({
|
|
@@ -497,23 +503,98 @@ const PDFViewerApplication = {
|
|
|
497
503
|
this.pdfLayerViewer = new _webPdf_layer_viewer.PDFLayerViewer({
|
|
498
504
|
container: appConfig.sidebar.layersView,
|
|
499
505
|
eventBus,
|
|
500
|
-
l10n
|
|
506
|
+
l10n
|
|
501
507
|
});
|
|
502
508
|
}
|
|
503
509
|
if (appConfig.sidebar) {
|
|
504
510
|
this.pdfSidebar = new _webPdf_sidebar.PDFSidebar({
|
|
505
511
|
elements: appConfig.sidebar,
|
|
506
|
-
pdfViewer: this.pdfViewer,
|
|
507
|
-
pdfThumbnailViewer: this.pdfThumbnailViewer,
|
|
508
512
|
eventBus,
|
|
509
|
-
l10n
|
|
513
|
+
l10n
|
|
510
514
|
});
|
|
511
515
|
this.pdfSidebar.onToggled = this.forceRendering.bind(this);
|
|
512
|
-
this.
|
|
516
|
+
this.pdfSidebar.onUpdateThumbnails = () => {
|
|
517
|
+
for (const pageView of pdfViewer.getCachedPageViews()) {
|
|
518
|
+
if (pageView.renderingState === _ui_utils.RenderingStates.FINISHED) {
|
|
519
|
+
this.pdfThumbnailViewer.getThumbnail(pageView.id - 1)?.setImage(pageView);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
this.pdfThumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber);
|
|
523
|
+
};
|
|
513
524
|
}
|
|
514
525
|
},
|
|
515
|
-
run(config) {
|
|
516
|
-
this.initialize(config)
|
|
526
|
+
async run(config) {
|
|
527
|
+
await this.initialize(config);
|
|
528
|
+
const {
|
|
529
|
+
appConfig,
|
|
530
|
+
eventBus
|
|
531
|
+
} = this;
|
|
532
|
+
let file;
|
|
533
|
+
const queryString = document.location.search.substring(1);
|
|
534
|
+
const params = (0, _ui_utils.parseQueryString)(queryString);
|
|
535
|
+
file = params.get("file") ?? _app_options.AppOptions.get("defaultUrl");
|
|
536
|
+
validateFileURL(file);
|
|
537
|
+
const fileInput = appConfig.openFileInput;
|
|
538
|
+
fileInput.value = null;
|
|
539
|
+
fileInput.addEventListener("change", function (evt) {
|
|
540
|
+
const {
|
|
541
|
+
files
|
|
542
|
+
} = evt.target;
|
|
543
|
+
if (!files || files.length === 0) {
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
eventBus.dispatch("fileinputchange", {
|
|
547
|
+
source: this,
|
|
548
|
+
fileInput: evt.target
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
appConfig.mainContainer.addEventListener("dragover", function (evt) {
|
|
552
|
+
evt.preventDefault();
|
|
553
|
+
evt.dataTransfer.dropEffect = evt.dataTransfer.effectAllowed === "copy" ? "copy" : "move";
|
|
554
|
+
});
|
|
555
|
+
appConfig.mainContainer.addEventListener("drop", function (evt) {
|
|
556
|
+
evt.preventDefault();
|
|
557
|
+
const {
|
|
558
|
+
files
|
|
559
|
+
} = evt.dataTransfer;
|
|
560
|
+
if (!files || files.length === 0) {
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
eventBus.dispatch("fileinputchange", {
|
|
564
|
+
source: this,
|
|
565
|
+
fileInput: evt.dataTransfer
|
|
566
|
+
});
|
|
567
|
+
});
|
|
568
|
+
if (!this.supportsDocumentFonts) {
|
|
569
|
+
_app_options.AppOptions.set("disableFontFace", true);
|
|
570
|
+
this.l10n.get("web_fonts_disabled").then(msg => {
|
|
571
|
+
console.warn(msg);
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
if (!this.supportsPrinting) {
|
|
575
|
+
appConfig.toolbar?.print?.classList.add("hidden");
|
|
576
|
+
appConfig.secondaryToolbar?.printButton.classList.add("hidden");
|
|
577
|
+
}
|
|
578
|
+
if (!this.supportsFullscreen) {
|
|
579
|
+
appConfig.secondaryToolbar?.presentationModeButton.classList.add("hidden");
|
|
580
|
+
}
|
|
581
|
+
if (this.supportsIntegratedFind) {
|
|
582
|
+
appConfig.toolbar?.viewFind?.classList.add("hidden");
|
|
583
|
+
}
|
|
584
|
+
appConfig.mainContainer.addEventListener("transitionend", function (evt) {
|
|
585
|
+
if (evt.target === this) {
|
|
586
|
+
eventBus.dispatch("resize", {
|
|
587
|
+
source: this
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
}, true);
|
|
591
|
+
if (file) {
|
|
592
|
+
this.open({
|
|
593
|
+
url: file
|
|
594
|
+
});
|
|
595
|
+
} else {
|
|
596
|
+
this._hideViewBookmark();
|
|
597
|
+
}
|
|
517
598
|
},
|
|
518
599
|
get initialized() {
|
|
519
600
|
return this._initializedCapability.settled;
|
|
@@ -579,7 +660,7 @@ const PDFViewerApplication = {
|
|
|
579
660
|
get supportedMouseWheelZoomModifierKeys() {
|
|
580
661
|
return this.externalServices.supportedMouseWheelZoomModifierKeys;
|
|
581
662
|
},
|
|
582
|
-
initPassiveLoading() {
|
|
663
|
+
initPassiveLoading(file) {
|
|
583
664
|
throw new Error("Not implemented: initPassiveLoading");
|
|
584
665
|
},
|
|
585
666
|
setTitleUsingUrl(url = "", downloadUrl = null) {
|
|
@@ -595,7 +676,7 @@ const PDFViewerApplication = {
|
|
|
595
676
|
if (!title) {
|
|
596
677
|
try {
|
|
597
678
|
title = decodeURIComponent((0, _pdfjsLib.getFilenameFromUrl)(url)) || url;
|
|
598
|
-
} catch
|
|
679
|
+
} catch {
|
|
599
680
|
title = url;
|
|
600
681
|
}
|
|
601
682
|
}
|
|
@@ -630,7 +711,7 @@ const PDFViewerApplication = {
|
|
|
630
711
|
if (this.pdfDocument?.annotationStorage.size > 0 && this._annotationStorageModified) {
|
|
631
712
|
try {
|
|
632
713
|
await this.save();
|
|
633
|
-
} catch
|
|
714
|
+
} catch {}
|
|
634
715
|
}
|
|
635
716
|
const promises = [];
|
|
636
717
|
promises.push(this.pdfLoadingTask.destroy());
|
|
@@ -694,6 +775,7 @@ const PDFViewerApplication = {
|
|
|
694
775
|
}
|
|
695
776
|
const apiParams = _app_options.AppOptions.getAll(_app_options.OptionKind.API);
|
|
696
777
|
const params = {
|
|
778
|
+
canvasMaxAreaInBytes: this.externalServices.canvasMaxAreaInBytes,
|
|
697
779
|
...apiParams,
|
|
698
780
|
...args
|
|
699
781
|
};
|
|
@@ -741,7 +823,7 @@ const PDFViewerApplication = {
|
|
|
741
823
|
}
|
|
742
824
|
throw new Error("PDF document not downloaded.");
|
|
743
825
|
},
|
|
744
|
-
async download() {
|
|
826
|
+
async download(options = {}) {
|
|
745
827
|
const url = this._downloadUrl,
|
|
746
828
|
filename = this._docFilename;
|
|
747
829
|
try {
|
|
@@ -750,12 +832,12 @@ const PDFViewerApplication = {
|
|
|
750
832
|
const blob = new Blob([data], {
|
|
751
833
|
type: "application/pdf"
|
|
752
834
|
});
|
|
753
|
-
await this.downloadManager.download(blob, url, filename);
|
|
754
|
-
} catch
|
|
755
|
-
await this.downloadManager.downloadUrl(url, filename);
|
|
835
|
+
await this.downloadManager.download(blob, url, filename, options);
|
|
836
|
+
} catch {
|
|
837
|
+
await this.downloadManager.downloadUrl(url, filename, options);
|
|
756
838
|
}
|
|
757
839
|
},
|
|
758
|
-
async save() {
|
|
840
|
+
async save(options = {}) {
|
|
759
841
|
if (this._saveInProgress) {
|
|
760
842
|
return;
|
|
761
843
|
}
|
|
@@ -769,10 +851,10 @@ const PDFViewerApplication = {
|
|
|
769
851
|
const blob = new Blob([data], {
|
|
770
852
|
type: "application/pdf"
|
|
771
853
|
});
|
|
772
|
-
await this.downloadManager.download(blob, url, filename);
|
|
854
|
+
await this.downloadManager.download(blob, url, filename, options);
|
|
773
855
|
} catch (reason) {
|
|
774
856
|
console.error(`Error when saving the document: ${reason.message}`);
|
|
775
|
-
await this.download();
|
|
857
|
+
await this.download(options);
|
|
776
858
|
} finally {
|
|
777
859
|
await this.pdfScriptingManager.dispatchDidSave();
|
|
778
860
|
this._saveInProgress = false;
|
|
@@ -786,13 +868,18 @@ const PDFViewerApplication = {
|
|
|
786
868
|
});
|
|
787
869
|
}
|
|
788
870
|
},
|
|
789
|
-
downloadOrSave() {
|
|
871
|
+
downloadOrSave(options = {}) {
|
|
790
872
|
if (this.pdfDocument?.annotationStorage.size > 0) {
|
|
791
|
-
this.save();
|
|
873
|
+
this.save(options);
|
|
792
874
|
} else {
|
|
793
|
-
this.download();
|
|
875
|
+
this.download(options);
|
|
794
876
|
}
|
|
795
877
|
},
|
|
878
|
+
openInExternalApp() {
|
|
879
|
+
this.downloadOrSave({
|
|
880
|
+
openInExternalApp: true
|
|
881
|
+
});
|
|
882
|
+
},
|
|
796
883
|
_documentError(message, moreInfo = null) {
|
|
797
884
|
this._unblockDocumentLoadEvent();
|
|
798
885
|
this._otherError(message, moreInfo);
|
|
@@ -846,17 +933,12 @@ const PDFViewerApplication = {
|
|
|
846
933
|
});
|
|
847
934
|
});
|
|
848
935
|
});
|
|
849
|
-
const pageLayoutPromise = pdfDocument.getPageLayout().catch(
|
|
850
|
-
const pageModePromise = pdfDocument.getPageMode().catch(
|
|
851
|
-
const openActionPromise = pdfDocument.getOpenAction().catch(
|
|
936
|
+
const pageLayoutPromise = pdfDocument.getPageLayout().catch(() => {});
|
|
937
|
+
const pageModePromise = pdfDocument.getPageMode().catch(() => {});
|
|
938
|
+
const openActionPromise = pdfDocument.getOpenAction().catch(() => {});
|
|
852
939
|
this.toolbar?.setPagesCount(pdfDocument.numPages, false);
|
|
853
940
|
this.secondaryToolbar?.setPagesCount(pdfDocument.numPages);
|
|
854
|
-
|
|
855
|
-
baseDocumentUrl = null;
|
|
856
|
-
if (baseDocumentUrl && (0, _pdfjsLib.isDataScheme)(baseDocumentUrl)) {
|
|
857
|
-
baseDocumentUrl = null;
|
|
858
|
-
}
|
|
859
|
-
this.pdfLinkService.setDocument(pdfDocument, baseDocumentUrl);
|
|
941
|
+
this.pdfLinkService.setDocument(pdfDocument);
|
|
860
942
|
this.pdfDocumentProperties?.setDocument(pdfDocument);
|
|
861
943
|
const pdfViewer = this.pdfViewer;
|
|
862
944
|
pdfViewer.setDocument(pdfDocument);
|
|
@@ -875,9 +957,7 @@ const PDFViewerApplication = {
|
|
|
875
957
|
sidebarView: _ui_utils.SidebarView.UNKNOWN,
|
|
876
958
|
scrollMode: _ui_utils.ScrollMode.UNKNOWN,
|
|
877
959
|
spreadMode: _ui_utils.SpreadMode.UNKNOWN
|
|
878
|
-
}).catch(() => {
|
|
879
|
-
return Object.create(null);
|
|
880
|
-
});
|
|
960
|
+
}).catch(() => {});
|
|
881
961
|
firstPagePromise.then(pdfPage => {
|
|
882
962
|
this.loadingBar?.setWidth(this.appConfig.viewerContainer);
|
|
883
963
|
this._initializeAnnotationStorageCallbacks(pdfDocument);
|
|
@@ -895,7 +975,7 @@ const PDFViewerApplication = {
|
|
|
895
975
|
let sidebarView = _app_options.AppOptions.get("sidebarViewOnLoad");
|
|
896
976
|
let scrollMode = _app_options.AppOptions.get("scrollModeOnLoad");
|
|
897
977
|
let spreadMode = _app_options.AppOptions.get("spreadModeOnLoad");
|
|
898
|
-
if (stored
|
|
978
|
+
if (stored?.page && viewOnLoad !== ViewOnLoad.INITIAL) {
|
|
899
979
|
hash = `page=${stored.page}&zoom=${zoom || stored.zoom},` + `${stored.scrollLeft},${stored.scrollTop}`;
|
|
900
980
|
rotation = parseInt(stored.rotation, 10);
|
|
901
981
|
if (sidebarView === _ui_utils.SidebarView.UNKNOWN) {
|
|
@@ -1231,7 +1311,7 @@ const PDFViewerApplication = {
|
|
|
1231
1311
|
}
|
|
1232
1312
|
this.pdfViewer.cleanup();
|
|
1233
1313
|
this.pdfThumbnailViewer?.cleanup();
|
|
1234
|
-
this.pdfDocument.cleanup(
|
|
1314
|
+
this.pdfDocument.cleanup();
|
|
1235
1315
|
},
|
|
1236
1316
|
forceRendering() {
|
|
1237
1317
|
this.pdfRenderingQueue.printing = !!this.printService;
|
|
@@ -1328,6 +1408,7 @@ const PDFViewerApplication = {
|
|
|
1328
1408
|
eventBus._on("switchannotationeditorparams", webViewerSwitchAnnotationEditorParams);
|
|
1329
1409
|
eventBus._on("print", webViewerPrint);
|
|
1330
1410
|
eventBus._on("download", webViewerDownload);
|
|
1411
|
+
eventBus._on("openinexternalapp", webViewerOpenInExternalApp);
|
|
1331
1412
|
eventBus._on("firstpage", webViewerFirstPage);
|
|
1332
1413
|
eventBus._on("lastpage", webViewerLastPage);
|
|
1333
1414
|
eventBus._on("nextpage", webViewerNextPage);
|
|
@@ -1446,6 +1527,7 @@ const PDFViewerApplication = {
|
|
|
1446
1527
|
eventBus._off("presentationmode", webViewerPresentationMode);
|
|
1447
1528
|
eventBus._off("print", webViewerPrint);
|
|
1448
1529
|
eventBus._off("download", webViewerDownload);
|
|
1530
|
+
eventBus._off("openinexternalapp", webViewerOpenInExternalApp);
|
|
1449
1531
|
eventBus._off("firstpage", webViewerFirstPage);
|
|
1450
1532
|
eventBus._off("lastpage", webViewerLastPage);
|
|
1451
1533
|
eventBus._off("nextpage", webViewerNextPage);
|
|
@@ -1595,85 +1677,6 @@ function reportPageStatsPDFBug({
|
|
|
1595
1677
|
const pageView = PDFViewerApplication.pdfViewer.getPageView(pageNumber - 1);
|
|
1596
1678
|
globalThis.Stats.add(pageNumber, pageView?.pdfPage?.stats);
|
|
1597
1679
|
}
|
|
1598
|
-
function webViewerInitialized() {
|
|
1599
|
-
const {
|
|
1600
|
-
appConfig,
|
|
1601
|
-
eventBus,
|
|
1602
|
-
l10n
|
|
1603
|
-
} = PDFViewerApplication;
|
|
1604
|
-
let file;
|
|
1605
|
-
const queryString = document.location.search.substring(1);
|
|
1606
|
-
const params = (0, _ui_utils.parseQueryString)(queryString);
|
|
1607
|
-
file = params.get("file") ?? _app_options.AppOptions.get("defaultUrl");
|
|
1608
|
-
validateFileURL(file);
|
|
1609
|
-
const fileInput = appConfig.openFileInput;
|
|
1610
|
-
fileInput.value = null;
|
|
1611
|
-
fileInput.addEventListener("change", function (evt) {
|
|
1612
|
-
const {
|
|
1613
|
-
files
|
|
1614
|
-
} = evt.target;
|
|
1615
|
-
if (!files || files.length === 0) {
|
|
1616
|
-
return;
|
|
1617
|
-
}
|
|
1618
|
-
eventBus.dispatch("fileinputchange", {
|
|
1619
|
-
source: this,
|
|
1620
|
-
fileInput: evt.target
|
|
1621
|
-
});
|
|
1622
|
-
});
|
|
1623
|
-
appConfig.mainContainer.addEventListener("dragover", function (evt) {
|
|
1624
|
-
evt.preventDefault();
|
|
1625
|
-
evt.dataTransfer.dropEffect = evt.dataTransfer.effectAllowed === "copy" ? "copy" : "move";
|
|
1626
|
-
});
|
|
1627
|
-
appConfig.mainContainer.addEventListener("drop", function (evt) {
|
|
1628
|
-
evt.preventDefault();
|
|
1629
|
-
const {
|
|
1630
|
-
files
|
|
1631
|
-
} = evt.dataTransfer;
|
|
1632
|
-
if (!files || files.length === 0) {
|
|
1633
|
-
return;
|
|
1634
|
-
}
|
|
1635
|
-
eventBus.dispatch("fileinputchange", {
|
|
1636
|
-
source: this,
|
|
1637
|
-
fileInput: evt.dataTransfer
|
|
1638
|
-
});
|
|
1639
|
-
});
|
|
1640
|
-
if (!PDFViewerApplication.supportsDocumentFonts) {
|
|
1641
|
-
_app_options.AppOptions.set("disableFontFace", true);
|
|
1642
|
-
l10n.get("web_fonts_disabled").then(msg => {
|
|
1643
|
-
console.warn(msg);
|
|
1644
|
-
});
|
|
1645
|
-
}
|
|
1646
|
-
if (!PDFViewerApplication.supportsPrinting) {
|
|
1647
|
-
appConfig.toolbar?.print.classList.add("hidden");
|
|
1648
|
-
appConfig.secondaryToolbar?.printButton.classList.add("hidden");
|
|
1649
|
-
}
|
|
1650
|
-
if (!PDFViewerApplication.supportsFullscreen) {
|
|
1651
|
-
appConfig.secondaryToolbar?.presentationModeButton.classList.add("hidden");
|
|
1652
|
-
}
|
|
1653
|
-
if (PDFViewerApplication.supportsIntegratedFind) {
|
|
1654
|
-
appConfig.toolbar?.viewFind.classList.add("hidden");
|
|
1655
|
-
}
|
|
1656
|
-
appConfig.mainContainer.addEventListener("transitionend", function (evt) {
|
|
1657
|
-
if (evt.target === this) {
|
|
1658
|
-
eventBus.dispatch("resize", {
|
|
1659
|
-
source: this
|
|
1660
|
-
});
|
|
1661
|
-
}
|
|
1662
|
-
}, true);
|
|
1663
|
-
try {
|
|
1664
|
-
if (file) {
|
|
1665
|
-
PDFViewerApplication.open({
|
|
1666
|
-
url: file
|
|
1667
|
-
});
|
|
1668
|
-
} else {
|
|
1669
|
-
PDFViewerApplication._hideViewBookmark();
|
|
1670
|
-
}
|
|
1671
|
-
} catch (reason) {
|
|
1672
|
-
l10n.get("loading_error").then(msg => {
|
|
1673
|
-
PDFViewerApplication._documentError(msg, reason);
|
|
1674
|
-
});
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
1680
|
function webViewerPageRender({
|
|
1678
1681
|
pageNumber
|
|
1679
1682
|
}) {
|
|
@@ -1691,8 +1694,8 @@ function webViewerPageRendered({
|
|
|
1691
1694
|
if (PDFViewerApplication.pdfSidebar?.visibleView === _ui_utils.SidebarView.THUMBS) {
|
|
1692
1695
|
const pageView = PDFViewerApplication.pdfViewer.getPageView(pageNumber - 1);
|
|
1693
1696
|
const thumbnailView = PDFViewerApplication.pdfThumbnailViewer?.getThumbnail(pageNumber - 1);
|
|
1694
|
-
if (pageView
|
|
1695
|
-
thumbnailView
|
|
1697
|
+
if (pageView) {
|
|
1698
|
+
thumbnailView?.setImage(pageView);
|
|
1696
1699
|
}
|
|
1697
1700
|
}
|
|
1698
1701
|
if (error) {
|
|
@@ -1833,7 +1836,7 @@ function webViewerPresentationMode() {
|
|
|
1833
1836
|
PDFViewerApplication.requestPresentationMode();
|
|
1834
1837
|
}
|
|
1835
1838
|
function webViewerSwitchAnnotationEditorMode(evt) {
|
|
1836
|
-
PDFViewerApplication.pdfViewer.annotationEditorMode = evt
|
|
1839
|
+
PDFViewerApplication.pdfViewer.annotationEditorMode = evt;
|
|
1837
1840
|
}
|
|
1838
1841
|
function webViewerSwitchAnnotationEditorParams(evt) {
|
|
1839
1842
|
PDFViewerApplication.pdfViewer.annotationEditorParams = evt;
|
|
@@ -1844,6 +1847,9 @@ function webViewerPrint() {
|
|
|
1844
1847
|
function webViewerDownload() {
|
|
1845
1848
|
PDFViewerApplication.downloadOrSave();
|
|
1846
1849
|
}
|
|
1850
|
+
function webViewerOpenInExternalApp() {
|
|
1851
|
+
PDFViewerApplication.openInExternalApp();
|
|
1852
|
+
}
|
|
1847
1853
|
function webViewerFirstPage() {
|
|
1848
1854
|
PDFViewerApplication.page = 1;
|
|
1849
1855
|
}
|
|
@@ -1900,7 +1906,6 @@ function webViewerFindFromUrlHash(evt) {
|
|
|
1900
1906
|
source: evt.source,
|
|
1901
1907
|
type: "",
|
|
1902
1908
|
query: evt.query,
|
|
1903
|
-
phraseSearch: evt.phraseSearch,
|
|
1904
1909
|
caseSensitive: false,
|
|
1905
1910
|
entireWord: false,
|
|
1906
1911
|
highlightAll: true,
|
|
@@ -2436,7 +2441,7 @@ exports.PDFPrintServiceFactory = PDFPrintServiceFactory;
|
|
|
2436
2441
|
Object.defineProperty(exports, "__esModule", ({
|
|
2437
2442
|
value: true
|
|
2438
2443
|
}));
|
|
2439
|
-
exports.animationStarted = exports.VERTICAL_PADDING = exports.UNKNOWN_SCALE = exports.TextLayerMode = exports.SpreadMode = exports.SidebarView = exports.ScrollMode = exports.SCROLLBAR_PADDING = exports.RenderingStates = exports.
|
|
2444
|
+
exports.animationStarted = exports.VERTICAL_PADDING = exports.UNKNOWN_SCALE = exports.TextLayerMode = exports.SpreadMode = exports.SidebarView = exports.ScrollMode = exports.SCROLLBAR_PADDING = exports.RenderingStates = exports.ProgressBar = exports.PresentationModeState = exports.OutputScale = exports.MIN_SCALE = exports.MAX_SCALE = exports.MAX_AUTO_SCALE = exports.DEFAULT_SCALE_VALUE = exports.DEFAULT_SCALE_DELTA = exports.DEFAULT_SCALE = exports.CursorTool = exports.AutoPrintRegExp = void 0;
|
|
2440
2445
|
exports.apiPageLayoutToViewerModes = apiPageLayoutToViewerModes;
|
|
2441
2446
|
exports.apiPageModeToSidebarView = apiPageModeToSidebarView;
|
|
2442
2447
|
exports.approximateFraction = approximateFraction;
|
|
@@ -2457,6 +2462,8 @@ exports.parseQueryString = parseQueryString;
|
|
|
2457
2462
|
exports.removeNullCharacters = removeNullCharacters;
|
|
2458
2463
|
exports.roundToDivide = roundToDivide;
|
|
2459
2464
|
exports.scrollIntoView = scrollIntoView;
|
|
2465
|
+
exports.toggleCheckedBtn = toggleCheckedBtn;
|
|
2466
|
+
exports.toggleExpandedBtn = toggleExpandedBtn;
|
|
2460
2467
|
exports.watchScroll = watchScroll;
|
|
2461
2468
|
const DEFAULT_SCALE_VALUE = "auto";
|
|
2462
2469
|
exports.DEFAULT_SCALE_VALUE = DEFAULT_SCALE_VALUE;
|
|
@@ -2499,14 +2506,10 @@ const SidebarView = {
|
|
|
2499
2506
|
LAYERS: 4
|
|
2500
2507
|
};
|
|
2501
2508
|
exports.SidebarView = SidebarView;
|
|
2502
|
-
const RendererType = {
|
|
2503
|
-
CANVAS: "canvas",
|
|
2504
|
-
SVG: "svg"
|
|
2505
|
-
};
|
|
2506
|
-
exports.RendererType = RendererType;
|
|
2507
2509
|
const TextLayerMode = {
|
|
2508
2510
|
DISABLE: 0,
|
|
2509
|
-
ENABLE: 1
|
|
2511
|
+
ENABLE: 1,
|
|
2512
|
+
ENABLE_PERMISSIONS: 2
|
|
2510
2513
|
};
|
|
2511
2514
|
exports.TextLayerMode = TextLayerMode;
|
|
2512
2515
|
const ScrollMode = {
|
|
@@ -2610,7 +2613,6 @@ function parseQueryString(query) {
|
|
|
2610
2613
|
}
|
|
2611
2614
|
return params;
|
|
2612
2615
|
}
|
|
2613
|
-
const NullCharactersRegExp = /\x00/g;
|
|
2614
2616
|
const InvisibleCharactersRegExp = /[\x01-\x1F]/g;
|
|
2615
2617
|
function removeNullCharacters(str, replaceInvisible = false) {
|
|
2616
2618
|
if (typeof str !== "string") {
|
|
@@ -2618,9 +2620,9 @@ function removeNullCharacters(str, replaceInvisible = false) {
|
|
|
2618
2620
|
return str;
|
|
2619
2621
|
}
|
|
2620
2622
|
if (replaceInvisible) {
|
|
2621
|
-
str = str.
|
|
2623
|
+
str = str.replaceAll(InvisibleCharactersRegExp, " ");
|
|
2622
2624
|
}
|
|
2623
|
-
return str.
|
|
2625
|
+
return str.replaceAll("\x00", "");
|
|
2624
2626
|
}
|
|
2625
2627
|
function binarySearchFirstItem(items, condition, start = 0) {
|
|
2626
2628
|
let minIndex = start;
|
|
@@ -2953,6 +2955,16 @@ function apiPageModeToSidebarView(mode) {
|
|
|
2953
2955
|
}
|
|
2954
2956
|
return SidebarView.NONE;
|
|
2955
2957
|
}
|
|
2958
|
+
function toggleCheckedBtn(button, toggle, view = null) {
|
|
2959
|
+
button.classList.toggle("toggled", toggle);
|
|
2960
|
+
button.setAttribute("aria-checked", toggle);
|
|
2961
|
+
view?.classList.toggle("hidden", !toggle);
|
|
2962
|
+
}
|
|
2963
|
+
function toggleExpandedBtn(button, toggle, view = null) {
|
|
2964
|
+
button.classList.toggle("toggled", toggle);
|
|
2965
|
+
button.setAttribute("aria-expanded", toggle);
|
|
2966
|
+
view?.classList.toggle("hidden", !toggle);
|
|
2967
|
+
}
|
|
2956
2968
|
|
|
2957
2969
|
/***/ }),
|
|
2958
2970
|
/* 4 */
|
|
@@ -2960,13 +2972,7 @@ function apiPageModeToSidebarView(mode) {
|
|
|
2960
2972
|
|
|
2961
2973
|
|
|
2962
2974
|
|
|
2963
|
-
|
|
2964
|
-
if (typeof window !== "undefined" && window["pdfjs-dist/build/pdf"]) {
|
|
2965
|
-
pdfjsLib = window["pdfjs-dist/build/pdf"];
|
|
2966
|
-
} else {
|
|
2967
|
-
pdfjsLib = require("../build/pdf.js");
|
|
2968
|
-
}
|
|
2969
|
-
module.exports = pdfjsLib;
|
|
2975
|
+
module.exports = globalThis.pdfjsLib;
|
|
2970
2976
|
|
|
2971
2977
|
/***/ }),
|
|
2972
2978
|
/* 5 */
|
|
@@ -3040,6 +3046,10 @@ const defaultOptions = {
|
|
|
3040
3046
|
value: true,
|
|
3041
3047
|
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
|
3042
3048
|
},
|
|
3049
|
+
enableStampEditor: {
|
|
3050
|
+
value: true,
|
|
3051
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
|
3052
|
+
},
|
|
3043
3053
|
externalLinkRel: {
|
|
3044
3054
|
value: "noopener noreferrer nofollow",
|
|
3045
3055
|
kind: OptionKind.VIEWER
|
|
@@ -3100,10 +3110,6 @@ const defaultOptions = {
|
|
|
3100
3110
|
value: 1,
|
|
3101
3111
|
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
|
3102
3112
|
},
|
|
3103
|
-
useOnlyCssZoom: {
|
|
3104
|
-
value: false,
|
|
3105
|
-
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
|
3106
|
-
},
|
|
3107
3113
|
viewerCssTheme: {
|
|
3108
3114
|
value: 0,
|
|
3109
3115
|
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
|
@@ -3194,10 +3200,6 @@ const defaultOptions = {
|
|
|
3194
3200
|
value: navigator.language || "en-US",
|
|
3195
3201
|
kind: OptionKind.VIEWER
|
|
3196
3202
|
};
|
|
3197
|
-
defaultOptions.renderer = {
|
|
3198
|
-
value: "canvas",
|
|
3199
|
-
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
|
3200
|
-
};
|
|
3201
3203
|
defaultOptions.sandboxBundleSrc = {
|
|
3202
3204
|
value: "../build/pdf.sandbox.js",
|
|
3203
3205
|
kind: OptionKind.VIEWER
|
|
@@ -3578,7 +3580,7 @@ class PDFLinkService {
|
|
|
3578
3580
|
return this.getAnchorUrl("");
|
|
3579
3581
|
}
|
|
3580
3582
|
getAnchorUrl(anchor) {
|
|
3581
|
-
return
|
|
3583
|
+
return this.baseUrl ? this.baseUrl + anchor : anchor;
|
|
3582
3584
|
}
|
|
3583
3585
|
setHash(hash) {
|
|
3584
3586
|
if (!this.pdfDocument) {
|
|
@@ -3588,10 +3590,11 @@ class PDFLinkService {
|
|
|
3588
3590
|
if (hash.includes("=")) {
|
|
3589
3591
|
const params = (0, _ui_utils.parseQueryString)(hash);
|
|
3590
3592
|
if (params.has("search")) {
|
|
3593
|
+
const query = params.get("search").replaceAll('"', ""),
|
|
3594
|
+
phrase = params.get("phrase") === "true";
|
|
3591
3595
|
this.eventBus.dispatch("findfromurlhash", {
|
|
3592
3596
|
source: this,
|
|
3593
|
-
query:
|
|
3594
|
-
phraseSearch: params.get("phrase") === "true"
|
|
3597
|
+
query: phrase ? query : query.match(/\S+/g)
|
|
3595
3598
|
});
|
|
3596
3599
|
}
|
|
3597
3600
|
if (params.has("page")) {
|
|
@@ -3605,26 +3608,24 @@ class PDFLinkService {
|
|
|
3605
3608
|
dest = [null, {
|
|
3606
3609
|
name: "XYZ"
|
|
3607
3610
|
}, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg];
|
|
3608
|
-
} else {
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3611
|
+
} else if (zoomArg === "Fit" || zoomArg === "FitB") {
|
|
3612
|
+
dest = [null, {
|
|
3613
|
+
name: zoomArg
|
|
3614
|
+
}];
|
|
3615
|
+
} else if (zoomArg === "FitH" || zoomArg === "FitBH" || zoomArg === "FitV" || zoomArg === "FitBV") {
|
|
3616
|
+
dest = [null, {
|
|
3617
|
+
name: zoomArg
|
|
3618
|
+
}, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null];
|
|
3619
|
+
} else if (zoomArg === "FitR") {
|
|
3620
|
+
if (zoomArgs.length !== 5) {
|
|
3621
|
+
console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');
|
|
3622
|
+
} else {
|
|
3614
3623
|
dest = [null, {
|
|
3615
3624
|
name: zoomArg
|
|
3616
|
-
}, zoomArgs
|
|
3617
|
-
} else if (zoomArg === "FitR") {
|
|
3618
|
-
if (zoomArgs.length !== 5) {
|
|
3619
|
-
console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');
|
|
3620
|
-
} else {
|
|
3621
|
-
dest = [null, {
|
|
3622
|
-
name: zoomArg
|
|
3623
|
-
}, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];
|
|
3624
|
-
}
|
|
3625
|
-
} else {
|
|
3626
|
-
console.error(`PDFLinkService.setHash: "${zoomArg}" is not a valid zoom value.`);
|
|
3625
|
+
}, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];
|
|
3627
3626
|
}
|
|
3627
|
+
} else {
|
|
3628
|
+
console.error(`PDFLinkService.setHash: "${zoomArg}" is not a valid zoom value.`);
|
|
3628
3629
|
}
|
|
3629
3630
|
}
|
|
3630
3631
|
if (dest) {
|
|
@@ -3652,7 +3653,7 @@ class PDFLinkService {
|
|
|
3652
3653
|
if (!Array.isArray(dest)) {
|
|
3653
3654
|
dest = dest.toString();
|
|
3654
3655
|
}
|
|
3655
|
-
} catch
|
|
3656
|
+
} catch {}
|
|
3656
3657
|
if (typeof dest === "string" || PDFLinkService.#isValidExplicitDestination(dest)) {
|
|
3657
3658
|
this.goToDestination(dest);
|
|
3658
3659
|
return;
|
|
@@ -3734,12 +3735,6 @@ class PDFLinkService {
|
|
|
3734
3735
|
const refStr = pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;
|
|
3735
3736
|
return this.#pagesRefCache.get(refStr) || null;
|
|
3736
3737
|
}
|
|
3737
|
-
isPageVisible(pageNumber) {
|
|
3738
|
-
return this.pdfViewer.isPageVisible(pageNumber);
|
|
3739
|
-
}
|
|
3740
|
-
isPageCached(pageNumber) {
|
|
3741
|
-
return this.pdfViewer.isPageCached(pageNumber);
|
|
3742
|
-
}
|
|
3743
3738
|
static #isValidExplicitDestination(dest) {
|
|
3744
3739
|
if (!Array.isArray(dest)) {
|
|
3745
3740
|
return false;
|
|
@@ -3829,12 +3824,6 @@ class SimpleLinkService {
|
|
|
3829
3824
|
executeNamedAction(action) {}
|
|
3830
3825
|
executeSetOCGState(action) {}
|
|
3831
3826
|
cachePageRef(pageNum, pageRef) {}
|
|
3832
|
-
isPageVisible(pageNumber) {
|
|
3833
|
-
return true;
|
|
3834
|
-
}
|
|
3835
|
-
isPageCached(pageNumber) {
|
|
3836
|
-
return true;
|
|
3837
|
-
}
|
|
3838
3827
|
}
|
|
3839
3828
|
exports.SimpleLinkService = SimpleLinkService;
|
|
3840
3829
|
|
|
@@ -3861,40 +3850,27 @@ class AnnotationEditorParams {
|
|
|
3861
3850
|
editorInkThickness,
|
|
3862
3851
|
editorInkOpacity
|
|
3863
3852
|
}) {
|
|
3864
|
-
|
|
3853
|
+
const dispatchEvent = (typeStr, value) => {
|
|
3865
3854
|
this.eventBus.dispatch("switchannotationeditorparams", {
|
|
3866
3855
|
source: this,
|
|
3867
|
-
type: _pdfjsLib.AnnotationEditorParamsType
|
|
3868
|
-
value
|
|
3856
|
+
type: _pdfjsLib.AnnotationEditorParamsType[typeStr],
|
|
3857
|
+
value
|
|
3869
3858
|
});
|
|
3859
|
+
};
|
|
3860
|
+
editorFreeTextFontSize.addEventListener("input", function () {
|
|
3861
|
+
dispatchEvent("FREETEXT_SIZE", this.valueAsNumber);
|
|
3870
3862
|
});
|
|
3871
|
-
editorFreeTextColor.addEventListener("input",
|
|
3872
|
-
|
|
3873
|
-
source: this,
|
|
3874
|
-
type: _pdfjsLib.AnnotationEditorParamsType.FREETEXT_COLOR,
|
|
3875
|
-
value: editorFreeTextColor.value
|
|
3876
|
-
});
|
|
3863
|
+
editorFreeTextColor.addEventListener("input", function () {
|
|
3864
|
+
dispatchEvent("FREETEXT_COLOR", this.value);
|
|
3877
3865
|
});
|
|
3878
|
-
editorInkColor.addEventListener("input",
|
|
3879
|
-
|
|
3880
|
-
source: this,
|
|
3881
|
-
type: _pdfjsLib.AnnotationEditorParamsType.INK_COLOR,
|
|
3882
|
-
value: editorInkColor.value
|
|
3883
|
-
});
|
|
3866
|
+
editorInkColor.addEventListener("input", function () {
|
|
3867
|
+
dispatchEvent("INK_COLOR", this.value);
|
|
3884
3868
|
});
|
|
3885
|
-
editorInkThickness.addEventListener("input",
|
|
3886
|
-
|
|
3887
|
-
source: this,
|
|
3888
|
-
type: _pdfjsLib.AnnotationEditorParamsType.INK_THICKNESS,
|
|
3889
|
-
value: editorInkThickness.valueAsNumber
|
|
3890
|
-
});
|
|
3869
|
+
editorInkThickness.addEventListener("input", function () {
|
|
3870
|
+
dispatchEvent("INK_THICKNESS", this.valueAsNumber);
|
|
3891
3871
|
});
|
|
3892
|
-
editorInkOpacity.addEventListener("input",
|
|
3893
|
-
|
|
3894
|
-
source: this,
|
|
3895
|
-
type: _pdfjsLib.AnnotationEditorParamsType.INK_OPACITY,
|
|
3896
|
-
value: editorInkOpacity.valueAsNumber
|
|
3897
|
-
});
|
|
3872
|
+
editorInkOpacity.addEventListener("input", function () {
|
|
3873
|
+
dispatchEvent("INK_OPACITY", this.valueAsNumber);
|
|
3898
3874
|
});
|
|
3899
3875
|
this.eventBus._on("annotationeditorparamschanged", evt => {
|
|
3900
3876
|
for (const [type, value] of evt.details) {
|
|
@@ -3950,14 +3926,6 @@ class OverlayManager {
|
|
|
3950
3926
|
this.#active = null;
|
|
3951
3927
|
});
|
|
3952
3928
|
}
|
|
3953
|
-
async unregister(dialog) {
|
|
3954
|
-
if (!this.#overlays.has(dialog)) {
|
|
3955
|
-
throw new Error("The overlay does not exist.");
|
|
3956
|
-
} else if (this.#active === dialog) {
|
|
3957
|
-
throw new Error("The overlay cannot be removed while it is active.");
|
|
3958
|
-
}
|
|
3959
|
-
this.#overlays.delete(dialog);
|
|
3960
|
-
}
|
|
3961
3929
|
async open(dialog) {
|
|
3962
3930
|
if (!this.#overlays.has(dialog)) {
|
|
3963
3931
|
throw new Error("The overlay does not exist.");
|
|
@@ -4025,11 +3993,11 @@ class PasswordPrompt {
|
|
|
4025
3993
|
if (this.#activeCapability) {
|
|
4026
3994
|
await this.#activeCapability.promise;
|
|
4027
3995
|
}
|
|
4028
|
-
this.#activeCapability =
|
|
3996
|
+
this.#activeCapability = new _pdfjsLib.PromiseCapability();
|
|
4029
3997
|
try {
|
|
4030
3998
|
await this.overlayManager.open(this.dialog);
|
|
4031
3999
|
} catch (ex) {
|
|
4032
|
-
this.#activeCapability
|
|
4000
|
+
this.#activeCapability.resolve();
|
|
4033
4001
|
throw ex;
|
|
4034
4002
|
}
|
|
4035
4003
|
const passwordIncorrect = this.#reason === _pdfjsLib.PasswordResponses.INCORRECT_PASSWORD;
|
|
@@ -4095,7 +4063,7 @@ class PDFAttachmentViewer extends _base_tree_viewer.BaseTreeViewer {
|
|
|
4095
4063
|
super.reset();
|
|
4096
4064
|
this._attachments = null;
|
|
4097
4065
|
if (!keepRenderedCapability) {
|
|
4098
|
-
this._renderedCapability =
|
|
4066
|
+
this._renderedCapability = new _pdfjsLib.PromiseCapability();
|
|
4099
4067
|
}
|
|
4100
4068
|
this._pendingDispatchEvent = false;
|
|
4101
4069
|
}
|
|
@@ -4139,12 +4107,9 @@ class PDFAttachmentViewer extends _base_tree_viewer.BaseTreeViewer {
|
|
|
4139
4107
|
this._dispatchEvent(0);
|
|
4140
4108
|
return;
|
|
4141
4109
|
}
|
|
4142
|
-
const names = Object.keys(attachments).sort(function (a, b) {
|
|
4143
|
-
return a.toLowerCase().localeCompare(b.toLowerCase());
|
|
4144
|
-
});
|
|
4145
4110
|
const fragment = document.createDocumentFragment();
|
|
4146
4111
|
let attachmentsCount = 0;
|
|
4147
|
-
for (const name
|
|
4112
|
+
for (const name in attachments) {
|
|
4148
4113
|
const item = attachments[name];
|
|
4149
4114
|
const content = item.content,
|
|
4150
4115
|
filename = (0, _pdfjsLib.getFilenameFromUrl)(item.filename, true);
|
|
@@ -4302,10 +4267,12 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
4302
4267
|
value: true
|
|
4303
4268
|
}));
|
|
4304
4269
|
exports.PDFCursorTools = void 0;
|
|
4305
|
-
var _ui_utils = __webpack_require__(3);
|
|
4306
4270
|
var _pdfjsLib = __webpack_require__(4);
|
|
4271
|
+
var _ui_utils = __webpack_require__(3);
|
|
4307
4272
|
var _grab_to_pan = __webpack_require__(14);
|
|
4308
4273
|
class PDFCursorTools {
|
|
4274
|
+
#active = _ui_utils.CursorTool.SELECT;
|
|
4275
|
+
#prevActive = null;
|
|
4309
4276
|
constructor({
|
|
4310
4277
|
container,
|
|
4311
4278
|
eventBus,
|
|
@@ -4313,32 +4280,27 @@ class PDFCursorTools {
|
|
|
4313
4280
|
}) {
|
|
4314
4281
|
this.container = container;
|
|
4315
4282
|
this.eventBus = eventBus;
|
|
4316
|
-
this.active = _ui_utils.CursorTool.SELECT;
|
|
4317
|
-
this.previouslyActive = null;
|
|
4318
|
-
this.handTool = new _grab_to_pan.GrabToPan({
|
|
4319
|
-
element: this.container
|
|
4320
|
-
});
|
|
4321
4283
|
this.#addEventListeners();
|
|
4322
4284
|
Promise.resolve().then(() => {
|
|
4323
4285
|
this.switchTool(cursorToolOnLoad);
|
|
4324
4286
|
});
|
|
4325
4287
|
}
|
|
4326
4288
|
get activeTool() {
|
|
4327
|
-
return this
|
|
4289
|
+
return this.#active;
|
|
4328
4290
|
}
|
|
4329
4291
|
switchTool(tool) {
|
|
4330
|
-
if (this
|
|
4292
|
+
if (this.#prevActive !== null) {
|
|
4331
4293
|
return;
|
|
4332
4294
|
}
|
|
4333
|
-
if (tool === this
|
|
4295
|
+
if (tool === this.#active) {
|
|
4334
4296
|
return;
|
|
4335
4297
|
}
|
|
4336
4298
|
const disableActiveTool = () => {
|
|
4337
|
-
switch (this
|
|
4299
|
+
switch (this.#active) {
|
|
4338
4300
|
case _ui_utils.CursorTool.SELECT:
|
|
4339
4301
|
break;
|
|
4340
4302
|
case _ui_utils.CursorTool.HAND:
|
|
4341
|
-
this.
|
|
4303
|
+
this._handTool.deactivate();
|
|
4342
4304
|
break;
|
|
4343
4305
|
case _ui_utils.CursorTool.ZOOM:
|
|
4344
4306
|
}
|
|
@@ -4349,20 +4311,17 @@ class PDFCursorTools {
|
|
|
4349
4311
|
break;
|
|
4350
4312
|
case _ui_utils.CursorTool.HAND:
|
|
4351
4313
|
disableActiveTool();
|
|
4352
|
-
this.
|
|
4314
|
+
this._handTool.activate();
|
|
4353
4315
|
break;
|
|
4354
4316
|
case _ui_utils.CursorTool.ZOOM:
|
|
4355
4317
|
default:
|
|
4356
4318
|
console.error(`switchTool: "${tool}" is an unsupported value.`);
|
|
4357
4319
|
return;
|
|
4358
4320
|
}
|
|
4359
|
-
this
|
|
4360
|
-
this.#dispatchEvent();
|
|
4361
|
-
}
|
|
4362
|
-
#dispatchEvent() {
|
|
4321
|
+
this.#active = tool;
|
|
4363
4322
|
this.eventBus.dispatch("cursortoolchanged", {
|
|
4364
4323
|
source: this,
|
|
4365
|
-
tool
|
|
4324
|
+
tool
|
|
4366
4325
|
});
|
|
4367
4326
|
}
|
|
4368
4327
|
#addEventListeners() {
|
|
@@ -4372,19 +4331,19 @@ class PDFCursorTools {
|
|
|
4372
4331
|
let annotationEditorMode = _pdfjsLib.AnnotationEditorType.NONE,
|
|
4373
4332
|
presentationModeState = _ui_utils.PresentationModeState.NORMAL;
|
|
4374
4333
|
const disableActive = () => {
|
|
4375
|
-
const
|
|
4334
|
+
const prevActive = this.#active;
|
|
4376
4335
|
this.switchTool(_ui_utils.CursorTool.SELECT);
|
|
4377
|
-
this
|
|
4336
|
+
this.#prevActive ??= prevActive;
|
|
4378
4337
|
};
|
|
4379
4338
|
const enableActive = () => {
|
|
4380
|
-
const
|
|
4381
|
-
if (
|
|
4382
|
-
this
|
|
4383
|
-
this.switchTool(
|
|
4339
|
+
const prevActive = this.#prevActive;
|
|
4340
|
+
if (prevActive !== null && annotationEditorMode === _pdfjsLib.AnnotationEditorType.NONE && presentationModeState === _ui_utils.PresentationModeState.NORMAL) {
|
|
4341
|
+
this.#prevActive = null;
|
|
4342
|
+
this.switchTool(prevActive);
|
|
4384
4343
|
}
|
|
4385
4344
|
};
|
|
4386
4345
|
this.eventBus._on("secondarytoolbarreset", evt => {
|
|
4387
|
-
if (this
|
|
4346
|
+
if (this.#prevActive !== null) {
|
|
4388
4347
|
annotationEditorMode = _pdfjsLib.AnnotationEditorType.NONE;
|
|
4389
4348
|
presentationModeState = _ui_utils.PresentationModeState.NORMAL;
|
|
4390
4349
|
enableActive();
|
|
@@ -4411,6 +4370,11 @@ class PDFCursorTools {
|
|
|
4411
4370
|
}
|
|
4412
4371
|
});
|
|
4413
4372
|
}
|
|
4373
|
+
get _handTool() {
|
|
4374
|
+
return (0, _pdfjsLib.shadow)(this, "_handTool", new _grab_to_pan.GrabToPan({
|
|
4375
|
+
element: this.container
|
|
4376
|
+
}));
|
|
4377
|
+
}
|
|
4414
4378
|
}
|
|
4415
4379
|
exports.PDFCursorTools = PDFCursorTools;
|
|
4416
4380
|
|
|
@@ -4426,13 +4390,11 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
4426
4390
|
exports.GrabToPan = void 0;
|
|
4427
4391
|
const CSS_CLASS_GRAB = "grab-to-pan-grab";
|
|
4428
4392
|
class GrabToPan {
|
|
4429
|
-
constructor(
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
}
|
|
4435
|
-
this.onActiveChanged = options.onActiveChanged;
|
|
4393
|
+
constructor({
|
|
4394
|
+
element
|
|
4395
|
+
}) {
|
|
4396
|
+
this.element = element;
|
|
4397
|
+
this.document = element.ownerDocument;
|
|
4436
4398
|
this.activate = this.activate.bind(this);
|
|
4437
4399
|
this.deactivate = this.deactivate.bind(this);
|
|
4438
4400
|
this.toggle = this.toggle.bind(this);
|
|
@@ -4447,7 +4409,6 @@ class GrabToPan {
|
|
|
4447
4409
|
this.active = true;
|
|
4448
4410
|
this.element.addEventListener("mousedown", this._onMouseDown, true);
|
|
4449
4411
|
this.element.classList.add(CSS_CLASS_GRAB);
|
|
4450
|
-
this.onActiveChanged?.(true);
|
|
4451
4412
|
}
|
|
4452
4413
|
}
|
|
4453
4414
|
deactivate() {
|
|
@@ -4456,7 +4417,6 @@ class GrabToPan {
|
|
|
4456
4417
|
this.element.removeEventListener("mousedown", this._onMouseDown, true);
|
|
4457
4418
|
this._endPan();
|
|
4458
4419
|
this.element.classList.remove(CSS_CLASS_GRAB);
|
|
4459
|
-
this.onActiveChanged?.(false);
|
|
4460
4420
|
}
|
|
4461
4421
|
}
|
|
4462
4422
|
toggle() {
|
|
@@ -4476,7 +4436,7 @@ class GrabToPan {
|
|
|
4476
4436
|
if (event.originalTarget) {
|
|
4477
4437
|
try {
|
|
4478
4438
|
event.originalTarget.tagName;
|
|
4479
|
-
} catch
|
|
4439
|
+
} catch {
|
|
4480
4440
|
return;
|
|
4481
4441
|
}
|
|
4482
4442
|
}
|
|
@@ -4502,18 +4462,11 @@ class GrabToPan {
|
|
|
4502
4462
|
}
|
|
4503
4463
|
const xDiff = event.clientX - this.clientXStart;
|
|
4504
4464
|
const yDiff = event.clientY - this.clientYStart;
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
left: scrollLeft,
|
|
4511
|
-
behavior: "instant"
|
|
4512
|
-
});
|
|
4513
|
-
} else {
|
|
4514
|
-
this.element.scrollTop = scrollTop;
|
|
4515
|
-
this.element.scrollLeft = scrollLeft;
|
|
4516
|
-
}
|
|
4465
|
+
this.element.scrollTo({
|
|
4466
|
+
top: this.scrollTopStart - yDiff,
|
|
4467
|
+
left: this.scrollLeftStart - xDiff,
|
|
4468
|
+
behavior: "instant"
|
|
4469
|
+
});
|
|
4517
4470
|
if (!this.overlay.parentNode) {
|
|
4518
4471
|
document.body.append(this.overlay);
|
|
4519
4472
|
}
|
|
@@ -4537,8 +4490,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
4537
4490
|
value: true
|
|
4538
4491
|
}));
|
|
4539
4492
|
exports.PDFDocumentProperties = void 0;
|
|
4540
|
-
var _pdfjsLib = __webpack_require__(4);
|
|
4541
4493
|
var _ui_utils = __webpack_require__(3);
|
|
4494
|
+
var _pdfjsLib = __webpack_require__(4);
|
|
4542
4495
|
const DEFAULT_FIELD_CONTENT = "-";
|
|
4543
4496
|
const NON_METRIC_LOCALES = ["en-us", "en-lr", "my"];
|
|
4544
4497
|
const US_PAGE_NAMES = {
|
|
@@ -4642,7 +4595,7 @@ class PDFDocumentProperties {
|
|
|
4642
4595
|
#reset() {
|
|
4643
4596
|
this.pdfDocument = null;
|
|
4644
4597
|
this.#fieldData = null;
|
|
4645
|
-
this._dataAvailableCapability =
|
|
4598
|
+
this._dataAvailableCapability = new _pdfjsLib.PromiseCapability();
|
|
4646
4599
|
this._currentPageNumber = 1;
|
|
4647
4600
|
this._pagesRotation = 0;
|
|
4648
4601
|
}
|
|
@@ -4752,6 +4705,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
4752
4705
|
}));
|
|
4753
4706
|
exports.PDFFindBar = void 0;
|
|
4754
4707
|
var _pdf_find_controller = __webpack_require__(17);
|
|
4708
|
+
var _ui_utils = __webpack_require__(3);
|
|
4755
4709
|
const MATCHES_COUNT_LIMIT = 1000;
|
|
4756
4710
|
class PDFFindBar {
|
|
4757
4711
|
constructor(options, eventBus, l10n) {
|
|
@@ -4815,7 +4769,6 @@ class PDFFindBar {
|
|
|
4815
4769
|
source: this,
|
|
4816
4770
|
type,
|
|
4817
4771
|
query: this.findField.value,
|
|
4818
|
-
phraseSearch: true,
|
|
4819
4772
|
caseSensitive: this.caseSensitive.checked,
|
|
4820
4773
|
entireWord: this.entireWord.checked,
|
|
4821
4774
|
highlightAll: this.highlightAll.checked,
|
|
@@ -4843,6 +4796,7 @@ class PDFFindBar {
|
|
|
4843
4796
|
this.findField.setAttribute("data-status", status);
|
|
4844
4797
|
this.findField.setAttribute("aria-invalid", state === _pdf_find_controller.FindState.NOT_FOUND);
|
|
4845
4798
|
findMsg.then(msg => {
|
|
4799
|
+
this.findMsg.setAttribute("data-status", status);
|
|
4846
4800
|
this.findMsg.textContent = msg;
|
|
4847
4801
|
this.#adjustWidth();
|
|
4848
4802
|
});
|
|
@@ -4876,9 +4830,7 @@ class PDFFindBar {
|
|
|
4876
4830
|
open() {
|
|
4877
4831
|
if (!this.opened) {
|
|
4878
4832
|
this.opened = true;
|
|
4879
|
-
this.toggleButton.
|
|
4880
|
-
this.toggleButton.setAttribute("aria-expanded", "true");
|
|
4881
|
-
this.bar.classList.remove("hidden");
|
|
4833
|
+
(0, _ui_utils.toggleExpandedBtn)(this.toggleButton, true, this.bar);
|
|
4882
4834
|
}
|
|
4883
4835
|
this.findField.select();
|
|
4884
4836
|
this.findField.focus();
|
|
@@ -4889,9 +4841,7 @@ class PDFFindBar {
|
|
|
4889
4841
|
return;
|
|
4890
4842
|
}
|
|
4891
4843
|
this.opened = false;
|
|
4892
|
-
this.toggleButton.
|
|
4893
|
-
this.toggleButton.setAttribute("aria-expanded", "false");
|
|
4894
|
-
this.bar.classList.add("hidden");
|
|
4844
|
+
(0, _ui_utils.toggleExpandedBtn)(this.toggleButton, false, this.bar);
|
|
4895
4845
|
this.eventBus.dispatch("findbarclose", {
|
|
4896
4846
|
source: this
|
|
4897
4847
|
});
|
|
@@ -4928,8 +4878,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
4928
4878
|
}));
|
|
4929
4879
|
exports.PDFFindController = exports.FindState = void 0;
|
|
4930
4880
|
var _ui_utils = __webpack_require__(3);
|
|
4931
|
-
var _pdfjsLib = __webpack_require__(4);
|
|
4932
4881
|
var _pdf_find_utils = __webpack_require__(18);
|
|
4882
|
+
var _pdfjsLib = __webpack_require__(4);
|
|
4933
4883
|
const FindState = {
|
|
4934
4884
|
FOUND: 0,
|
|
4935
4885
|
NOT_FOUND: 1,
|
|
@@ -4989,7 +4939,7 @@ function normalize(text) {
|
|
|
4989
4939
|
normalizationRegex = withSyllablesRegExp;
|
|
4990
4940
|
} else {
|
|
4991
4941
|
const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join("");
|
|
4992
|
-
const toNormalizeWithNFKC =
|
|
4942
|
+
const toNormalizeWithNFKC = (0, _pdf_find_utils.getNormalizeWithNFKC)();
|
|
4993
4943
|
const CJK = "(?:\\p{Ideographic}|[\u3040-\u30FF])";
|
|
4994
4944
|
const HKDiacritics = "(?:\u3099|\u309A)";
|
|
4995
4945
|
const regexp = `([${replace}])|([${toNormalizeWithNFKC}])|(${HKDiacritics}\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(${CJK}\\n)|(\\n)`;
|
|
@@ -5074,17 +5024,19 @@ function normalize(text) {
|
|
|
5074
5024
|
return p4;
|
|
5075
5025
|
}
|
|
5076
5026
|
if (p5) {
|
|
5077
|
-
|
|
5027
|
+
const len = p5.length - 2;
|
|
5028
|
+
positions.push([i - shift + len, 1 + shift]);
|
|
5078
5029
|
shift += 1;
|
|
5079
5030
|
shiftOrigin += 1;
|
|
5080
5031
|
eol += 1;
|
|
5081
|
-
return p5.
|
|
5032
|
+
return p5.slice(0, -2);
|
|
5082
5033
|
}
|
|
5083
5034
|
if (p6) {
|
|
5084
|
-
|
|
5035
|
+
const len = p6.length - 1;
|
|
5036
|
+
positions.push([i - shift + len, shift]);
|
|
5085
5037
|
shiftOrigin += 1;
|
|
5086
5038
|
eol += 1;
|
|
5087
|
-
return p6.
|
|
5039
|
+
return p6.slice(0, -1);
|
|
5088
5040
|
}
|
|
5089
5041
|
if (p7) {
|
|
5090
5042
|
positions.push([i - shift + 1, shift - 1]);
|
|
@@ -5112,7 +5064,7 @@ function getOriginalIndex(diffs, pos, len) {
|
|
|
5112
5064
|
return [pos, len];
|
|
5113
5065
|
}
|
|
5114
5066
|
const start = pos;
|
|
5115
|
-
const end = pos + len;
|
|
5067
|
+
const end = pos + len - 1;
|
|
5116
5068
|
let i = (0, _ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= start);
|
|
5117
5069
|
if (diffs[i][0] > start) {
|
|
5118
5070
|
--i;
|
|
@@ -5121,9 +5073,13 @@ function getOriginalIndex(diffs, pos, len) {
|
|
|
5121
5073
|
if (diffs[j][0] > end) {
|
|
5122
5074
|
--j;
|
|
5123
5075
|
}
|
|
5124
|
-
|
|
5076
|
+
const oldStart = start + diffs[i][1];
|
|
5077
|
+
const oldEnd = end + diffs[j][1];
|
|
5078
|
+
const oldLen = oldEnd + 1 - oldStart;
|
|
5079
|
+
return [oldStart, oldLen];
|
|
5125
5080
|
}
|
|
5126
5081
|
class PDFFindController {
|
|
5082
|
+
#state = null;
|
|
5127
5083
|
#updateMatchesCountOnProgress = true;
|
|
5128
5084
|
#visitedPagesCount = 0;
|
|
5129
5085
|
constructor({
|
|
@@ -5134,6 +5090,7 @@ class PDFFindController {
|
|
|
5134
5090
|
this._linkService = linkService;
|
|
5135
5091
|
this._eventBus = eventBus;
|
|
5136
5092
|
this.#updateMatchesCountOnProgress = updateMatchesCountOnProgress;
|
|
5093
|
+
this.onIsPageVisible = null;
|
|
5137
5094
|
this.#reset();
|
|
5138
5095
|
eventBus._on("find", this.#onFind.bind(this));
|
|
5139
5096
|
eventBus._on("findbarclose", this.#onFindBarClose.bind(this));
|
|
@@ -5151,7 +5108,7 @@ class PDFFindController {
|
|
|
5151
5108
|
return this._selected;
|
|
5152
5109
|
}
|
|
5153
5110
|
get state() {
|
|
5154
|
-
return this
|
|
5111
|
+
return this.#state;
|
|
5155
5112
|
}
|
|
5156
5113
|
setDocument(pdfDocument) {
|
|
5157
5114
|
if (this._pdfDocument) {
|
|
@@ -5167,14 +5124,20 @@ class PDFFindController {
|
|
|
5167
5124
|
if (!state) {
|
|
5168
5125
|
return;
|
|
5169
5126
|
}
|
|
5127
|
+
if (state.phraseSearch === false) {
|
|
5128
|
+
console.error("The `phraseSearch`-parameter was removed, please provide " + "an Array of strings in the `query`-parameter instead.");
|
|
5129
|
+
if (typeof state.query === "string") {
|
|
5130
|
+
state.query = state.query.match(/\S+/g);
|
|
5131
|
+
}
|
|
5132
|
+
}
|
|
5170
5133
|
const pdfDocument = this._pdfDocument;
|
|
5171
5134
|
const {
|
|
5172
5135
|
type
|
|
5173
5136
|
} = state;
|
|
5174
|
-
if (this
|
|
5137
|
+
if (this.#state === null || this.#shouldDirtyMatch(state)) {
|
|
5175
5138
|
this._dirtyMatch = true;
|
|
5176
5139
|
}
|
|
5177
|
-
this
|
|
5140
|
+
this.#state = state;
|
|
5178
5141
|
if (type !== "highlightallchange") {
|
|
5179
5142
|
this.#updateUIState(FindState.PENDING);
|
|
5180
5143
|
}
|
|
@@ -5198,7 +5161,7 @@ class PDFFindController {
|
|
|
5198
5161
|
this.#nextMatch();
|
|
5199
5162
|
} else if (type === "again") {
|
|
5200
5163
|
this.#nextMatch();
|
|
5201
|
-
if (findbarClosed && this.
|
|
5164
|
+
if (findbarClosed && this.#state.highlightAll) {
|
|
5202
5165
|
this.#updateAllPages();
|
|
5203
5166
|
}
|
|
5204
5167
|
} else if (type === "highlightallchange") {
|
|
@@ -5240,7 +5203,7 @@ class PDFFindController {
|
|
|
5240
5203
|
this._pageMatches = [];
|
|
5241
5204
|
this._pageMatchesLength = [];
|
|
5242
5205
|
this.#visitedPagesCount = 0;
|
|
5243
|
-
this
|
|
5206
|
+
this.#state = null;
|
|
5244
5207
|
this._selected = {
|
|
5245
5208
|
pageIdx: -1,
|
|
5246
5209
|
matchIdx: -1
|
|
@@ -5261,27 +5224,41 @@ class PDFFindController {
|
|
|
5261
5224
|
this._dirtyMatch = false;
|
|
5262
5225
|
clearTimeout(this._findTimeout);
|
|
5263
5226
|
this._findTimeout = null;
|
|
5264
|
-
this._firstPageCapability =
|
|
5227
|
+
this._firstPageCapability = new _pdfjsLib.PromiseCapability();
|
|
5265
5228
|
}
|
|
5266
5229
|
get #query() {
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5230
|
+
const {
|
|
5231
|
+
query
|
|
5232
|
+
} = this.#state;
|
|
5233
|
+
if (typeof query === "string") {
|
|
5234
|
+
if (query !== this._rawQuery) {
|
|
5235
|
+
this._rawQuery = query;
|
|
5236
|
+
[this._normalizedQuery] = normalize(query);
|
|
5237
|
+
}
|
|
5238
|
+
return this._normalizedQuery;
|
|
5270
5239
|
}
|
|
5271
|
-
return
|
|
5240
|
+
return (query || []).filter(q => !!q).map(q => normalize(q)[0]);
|
|
5272
5241
|
}
|
|
5273
5242
|
#shouldDirtyMatch(state) {
|
|
5274
|
-
|
|
5243
|
+
const newQuery = state.query,
|
|
5244
|
+
prevQuery = this.#state.query;
|
|
5245
|
+
const newType = typeof newQuery,
|
|
5246
|
+
prevType = typeof prevQuery;
|
|
5247
|
+
if (newType !== prevType) {
|
|
5248
|
+
return true;
|
|
5249
|
+
}
|
|
5250
|
+
if (newType === "string") {
|
|
5251
|
+
if (newQuery !== prevQuery) {
|
|
5252
|
+
return true;
|
|
5253
|
+
}
|
|
5254
|
+
} else if (JSON.stringify(newQuery) !== JSON.stringify(prevQuery)) {
|
|
5275
5255
|
return true;
|
|
5276
5256
|
}
|
|
5277
5257
|
switch (state.type) {
|
|
5278
5258
|
case "again":
|
|
5279
5259
|
const pageNumber = this._selected.pageIdx + 1;
|
|
5280
5260
|
const linkService = this._linkService;
|
|
5281
|
-
|
|
5282
|
-
return true;
|
|
5283
|
-
}
|
|
5284
|
-
return false;
|
|
5261
|
+
return pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !(this.onIsPageVisible?.(pageNumber) ?? true);
|
|
5285
5262
|
case "highlightallchange":
|
|
5286
5263
|
return false;
|
|
5287
5264
|
}
|
|
@@ -5328,9 +5305,9 @@ class PDFFindController {
|
|
|
5328
5305
|
#convertToRegExpString(query, hasDiacritics) {
|
|
5329
5306
|
const {
|
|
5330
5307
|
matchDiacritics
|
|
5331
|
-
} = this
|
|
5308
|
+
} = this.#state;
|
|
5332
5309
|
let isUnicode = false;
|
|
5333
|
-
query = query.
|
|
5310
|
+
query = query.replaceAll(SPECIAL_CHARS_REG_EXP, (match, p1, p2, p3, p4, p5) => {
|
|
5334
5311
|
if (p1) {
|
|
5335
5312
|
return `[ ]*\\${p1}[ ]*`;
|
|
5336
5313
|
}
|
|
@@ -5367,33 +5344,29 @@ class PDFFindController {
|
|
|
5367
5344
|
}
|
|
5368
5345
|
#calculateMatch(pageIndex) {
|
|
5369
5346
|
let query = this.#query;
|
|
5370
|
-
if (
|
|
5347
|
+
if (query.length === 0) {
|
|
5371
5348
|
return;
|
|
5372
5349
|
}
|
|
5373
5350
|
const {
|
|
5374
5351
|
caseSensitive,
|
|
5375
|
-
entireWord
|
|
5376
|
-
|
|
5377
|
-
} = this._state;
|
|
5352
|
+
entireWord
|
|
5353
|
+
} = this.#state;
|
|
5378
5354
|
const pageContent = this._pageContents[pageIndex];
|
|
5379
5355
|
const hasDiacritics = this._hasDiacritics[pageIndex];
|
|
5380
5356
|
let isUnicode = false;
|
|
5381
|
-
if (
|
|
5357
|
+
if (typeof query === "string") {
|
|
5382
5358
|
[isUnicode, query] = this.#convertToRegExpString(query, hasDiacritics);
|
|
5383
5359
|
} else {
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
return `(${queryPart})`;
|
|
5390
|
-
}).join("|");
|
|
5391
|
-
}
|
|
5360
|
+
query = query.sort().reverse().map(q => {
|
|
5361
|
+
const [isUnicodePart, queryPart] = this.#convertToRegExpString(q, hasDiacritics);
|
|
5362
|
+
isUnicode ||= isUnicodePart;
|
|
5363
|
+
return `(${queryPart})`;
|
|
5364
|
+
}).join("|");
|
|
5392
5365
|
}
|
|
5393
5366
|
const flags = `g${isUnicode ? "u" : ""}${caseSensitive ? "" : "i"}`;
|
|
5394
5367
|
query = query ? new RegExp(query, flags) : null;
|
|
5395
5368
|
this.#calculateRegExpMatch(query, entireWord, pageIndex, pageContent);
|
|
5396
|
-
if (this.
|
|
5369
|
+
if (this.#state.highlightAll) {
|
|
5397
5370
|
this.#updatePage(pageIndex);
|
|
5398
5371
|
}
|
|
5399
5372
|
if (this._resumePageIdx === pageIndex) {
|
|
@@ -5415,12 +5388,15 @@ class PDFFindController {
|
|
|
5415
5388
|
return;
|
|
5416
5389
|
}
|
|
5417
5390
|
let promise = Promise.resolve();
|
|
5391
|
+
const textOptions = {
|
|
5392
|
+
disableNormalization: true
|
|
5393
|
+
};
|
|
5418
5394
|
for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {
|
|
5419
|
-
const extractTextCapability =
|
|
5395
|
+
const extractTextCapability = new _pdfjsLib.PromiseCapability();
|
|
5420
5396
|
this._extractTextPromises[i] = extractTextCapability.promise;
|
|
5421
5397
|
promise = promise.then(() => {
|
|
5422
5398
|
return this._pdfDocument.getPage(i + 1).then(pdfPage => {
|
|
5423
|
-
return pdfPage.getTextContent();
|
|
5399
|
+
return pdfPage.getTextContent(textOptions);
|
|
5424
5400
|
}).then(textContent => {
|
|
5425
5401
|
const strBuf = [];
|
|
5426
5402
|
for (const textItem of textContent.items) {
|
|
@@ -5457,7 +5433,7 @@ class PDFFindController {
|
|
|
5457
5433
|
});
|
|
5458
5434
|
}
|
|
5459
5435
|
#nextMatch() {
|
|
5460
|
-
const previous = this.
|
|
5436
|
+
const previous = this.#state.findPrevious;
|
|
5461
5437
|
const currentPageIndex = this._linkService.page - 1;
|
|
5462
5438
|
const numPages = this._linkService.pagesCount;
|
|
5463
5439
|
this._highlightMatches = true;
|
|
@@ -5484,7 +5460,8 @@ class PDFFindController {
|
|
|
5484
5460
|
});
|
|
5485
5461
|
}
|
|
5486
5462
|
}
|
|
5487
|
-
|
|
5463
|
+
const query = this.#query;
|
|
5464
|
+
if (query.length === 0) {
|
|
5488
5465
|
this.#updateUIState(FindState.FOUND);
|
|
5489
5466
|
return;
|
|
5490
5467
|
}
|
|
@@ -5507,7 +5484,7 @@ class PDFFindController {
|
|
|
5507
5484
|
#matchesReady(matches) {
|
|
5508
5485
|
const offset = this._offset;
|
|
5509
5486
|
const numMatches = matches.length;
|
|
5510
|
-
const previous = this.
|
|
5487
|
+
const previous = this.#state.findPrevious;
|
|
5511
5488
|
if (numMatches) {
|
|
5512
5489
|
offset.matchIdx = previous ? numMatches - 1 : 0;
|
|
5513
5490
|
this.#updateMatch(true);
|
|
@@ -5561,7 +5538,7 @@ class PDFFindController {
|
|
|
5561
5538
|
this.#updatePage(previousPage);
|
|
5562
5539
|
}
|
|
5563
5540
|
}
|
|
5564
|
-
this.#updateUIState(state, this.
|
|
5541
|
+
this.#updateUIState(state, this.#state.findPrevious);
|
|
5565
5542
|
if (this._selected.pageIdx !== -1) {
|
|
5566
5543
|
this._scrollMatches = true;
|
|
5567
5544
|
this.#updatePage(this._selected.pageIdx);
|
|
@@ -5622,7 +5599,7 @@ class PDFFindController {
|
|
|
5622
5599
|
state,
|
|
5623
5600
|
previous,
|
|
5624
5601
|
matchesCount: this.#requestMatchesCount(),
|
|
5625
|
-
rawQuery: this
|
|
5602
|
+
rawQuery: this.#state?.query ?? null
|
|
5626
5603
|
});
|
|
5627
5604
|
}
|
|
5628
5605
|
}
|
|
@@ -5639,6 +5616,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
5639
5616
|
}));
|
|
5640
5617
|
exports.CharacterType = void 0;
|
|
5641
5618
|
exports.getCharacterType = getCharacterType;
|
|
5619
|
+
exports.getNormalizeWithNFKC = getNormalizeWithNFKC;
|
|
5642
5620
|
const CharacterType = {
|
|
5643
5621
|
SPACE: 0,
|
|
5644
5622
|
ALPHA_LETTER: 1,
|
|
@@ -5707,6 +5685,11 @@ function getCharacterType(charCode) {
|
|
|
5707
5685
|
}
|
|
5708
5686
|
return CharacterType.ALPHA_LETTER;
|
|
5709
5687
|
}
|
|
5688
|
+
let NormalizeWithNFKC;
|
|
5689
|
+
function getNormalizeWithNFKC() {
|
|
5690
|
+
NormalizeWithNFKC ||= ` ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`;
|
|
5691
|
+
return NormalizeWithNFKC;
|
|
5692
|
+
}
|
|
5710
5693
|
|
|
5711
5694
|
/***/ }),
|
|
5712
5695
|
/* 19 */
|
|
@@ -6398,7 +6381,7 @@ class PDFOutlineViewer extends _base_tree_viewer.BaseTreeViewer {
|
|
|
6398
6381
|
this._currentOutlineItemCapability = null;
|
|
6399
6382
|
}
|
|
6400
6383
|
_dispatchEvent(outlineCount) {
|
|
6401
|
-
this._currentOutlineItemCapability =
|
|
6384
|
+
this._currentOutlineItemCapability = new _pdfjsLib.PromiseCapability();
|
|
6402
6385
|
if (outlineCount === 0 || this._pdfDocument?.loadingParams.disableAutoFetch) {
|
|
6403
6386
|
this._currentOutlineItemCapability.resolve(false);
|
|
6404
6387
|
} else if (this._isPagesLoaded !== null) {
|
|
@@ -6580,7 +6563,7 @@ class PDFOutlineViewer extends _base_tree_viewer.BaseTreeViewer {
|
|
|
6580
6563
|
if (this._pageNumberToDestHashCapability) {
|
|
6581
6564
|
return this._pageNumberToDestHashCapability.promise;
|
|
6582
6565
|
}
|
|
6583
|
-
this._pageNumberToDestHashCapability =
|
|
6566
|
+
this._pageNumberToDestHashCapability = new _pdfjsLib.PromiseCapability();
|
|
6584
6567
|
const pageNumberToDestHash = new Map(),
|
|
6585
6568
|
pageNumberNesting = new Map();
|
|
6586
6569
|
const queue = [{
|
|
@@ -6614,7 +6597,7 @@ class PDFOutlineViewer extends _base_tree_viewer.BaseTreeViewer {
|
|
|
6614
6597
|
return null;
|
|
6615
6598
|
}
|
|
6616
6599
|
this.linkService.cachePageRef(pageNumber, destRef);
|
|
6617
|
-
} catch
|
|
6600
|
+
} catch {}
|
|
6618
6601
|
}
|
|
6619
6602
|
} else if (Number.isInteger(destRef)) {
|
|
6620
6603
|
pageNumber = destRef + 1;
|
|
@@ -6703,7 +6686,7 @@ class PDFPresentationMode {
|
|
|
6703
6686
|
await promise;
|
|
6704
6687
|
pdfViewer.focus();
|
|
6705
6688
|
return true;
|
|
6706
|
-
} catch
|
|
6689
|
+
} catch {
|
|
6707
6690
|
this.#removeFullscreenChangeListeners();
|
|
6708
6691
|
this.#notifyStateChange(_ui_utils.PresentationModeState.NORMAL);
|
|
6709
6692
|
}
|
|
@@ -6754,7 +6737,9 @@ class PDFPresentationMode {
|
|
|
6754
6737
|
this.pdfViewer.currentPageNumber = this.#args.pageNumber;
|
|
6755
6738
|
this.pdfViewer.currentScaleValue = "page-fit";
|
|
6756
6739
|
if (this.#args.annotationEditorMode !== null) {
|
|
6757
|
-
this.pdfViewer.annotationEditorMode =
|
|
6740
|
+
this.pdfViewer.annotationEditorMode = {
|
|
6741
|
+
mode: _pdfjsLib.AnnotationEditorType.NONE
|
|
6742
|
+
};
|
|
6758
6743
|
}
|
|
6759
6744
|
}, 0);
|
|
6760
6745
|
this.#addWindowListeners();
|
|
@@ -6775,7 +6760,9 @@ class PDFPresentationMode {
|
|
|
6775
6760
|
this.pdfViewer.currentScaleValue = this.#args.scaleValue;
|
|
6776
6761
|
this.pdfViewer.currentPageNumber = pageNumber;
|
|
6777
6762
|
if (this.#args.annotationEditorMode !== null) {
|
|
6778
|
-
this.pdfViewer.annotationEditorMode =
|
|
6763
|
+
this.pdfViewer.annotationEditorMode = {
|
|
6764
|
+
mode: this.#args.annotationEditorMode
|
|
6765
|
+
};
|
|
6779
6766
|
}
|
|
6780
6767
|
this.#args = null;
|
|
6781
6768
|
}, 0);
|
|
@@ -6951,6 +6938,9 @@ class PDFRenderingQueue {
|
|
|
6951
6938
|
this.idleTimeout = null;
|
|
6952
6939
|
this.printing = false;
|
|
6953
6940
|
this.isThumbnailViewEnabled = false;
|
|
6941
|
+
Object.defineProperty(this, "hasViewer", {
|
|
6942
|
+
value: () => !!this.pdfViewer
|
|
6943
|
+
});
|
|
6954
6944
|
}
|
|
6955
6945
|
setViewer(pdfViewer) {
|
|
6956
6946
|
this.pdfViewer = pdfViewer;
|
|
@@ -6961,9 +6951,6 @@ class PDFRenderingQueue {
|
|
|
6961
6951
|
isHighestPriority(view) {
|
|
6962
6952
|
return this.highestPriorityPage === view.renderingId;
|
|
6963
6953
|
}
|
|
6964
|
-
hasViewer() {
|
|
6965
|
-
return !!this.pdfViewer;
|
|
6966
|
-
}
|
|
6967
6954
|
renderHighestPriority(currentlyVisiblePages) {
|
|
6968
6955
|
if (this.idleTimeout) {
|
|
6969
6956
|
clearTimeout(this.idleTimeout);
|
|
@@ -7067,57 +7054,60 @@ exports.PDFScriptingManager = void 0;
|
|
|
7067
7054
|
var _ui_utils = __webpack_require__(3);
|
|
7068
7055
|
var _pdfjsLib = __webpack_require__(4);
|
|
7069
7056
|
class PDFScriptingManager {
|
|
7057
|
+
#closeCapability = null;
|
|
7058
|
+
#destroyCapability = null;
|
|
7059
|
+
#docProperties = null;
|
|
7060
|
+
#eventBus = null;
|
|
7061
|
+
#externalServices = null;
|
|
7062
|
+
#pdfDocument = null;
|
|
7063
|
+
#pdfViewer = null;
|
|
7064
|
+
#ready = false;
|
|
7065
|
+
#sandboxBundleSrc = null;
|
|
7066
|
+
#scripting = null;
|
|
7070
7067
|
constructor({
|
|
7071
7068
|
eventBus,
|
|
7072
7069
|
sandboxBundleSrc = null,
|
|
7073
|
-
|
|
7074
|
-
|
|
7070
|
+
externalServices = null,
|
|
7071
|
+
docProperties = null
|
|
7075
7072
|
}) {
|
|
7076
|
-
this
|
|
7077
|
-
this
|
|
7078
|
-
this
|
|
7079
|
-
this
|
|
7080
|
-
this._scripting = null;
|
|
7081
|
-
this._ready = false;
|
|
7082
|
-
this._eventBus = eventBus;
|
|
7083
|
-
this._sandboxBundleSrc = sandboxBundleSrc;
|
|
7084
|
-
this._scriptingFactory = scriptingFactory;
|
|
7085
|
-
this._docPropertiesLookup = docPropertiesLookup;
|
|
7073
|
+
this.#eventBus = eventBus;
|
|
7074
|
+
this.#sandboxBundleSrc = sandboxBundleSrc;
|
|
7075
|
+
this.#externalServices = externalServices;
|
|
7076
|
+
this.#docProperties = docProperties;
|
|
7086
7077
|
}
|
|
7087
7078
|
setViewer(pdfViewer) {
|
|
7088
|
-
this
|
|
7079
|
+
this.#pdfViewer = pdfViewer;
|
|
7089
7080
|
}
|
|
7090
7081
|
async setDocument(pdfDocument) {
|
|
7091
|
-
if (this
|
|
7092
|
-
await this
|
|
7082
|
+
if (this.#pdfDocument) {
|
|
7083
|
+
await this.#destroyScripting();
|
|
7093
7084
|
}
|
|
7094
|
-
this
|
|
7085
|
+
this.#pdfDocument = pdfDocument;
|
|
7095
7086
|
if (!pdfDocument) {
|
|
7096
7087
|
return;
|
|
7097
7088
|
}
|
|
7098
7089
|
const [objects, calculationOrder, docActions] = await Promise.all([pdfDocument.getFieldObjects(), pdfDocument.getCalculationOrderIds(), pdfDocument.getJSActions()]);
|
|
7099
7090
|
if (!objects && !docActions) {
|
|
7100
|
-
await this
|
|
7091
|
+
await this.#destroyScripting();
|
|
7101
7092
|
return;
|
|
7102
7093
|
}
|
|
7103
|
-
if (pdfDocument !== this
|
|
7094
|
+
if (pdfDocument !== this.#pdfDocument) {
|
|
7104
7095
|
return;
|
|
7105
7096
|
}
|
|
7106
7097
|
try {
|
|
7107
|
-
this
|
|
7098
|
+
this.#scripting = this.#initScripting();
|
|
7108
7099
|
} catch (error) {
|
|
7109
|
-
console.error(`
|
|
7110
|
-
await this
|
|
7100
|
+
console.error(`setDocument: "${error.message}".`);
|
|
7101
|
+
await this.#destroyScripting();
|
|
7111
7102
|
return;
|
|
7112
7103
|
}
|
|
7113
7104
|
this._internalEvents.set("updatefromsandbox", event => {
|
|
7114
|
-
if (event?.source
|
|
7115
|
-
|
|
7105
|
+
if (event?.source === window) {
|
|
7106
|
+
this.#updateFromSandbox(event.detail);
|
|
7116
7107
|
}
|
|
7117
|
-
this._updateFromSandbox(event.detail);
|
|
7118
7108
|
});
|
|
7119
7109
|
this._internalEvents.set("dispatcheventinsandbox", event => {
|
|
7120
|
-
this
|
|
7110
|
+
this.#scripting?.dispatchEventInSandbox(event.detail);
|
|
7121
7111
|
});
|
|
7122
7112
|
this._internalEvents.set("pagechanging", ({
|
|
7123
7113
|
pageNumber,
|
|
@@ -7126,8 +7116,8 @@ class PDFScriptingManager {
|
|
|
7126
7116
|
if (pageNumber === previous) {
|
|
7127
7117
|
return;
|
|
7128
7118
|
}
|
|
7129
|
-
this
|
|
7130
|
-
this
|
|
7119
|
+
this.#dispatchPageClose(previous);
|
|
7120
|
+
this.#dispatchPageOpen(pageNumber);
|
|
7131
7121
|
});
|
|
7132
7122
|
this._internalEvents.set("pagerendered", ({
|
|
7133
7123
|
pageNumber
|
|
@@ -7135,28 +7125,28 @@ class PDFScriptingManager {
|
|
|
7135
7125
|
if (!this._pageOpenPending.has(pageNumber)) {
|
|
7136
7126
|
return;
|
|
7137
7127
|
}
|
|
7138
|
-
if (pageNumber !== this.
|
|
7128
|
+
if (pageNumber !== this.#pdfViewer.currentPageNumber) {
|
|
7139
7129
|
return;
|
|
7140
7130
|
}
|
|
7141
|
-
this
|
|
7131
|
+
this.#dispatchPageOpen(pageNumber);
|
|
7142
7132
|
});
|
|
7143
|
-
this._internalEvents.set("pagesdestroy", async
|
|
7144
|
-
await this
|
|
7145
|
-
await this
|
|
7133
|
+
this._internalEvents.set("pagesdestroy", async () => {
|
|
7134
|
+
await this.#dispatchPageClose(this.#pdfViewer.currentPageNumber);
|
|
7135
|
+
await this.#scripting?.dispatchEventInSandbox({
|
|
7146
7136
|
id: "doc",
|
|
7147
7137
|
name: "WillClose"
|
|
7148
7138
|
});
|
|
7149
|
-
this
|
|
7139
|
+
this.#closeCapability?.resolve();
|
|
7150
7140
|
});
|
|
7151
7141
|
for (const [name, listener] of this._internalEvents) {
|
|
7152
|
-
this.
|
|
7142
|
+
this.#eventBus._on(name, listener);
|
|
7153
7143
|
}
|
|
7154
7144
|
try {
|
|
7155
|
-
const docProperties = await this
|
|
7156
|
-
if (pdfDocument !== this
|
|
7145
|
+
const docProperties = await this.#docProperties(pdfDocument);
|
|
7146
|
+
if (pdfDocument !== this.#pdfDocument) {
|
|
7157
7147
|
return;
|
|
7158
7148
|
}
|
|
7159
|
-
await this.
|
|
7149
|
+
await this.#scripting.createSandbox({
|
|
7160
7150
|
objects,
|
|
7161
7151
|
calculationOrder,
|
|
7162
7152
|
appInfo: {
|
|
@@ -7168,54 +7158,54 @@ class PDFScriptingManager {
|
|
|
7168
7158
|
actions: docActions
|
|
7169
7159
|
}
|
|
7170
7160
|
});
|
|
7171
|
-
this.
|
|
7161
|
+
this.#eventBus.dispatch("sandboxcreated", {
|
|
7172
7162
|
source: this
|
|
7173
7163
|
});
|
|
7174
7164
|
} catch (error) {
|
|
7175
|
-
console.error(`
|
|
7176
|
-
await this
|
|
7165
|
+
console.error(`setDocument: "${error.message}".`);
|
|
7166
|
+
await this.#destroyScripting();
|
|
7177
7167
|
return;
|
|
7178
7168
|
}
|
|
7179
|
-
await this
|
|
7169
|
+
await this.#scripting?.dispatchEventInSandbox({
|
|
7180
7170
|
id: "doc",
|
|
7181
7171
|
name: "Open"
|
|
7182
7172
|
});
|
|
7183
|
-
await this
|
|
7173
|
+
await this.#dispatchPageOpen(this.#pdfViewer.currentPageNumber, true);
|
|
7184
7174
|
Promise.resolve().then(() => {
|
|
7185
|
-
if (pdfDocument === this
|
|
7186
|
-
this
|
|
7175
|
+
if (pdfDocument === this.#pdfDocument) {
|
|
7176
|
+
this.#ready = true;
|
|
7187
7177
|
}
|
|
7188
7178
|
});
|
|
7189
7179
|
}
|
|
7190
|
-
async dispatchWillSave(
|
|
7191
|
-
return this
|
|
7180
|
+
async dispatchWillSave() {
|
|
7181
|
+
return this.#scripting?.dispatchEventInSandbox({
|
|
7192
7182
|
id: "doc",
|
|
7193
7183
|
name: "WillSave"
|
|
7194
7184
|
});
|
|
7195
7185
|
}
|
|
7196
|
-
async dispatchDidSave(
|
|
7197
|
-
return this
|
|
7186
|
+
async dispatchDidSave() {
|
|
7187
|
+
return this.#scripting?.dispatchEventInSandbox({
|
|
7198
7188
|
id: "doc",
|
|
7199
7189
|
name: "DidSave"
|
|
7200
7190
|
});
|
|
7201
7191
|
}
|
|
7202
|
-
async dispatchWillPrint(
|
|
7203
|
-
return this
|
|
7192
|
+
async dispatchWillPrint() {
|
|
7193
|
+
return this.#scripting?.dispatchEventInSandbox({
|
|
7204
7194
|
id: "doc",
|
|
7205
7195
|
name: "WillPrint"
|
|
7206
7196
|
});
|
|
7207
7197
|
}
|
|
7208
|
-
async dispatchDidPrint(
|
|
7209
|
-
return this
|
|
7198
|
+
async dispatchDidPrint() {
|
|
7199
|
+
return this.#scripting?.dispatchEventInSandbox({
|
|
7210
7200
|
id: "doc",
|
|
7211
7201
|
name: "DidPrint"
|
|
7212
7202
|
});
|
|
7213
7203
|
}
|
|
7214
7204
|
get destroyPromise() {
|
|
7215
|
-
return this
|
|
7205
|
+
return this.#destroyCapability?.promise || null;
|
|
7216
7206
|
}
|
|
7217
7207
|
get ready() {
|
|
7218
|
-
return this
|
|
7208
|
+
return this.#ready;
|
|
7219
7209
|
}
|
|
7220
7210
|
get _internalEvents() {
|
|
7221
7211
|
return (0, _pdfjsLib.shadow)(this, "_internalEvents", new Map());
|
|
@@ -7226,8 +7216,9 @@ class PDFScriptingManager {
|
|
|
7226
7216
|
get _visitedPages() {
|
|
7227
7217
|
return (0, _pdfjsLib.shadow)(this, "_visitedPages", new Map());
|
|
7228
7218
|
}
|
|
7229
|
-
async
|
|
7230
|
-
const
|
|
7219
|
+
async #updateFromSandbox(detail) {
|
|
7220
|
+
const pdfViewer = this.#pdfViewer;
|
|
7221
|
+
const isInPresentationMode = pdfViewer.isInPresentationMode || pdfViewer.isChangingPresentationMode;
|
|
7231
7222
|
const {
|
|
7232
7223
|
id,
|
|
7233
7224
|
siblings,
|
|
@@ -7243,20 +7234,17 @@ class PDFScriptingManager {
|
|
|
7243
7234
|
console.error(value);
|
|
7244
7235
|
break;
|
|
7245
7236
|
case "layout":
|
|
7246
|
-
{
|
|
7247
|
-
if (isInPresentationMode) {
|
|
7248
|
-
return;
|
|
7249
|
-
}
|
|
7237
|
+
if (!isInPresentationMode) {
|
|
7250
7238
|
const modes = (0, _ui_utils.apiPageLayoutToViewerModes)(value);
|
|
7251
|
-
|
|
7252
|
-
break;
|
|
7239
|
+
pdfViewer.spreadMode = modes.spreadMode;
|
|
7253
7240
|
}
|
|
7241
|
+
break;
|
|
7254
7242
|
case "page-num":
|
|
7255
|
-
|
|
7243
|
+
pdfViewer.currentPageNumber = value + 1;
|
|
7256
7244
|
break;
|
|
7257
7245
|
case "print":
|
|
7258
|
-
await
|
|
7259
|
-
this.
|
|
7246
|
+
await pdfViewer.pagesPromise;
|
|
7247
|
+
this.#eventBus.dispatch("print", {
|
|
7260
7248
|
source: this
|
|
7261
7249
|
});
|
|
7262
7250
|
break;
|
|
@@ -7264,47 +7252,42 @@ class PDFScriptingManager {
|
|
|
7264
7252
|
console.log(value);
|
|
7265
7253
|
break;
|
|
7266
7254
|
case "zoom":
|
|
7267
|
-
if (isInPresentationMode) {
|
|
7268
|
-
|
|
7255
|
+
if (!isInPresentationMode) {
|
|
7256
|
+
pdfViewer.currentScaleValue = value;
|
|
7269
7257
|
}
|
|
7270
|
-
this._pdfViewer.currentScaleValue = value;
|
|
7271
7258
|
break;
|
|
7272
7259
|
case "SaveAs":
|
|
7273
|
-
this.
|
|
7260
|
+
this.#eventBus.dispatch("download", {
|
|
7274
7261
|
source: this
|
|
7275
7262
|
});
|
|
7276
7263
|
break;
|
|
7277
7264
|
case "FirstPage":
|
|
7278
|
-
|
|
7265
|
+
pdfViewer.currentPageNumber = 1;
|
|
7279
7266
|
break;
|
|
7280
7267
|
case "LastPage":
|
|
7281
|
-
|
|
7268
|
+
pdfViewer.currentPageNumber = pdfViewer.pagesCount;
|
|
7282
7269
|
break;
|
|
7283
7270
|
case "NextPage":
|
|
7284
|
-
|
|
7271
|
+
pdfViewer.nextPage();
|
|
7285
7272
|
break;
|
|
7286
7273
|
case "PrevPage":
|
|
7287
|
-
|
|
7274
|
+
pdfViewer.previousPage();
|
|
7288
7275
|
break;
|
|
7289
7276
|
case "ZoomViewIn":
|
|
7290
|
-
if (isInPresentationMode) {
|
|
7291
|
-
|
|
7277
|
+
if (!isInPresentationMode) {
|
|
7278
|
+
pdfViewer.increaseScale();
|
|
7292
7279
|
}
|
|
7293
|
-
this._pdfViewer.increaseScale();
|
|
7294
7280
|
break;
|
|
7295
7281
|
case "ZoomViewOut":
|
|
7296
|
-
if (isInPresentationMode) {
|
|
7297
|
-
|
|
7282
|
+
if (!isInPresentationMode) {
|
|
7283
|
+
pdfViewer.decreaseScale();
|
|
7298
7284
|
}
|
|
7299
|
-
this._pdfViewer.decreaseScale();
|
|
7300
7285
|
break;
|
|
7301
7286
|
}
|
|
7302
7287
|
return;
|
|
7303
7288
|
}
|
|
7304
|
-
if (isInPresentationMode) {
|
|
7305
|
-
|
|
7306
|
-
return;
|
|
7307
|
-
}
|
|
7289
|
+
if (isInPresentationMode && detail.focus) {
|
|
7290
|
+
return;
|
|
7308
7291
|
}
|
|
7309
7292
|
delete detail.id;
|
|
7310
7293
|
delete detail.siblings;
|
|
@@ -7316,20 +7299,20 @@ class PDFScriptingManager {
|
|
|
7316
7299
|
detail
|
|
7317
7300
|
}));
|
|
7318
7301
|
} else {
|
|
7319
|
-
this
|
|
7302
|
+
this.#pdfDocument?.annotationStorage.setValue(elementId, detail);
|
|
7320
7303
|
}
|
|
7321
7304
|
}
|
|
7322
7305
|
}
|
|
7323
|
-
async
|
|
7324
|
-
const pdfDocument = this
|
|
7306
|
+
async #dispatchPageOpen(pageNumber, initialize = false) {
|
|
7307
|
+
const pdfDocument = this.#pdfDocument,
|
|
7325
7308
|
visitedPages = this._visitedPages;
|
|
7326
7309
|
if (initialize) {
|
|
7327
|
-
this
|
|
7310
|
+
this.#closeCapability = new _pdfjsLib.PromiseCapability();
|
|
7328
7311
|
}
|
|
7329
|
-
if (!this
|
|
7312
|
+
if (!this.#closeCapability) {
|
|
7330
7313
|
return;
|
|
7331
7314
|
}
|
|
7332
|
-
const pageView = this.
|
|
7315
|
+
const pageView = this.#pdfViewer.getPageView(pageNumber - 1);
|
|
7333
7316
|
if (pageView?.renderingState !== _ui_utils.RenderingStates.FINISHED) {
|
|
7334
7317
|
this._pageOpenPending.add(pageNumber);
|
|
7335
7318
|
return;
|
|
@@ -7337,10 +7320,10 @@ class PDFScriptingManager {
|
|
|
7337
7320
|
this._pageOpenPending.delete(pageNumber);
|
|
7338
7321
|
const actionsPromise = (async () => {
|
|
7339
7322
|
const actions = await (!visitedPages.has(pageNumber) ? pageView.pdfPage?.getJSActions() : null);
|
|
7340
|
-
if (pdfDocument !== this
|
|
7323
|
+
if (pdfDocument !== this.#pdfDocument) {
|
|
7341
7324
|
return;
|
|
7342
7325
|
}
|
|
7343
|
-
await this
|
|
7326
|
+
await this.#scripting?.dispatchEventInSandbox({
|
|
7344
7327
|
id: "page",
|
|
7345
7328
|
name: "PageOpen",
|
|
7346
7329
|
pageNumber,
|
|
@@ -7349,10 +7332,10 @@ class PDFScriptingManager {
|
|
|
7349
7332
|
})();
|
|
7350
7333
|
visitedPages.set(pageNumber, actionsPromise);
|
|
7351
7334
|
}
|
|
7352
|
-
async
|
|
7353
|
-
const pdfDocument = this
|
|
7335
|
+
async #dispatchPageClose(pageNumber) {
|
|
7336
|
+
const pdfDocument = this.#pdfDocument,
|
|
7354
7337
|
visitedPages = this._visitedPages;
|
|
7355
|
-
if (!this
|
|
7338
|
+
if (!this.#closeCapability) {
|
|
7356
7339
|
return;
|
|
7357
7340
|
}
|
|
7358
7341
|
if (this._pageOpenPending.has(pageNumber)) {
|
|
@@ -7364,58 +7347,49 @@ class PDFScriptingManager {
|
|
|
7364
7347
|
}
|
|
7365
7348
|
visitedPages.set(pageNumber, null);
|
|
7366
7349
|
await actionsPromise;
|
|
7367
|
-
if (pdfDocument !== this
|
|
7350
|
+
if (pdfDocument !== this.#pdfDocument) {
|
|
7368
7351
|
return;
|
|
7369
7352
|
}
|
|
7370
|
-
await this
|
|
7353
|
+
await this.#scripting?.dispatchEventInSandbox({
|
|
7371
7354
|
id: "page",
|
|
7372
7355
|
name: "PageClose",
|
|
7373
7356
|
pageNumber
|
|
7374
7357
|
});
|
|
7375
7358
|
}
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
throw new Error("_getDocProperties: Unable to lookup properties.");
|
|
7381
|
-
}
|
|
7382
|
-
_createScripting() {
|
|
7383
|
-
this._destroyCapability = (0, _pdfjsLib.createPromiseCapability)();
|
|
7384
|
-
if (this._scripting) {
|
|
7385
|
-
throw new Error("_createScripting: Scripting already exists.");
|
|
7386
|
-
}
|
|
7387
|
-
if (this._scriptingFactory) {
|
|
7388
|
-
return this._scriptingFactory.createScripting({
|
|
7389
|
-
sandboxBundleSrc: this._sandboxBundleSrc
|
|
7390
|
-
});
|
|
7359
|
+
#initScripting() {
|
|
7360
|
+
this.#destroyCapability = new _pdfjsLib.PromiseCapability();
|
|
7361
|
+
if (this.#scripting) {
|
|
7362
|
+
throw new Error("#initScripting: Scripting already exists.");
|
|
7391
7363
|
}
|
|
7392
|
-
|
|
7364
|
+
return this.#externalServices.createScripting({
|
|
7365
|
+
sandboxBundleSrc: this.#sandboxBundleSrc
|
|
7366
|
+
});
|
|
7393
7367
|
}
|
|
7394
|
-
async
|
|
7395
|
-
if (!this
|
|
7396
|
-
this
|
|
7397
|
-
this
|
|
7368
|
+
async #destroyScripting() {
|
|
7369
|
+
if (!this.#scripting) {
|
|
7370
|
+
this.#pdfDocument = null;
|
|
7371
|
+
this.#destroyCapability?.resolve();
|
|
7398
7372
|
return;
|
|
7399
7373
|
}
|
|
7400
|
-
if (this
|
|
7401
|
-
await Promise.race([this.
|
|
7374
|
+
if (this.#closeCapability) {
|
|
7375
|
+
await Promise.race([this.#closeCapability.promise, new Promise(resolve => {
|
|
7402
7376
|
setTimeout(resolve, 1000);
|
|
7403
|
-
})]).catch(
|
|
7404
|
-
this
|
|
7377
|
+
})]).catch(() => {});
|
|
7378
|
+
this.#closeCapability = null;
|
|
7405
7379
|
}
|
|
7406
|
-
this
|
|
7380
|
+
this.#pdfDocument = null;
|
|
7407
7381
|
try {
|
|
7408
|
-
await this.
|
|
7409
|
-
} catch
|
|
7382
|
+
await this.#scripting.destroySandbox();
|
|
7383
|
+
} catch {}
|
|
7410
7384
|
for (const [name, listener] of this._internalEvents) {
|
|
7411
|
-
this.
|
|
7385
|
+
this.#eventBus._off(name, listener);
|
|
7412
7386
|
}
|
|
7413
7387
|
this._internalEvents.clear();
|
|
7414
7388
|
this._pageOpenPending.clear();
|
|
7415
7389
|
this._visitedPages.clear();
|
|
7416
|
-
this
|
|
7417
|
-
this
|
|
7418
|
-
this
|
|
7390
|
+
this.#scripting = null;
|
|
7391
|
+
this.#ready = false;
|
|
7392
|
+
this.#destroyCapability?.resolve();
|
|
7419
7393
|
}
|
|
7420
7394
|
}
|
|
7421
7395
|
exports.PDFScriptingManager = PDFScriptingManager;
|
|
@@ -7431,12 +7405,18 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
7431
7405
|
}));
|
|
7432
7406
|
exports.PDFSidebar = void 0;
|
|
7433
7407
|
var _ui_utils = __webpack_require__(3);
|
|
7408
|
+
const SIDEBAR_WIDTH_VAR = "--sidebar-width";
|
|
7409
|
+
const SIDEBAR_MIN_WIDTH = 200;
|
|
7410
|
+
const SIDEBAR_RESIZING_CLASS = "sidebarResizing";
|
|
7434
7411
|
const UI_NOTIFICATION_CLASS = "pdfSidebarNotification";
|
|
7435
7412
|
class PDFSidebar {
|
|
7413
|
+
#isRTL = false;
|
|
7414
|
+
#mouseMoveBound = this.#mouseMove.bind(this);
|
|
7415
|
+
#mouseUpBound = this.#mouseUp.bind(this);
|
|
7416
|
+
#outerContainerWidth = null;
|
|
7417
|
+
#width = null;
|
|
7436
7418
|
constructor({
|
|
7437
7419
|
elements,
|
|
7438
|
-
pdfViewer,
|
|
7439
|
-
pdfThumbnailViewer,
|
|
7440
7420
|
eventBus,
|
|
7441
7421
|
l10n
|
|
7442
7422
|
}) {
|
|
@@ -7445,11 +7425,11 @@ class PDFSidebar {
|
|
|
7445
7425
|
this.isInitialViewSet = false;
|
|
7446
7426
|
this.isInitialEventDispatched = false;
|
|
7447
7427
|
this.onToggled = null;
|
|
7448
|
-
this.
|
|
7449
|
-
this.pdfThumbnailViewer = pdfThumbnailViewer;
|
|
7428
|
+
this.onUpdateThumbnails = null;
|
|
7450
7429
|
this.outerContainer = elements.outerContainer;
|
|
7451
7430
|
this.sidebarContainer = elements.sidebarContainer;
|
|
7452
7431
|
this.toggleButton = elements.toggleButton;
|
|
7432
|
+
this.resizer = elements.resizer;
|
|
7453
7433
|
this.thumbnailButton = elements.thumbnailButton;
|
|
7454
7434
|
this.outlineButton = elements.outlineButton;
|
|
7455
7435
|
this.attachmentsButton = elements.attachmentsButton;
|
|
@@ -7462,6 +7442,9 @@ class PDFSidebar {
|
|
|
7462
7442
|
this._currentOutlineItemButton = elements.currentOutlineItemButton;
|
|
7463
7443
|
this.eventBus = eventBus;
|
|
7464
7444
|
this.l10n = l10n;
|
|
7445
|
+
l10n.getDirection().then(dir => {
|
|
7446
|
+
this.#isRTL = dir === "rtl";
|
|
7447
|
+
});
|
|
7465
7448
|
this.#addEventListeners();
|
|
7466
7449
|
}
|
|
7467
7450
|
reset() {
|
|
@@ -7493,7 +7476,7 @@ class PDFSidebar {
|
|
|
7493
7476
|
}
|
|
7494
7477
|
switchView(view, forceOpen = false) {
|
|
7495
7478
|
const isViewChanged = view !== this.active;
|
|
7496
|
-
let
|
|
7479
|
+
let forceRendering = false;
|
|
7497
7480
|
switch (view) {
|
|
7498
7481
|
case _ui_utils.SidebarView.NONE:
|
|
7499
7482
|
if (this.isOpen) {
|
|
@@ -7502,7 +7485,7 @@ class PDFSidebar {
|
|
|
7502
7485
|
return;
|
|
7503
7486
|
case _ui_utils.SidebarView.THUMBS:
|
|
7504
7487
|
if (this.isOpen && isViewChanged) {
|
|
7505
|
-
|
|
7488
|
+
forceRendering = true;
|
|
7506
7489
|
}
|
|
7507
7490
|
break;
|
|
7508
7491
|
case _ui_utils.SidebarView.OUTLINE:
|
|
@@ -7525,30 +7508,18 @@ class PDFSidebar {
|
|
|
7525
7508
|
return;
|
|
7526
7509
|
}
|
|
7527
7510
|
this.active = view;
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
this.
|
|
7533
|
-
this.outlineButton.classList.toggle("toggled", isOutline);
|
|
7534
|
-
this.attachmentsButton.classList.toggle("toggled", isAttachments);
|
|
7535
|
-
this.layersButton.classList.toggle("toggled", isLayers);
|
|
7536
|
-
this.thumbnailButton.setAttribute("aria-checked", isThumbs);
|
|
7537
|
-
this.outlineButton.setAttribute("aria-checked", isOutline);
|
|
7538
|
-
this.attachmentsButton.setAttribute("aria-checked", isAttachments);
|
|
7539
|
-
this.layersButton.setAttribute("aria-checked", isLayers);
|
|
7540
|
-
this.thumbnailView.classList.toggle("hidden", !isThumbs);
|
|
7541
|
-
this.outlineView.classList.toggle("hidden", !isOutline);
|
|
7542
|
-
this.attachmentsView.classList.toggle("hidden", !isAttachments);
|
|
7543
|
-
this.layersView.classList.toggle("hidden", !isLayers);
|
|
7544
|
-
this._outlineOptionsContainer.classList.toggle("hidden", !isOutline);
|
|
7511
|
+
(0, _ui_utils.toggleCheckedBtn)(this.thumbnailButton, view === _ui_utils.SidebarView.THUMBS, this.thumbnailView);
|
|
7512
|
+
(0, _ui_utils.toggleCheckedBtn)(this.outlineButton, view === _ui_utils.SidebarView.OUTLINE, this.outlineView);
|
|
7513
|
+
(0, _ui_utils.toggleCheckedBtn)(this.attachmentsButton, view === _ui_utils.SidebarView.ATTACHMENTS, this.attachmentsView);
|
|
7514
|
+
(0, _ui_utils.toggleCheckedBtn)(this.layersButton, view === _ui_utils.SidebarView.LAYERS, this.layersView);
|
|
7515
|
+
this._outlineOptionsContainer.classList.toggle("hidden", view !== _ui_utils.SidebarView.OUTLINE);
|
|
7545
7516
|
if (forceOpen && !this.isOpen) {
|
|
7546
7517
|
this.open();
|
|
7547
7518
|
return;
|
|
7548
7519
|
}
|
|
7549
|
-
if (
|
|
7550
|
-
this
|
|
7551
|
-
this
|
|
7520
|
+
if (forceRendering) {
|
|
7521
|
+
this.onUpdateThumbnails();
|
|
7522
|
+
this.onToggled();
|
|
7552
7523
|
}
|
|
7553
7524
|
if (isViewChanged) {
|
|
7554
7525
|
this.#dispatchEvent();
|
|
@@ -7559,13 +7530,12 @@ class PDFSidebar {
|
|
|
7559
7530
|
return;
|
|
7560
7531
|
}
|
|
7561
7532
|
this.isOpen = true;
|
|
7562
|
-
this.toggleButton
|
|
7563
|
-
this.toggleButton.setAttribute("aria-expanded", "true");
|
|
7533
|
+
(0, _ui_utils.toggleExpandedBtn)(this.toggleButton, true);
|
|
7564
7534
|
this.outerContainer.classList.add("sidebarMoving", "sidebarOpen");
|
|
7565
7535
|
if (this.active === _ui_utils.SidebarView.THUMBS) {
|
|
7566
|
-
this
|
|
7536
|
+
this.onUpdateThumbnails();
|
|
7567
7537
|
}
|
|
7568
|
-
this
|
|
7538
|
+
this.onToggled();
|
|
7569
7539
|
this.#dispatchEvent();
|
|
7570
7540
|
this.#hideUINotification();
|
|
7571
7541
|
}
|
|
@@ -7574,11 +7544,10 @@ class PDFSidebar {
|
|
|
7574
7544
|
return;
|
|
7575
7545
|
}
|
|
7576
7546
|
this.isOpen = false;
|
|
7577
|
-
this.toggleButton
|
|
7578
|
-
this.toggleButton.setAttribute("aria-expanded", "false");
|
|
7547
|
+
(0, _ui_utils.toggleExpandedBtn)(this.toggleButton, false);
|
|
7579
7548
|
this.outerContainer.classList.add("sidebarMoving");
|
|
7580
7549
|
this.outerContainer.classList.remove("sidebarOpen");
|
|
7581
|
-
this
|
|
7550
|
+
this.onToggled();
|
|
7582
7551
|
this.#dispatchEvent();
|
|
7583
7552
|
}
|
|
7584
7553
|
toggle() {
|
|
@@ -7589,37 +7558,14 @@ class PDFSidebar {
|
|
|
7589
7558
|
}
|
|
7590
7559
|
}
|
|
7591
7560
|
#dispatchEvent() {
|
|
7592
|
-
if (this.isInitialViewSet
|
|
7593
|
-
this.isInitialEventDispatched
|
|
7561
|
+
if (this.isInitialViewSet) {
|
|
7562
|
+
this.isInitialEventDispatched ||= true;
|
|
7594
7563
|
}
|
|
7595
7564
|
this.eventBus.dispatch("sidebarviewchanged", {
|
|
7596
7565
|
source: this,
|
|
7597
7566
|
view: this.visibleView
|
|
7598
7567
|
});
|
|
7599
7568
|
}
|
|
7600
|
-
#forceRendering() {
|
|
7601
|
-
if (this.onToggled) {
|
|
7602
|
-
this.onToggled();
|
|
7603
|
-
} else {
|
|
7604
|
-
this.pdfViewer.forceRendering();
|
|
7605
|
-
this.pdfThumbnailViewer.forceRendering();
|
|
7606
|
-
}
|
|
7607
|
-
}
|
|
7608
|
-
#updateThumbnailViewer() {
|
|
7609
|
-
const {
|
|
7610
|
-
pdfViewer,
|
|
7611
|
-
pdfThumbnailViewer
|
|
7612
|
-
} = this;
|
|
7613
|
-
const pagesCount = pdfViewer.pagesCount;
|
|
7614
|
-
for (let pageIndex = 0; pageIndex < pagesCount; pageIndex++) {
|
|
7615
|
-
const pageView = pdfViewer.getPageView(pageIndex);
|
|
7616
|
-
if (pageView?.renderingState === _ui_utils.RenderingStates.FINISHED) {
|
|
7617
|
-
const thumbnailView = pdfThumbnailViewer.getThumbnail(pageIndex);
|
|
7618
|
-
thumbnailView.setImage(pageView);
|
|
7619
|
-
}
|
|
7620
|
-
}
|
|
7621
|
-
pdfThumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber);
|
|
7622
|
-
}
|
|
7623
7569
|
#showUINotification() {
|
|
7624
7570
|
this.toggleButton.setAttribute("data-l10n-id", "toggle_sidebar_notification2");
|
|
7625
7571
|
this.l10n.translate(this.toggleButton);
|
|
@@ -7697,46 +7643,45 @@ class PDFSidebar {
|
|
|
7697
7643
|
});
|
|
7698
7644
|
this.eventBus._on("presentationmodechanged", evt => {
|
|
7699
7645
|
if (evt.state === _ui_utils.PresentationModeState.NORMAL && this.visibleView === _ui_utils.SidebarView.THUMBS) {
|
|
7700
|
-
this
|
|
7646
|
+
this.onUpdateThumbnails();
|
|
7701
7647
|
}
|
|
7702
7648
|
});
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
7714
|
-
value: true
|
|
7715
|
-
}));
|
|
7716
|
-
exports.PDFSidebarResizer = void 0;
|
|
7717
|
-
var _ui_utils = __webpack_require__(3);
|
|
7718
|
-
const SIDEBAR_WIDTH_VAR = "--sidebar-width";
|
|
7719
|
-
const SIDEBAR_MIN_WIDTH = 200;
|
|
7720
|
-
const SIDEBAR_RESIZING_CLASS = "sidebarResizing";
|
|
7721
|
-
class PDFSidebarResizer {
|
|
7722
|
-
constructor(options, eventBus, l10n) {
|
|
7723
|
-
this.isRTL = false;
|
|
7724
|
-
this.sidebarOpen = false;
|
|
7725
|
-
this._width = null;
|
|
7726
|
-
this._outerContainerWidth = null;
|
|
7727
|
-
this._boundEvents = Object.create(null);
|
|
7728
|
-
this.outerContainer = options.outerContainer;
|
|
7729
|
-
this.resizer = options.resizer;
|
|
7730
|
-
this.eventBus = eventBus;
|
|
7731
|
-
l10n.getDirection().then(dir => {
|
|
7732
|
-
this.isRTL = dir === "rtl";
|
|
7649
|
+
this.resizer.addEventListener("mousedown", evt => {
|
|
7650
|
+
if (evt.button !== 0) {
|
|
7651
|
+
return;
|
|
7652
|
+
}
|
|
7653
|
+
this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);
|
|
7654
|
+
window.addEventListener("mousemove", this.#mouseMoveBound);
|
|
7655
|
+
window.addEventListener("mouseup", this.#mouseUpBound);
|
|
7733
7656
|
});
|
|
7734
|
-
this.
|
|
7735
|
-
|
|
7657
|
+
this.eventBus._on("resize", evt => {
|
|
7658
|
+
if (evt.source !== window) {
|
|
7659
|
+
return;
|
|
7660
|
+
}
|
|
7661
|
+
this.#outerContainerWidth = null;
|
|
7662
|
+
if (!this.#width) {
|
|
7663
|
+
return;
|
|
7664
|
+
}
|
|
7665
|
+
if (!this.isOpen) {
|
|
7666
|
+
this.#updateWidth(this.#width);
|
|
7667
|
+
return;
|
|
7668
|
+
}
|
|
7669
|
+
this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);
|
|
7670
|
+
const updated = this.#updateWidth(this.#width);
|
|
7671
|
+
Promise.resolve().then(() => {
|
|
7672
|
+
this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);
|
|
7673
|
+
if (updated) {
|
|
7674
|
+
this.eventBus.dispatch("resize", {
|
|
7675
|
+
source: this
|
|
7676
|
+
});
|
|
7677
|
+
}
|
|
7678
|
+
});
|
|
7679
|
+
});
|
|
7680
|
+
}
|
|
7736
7681
|
get outerContainerWidth() {
|
|
7737
|
-
return this
|
|
7682
|
+
return this.#outerContainerWidth ||= this.outerContainer.clientWidth;
|
|
7738
7683
|
}
|
|
7739
|
-
|
|
7684
|
+
#updateWidth(width = 0) {
|
|
7740
7685
|
const maxWidth = Math.floor(this.outerContainerWidth / 2);
|
|
7741
7686
|
if (width > maxWidth) {
|
|
7742
7687
|
width = maxWidth;
|
|
@@ -7744,73 +7689,33 @@ class PDFSidebarResizer {
|
|
|
7744
7689
|
if (width < SIDEBAR_MIN_WIDTH) {
|
|
7745
7690
|
width = SIDEBAR_MIN_WIDTH;
|
|
7746
7691
|
}
|
|
7747
|
-
if (width === this
|
|
7692
|
+
if (width === this.#width) {
|
|
7748
7693
|
return false;
|
|
7749
7694
|
}
|
|
7750
|
-
this
|
|
7695
|
+
this.#width = width;
|
|
7751
7696
|
_ui_utils.docStyle.setProperty(SIDEBAR_WIDTH_VAR, `${width}px`);
|
|
7752
7697
|
return true;
|
|
7753
7698
|
}
|
|
7754
|
-
|
|
7699
|
+
#mouseMove(evt) {
|
|
7755
7700
|
let width = evt.clientX;
|
|
7756
|
-
if (this
|
|
7701
|
+
if (this.#isRTL) {
|
|
7757
7702
|
width = this.outerContainerWidth - width;
|
|
7758
7703
|
}
|
|
7759
|
-
this
|
|
7704
|
+
this.#updateWidth(width);
|
|
7760
7705
|
}
|
|
7761
|
-
|
|
7706
|
+
#mouseUp(evt) {
|
|
7762
7707
|
this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);
|
|
7763
7708
|
this.eventBus.dispatch("resize", {
|
|
7764
7709
|
source: this
|
|
7765
7710
|
});
|
|
7766
|
-
|
|
7767
|
-
window.removeEventListener("
|
|
7768
|
-
window.removeEventListener("mouseup", _boundEvents.mouseUp);
|
|
7769
|
-
}
|
|
7770
|
-
_addEventListeners() {
|
|
7771
|
-
const _boundEvents = this._boundEvents;
|
|
7772
|
-
_boundEvents.mouseMove = this._mouseMove.bind(this);
|
|
7773
|
-
_boundEvents.mouseUp = this._mouseUp.bind(this);
|
|
7774
|
-
this.resizer.addEventListener("mousedown", evt => {
|
|
7775
|
-
if (evt.button !== 0) {
|
|
7776
|
-
return;
|
|
7777
|
-
}
|
|
7778
|
-
this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);
|
|
7779
|
-
window.addEventListener("mousemove", _boundEvents.mouseMove);
|
|
7780
|
-
window.addEventListener("mouseup", _boundEvents.mouseUp);
|
|
7781
|
-
});
|
|
7782
|
-
this.eventBus._on("sidebarviewchanged", evt => {
|
|
7783
|
-
this.sidebarOpen = !!evt?.view;
|
|
7784
|
-
});
|
|
7785
|
-
this.eventBus._on("resize", evt => {
|
|
7786
|
-
if (evt?.source !== window) {
|
|
7787
|
-
return;
|
|
7788
|
-
}
|
|
7789
|
-
this._outerContainerWidth = null;
|
|
7790
|
-
if (!this._width) {
|
|
7791
|
-
return;
|
|
7792
|
-
}
|
|
7793
|
-
if (!this.sidebarOpen) {
|
|
7794
|
-
this._updateWidth(this._width);
|
|
7795
|
-
return;
|
|
7796
|
-
}
|
|
7797
|
-
this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);
|
|
7798
|
-
const updated = this._updateWidth(this._width);
|
|
7799
|
-
Promise.resolve().then(() => {
|
|
7800
|
-
this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);
|
|
7801
|
-
if (updated) {
|
|
7802
|
-
this.eventBus.dispatch("resize", {
|
|
7803
|
-
source: this
|
|
7804
|
-
});
|
|
7805
|
-
}
|
|
7806
|
-
});
|
|
7807
|
-
});
|
|
7711
|
+
window.removeEventListener("mousemove", this.#mouseMoveBound);
|
|
7712
|
+
window.removeEventListener("mouseup", this.#mouseUpBound);
|
|
7808
7713
|
}
|
|
7809
7714
|
}
|
|
7810
|
-
exports.
|
|
7715
|
+
exports.PDFSidebar = PDFSidebar;
|
|
7811
7716
|
|
|
7812
7717
|
/***/ }),
|
|
7813
|
-
/*
|
|
7718
|
+
/* 26 */
|
|
7814
7719
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7815
7720
|
|
|
7816
7721
|
|
|
@@ -7820,28 +7725,24 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
7820
7725
|
}));
|
|
7821
7726
|
exports.PDFThumbnailViewer = void 0;
|
|
7822
7727
|
var _ui_utils = __webpack_require__(3);
|
|
7823
|
-
var _pdf_thumbnail_view = __webpack_require__(
|
|
7728
|
+
var _pdf_thumbnail_view = __webpack_require__(27);
|
|
7824
7729
|
const THUMBNAIL_SCROLL_MARGIN = -19;
|
|
7825
7730
|
const THUMBNAIL_SELECTED_CLASS = "selected";
|
|
7826
7731
|
class PDFThumbnailViewer {
|
|
7827
7732
|
constructor({
|
|
7828
7733
|
container,
|
|
7734
|
+
eventBus,
|
|
7829
7735
|
linkService,
|
|
7830
7736
|
renderingQueue,
|
|
7831
7737
|
l10n,
|
|
7832
7738
|
pageColors
|
|
7833
7739
|
}) {
|
|
7834
7740
|
this.container = container;
|
|
7741
|
+
this.eventBus = eventBus;
|
|
7835
7742
|
this.linkService = linkService;
|
|
7836
7743
|
this.renderingQueue = renderingQueue;
|
|
7837
7744
|
this.l10n = l10n;
|
|
7838
7745
|
this.pageColors = pageColors || null;
|
|
7839
|
-
if (this.pageColors && !(CSS.supports("color", this.pageColors.background) && CSS.supports("color", this.pageColors.foreground))) {
|
|
7840
|
-
if (this.pageColors.background || this.pageColors.foreground) {
|
|
7841
|
-
console.warn("PDFThumbnailViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used.");
|
|
7842
|
-
}
|
|
7843
|
-
this.pageColors = null;
|
|
7844
|
-
}
|
|
7845
7746
|
this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdated.bind(this));
|
|
7846
7747
|
this._resetView();
|
|
7847
7748
|
}
|
|
@@ -7955,6 +7856,7 @@ class PDFThumbnailViewer {
|
|
|
7955
7856
|
for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
|
|
7956
7857
|
const thumbnail = new _pdf_thumbnail_view.PDFThumbnailView({
|
|
7957
7858
|
container: this.container,
|
|
7859
|
+
eventBus: this.eventBus,
|
|
7958
7860
|
id: pageNum,
|
|
7959
7861
|
defaultViewport: viewport.clone(),
|
|
7960
7862
|
optionalContentConfigPromise,
|
|
@@ -8032,7 +7934,7 @@ class PDFThumbnailViewer {
|
|
|
8032
7934
|
exports.PDFThumbnailViewer = PDFThumbnailViewer;
|
|
8033
7935
|
|
|
8034
7936
|
/***/ }),
|
|
8035
|
-
/*
|
|
7937
|
+
/* 27 */
|
|
8036
7938
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8037
7939
|
|
|
8038
7940
|
|
|
@@ -8045,7 +7947,6 @@ var _ui_utils = __webpack_require__(3);
|
|
|
8045
7947
|
var _pdfjsLib = __webpack_require__(4);
|
|
8046
7948
|
const DRAW_UPSCALE_FACTOR = 2;
|
|
8047
7949
|
const MAX_NUM_SCALING_STEPS = 3;
|
|
8048
|
-
const THUMBNAIL_CANVAS_BORDER_WIDTH = 1;
|
|
8049
7950
|
const THUMBNAIL_WIDTH = 98;
|
|
8050
7951
|
class TempImageFactory {
|
|
8051
7952
|
static #tempCanvas = null;
|
|
@@ -8075,6 +7976,7 @@ exports.TempImageFactory = TempImageFactory;
|
|
|
8075
7976
|
class PDFThumbnailView {
|
|
8076
7977
|
constructor({
|
|
8077
7978
|
container,
|
|
7979
|
+
eventBus,
|
|
8078
7980
|
id,
|
|
8079
7981
|
defaultViewport,
|
|
8080
7982
|
optionalContentConfigPromise,
|
|
@@ -8092,17 +7994,12 @@ class PDFThumbnailView {
|
|
|
8092
7994
|
this.pdfPageRotate = defaultViewport.rotation;
|
|
8093
7995
|
this._optionalContentConfigPromise = optionalContentConfigPromise || null;
|
|
8094
7996
|
this.pageColors = pageColors || null;
|
|
7997
|
+
this.eventBus = eventBus;
|
|
8095
7998
|
this.linkService = linkService;
|
|
8096
7999
|
this.renderingQueue = renderingQueue;
|
|
8097
8000
|
this.renderTask = null;
|
|
8098
8001
|
this.renderingState = _ui_utils.RenderingStates.INITIAL;
|
|
8099
8002
|
this.resume = null;
|
|
8100
|
-
const pageWidth = this.viewport.width,
|
|
8101
|
-
pageHeight = this.viewport.height,
|
|
8102
|
-
pageRatio = pageWidth / pageHeight;
|
|
8103
|
-
this.canvasWidth = THUMBNAIL_WIDTH;
|
|
8104
|
-
this.canvasHeight = this.canvasWidth / pageRatio | 0;
|
|
8105
|
-
this.scale = this.canvasWidth / pageWidth;
|
|
8106
8003
|
this.l10n = l10n;
|
|
8107
8004
|
const anchor = document.createElement("a");
|
|
8108
8005
|
anchor.href = linkService.getAnchorUrl("#page=" + id);
|
|
@@ -8118,16 +8015,29 @@ class PDFThumbnailView {
|
|
|
8118
8015
|
div.className = "thumbnail";
|
|
8119
8016
|
div.setAttribute("data-page-number", this.id);
|
|
8120
8017
|
this.div = div;
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
this.ring = ring;
|
|
8127
|
-
div.append(ring);
|
|
8018
|
+
this.#updateDims();
|
|
8019
|
+
const img = document.createElement("div");
|
|
8020
|
+
img.className = "thumbnailImage";
|
|
8021
|
+
this._placeholderImg = img;
|
|
8022
|
+
div.append(img);
|
|
8128
8023
|
anchor.append(div);
|
|
8129
8024
|
container.append(anchor);
|
|
8130
8025
|
}
|
|
8026
|
+
#updateDims() {
|
|
8027
|
+
const {
|
|
8028
|
+
width,
|
|
8029
|
+
height
|
|
8030
|
+
} = this.viewport;
|
|
8031
|
+
const ratio = width / height;
|
|
8032
|
+
this.canvasWidth = THUMBNAIL_WIDTH;
|
|
8033
|
+
this.canvasHeight = this.canvasWidth / ratio | 0;
|
|
8034
|
+
this.scale = this.canvasWidth / width;
|
|
8035
|
+
const {
|
|
8036
|
+
style
|
|
8037
|
+
} = this.div;
|
|
8038
|
+
style.setProperty("--thumbnail-width", `${this.canvasWidth}px`);
|
|
8039
|
+
style.setProperty("--thumbnail-height", `${this.canvasHeight}px`);
|
|
8040
|
+
}
|
|
8131
8041
|
setPdfPage(pdfPage) {
|
|
8132
8042
|
this.pdfPage = pdfPage;
|
|
8133
8043
|
this.pdfPageRotate = pdfPage.rotate;
|
|
@@ -8141,22 +8051,9 @@ class PDFThumbnailView {
|
|
|
8141
8051
|
reset() {
|
|
8142
8052
|
this.cancelRendering();
|
|
8143
8053
|
this.renderingState = _ui_utils.RenderingStates.INITIAL;
|
|
8144
|
-
const pageWidth = this.viewport.width,
|
|
8145
|
-
pageHeight = this.viewport.height,
|
|
8146
|
-
pageRatio = pageWidth / pageHeight;
|
|
8147
|
-
this.canvasHeight = this.canvasWidth / pageRatio | 0;
|
|
8148
|
-
this.scale = this.canvasWidth / pageWidth;
|
|
8149
8054
|
this.div.removeAttribute("data-loaded");
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
const borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH;
|
|
8153
|
-
ring.style.width = this.canvasWidth + borderAdjustment + "px";
|
|
8154
|
-
ring.style.height = this.canvasHeight + borderAdjustment + "px";
|
|
8155
|
-
if (this.canvas) {
|
|
8156
|
-
this.canvas.width = 0;
|
|
8157
|
-
this.canvas.height = 0;
|
|
8158
|
-
delete this.canvas;
|
|
8159
|
-
}
|
|
8055
|
+
this.image?.replaceWith(this._placeholderImg);
|
|
8056
|
+
this.#updateDims();
|
|
8160
8057
|
if (this.image) {
|
|
8161
8058
|
this.image.removeAttribute("src");
|
|
8162
8059
|
delete this.image;
|
|
@@ -8207,41 +8104,39 @@ class PDFThumbnailView {
|
|
|
8207
8104
|
this._thumbPageCanvas.then(msg => {
|
|
8208
8105
|
image.setAttribute("aria-label", msg);
|
|
8209
8106
|
});
|
|
8210
|
-
image.style.width = this.canvasWidth + "px";
|
|
8211
|
-
image.style.height = this.canvasHeight + "px";
|
|
8212
8107
|
image.src = reducedCanvas.toDataURL();
|
|
8213
8108
|
this.image = image;
|
|
8214
8109
|
this.div.setAttribute("data-loaded", true);
|
|
8215
|
-
this.
|
|
8110
|
+
this._placeholderImg.replaceWith(image);
|
|
8216
8111
|
reducedCanvas.width = 0;
|
|
8217
8112
|
reducedCanvas.height = 0;
|
|
8218
8113
|
}
|
|
8219
|
-
|
|
8114
|
+
async #finishRenderTask(renderTask, canvas, error = null) {
|
|
8115
|
+
if (renderTask === this.renderTask) {
|
|
8116
|
+
this.renderTask = null;
|
|
8117
|
+
}
|
|
8118
|
+
if (error instanceof _pdfjsLib.RenderingCancelledException) {
|
|
8119
|
+
return;
|
|
8120
|
+
}
|
|
8121
|
+
this.renderingState = _ui_utils.RenderingStates.FINISHED;
|
|
8122
|
+
this._convertCanvasToImage(canvas);
|
|
8123
|
+
if (error) {
|
|
8124
|
+
throw error;
|
|
8125
|
+
}
|
|
8126
|
+
}
|
|
8127
|
+
async draw() {
|
|
8220
8128
|
if (this.renderingState !== _ui_utils.RenderingStates.INITIAL) {
|
|
8221
8129
|
console.error("Must be in new state before drawing");
|
|
8222
|
-
return
|
|
8130
|
+
return undefined;
|
|
8223
8131
|
}
|
|
8224
8132
|
const {
|
|
8225
8133
|
pdfPage
|
|
8226
8134
|
} = this;
|
|
8227
8135
|
if (!pdfPage) {
|
|
8228
8136
|
this.renderingState = _ui_utils.RenderingStates.FINISHED;
|
|
8229
|
-
|
|
8137
|
+
throw new Error("pdfPage is not loaded");
|
|
8230
8138
|
}
|
|
8231
8139
|
this.renderingState = _ui_utils.RenderingStates.RUNNING;
|
|
8232
|
-
const finishRenderTask = async (error = null) => {
|
|
8233
|
-
if (renderTask === this.renderTask) {
|
|
8234
|
-
this.renderTask = null;
|
|
8235
|
-
}
|
|
8236
|
-
if (error instanceof _pdfjsLib.RenderingCancelledException) {
|
|
8237
|
-
return;
|
|
8238
|
-
}
|
|
8239
|
-
this.renderingState = _ui_utils.RenderingStates.FINISHED;
|
|
8240
|
-
this._convertCanvasToImage(canvas);
|
|
8241
|
-
if (error) {
|
|
8242
|
-
throw error;
|
|
8243
|
-
}
|
|
8244
|
-
};
|
|
8245
8140
|
const {
|
|
8246
8141
|
ctx,
|
|
8247
8142
|
canvas,
|
|
@@ -8270,18 +8165,15 @@ class PDFThumbnailView {
|
|
|
8270
8165
|
};
|
|
8271
8166
|
const renderTask = this.renderTask = pdfPage.render(renderContext);
|
|
8272
8167
|
renderTask.onContinue = renderContinueCallback;
|
|
8273
|
-
const resultPromise = renderTask.promise.then(
|
|
8274
|
-
return finishRenderTask(null);
|
|
8275
|
-
}, function (error) {
|
|
8276
|
-
return finishRenderTask(error);
|
|
8277
|
-
});
|
|
8168
|
+
const resultPromise = renderTask.promise.then(() => this.#finishRenderTask(renderTask, canvas), error => this.#finishRenderTask(renderTask, canvas, error));
|
|
8278
8169
|
resultPromise.finally(() => {
|
|
8279
8170
|
canvas.width = 0;
|
|
8280
8171
|
canvas.height = 0;
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
this.
|
|
8284
|
-
|
|
8172
|
+
this.eventBus.dispatch("thumbnailrendered", {
|
|
8173
|
+
source: this,
|
|
8174
|
+
pageNumber: this.id,
|
|
8175
|
+
pdfPage: this.pdfPage
|
|
8176
|
+
});
|
|
8285
8177
|
});
|
|
8286
8178
|
return resultPromise;
|
|
8287
8179
|
}
|
|
@@ -8357,7 +8249,7 @@ class PDFThumbnailView {
|
|
|
8357
8249
|
exports.PDFThumbnailView = PDFThumbnailView;
|
|
8358
8250
|
|
|
8359
8251
|
/***/ }),
|
|
8360
|
-
/*
|
|
8252
|
+
/* 28 */
|
|
8361
8253
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8362
8254
|
|
|
8363
8255
|
|
|
@@ -8368,12 +8260,11 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
8368
8260
|
exports.PagesCountLimit = exports.PDFViewer = exports.PDFPageViewBuffer = void 0;
|
|
8369
8261
|
var _pdfjsLib = __webpack_require__(4);
|
|
8370
8262
|
var _ui_utils = __webpack_require__(3);
|
|
8371
|
-
var _l10n_utils = __webpack_require__(
|
|
8372
|
-
var _pdf_page_view = __webpack_require__(
|
|
8263
|
+
var _l10n_utils = __webpack_require__(29);
|
|
8264
|
+
var _pdf_page_view = __webpack_require__(30);
|
|
8373
8265
|
var _pdf_rendering_queue = __webpack_require__(23);
|
|
8374
8266
|
var _pdf_link_service = __webpack_require__(7);
|
|
8375
8267
|
const DEFAULT_CACHE_SIZE = 10;
|
|
8376
|
-
const ENABLE_PERMISSIONS_CLASS = "enablePermissions";
|
|
8377
8268
|
const PagesCountLimit = {
|
|
8378
8269
|
FORCE_SCROLL_MODE_PAGE: 15000,
|
|
8379
8270
|
FORCE_LAZY_PAGE_INIT: 7500,
|
|
@@ -8438,14 +8329,19 @@ class PDFViewer {
|
|
|
8438
8329
|
#annotationEditorUIManager = null;
|
|
8439
8330
|
#annotationMode = _pdfjsLib.AnnotationMode.ENABLE_FORMS;
|
|
8440
8331
|
#containerTopLeft = null;
|
|
8332
|
+
#copyCallbackBound = null;
|
|
8441
8333
|
#enablePermissions = false;
|
|
8334
|
+
#getAllTextInProgress = false;
|
|
8335
|
+
#hiddenCopyElement = null;
|
|
8336
|
+
#interruptCopyCondition = false;
|
|
8442
8337
|
#previousContainerHeight = 0;
|
|
8443
8338
|
#resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this));
|
|
8444
8339
|
#scrollModePageState = null;
|
|
8445
8340
|
#onVisibilityChange = null;
|
|
8446
8341
|
#scaleTimeoutId = null;
|
|
8342
|
+
#textLayerMode = _ui_utils.TextLayerMode.ENABLE;
|
|
8447
8343
|
constructor(options) {
|
|
8448
|
-
const viewerVersion = '3.
|
|
8344
|
+
const viewerVersion = '3.9.179';
|
|
8449
8345
|
if (_pdfjsLib.version !== viewerVersion) {
|
|
8450
8346
|
throw new Error(`The API version "${_pdfjsLib.version}" does not match the Viewer version "${viewerVersion}".`);
|
|
8451
8347
|
}
|
|
@@ -8462,26 +8358,25 @@ class PDFViewer {
|
|
|
8462
8358
|
this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService();
|
|
8463
8359
|
this.downloadManager = options.downloadManager || null;
|
|
8464
8360
|
this.findController = options.findController || null;
|
|
8361
|
+
if (this.findController) {
|
|
8362
|
+
this.findController.onIsPageVisible = pageNumber => this._getVisiblePages().ids.has(pageNumber);
|
|
8363
|
+
}
|
|
8465
8364
|
this._scriptingManager = options.scriptingManager || null;
|
|
8466
|
-
this
|
|
8365
|
+
this.#textLayerMode = options.textLayerMode ?? _ui_utils.TextLayerMode.ENABLE;
|
|
8467
8366
|
this.#annotationMode = options.annotationMode ?? _pdfjsLib.AnnotationMode.ENABLE_FORMS;
|
|
8468
8367
|
this.#annotationEditorMode = options.annotationEditorMode ?? _pdfjsLib.AnnotationEditorType.NONE;
|
|
8469
8368
|
this.imageResourcesPath = options.imageResourcesPath || "";
|
|
8470
8369
|
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
|
|
8471
8370
|
this.removePageBorders = options.removePageBorders || false;
|
|
8472
|
-
|
|
8473
|
-
|
|
8371
|
+
if (options.useOnlyCssZoom) {
|
|
8372
|
+
console.error("useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead.");
|
|
8373
|
+
options.maxCanvasPixels = 0;
|
|
8374
|
+
}
|
|
8474
8375
|
this.isOffscreenCanvasSupported = options.isOffscreenCanvasSupported ?? true;
|
|
8475
8376
|
this.maxCanvasPixels = options.maxCanvasPixels;
|
|
8476
8377
|
this.l10n = options.l10n || _l10n_utils.NullL10n;
|
|
8477
8378
|
this.#enablePermissions = options.enablePermissions || false;
|
|
8478
8379
|
this.pageColors = options.pageColors || null;
|
|
8479
|
-
if (this.pageColors && !(CSS.supports("color", this.pageColors.background) && CSS.supports("color", this.pageColors.foreground))) {
|
|
8480
|
-
if (this.pageColors.background || this.pageColors.foreground) {
|
|
8481
|
-
console.warn("PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used.");
|
|
8482
|
-
}
|
|
8483
|
-
this.pageColors = null;
|
|
8484
|
-
}
|
|
8485
8380
|
this.defaultRenderingQueue = !options.renderingQueue;
|
|
8486
8381
|
if (this.defaultRenderingQueue) {
|
|
8487
8382
|
this.renderingQueue = new _pdf_rendering_queue.PDFRenderingQueue();
|
|
@@ -8497,6 +8392,15 @@ class PDFViewer {
|
|
|
8497
8392
|
this.viewer.classList.add("removePageBorders");
|
|
8498
8393
|
}
|
|
8499
8394
|
this.#updateContainerHeightCss();
|
|
8395
|
+
this.eventBus._on("thumbnailrendered", ({
|
|
8396
|
+
pageNumber,
|
|
8397
|
+
pdfPage
|
|
8398
|
+
}) => {
|
|
8399
|
+
const pageView = this._pages[pageNumber - 1];
|
|
8400
|
+
if (!this.#buffer.has(pageView)) {
|
|
8401
|
+
pdfPage?.cleanup();
|
|
8402
|
+
}
|
|
8403
|
+
});
|
|
8500
8404
|
}
|
|
8501
8405
|
get pagesCount() {
|
|
8502
8406
|
return this._pages.length;
|
|
@@ -8504,13 +8408,11 @@ class PDFViewer {
|
|
|
8504
8408
|
getPageView(index) {
|
|
8505
8409
|
return this._pages[index];
|
|
8506
8410
|
}
|
|
8411
|
+
getCachedPageViews() {
|
|
8412
|
+
return new Set(this.#buffer);
|
|
8413
|
+
}
|
|
8507
8414
|
get pageViewsReady() {
|
|
8508
|
-
|
|
8509
|
-
return false;
|
|
8510
|
-
}
|
|
8511
|
-
return this._pages.every(function (pageView) {
|
|
8512
|
-
return pageView?.pdfPage;
|
|
8513
|
-
});
|
|
8415
|
+
return this._pagesCapability.settled && this._pages.every(pageView => pageView?.pdfPage);
|
|
8514
8416
|
}
|
|
8515
8417
|
get renderForms() {
|
|
8516
8418
|
return this.#annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS;
|
|
@@ -8583,7 +8485,7 @@ class PDFViewer {
|
|
|
8583
8485
|
if (!this.pdfDocument) {
|
|
8584
8486
|
return;
|
|
8585
8487
|
}
|
|
8586
|
-
this
|
|
8488
|
+
this.#setScale(val, {
|
|
8587
8489
|
noScroll: false
|
|
8588
8490
|
});
|
|
8589
8491
|
}
|
|
@@ -8594,7 +8496,7 @@ class PDFViewer {
|
|
|
8594
8496
|
if (!this.pdfDocument) {
|
|
8595
8497
|
return;
|
|
8596
8498
|
}
|
|
8597
|
-
this
|
|
8499
|
+
this.#setScale(val, {
|
|
8598
8500
|
noScroll: false
|
|
8599
8501
|
});
|
|
8600
8502
|
}
|
|
@@ -8621,7 +8523,7 @@ class PDFViewer {
|
|
|
8621
8523
|
rotation
|
|
8622
8524
|
});
|
|
8623
8525
|
if (this._currentScaleValue) {
|
|
8624
|
-
this
|
|
8526
|
+
this.#setScale(this._currentScaleValue, {
|
|
8625
8527
|
noScroll: true
|
|
8626
8528
|
});
|
|
8627
8529
|
}
|
|
@@ -8676,13 +8578,13 @@ class PDFViewer {
|
|
|
8676
8578
|
const params = {
|
|
8677
8579
|
annotationEditorMode: this.#annotationEditorMode,
|
|
8678
8580
|
annotationMode: this.#annotationMode,
|
|
8679
|
-
textLayerMode: this
|
|
8581
|
+
textLayerMode: this.#textLayerMode
|
|
8680
8582
|
};
|
|
8681
8583
|
if (!permissions) {
|
|
8682
8584
|
return params;
|
|
8683
8585
|
}
|
|
8684
|
-
if (!permissions.includes(_pdfjsLib.PermissionFlag.COPY)) {
|
|
8685
|
-
|
|
8586
|
+
if (!permissions.includes(_pdfjsLib.PermissionFlag.COPY) && this.#textLayerMode === _ui_utils.TextLayerMode.ENABLE) {
|
|
8587
|
+
params.textLayerMode = _ui_utils.TextLayerMode.ENABLE_PERMISSIONS;
|
|
8686
8588
|
}
|
|
8687
8589
|
if (!permissions.includes(_pdfjsLib.PermissionFlag.MODIFY_CONTENTS)) {
|
|
8688
8590
|
params.annotationEditorMode = _pdfjsLib.AnnotationEditorType.DISABLE;
|
|
@@ -8709,6 +8611,63 @@ class PDFViewer {
|
|
|
8709
8611
|
});
|
|
8710
8612
|
return Promise.race([this._onePageRenderedCapability.promise, visibilityChangePromise]);
|
|
8711
8613
|
}
|
|
8614
|
+
async getAllText() {
|
|
8615
|
+
const texts = [];
|
|
8616
|
+
const buffer = [];
|
|
8617
|
+
for (let pageNum = 1, pagesCount = this.pdfDocument.numPages; pageNum <= pagesCount; ++pageNum) {
|
|
8618
|
+
if (this.#interruptCopyCondition) {
|
|
8619
|
+
return null;
|
|
8620
|
+
}
|
|
8621
|
+
buffer.length = 0;
|
|
8622
|
+
const page = await this.pdfDocument.getPage(pageNum);
|
|
8623
|
+
const {
|
|
8624
|
+
items
|
|
8625
|
+
} = await page.getTextContent();
|
|
8626
|
+
for (const item of items) {
|
|
8627
|
+
if (item.str) {
|
|
8628
|
+
buffer.push(item.str);
|
|
8629
|
+
}
|
|
8630
|
+
if (item.hasEOL) {
|
|
8631
|
+
buffer.push("\n");
|
|
8632
|
+
}
|
|
8633
|
+
}
|
|
8634
|
+
texts.push((0, _ui_utils.removeNullCharacters)(buffer.join("")));
|
|
8635
|
+
}
|
|
8636
|
+
return texts.join("\n");
|
|
8637
|
+
}
|
|
8638
|
+
#copyCallback(textLayerMode, event) {
|
|
8639
|
+
const selection = document.getSelection();
|
|
8640
|
+
const {
|
|
8641
|
+
focusNode,
|
|
8642
|
+
anchorNode
|
|
8643
|
+
} = selection;
|
|
8644
|
+
if (anchorNode && focusNode && selection.containsNode(this.#hiddenCopyElement)) {
|
|
8645
|
+
if (this.#getAllTextInProgress || textLayerMode === _ui_utils.TextLayerMode.ENABLE_PERMISSIONS) {
|
|
8646
|
+
event.preventDefault();
|
|
8647
|
+
event.stopPropagation();
|
|
8648
|
+
return;
|
|
8649
|
+
}
|
|
8650
|
+
this.#getAllTextInProgress = true;
|
|
8651
|
+
const savedCursor = this.container.style.cursor;
|
|
8652
|
+
this.container.style.cursor = "wait";
|
|
8653
|
+
const interruptCopy = ev => this.#interruptCopyCondition = ev.key === "Escape";
|
|
8654
|
+
window.addEventListener("keydown", interruptCopy);
|
|
8655
|
+
this.getAllText().then(async text => {
|
|
8656
|
+
if (text !== null) {
|
|
8657
|
+
await navigator.clipboard.writeText(text);
|
|
8658
|
+
}
|
|
8659
|
+
}).catch(reason => {
|
|
8660
|
+
console.warn(`Something goes wrong when extracting the text: ${reason.message}`);
|
|
8661
|
+
}).finally(() => {
|
|
8662
|
+
this.#getAllTextInProgress = false;
|
|
8663
|
+
this.#interruptCopyCondition = false;
|
|
8664
|
+
window.removeEventListener("keydown", interruptCopy);
|
|
8665
|
+
this.container.style.cursor = savedCursor;
|
|
8666
|
+
});
|
|
8667
|
+
event.preventDefault();
|
|
8668
|
+
event.stopPropagation();
|
|
8669
|
+
}
|
|
8670
|
+
}
|
|
8712
8671
|
setDocument(pdfDocument) {
|
|
8713
8672
|
if (this.pdfDocument) {
|
|
8714
8673
|
this.eventBus.dispatch("pagesdestroy", {
|
|
@@ -8779,12 +8738,17 @@ class PDFViewer {
|
|
|
8779
8738
|
annotationMode,
|
|
8780
8739
|
textLayerMode
|
|
8781
8740
|
} = this.#initializePermissions(permissions);
|
|
8741
|
+
if (textLayerMode !== _ui_utils.TextLayerMode.DISABLE) {
|
|
8742
|
+
const element = this.#hiddenCopyElement = document.createElement("div");
|
|
8743
|
+
element.id = "hiddenCopyElement";
|
|
8744
|
+
this.viewer.before(element);
|
|
8745
|
+
}
|
|
8782
8746
|
if (annotationEditorMode !== _pdfjsLib.AnnotationEditorType.DISABLE) {
|
|
8783
8747
|
const mode = annotationEditorMode;
|
|
8784
8748
|
if (pdfDocument.isPureXfa) {
|
|
8785
8749
|
console.warn("Warning: XFA-editing is not implemented.");
|
|
8786
8750
|
} else if (isValidAnnotationEditorMode(mode)) {
|
|
8787
|
-
this.#annotationEditorUIManager = new _pdfjsLib.AnnotationEditorUIManager(this.container, this.eventBus, pdfDocument
|
|
8751
|
+
this.#annotationEditorUIManager = new _pdfjsLib.AnnotationEditorUIManager(this.container, this.eventBus, pdfDocument, this.pageColors);
|
|
8788
8752
|
if (mode !== _pdfjsLib.AnnotationEditorType.NONE) {
|
|
8789
8753
|
this.#annotationEditorUIManager.updateMode(mode);
|
|
8790
8754
|
}
|
|
@@ -8799,6 +8763,9 @@ class PDFViewer {
|
|
|
8799
8763
|
scale: scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS
|
|
8800
8764
|
});
|
|
8801
8765
|
this.viewer.style.setProperty("--scale-factor", viewport.scale);
|
|
8766
|
+
if (this.pageColors?.foreground === "CanvasText" || this.pageColors?.background === "Canvas") {
|
|
8767
|
+
this.viewer.style.setProperty("--hcm-highligh-filter", pdfDocument.filterFactory.addHighlightHCMFilter("CanvasText", "Canvas", "HighlightText", "Highlight"));
|
|
8768
|
+
}
|
|
8802
8769
|
for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
|
|
8803
8770
|
const pageView = new _pdf_page_view.PDFPageView({
|
|
8804
8771
|
container: viewerElement,
|
|
@@ -8811,8 +8778,6 @@ class PDFViewer {
|
|
|
8811
8778
|
textLayerMode,
|
|
8812
8779
|
annotationMode,
|
|
8813
8780
|
imageResourcesPath: this.imageResourcesPath,
|
|
8814
|
-
renderer: this.renderer,
|
|
8815
|
-
useOnlyCssZoom: this.useOnlyCssZoom,
|
|
8816
8781
|
isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,
|
|
8817
8782
|
maxCanvasPixels: this.maxCanvasPixels,
|
|
8818
8783
|
pageColors: this.pageColors,
|
|
@@ -8834,6 +8799,10 @@ class PDFViewer {
|
|
|
8834
8799
|
this.#onePageRenderedOrForceFetch().then(async () => {
|
|
8835
8800
|
this.findController?.setDocument(pdfDocument);
|
|
8836
8801
|
this._scriptingManager?.setDocument(pdfDocument);
|
|
8802
|
+
if (this.#hiddenCopyElement) {
|
|
8803
|
+
this.#copyCallbackBound = this.#copyCallback.bind(this, textLayerMode);
|
|
8804
|
+
document.addEventListener("copy", this.#copyCallbackBound);
|
|
8805
|
+
}
|
|
8837
8806
|
if (this.#annotationEditorUIManager) {
|
|
8838
8807
|
this.eventBus.dispatch("annotationeditormodechanged", {
|
|
8839
8808
|
source: this,
|
|
@@ -8917,9 +8886,9 @@ class PDFViewer {
|
|
|
8917
8886
|
this._location = null;
|
|
8918
8887
|
this._pagesRotation = 0;
|
|
8919
8888
|
this._optionalContentConfigPromise = null;
|
|
8920
|
-
this._firstPageCapability =
|
|
8921
|
-
this._onePageRenderedCapability =
|
|
8922
|
-
this._pagesCapability =
|
|
8889
|
+
this._firstPageCapability = new _pdfjsLib.PromiseCapability();
|
|
8890
|
+
this._onePageRenderedCapability = new _pdfjsLib.PromiseCapability();
|
|
8891
|
+
this._pagesCapability = new _pdfjsLib.PromiseCapability();
|
|
8923
8892
|
this._scrollMode = _ui_utils.ScrollMode.VERTICAL;
|
|
8924
8893
|
this._previousScrollMode = _ui_utils.ScrollMode.UNKNOWN;
|
|
8925
8894
|
this._spreadMode = _ui_utils.SpreadMode.NONE;
|
|
@@ -8943,7 +8912,12 @@ class PDFViewer {
|
|
|
8943
8912
|
this.viewer.textContent = "";
|
|
8944
8913
|
this._updateScrollMode();
|
|
8945
8914
|
this.viewer.removeAttribute("lang");
|
|
8946
|
-
this
|
|
8915
|
+
if (this.#hiddenCopyElement) {
|
|
8916
|
+
document.removeEventListener("copy", this.#copyCallbackBound);
|
|
8917
|
+
this.#copyCallbackBound = null;
|
|
8918
|
+
this.#hiddenCopyElement.remove();
|
|
8919
|
+
this.#hiddenCopyElement = null;
|
|
8920
|
+
}
|
|
8947
8921
|
}
|
|
8948
8922
|
#ensurePageViewVisible() {
|
|
8949
8923
|
if (this._scrollMode !== _ui_utils.ScrollMode.PAGE) {
|
|
@@ -9030,7 +9004,7 @@ class PDFViewer {
|
|
|
9030
9004
|
#isSameScale(newScale) {
|
|
9031
9005
|
return newScale === this._currentScale || Math.abs(newScale - this._currentScale) < 1e-15;
|
|
9032
9006
|
}
|
|
9033
|
-
|
|
9007
|
+
#setScaleUpdatePages(newScale, newValue, {
|
|
9034
9008
|
noScroll = false,
|
|
9035
9009
|
preset = false,
|
|
9036
9010
|
drawingDelay = -1
|
|
@@ -9083,17 +9057,17 @@ class PDFViewer {
|
|
|
9083
9057
|
this.update();
|
|
9084
9058
|
}
|
|
9085
9059
|
}
|
|
9086
|
-
get
|
|
9060
|
+
get #pageWidthScaleFactor() {
|
|
9087
9061
|
if (this._spreadMode !== _ui_utils.SpreadMode.NONE && this._scrollMode !== _ui_utils.ScrollMode.HORIZONTAL) {
|
|
9088
9062
|
return 2;
|
|
9089
9063
|
}
|
|
9090
9064
|
return 1;
|
|
9091
9065
|
}
|
|
9092
|
-
|
|
9066
|
+
#setScale(value, options) {
|
|
9093
9067
|
let scale = parseFloat(value);
|
|
9094
9068
|
if (scale > 0) {
|
|
9095
9069
|
options.preset = false;
|
|
9096
|
-
this
|
|
9070
|
+
this.#setScaleUpdatePages(scale, value, options);
|
|
9097
9071
|
} else {
|
|
9098
9072
|
const currentPage = this._pages[this._currentPageNumber - 1];
|
|
9099
9073
|
if (!currentPage) {
|
|
@@ -9111,7 +9085,7 @@ class PDFViewer {
|
|
|
9111
9085
|
} else if (this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL) {
|
|
9112
9086
|
[hPadding, vPadding] = [vPadding, hPadding];
|
|
9113
9087
|
}
|
|
9114
|
-
const pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this
|
|
9088
|
+
const pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this.#pageWidthScaleFactor;
|
|
9115
9089
|
const pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale;
|
|
9116
9090
|
switch (value) {
|
|
9117
9091
|
case "page-actual":
|
|
@@ -9131,17 +9105,17 @@ class PDFViewer {
|
|
|
9131
9105
|
scale = Math.min(_ui_utils.MAX_AUTO_SCALE, horizontalScale);
|
|
9132
9106
|
break;
|
|
9133
9107
|
default:
|
|
9134
|
-
console.error(
|
|
9108
|
+
console.error(`#setScale: "${value}" is an unknown zoom value.`);
|
|
9135
9109
|
return;
|
|
9136
9110
|
}
|
|
9137
9111
|
options.preset = true;
|
|
9138
|
-
this
|
|
9112
|
+
this.#setScaleUpdatePages(scale, value, options);
|
|
9139
9113
|
}
|
|
9140
9114
|
}
|
|
9141
9115
|
#resetCurrentPageView() {
|
|
9142
9116
|
const pageView = this._pages[this._currentPageNumber - 1];
|
|
9143
9117
|
if (this.isInPresentationMode) {
|
|
9144
|
-
this
|
|
9118
|
+
this.#setScale(this._currentScaleValue, {
|
|
9145
9119
|
noScroll: true
|
|
9146
9120
|
});
|
|
9147
9121
|
}
|
|
@@ -9341,27 +9315,6 @@ class PDFViewer {
|
|
|
9341
9315
|
rtl
|
|
9342
9316
|
});
|
|
9343
9317
|
}
|
|
9344
|
-
isPageVisible(pageNumber) {
|
|
9345
|
-
if (!this.pdfDocument) {
|
|
9346
|
-
return false;
|
|
9347
|
-
}
|
|
9348
|
-
if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
|
|
9349
|
-
console.error(`isPageVisible: "${pageNumber}" is not a valid page.`);
|
|
9350
|
-
return false;
|
|
9351
|
-
}
|
|
9352
|
-
return this._getVisiblePages().ids.has(pageNumber);
|
|
9353
|
-
}
|
|
9354
|
-
isPageCached(pageNumber) {
|
|
9355
|
-
if (!this.pdfDocument) {
|
|
9356
|
-
return false;
|
|
9357
|
-
}
|
|
9358
|
-
if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
|
|
9359
|
-
console.error(`isPageCached: "${pageNumber}" is not a valid page.`);
|
|
9360
|
-
return false;
|
|
9361
|
-
}
|
|
9362
|
-
const pageView = this._pages[pageNumber - 1];
|
|
9363
|
-
return this.#buffer.has(pageView);
|
|
9364
|
-
}
|
|
9365
9318
|
cleanup() {
|
|
9366
9319
|
for (const pageView of this._pages) {
|
|
9367
9320
|
if (pageView.renderingState !== _ui_utils.RenderingStates.FINISHED) {
|
|
@@ -9430,21 +9383,25 @@ class PDFViewer {
|
|
|
9430
9383
|
return true;
|
|
9431
9384
|
}
|
|
9432
9385
|
getPagesOverview() {
|
|
9386
|
+
let initialOrientation;
|
|
9433
9387
|
return this._pages.map(pageView => {
|
|
9434
9388
|
const viewport = pageView.pdfPage.getViewport({
|
|
9435
9389
|
scale: 1
|
|
9436
9390
|
});
|
|
9437
|
-
|
|
9391
|
+
const orientation = (0, _ui_utils.isPortraitOrientation)(viewport);
|
|
9392
|
+
if (initialOrientation === undefined) {
|
|
9393
|
+
initialOrientation = orientation;
|
|
9394
|
+
} else if (this.enablePrintAutoRotate && orientation !== initialOrientation) {
|
|
9438
9395
|
return {
|
|
9439
|
-
width: viewport.
|
|
9440
|
-
height: viewport.
|
|
9441
|
-
rotation: viewport.rotation
|
|
9396
|
+
width: viewport.height,
|
|
9397
|
+
height: viewport.width,
|
|
9398
|
+
rotation: (viewport.rotation - 90) % 360
|
|
9442
9399
|
};
|
|
9443
9400
|
}
|
|
9444
9401
|
return {
|
|
9445
|
-
width: viewport.
|
|
9446
|
-
height: viewport.
|
|
9447
|
-
rotation:
|
|
9402
|
+
width: viewport.width,
|
|
9403
|
+
height: viewport.height,
|
|
9404
|
+
rotation: viewport.rotation
|
|
9448
9405
|
};
|
|
9449
9406
|
});
|
|
9450
9407
|
}
|
|
@@ -9512,7 +9469,7 @@ class PDFViewer {
|
|
|
9512
9469
|
this._updateSpreadMode();
|
|
9513
9470
|
}
|
|
9514
9471
|
if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
|
|
9515
|
-
this
|
|
9472
|
+
this.#setScale(this._currentScaleValue, {
|
|
9516
9473
|
noScroll: true
|
|
9517
9474
|
});
|
|
9518
9475
|
}
|
|
@@ -9570,7 +9527,7 @@ class PDFViewer {
|
|
|
9570
9527
|
return;
|
|
9571
9528
|
}
|
|
9572
9529
|
if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
|
|
9573
|
-
this
|
|
9530
|
+
this.#setScale(this._currentScaleValue, {
|
|
9574
9531
|
noScroll: true
|
|
9575
9532
|
});
|
|
9576
9533
|
}
|
|
@@ -9698,55 +9655,49 @@ class PDFViewer {
|
|
|
9698
9655
|
this.currentPageNumber = Math.max(currentPageNumber - advance, 1);
|
|
9699
9656
|
return true;
|
|
9700
9657
|
}
|
|
9701
|
-
increaseScale(
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
};
|
|
9707
|
-
}
|
|
9658
|
+
increaseScale({
|
|
9659
|
+
drawingDelay,
|
|
9660
|
+
scaleFactor,
|
|
9661
|
+
steps
|
|
9662
|
+
} = {}) {
|
|
9708
9663
|
if (!this.pdfDocument) {
|
|
9709
9664
|
return;
|
|
9710
9665
|
}
|
|
9711
|
-
options ||= Object.create(null);
|
|
9712
9666
|
let newScale = this._currentScale;
|
|
9713
|
-
if (
|
|
9714
|
-
newScale = Math.
|
|
9667
|
+
if (scaleFactor > 1) {
|
|
9668
|
+
newScale = Math.round(newScale * scaleFactor * 100) / 100;
|
|
9715
9669
|
} else {
|
|
9716
|
-
|
|
9670
|
+
steps ??= 1;
|
|
9717
9671
|
do {
|
|
9718
|
-
newScale = (newScale * _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2);
|
|
9719
|
-
newScale = Math.ceil(newScale * 10) / 10;
|
|
9720
|
-
newScale = Math.min(_ui_utils.MAX_SCALE, newScale);
|
|
9672
|
+
newScale = Math.ceil((newScale * _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;
|
|
9721
9673
|
} while (--steps > 0 && newScale < _ui_utils.MAX_SCALE);
|
|
9722
9674
|
}
|
|
9723
|
-
|
|
9724
|
-
|
|
9675
|
+
this.#setScale(Math.min(_ui_utils.MAX_SCALE, newScale), {
|
|
9676
|
+
noScroll: false,
|
|
9677
|
+
drawingDelay
|
|
9678
|
+
});
|
|
9725
9679
|
}
|
|
9726
|
-
decreaseScale(
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
};
|
|
9732
|
-
}
|
|
9680
|
+
decreaseScale({
|
|
9681
|
+
drawingDelay,
|
|
9682
|
+
scaleFactor,
|
|
9683
|
+
steps
|
|
9684
|
+
} = {}) {
|
|
9733
9685
|
if (!this.pdfDocument) {
|
|
9734
9686
|
return;
|
|
9735
9687
|
}
|
|
9736
|
-
options ||= Object.create(null);
|
|
9737
9688
|
let newScale = this._currentScale;
|
|
9738
|
-
if (
|
|
9739
|
-
newScale = Math.
|
|
9689
|
+
if (scaleFactor > 0 && scaleFactor < 1) {
|
|
9690
|
+
newScale = Math.round(newScale * scaleFactor * 100) / 100;
|
|
9740
9691
|
} else {
|
|
9741
|
-
|
|
9692
|
+
steps ??= 1;
|
|
9742
9693
|
do {
|
|
9743
|
-
newScale = (newScale / _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2);
|
|
9744
|
-
newScale = Math.floor(newScale * 10) / 10;
|
|
9745
|
-
newScale = Math.max(_ui_utils.MIN_SCALE, newScale);
|
|
9694
|
+
newScale = Math.floor((newScale / _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;
|
|
9746
9695
|
} while (--steps > 0 && newScale > _ui_utils.MIN_SCALE);
|
|
9747
9696
|
}
|
|
9748
|
-
|
|
9749
|
-
|
|
9697
|
+
this.#setScale(Math.max(_ui_utils.MIN_SCALE, newScale), {
|
|
9698
|
+
noScroll: false,
|
|
9699
|
+
drawingDelay
|
|
9700
|
+
});
|
|
9750
9701
|
}
|
|
9751
9702
|
#updateContainerHeightCss(height = this.container.clientHeight) {
|
|
9752
9703
|
if (height !== this.#previousContainerHeight) {
|
|
@@ -9769,7 +9720,10 @@ class PDFViewer {
|
|
|
9769
9720
|
get annotationEditorMode() {
|
|
9770
9721
|
return this.#annotationEditorUIManager ? this.#annotationEditorMode : _pdfjsLib.AnnotationEditorType.DISABLE;
|
|
9771
9722
|
}
|
|
9772
|
-
set annotationEditorMode(
|
|
9723
|
+
set annotationEditorMode({
|
|
9724
|
+
mode,
|
|
9725
|
+
editId = null
|
|
9726
|
+
}) {
|
|
9773
9727
|
if (!this.#annotationEditorUIManager) {
|
|
9774
9728
|
throw new Error(`The AnnotationEditor is not enabled.`);
|
|
9775
9729
|
}
|
|
@@ -9787,7 +9741,7 @@ class PDFViewer {
|
|
|
9787
9741
|
source: this,
|
|
9788
9742
|
mode
|
|
9789
9743
|
});
|
|
9790
|
-
this.#annotationEditorUIManager.updateMode(mode);
|
|
9744
|
+
this.#annotationEditorUIManager.updateMode(mode, editId);
|
|
9791
9745
|
}
|
|
9792
9746
|
set annotationEditorParams({
|
|
9793
9747
|
type,
|
|
@@ -9817,7 +9771,7 @@ class PDFViewer {
|
|
|
9817
9771
|
exports.PDFViewer = PDFViewer;
|
|
9818
9772
|
|
|
9819
9773
|
/***/ }),
|
|
9820
|
-
/*
|
|
9774
|
+
/* 29 */
|
|
9821
9775
|
/***/ ((__unused_webpack_module, exports) => {
|
|
9822
9776
|
|
|
9823
9777
|
|
|
@@ -9826,7 +9780,6 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
9826
9780
|
value: true
|
|
9827
9781
|
}));
|
|
9828
9782
|
exports.NullL10n = void 0;
|
|
9829
|
-
exports.fixupLangCode = fixupLangCode;
|
|
9830
9783
|
exports.getL10nFallback = getL10nFallback;
|
|
9831
9784
|
const DEFAULT_L10N_STRINGS = {
|
|
9832
9785
|
of_pages: "of {{pagesCount}}",
|
|
@@ -9867,6 +9820,7 @@ const DEFAULT_L10N_STRINGS = {
|
|
|
9867
9820
|
missing_file_error: "Missing PDF file.",
|
|
9868
9821
|
unexpected_response_error: "Unexpected server response.",
|
|
9869
9822
|
rendering_error: "An error occurred while rendering the page.",
|
|
9823
|
+
annotation_date_string: "{{date}}, {{time}}",
|
|
9870
9824
|
printing_not_supported: "Warning: Printing is not fully supported by this browser.",
|
|
9871
9825
|
printing_not_ready: "Warning: The PDF is not fully loaded for printing.",
|
|
9872
9826
|
web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts.",
|
|
@@ -9889,30 +9843,11 @@ function getL10nFallback(key, args) {
|
|
|
9889
9843
|
}
|
|
9890
9844
|
return DEFAULT_L10N_STRINGS[key] || "";
|
|
9891
9845
|
}
|
|
9892
|
-
const PARTIAL_LANG_CODES = {
|
|
9893
|
-
en: "en-US",
|
|
9894
|
-
es: "es-ES",
|
|
9895
|
-
fy: "fy-NL",
|
|
9896
|
-
ga: "ga-IE",
|
|
9897
|
-
gu: "gu-IN",
|
|
9898
|
-
hi: "hi-IN",
|
|
9899
|
-
hy: "hy-AM",
|
|
9900
|
-
nb: "nb-NO",
|
|
9901
|
-
ne: "ne-NP",
|
|
9902
|
-
nn: "nn-NO",
|
|
9903
|
-
pa: "pa-IN",
|
|
9904
|
-
pt: "pt-PT",
|
|
9905
|
-
sv: "sv-SE",
|
|
9906
|
-
zh: "zh-CN"
|
|
9907
|
-
};
|
|
9908
|
-
function fixupLangCode(langCode) {
|
|
9909
|
-
return PARTIAL_LANG_CODES[langCode?.toLowerCase()] || langCode;
|
|
9910
|
-
}
|
|
9911
9846
|
function formatL10nValue(text, args) {
|
|
9912
9847
|
if (!args) {
|
|
9913
9848
|
return text;
|
|
9914
9849
|
}
|
|
9915
|
-
return text.
|
|
9850
|
+
return text.replaceAll(/\{\{\s*(\w+)\s*\}\}/g, (all, name) => {
|
|
9916
9851
|
return name in args ? args[name] : "{{" + name + "}}";
|
|
9917
9852
|
});
|
|
9918
9853
|
}
|
|
@@ -9931,7 +9866,7 @@ const NullL10n = {
|
|
|
9931
9866
|
exports.NullL10n = NullL10n;
|
|
9932
9867
|
|
|
9933
9868
|
/***/ }),
|
|
9934
|
-
/*
|
|
9869
|
+
/* 30 */
|
|
9935
9870
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9936
9871
|
|
|
9937
9872
|
|
|
@@ -9942,30 +9877,35 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
9942
9877
|
exports.PDFPageView = void 0;
|
|
9943
9878
|
var _pdfjsLib = __webpack_require__(4);
|
|
9944
9879
|
var _ui_utils = __webpack_require__(3);
|
|
9945
|
-
var _annotation_editor_layer_builder = __webpack_require__(
|
|
9946
|
-
var _annotation_layer_builder = __webpack_require__(
|
|
9880
|
+
var _annotation_editor_layer_builder = __webpack_require__(31);
|
|
9881
|
+
var _annotation_layer_builder = __webpack_require__(32);
|
|
9947
9882
|
var _app_options = __webpack_require__(5);
|
|
9948
|
-
var _l10n_utils = __webpack_require__(
|
|
9883
|
+
var _l10n_utils = __webpack_require__(29);
|
|
9949
9884
|
var _pdf_link_service = __webpack_require__(7);
|
|
9950
|
-
var _struct_tree_layer_builder = __webpack_require__(
|
|
9951
|
-
var _text_accessibility = __webpack_require__(
|
|
9952
|
-
var _text_highlighter = __webpack_require__(
|
|
9953
|
-
var _text_layer_builder = __webpack_require__(
|
|
9954
|
-
var _xfa_layer_builder = __webpack_require__(
|
|
9885
|
+
var _struct_tree_layer_builder = __webpack_require__(33);
|
|
9886
|
+
var _text_accessibility = __webpack_require__(34);
|
|
9887
|
+
var _text_highlighter = __webpack_require__(35);
|
|
9888
|
+
var _text_layer_builder = __webpack_require__(36);
|
|
9889
|
+
var _xfa_layer_builder = __webpack_require__(37);
|
|
9955
9890
|
const MAX_CANVAS_PIXELS = _app_options.compatibilityParams.maxCanvasPixels || 16777216;
|
|
9956
9891
|
const DEFAULT_LAYER_PROPERTIES = () => {
|
|
9957
9892
|
return null;
|
|
9958
9893
|
};
|
|
9959
9894
|
class PDFPageView {
|
|
9960
9895
|
#annotationMode = _pdfjsLib.AnnotationMode.ENABLE_FORMS;
|
|
9896
|
+
#hasRestrictedScaling = false;
|
|
9961
9897
|
#layerProperties = null;
|
|
9962
9898
|
#loadingId = null;
|
|
9963
9899
|
#previousRotation = null;
|
|
9900
|
+
#renderError = null;
|
|
9964
9901
|
#renderingState = _ui_utils.RenderingStates.INITIAL;
|
|
9902
|
+
#textLayerMode = _ui_utils.TextLayerMode.ENABLE;
|
|
9965
9903
|
#useThumbnailCanvas = {
|
|
9904
|
+
directDrawing: true,
|
|
9966
9905
|
initialOptionalContent: true,
|
|
9967
9906
|
regularAnnotations: true
|
|
9968
9907
|
};
|
|
9908
|
+
#viewportMap = new WeakMap();
|
|
9969
9909
|
constructor(options) {
|
|
9970
9910
|
const container = options.container;
|
|
9971
9911
|
const defaultViewport = options.defaultViewport;
|
|
@@ -9979,23 +9919,23 @@ class PDFPageView {
|
|
|
9979
9919
|
this.viewport = defaultViewport;
|
|
9980
9920
|
this.pdfPageRotate = defaultViewport.rotation;
|
|
9981
9921
|
this._optionalContentConfigPromise = options.optionalContentConfigPromise || null;
|
|
9982
|
-
this
|
|
9983
|
-
this.textLayerMode = options.textLayerMode ?? _ui_utils.TextLayerMode.ENABLE;
|
|
9922
|
+
this.#textLayerMode = options.textLayerMode ?? _ui_utils.TextLayerMode.ENABLE;
|
|
9984
9923
|
this.#annotationMode = options.annotationMode ?? _pdfjsLib.AnnotationMode.ENABLE_FORMS;
|
|
9985
9924
|
this.imageResourcesPath = options.imageResourcesPath || "";
|
|
9986
|
-
this.useOnlyCssZoom = options.useOnlyCssZoom || false;
|
|
9987
9925
|
this.isOffscreenCanvasSupported = options.isOffscreenCanvasSupported ?? true;
|
|
9988
|
-
this.maxCanvasPixels = options.maxCanvasPixels
|
|
9926
|
+
this.maxCanvasPixels = options.maxCanvasPixels ?? MAX_CANVAS_PIXELS;
|
|
9989
9927
|
this.pageColors = options.pageColors || null;
|
|
9990
9928
|
this.eventBus = options.eventBus;
|
|
9991
9929
|
this.renderingQueue = options.renderingQueue;
|
|
9992
|
-
this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;
|
|
9993
9930
|
this.l10n = options.l10n || _l10n_utils.NullL10n;
|
|
9994
|
-
this.
|
|
9995
|
-
this.paintedViewportMap = new WeakMap();
|
|
9931
|
+
this.renderTask = null;
|
|
9996
9932
|
this.resume = null;
|
|
9997
|
-
this._renderError = null;
|
|
9998
9933
|
this._isStandalone = !this.renderingQueue?.hasViewer();
|
|
9934
|
+
this._container = container;
|
|
9935
|
+
if (options.useOnlyCssZoom) {
|
|
9936
|
+
console.error("useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead.");
|
|
9937
|
+
this.maxCanvasPixels = 0;
|
|
9938
|
+
}
|
|
9999
9939
|
this._annotationCanvasMap = null;
|
|
10000
9940
|
this.annotationLayer = null;
|
|
10001
9941
|
this.annotationEditorLayer = null;
|
|
@@ -10072,6 +10012,9 @@ class PDFPageView {
|
|
|
10072
10012
|
(0, _pdfjsLib.setLayerDimensions)(this.div, viewport, true, false);
|
|
10073
10013
|
}
|
|
10074
10014
|
setPdfPage(pdfPage) {
|
|
10015
|
+
if (this._isStandalone && (this.pageColors?.foreground === "CanvasText" || this.pageColors?.background === "Canvas")) {
|
|
10016
|
+
this._container?.style.setProperty("--hcm-highligh-filter", pdfPage.filterFactory.addHighlightHCMFilter("CanvasText", "Canvas", "HighlightText", "Highlight"));
|
|
10017
|
+
}
|
|
10075
10018
|
this.pdfPage = pdfPage;
|
|
10076
10019
|
this.pdfPageRotate = pdfPage.rotate;
|
|
10077
10020
|
const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
|
|
@@ -10154,7 +10097,8 @@ class PDFPageView {
|
|
|
10154
10097
|
try {
|
|
10155
10098
|
if (!textLayer.renderingDone) {
|
|
10156
10099
|
const readableStream = pdfPage.streamTextContent({
|
|
10157
|
-
includeMarkedContent: true
|
|
10100
|
+
includeMarkedContent: true,
|
|
10101
|
+
disableNormalization: true
|
|
10158
10102
|
});
|
|
10159
10103
|
textLayer.setTextContentSource(readableStream);
|
|
10160
10104
|
}
|
|
@@ -10200,7 +10144,7 @@ class PDFPageView {
|
|
|
10200
10144
|
return;
|
|
10201
10145
|
}
|
|
10202
10146
|
const zoomLayerCanvas = this.zoomLayer.firstChild;
|
|
10203
|
-
this.
|
|
10147
|
+
this.#viewportMap.delete(zoomLayerCanvas);
|
|
10204
10148
|
zoomLayerCanvas.width = 0;
|
|
10205
10149
|
zoomLayerCanvas.height = 0;
|
|
10206
10150
|
if (removeFromDOM) {
|
|
@@ -10257,17 +10201,13 @@ class PDFPageView {
|
|
|
10257
10201
|
this.structTreeLayer?.hide();
|
|
10258
10202
|
if (!zoomLayerNode) {
|
|
10259
10203
|
if (this.canvas) {
|
|
10260
|
-
this.
|
|
10204
|
+
this.#viewportMap.delete(this.canvas);
|
|
10261
10205
|
this.canvas.width = 0;
|
|
10262
10206
|
this.canvas.height = 0;
|
|
10263
10207
|
delete this.canvas;
|
|
10264
10208
|
}
|
|
10265
10209
|
this._resetZoomLayer();
|
|
10266
10210
|
}
|
|
10267
|
-
if (this.svg) {
|
|
10268
|
-
this.paintedViewportMap.delete(this.svg);
|
|
10269
|
-
delete this.svg;
|
|
10270
|
-
}
|
|
10271
10211
|
}
|
|
10272
10212
|
update({
|
|
10273
10213
|
scale = 0,
|
|
@@ -10288,6 +10228,7 @@ class PDFPageView {
|
|
|
10288
10228
|
this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility;
|
|
10289
10229
|
});
|
|
10290
10230
|
}
|
|
10231
|
+
this.#useThumbnailCanvas.directDrawing = true;
|
|
10291
10232
|
const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
|
|
10292
10233
|
this.viewport = this.viewport.clone({
|
|
10293
10234
|
scale: this.scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS,
|
|
@@ -10295,35 +10236,27 @@ class PDFPageView {
|
|
|
10295
10236
|
});
|
|
10296
10237
|
this.#setDimensions();
|
|
10297
10238
|
if (this._isStandalone) {
|
|
10298
|
-
this.
|
|
10299
|
-
}
|
|
10300
|
-
if (this.svg) {
|
|
10301
|
-
this.cssTransform({
|
|
10302
|
-
target: this.svg,
|
|
10303
|
-
redrawAnnotationLayer: true,
|
|
10304
|
-
redrawAnnotationEditorLayer: true,
|
|
10305
|
-
redrawXfaLayer: true,
|
|
10306
|
-
redrawTextLayer: true
|
|
10307
|
-
});
|
|
10308
|
-
this.eventBus.dispatch("pagerendered", {
|
|
10309
|
-
source: this,
|
|
10310
|
-
pageNumber: this.id,
|
|
10311
|
-
cssTransform: true,
|
|
10312
|
-
timestamp: performance.now(),
|
|
10313
|
-
error: this._renderError
|
|
10314
|
-
});
|
|
10315
|
-
return;
|
|
10316
|
-
}
|
|
10317
|
-
let isScalingRestricted = false;
|
|
10318
|
-
if (this.canvas && this.maxCanvasPixels > 0) {
|
|
10319
|
-
const outputScale = this.outputScale;
|
|
10320
|
-
if ((Math.floor(this.viewport.width) * outputScale.sx | 0) * (Math.floor(this.viewport.height) * outputScale.sy | 0) > this.maxCanvasPixels) {
|
|
10321
|
-
isScalingRestricted = true;
|
|
10322
|
-
}
|
|
10239
|
+
this._container?.style.setProperty("--scale-factor", this.viewport.scale);
|
|
10323
10240
|
}
|
|
10324
|
-
const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000;
|
|
10325
10241
|
if (this.canvas) {
|
|
10326
|
-
|
|
10242
|
+
let onlyCssZoom = false;
|
|
10243
|
+
if (this.#hasRestrictedScaling) {
|
|
10244
|
+
if (this.maxCanvasPixels === 0) {
|
|
10245
|
+
onlyCssZoom = true;
|
|
10246
|
+
} else if (this.maxCanvasPixels > 0) {
|
|
10247
|
+
const {
|
|
10248
|
+
width,
|
|
10249
|
+
height
|
|
10250
|
+
} = this.viewport;
|
|
10251
|
+
const {
|
|
10252
|
+
sx,
|
|
10253
|
+
sy
|
|
10254
|
+
} = this.outputScale;
|
|
10255
|
+
onlyCssZoom = (Math.floor(width) * sx | 0) * (Math.floor(height) * sy | 0) > this.maxCanvasPixels;
|
|
10256
|
+
}
|
|
10257
|
+
}
|
|
10258
|
+
const postponeDrawing = !onlyCssZoom && drawingDelay >= 0 && drawingDelay < 1000;
|
|
10259
|
+
if (postponeDrawing || onlyCssZoom) {
|
|
10327
10260
|
if (postponeDrawing && this.renderingState !== _ui_utils.RenderingStates.FINISHED) {
|
|
10328
10261
|
this.cancelRendering({
|
|
10329
10262
|
keepZoomLayer: true,
|
|
@@ -10334,6 +10267,7 @@ class PDFPageView {
|
|
|
10334
10267
|
cancelExtraDelay: drawingDelay
|
|
10335
10268
|
});
|
|
10336
10269
|
this.renderingState = _ui_utils.RenderingStates.FINISHED;
|
|
10270
|
+
this.#useThumbnailCanvas.directDrawing = false;
|
|
10337
10271
|
}
|
|
10338
10272
|
this.cssTransform({
|
|
10339
10273
|
target: this.canvas,
|
|
@@ -10343,12 +10277,15 @@ class PDFPageView {
|
|
|
10343
10277
|
redrawTextLayer: !postponeDrawing,
|
|
10344
10278
|
hideTextLayer: postponeDrawing
|
|
10345
10279
|
});
|
|
10280
|
+
if (postponeDrawing) {
|
|
10281
|
+
return;
|
|
10282
|
+
}
|
|
10346
10283
|
this.eventBus.dispatch("pagerendered", {
|
|
10347
10284
|
source: this,
|
|
10348
10285
|
pageNumber: this.id,
|
|
10349
10286
|
cssTransform: true,
|
|
10350
10287
|
timestamp: performance.now(),
|
|
10351
|
-
error: this
|
|
10288
|
+
error: this.#renderError
|
|
10352
10289
|
});
|
|
10353
10290
|
return;
|
|
10354
10291
|
}
|
|
@@ -10377,9 +10314,9 @@ class PDFPageView {
|
|
|
10377
10314
|
keepTextLayer = false,
|
|
10378
10315
|
cancelExtraDelay = 0
|
|
10379
10316
|
} = {}) {
|
|
10380
|
-
if (this.
|
|
10381
|
-
this.
|
|
10382
|
-
this.
|
|
10317
|
+
if (this.renderTask) {
|
|
10318
|
+
this.renderTask.cancel(cancelExtraDelay);
|
|
10319
|
+
this.renderTask = null;
|
|
10383
10320
|
}
|
|
10384
10321
|
this.resume = null;
|
|
10385
10322
|
if (this.textLayer && (!keepTextLayer || !this.textLayer.div)) {
|
|
@@ -10412,24 +10349,14 @@ class PDFPageView {
|
|
|
10412
10349
|
redrawTextLayer = false,
|
|
10413
10350
|
hideTextLayer = false
|
|
10414
10351
|
}) {
|
|
10415
|
-
if (target
|
|
10416
|
-
|
|
10417
|
-
target.setAttribute("zooming", true);
|
|
10418
|
-
const {
|
|
10419
|
-
style
|
|
10420
|
-
} = target;
|
|
10421
|
-
style.width = style.height = "";
|
|
10422
|
-
}
|
|
10423
|
-
} else {
|
|
10424
|
-
const div = this.div;
|
|
10352
|
+
if (!target.hasAttribute("zooming")) {
|
|
10353
|
+
target.setAttribute("zooming", true);
|
|
10425
10354
|
const {
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
target.style.width = target.parentNode.style.width = div.style.width = Math.floor(width) + "px";
|
|
10430
|
-
target.style.height = target.parentNode.style.height = div.style.height = Math.floor(height) + "px";
|
|
10355
|
+
style
|
|
10356
|
+
} = target;
|
|
10357
|
+
style.width = style.height = "";
|
|
10431
10358
|
}
|
|
10432
|
-
const originalViewport = this.
|
|
10359
|
+
const originalViewport = this.#viewportMap.get(target);
|
|
10433
10360
|
if (this.viewport !== originalViewport) {
|
|
10434
10361
|
const relativeRotation = this.viewport.rotation - originalViewport.rotation;
|
|
10435
10362
|
const absRotation = Math.abs(relativeRotation);
|
|
@@ -10443,9 +10370,7 @@ class PDFPageView {
|
|
|
10443
10370
|
scaleX = height / width;
|
|
10444
10371
|
scaleY = width / height;
|
|
10445
10372
|
}
|
|
10446
|
-
|
|
10447
|
-
target.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX}, ${scaleY})`;
|
|
10448
|
-
}
|
|
10373
|
+
target.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX}, ${scaleY})`;
|
|
10449
10374
|
}
|
|
10450
10375
|
if (redrawAnnotationLayer && this.annotationLayer) {
|
|
10451
10376
|
this.#renderAnnotationLayer();
|
|
@@ -10474,29 +10399,56 @@ class PDFPageView {
|
|
|
10474
10399
|
getPagePoint(x, y) {
|
|
10475
10400
|
return this.viewport.convertToPdfPoint(x, y);
|
|
10476
10401
|
}
|
|
10477
|
-
|
|
10402
|
+
async #finishRenderTask(renderTask, error = null) {
|
|
10403
|
+
if (renderTask === this.renderTask) {
|
|
10404
|
+
this.renderTask = null;
|
|
10405
|
+
}
|
|
10406
|
+
if (error instanceof _pdfjsLib.RenderingCancelledException) {
|
|
10407
|
+
this.#renderError = null;
|
|
10408
|
+
return;
|
|
10409
|
+
}
|
|
10410
|
+
this.#renderError = error;
|
|
10411
|
+
this.renderingState = _ui_utils.RenderingStates.FINISHED;
|
|
10412
|
+
this._resetZoomLayer(true);
|
|
10413
|
+
this.#useThumbnailCanvas.regularAnnotations = !renderTask.separateAnnots;
|
|
10414
|
+
this.eventBus.dispatch("pagerendered", {
|
|
10415
|
+
source: this,
|
|
10416
|
+
pageNumber: this.id,
|
|
10417
|
+
cssTransform: false,
|
|
10418
|
+
timestamp: performance.now(),
|
|
10419
|
+
error: this.#renderError
|
|
10420
|
+
});
|
|
10421
|
+
if (error) {
|
|
10422
|
+
throw error;
|
|
10423
|
+
}
|
|
10424
|
+
}
|
|
10425
|
+
async draw() {
|
|
10478
10426
|
if (this.renderingState !== _ui_utils.RenderingStates.INITIAL) {
|
|
10479
10427
|
console.error("Must be in new state before drawing");
|
|
10480
10428
|
this.reset();
|
|
10481
10429
|
}
|
|
10482
10430
|
const {
|
|
10483
10431
|
div,
|
|
10484
|
-
|
|
10432
|
+
l10n,
|
|
10433
|
+
pageColors,
|
|
10434
|
+
pdfPage,
|
|
10435
|
+
viewport
|
|
10485
10436
|
} = this;
|
|
10486
10437
|
if (!pdfPage) {
|
|
10487
10438
|
this.renderingState = _ui_utils.RenderingStates.FINISHED;
|
|
10488
|
-
|
|
10439
|
+
throw new Error("pdfPage is not loaded");
|
|
10489
10440
|
}
|
|
10490
10441
|
this.renderingState = _ui_utils.RenderingStates.RUNNING;
|
|
10491
10442
|
const canvasWrapper = document.createElement("div");
|
|
10492
10443
|
canvasWrapper.classList.add("canvasWrapper");
|
|
10493
10444
|
div.append(canvasWrapper);
|
|
10494
|
-
if (!this.textLayer && this
|
|
10445
|
+
if (!this.textLayer && this.#textLayerMode !== _ui_utils.TextLayerMode.DISABLE && !pdfPage.isPureXfa) {
|
|
10495
10446
|
this._accessibilityManager ||= new _text_accessibility.TextAccessibilityManager();
|
|
10496
10447
|
this.textLayer = new _text_layer_builder.TextLayerBuilder({
|
|
10497
10448
|
highlighter: this._textHighlighter,
|
|
10498
10449
|
accessibilityManager: this._accessibilityManager,
|
|
10499
|
-
isOffscreenCanvasSupported: this.isOffscreenCanvasSupported
|
|
10450
|
+
isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,
|
|
10451
|
+
enablePermissions: this.#textLayerMode === _ui_utils.TextLayerMode.ENABLE_PERMISSIONS
|
|
10500
10452
|
});
|
|
10501
10453
|
div.append(this.textLayer.div);
|
|
10502
10454
|
}
|
|
@@ -10518,7 +10470,7 @@ class PDFPageView {
|
|
|
10518
10470
|
renderForms: this.#annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS,
|
|
10519
10471
|
linkService,
|
|
10520
10472
|
downloadManager,
|
|
10521
|
-
l10n
|
|
10473
|
+
l10n,
|
|
10522
10474
|
enableScripting,
|
|
10523
10475
|
hasJSActionsPromise,
|
|
10524
10476
|
fieldObjectsPromise,
|
|
@@ -10526,111 +10478,18 @@ class PDFPageView {
|
|
|
10526
10478
|
accessibilityManager: this._accessibilityManager
|
|
10527
10479
|
});
|
|
10528
10480
|
}
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
this.
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
};
|
|
10538
|
-
return;
|
|
10539
|
-
}
|
|
10540
|
-
cont();
|
|
10541
|
-
};
|
|
10542
|
-
}
|
|
10543
|
-
const finishPaintTask = async (error = null) => {
|
|
10544
|
-
if (paintTask === this.paintTask) {
|
|
10545
|
-
this.paintTask = null;
|
|
10546
|
-
}
|
|
10547
|
-
if (error instanceof _pdfjsLib.RenderingCancelledException) {
|
|
10548
|
-
this._renderError = null;
|
|
10481
|
+
const renderContinueCallback = cont => {
|
|
10482
|
+
showCanvas?.(false);
|
|
10483
|
+
if (this.renderingQueue && !this.renderingQueue.isHighestPriority(this)) {
|
|
10484
|
+
this.renderingState = _ui_utils.RenderingStates.PAUSED;
|
|
10485
|
+
this.resume = () => {
|
|
10486
|
+
this.renderingState = _ui_utils.RenderingStates.RUNNING;
|
|
10487
|
+
cont();
|
|
10488
|
+
};
|
|
10549
10489
|
return;
|
|
10550
10490
|
}
|
|
10551
|
-
|
|
10552
|
-
this.renderingState = _ui_utils.RenderingStates.FINISHED;
|
|
10553
|
-
this._resetZoomLayer(true);
|
|
10554
|
-
this.#useThumbnailCanvas.regularAnnotations = !paintTask.separateAnnots;
|
|
10555
|
-
this.eventBus.dispatch("pagerendered", {
|
|
10556
|
-
source: this,
|
|
10557
|
-
pageNumber: this.id,
|
|
10558
|
-
cssTransform: false,
|
|
10559
|
-
timestamp: performance.now(),
|
|
10560
|
-
error: this._renderError
|
|
10561
|
-
});
|
|
10562
|
-
if (error) {
|
|
10563
|
-
throw error;
|
|
10564
|
-
}
|
|
10565
|
-
};
|
|
10566
|
-
const paintTask = this.renderer === _ui_utils.RendererType.SVG ? this.paintOnSvg(canvasWrapper) : this.paintOnCanvas(canvasWrapper);
|
|
10567
|
-
paintTask.onRenderContinue = renderContinueCallback;
|
|
10568
|
-
this.paintTask = paintTask;
|
|
10569
|
-
const resultPromise = paintTask.promise.then(() => {
|
|
10570
|
-
return finishPaintTask(null).then(async () => {
|
|
10571
|
-
this.#renderTextLayer();
|
|
10572
|
-
if (this.annotationLayer) {
|
|
10573
|
-
await this.#renderAnnotationLayer();
|
|
10574
|
-
}
|
|
10575
|
-
if (!this.annotationEditorLayer) {
|
|
10576
|
-
const {
|
|
10577
|
-
annotationEditorUIManager
|
|
10578
|
-
} = this.#layerProperties();
|
|
10579
|
-
if (!annotationEditorUIManager) {
|
|
10580
|
-
return;
|
|
10581
|
-
}
|
|
10582
|
-
this.annotationEditorLayer = new _annotation_editor_layer_builder.AnnotationEditorLayerBuilder({
|
|
10583
|
-
uiManager: annotationEditorUIManager,
|
|
10584
|
-
pageDiv: div,
|
|
10585
|
-
pdfPage,
|
|
10586
|
-
l10n: this.l10n,
|
|
10587
|
-
accessibilityManager: this._accessibilityManager
|
|
10588
|
-
});
|
|
10589
|
-
}
|
|
10590
|
-
this.#renderAnnotationEditorLayer();
|
|
10591
|
-
});
|
|
10592
|
-
}, function (reason) {
|
|
10593
|
-
return finishPaintTask(reason);
|
|
10594
|
-
});
|
|
10595
|
-
if (pdfPage.isPureXfa) {
|
|
10596
|
-
if (!this.xfaLayer) {
|
|
10597
|
-
const {
|
|
10598
|
-
annotationStorage,
|
|
10599
|
-
linkService
|
|
10600
|
-
} = this.#layerProperties();
|
|
10601
|
-
this.xfaLayer = new _xfa_layer_builder.XfaLayerBuilder({
|
|
10602
|
-
pageDiv: div,
|
|
10603
|
-
pdfPage,
|
|
10604
|
-
annotationStorage,
|
|
10605
|
-
linkService
|
|
10606
|
-
});
|
|
10607
|
-
} else if (this.xfaLayer.div) {
|
|
10608
|
-
div.append(this.xfaLayer.div);
|
|
10609
|
-
}
|
|
10610
|
-
this.#renderXfaLayer();
|
|
10611
|
-
}
|
|
10612
|
-
div.setAttribute("data-loaded", true);
|
|
10613
|
-
this.eventBus.dispatch("pagerender", {
|
|
10614
|
-
source: this,
|
|
10615
|
-
pageNumber: this.id
|
|
10616
|
-
});
|
|
10617
|
-
return resultPromise;
|
|
10618
|
-
}
|
|
10619
|
-
paintOnCanvas(canvasWrapper) {
|
|
10620
|
-
const renderCapability = (0, _pdfjsLib.createPromiseCapability)();
|
|
10621
|
-
const result = {
|
|
10622
|
-
promise: renderCapability.promise,
|
|
10623
|
-
onRenderContinue(cont) {
|
|
10624
|
-
cont();
|
|
10625
|
-
},
|
|
10626
|
-
cancel(extraDelay = 0) {
|
|
10627
|
-
renderTask.cancel(extraDelay);
|
|
10628
|
-
},
|
|
10629
|
-
get separateAnnots() {
|
|
10630
|
-
return renderTask.separateAnnots;
|
|
10631
|
-
}
|
|
10491
|
+
cont();
|
|
10632
10492
|
};
|
|
10633
|
-
const viewport = this.viewport;
|
|
10634
10493
|
const {
|
|
10635
10494
|
width,
|
|
10636
10495
|
height
|
|
@@ -10638,11 +10497,11 @@ class PDFPageView {
|
|
|
10638
10497
|
const canvas = document.createElement("canvas");
|
|
10639
10498
|
canvas.setAttribute("role", "presentation");
|
|
10640
10499
|
canvas.hidden = true;
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
if (
|
|
10500
|
+
const hasHCM = !!(pageColors?.background && pageColors?.foreground);
|
|
10501
|
+
let showCanvas = isLastShow => {
|
|
10502
|
+
if (!hasHCM || isLastShow) {
|
|
10644
10503
|
canvas.hidden = false;
|
|
10645
|
-
|
|
10504
|
+
showCanvas = null;
|
|
10646
10505
|
}
|
|
10647
10506
|
};
|
|
10648
10507
|
canvasWrapper.append(canvas);
|
|
@@ -10651,34 +10510,32 @@ class PDFPageView {
|
|
|
10651
10510
|
alpha: false
|
|
10652
10511
|
});
|
|
10653
10512
|
const outputScale = this.outputScale = new _ui_utils.OutputScale();
|
|
10654
|
-
if (this.
|
|
10655
|
-
const
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
}
|
|
10661
|
-
if (this.maxCanvasPixels > 0) {
|
|
10513
|
+
if (this.maxCanvasPixels === 0) {
|
|
10514
|
+
const invScale = 1 / this.scale;
|
|
10515
|
+
outputScale.sx *= invScale;
|
|
10516
|
+
outputScale.sy *= invScale;
|
|
10517
|
+
this.#hasRestrictedScaling = true;
|
|
10518
|
+
} else if (this.maxCanvasPixels > 0) {
|
|
10662
10519
|
const pixelsInViewport = width * height;
|
|
10663
10520
|
const maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport);
|
|
10664
10521
|
if (outputScale.sx > maxScale || outputScale.sy > maxScale) {
|
|
10665
10522
|
outputScale.sx = maxScale;
|
|
10666
10523
|
outputScale.sy = maxScale;
|
|
10667
|
-
this
|
|
10524
|
+
this.#hasRestrictedScaling = true;
|
|
10668
10525
|
} else {
|
|
10669
|
-
this
|
|
10526
|
+
this.#hasRestrictedScaling = false;
|
|
10670
10527
|
}
|
|
10671
10528
|
}
|
|
10672
10529
|
const sfx = (0, _ui_utils.approximateFraction)(outputScale.sx);
|
|
10673
10530
|
const sfy = (0, _ui_utils.approximateFraction)(outputScale.sy);
|
|
10674
|
-
canvas.width = (0, _ui_utils.roundToDivide)(
|
|
10675
|
-
canvas.height = (0, _ui_utils.roundToDivide)(
|
|
10531
|
+
canvas.width = (0, _ui_utils.roundToDivide)(width * outputScale.sx, sfx[0]);
|
|
10532
|
+
canvas.height = (0, _ui_utils.roundToDivide)(height * outputScale.sy, sfy[0]);
|
|
10676
10533
|
const {
|
|
10677
10534
|
style
|
|
10678
10535
|
} = canvas;
|
|
10679
|
-
style.width = (0, _ui_utils.roundToDivide)(
|
|
10680
|
-
style.height = (0, _ui_utils.roundToDivide)(
|
|
10681
|
-
this.
|
|
10536
|
+
style.width = (0, _ui_utils.roundToDivide)(width, sfx[1]) + "px";
|
|
10537
|
+
style.height = (0, _ui_utils.roundToDivide)(height, sfy[1]) + "px";
|
|
10538
|
+
this.#viewportMap.set(canvas, viewport);
|
|
10682
10539
|
const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null;
|
|
10683
10540
|
const renderContext = {
|
|
10684
10541
|
canvasContext: ctx,
|
|
@@ -10687,66 +10544,63 @@ class PDFPageView {
|
|
|
10687
10544
|
annotationMode: this.#annotationMode,
|
|
10688
10545
|
optionalContentConfigPromise: this._optionalContentConfigPromise,
|
|
10689
10546
|
annotationCanvasMap: this._annotationCanvasMap,
|
|
10690
|
-
pageColors
|
|
10547
|
+
pageColors
|
|
10691
10548
|
};
|
|
10692
|
-
const renderTask = this.pdfPage.render(renderContext);
|
|
10693
|
-
renderTask.onContinue =
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10549
|
+
const renderTask = this.renderTask = this.pdfPage.render(renderContext);
|
|
10550
|
+
renderTask.onContinue = renderContinueCallback;
|
|
10551
|
+
const resultPromise = renderTask.promise.then(async () => {
|
|
10552
|
+
showCanvas?.(true);
|
|
10553
|
+
await this.#finishRenderTask(renderTask);
|
|
10554
|
+
this.#renderTextLayer();
|
|
10555
|
+
if (this.annotationLayer) {
|
|
10556
|
+
await this.#renderAnnotationLayer();
|
|
10557
|
+
}
|
|
10558
|
+
if (!this.annotationEditorLayer) {
|
|
10559
|
+
const {
|
|
10560
|
+
annotationEditorUIManager
|
|
10561
|
+
} = this.#layerProperties();
|
|
10562
|
+
if (!annotationEditorUIManager) {
|
|
10563
|
+
return;
|
|
10564
|
+
}
|
|
10565
|
+
this.annotationEditorLayer = new _annotation_editor_layer_builder.AnnotationEditorLayerBuilder({
|
|
10566
|
+
uiManager: annotationEditorUIManager,
|
|
10567
|
+
pageDiv: div,
|
|
10568
|
+
pdfPage,
|
|
10569
|
+
l10n,
|
|
10570
|
+
accessibilityManager: this._accessibilityManager,
|
|
10571
|
+
annotationLayer: this.annotationLayer?.annotationLayer
|
|
10572
|
+
});
|
|
10699
10573
|
}
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
showCanvas();
|
|
10703
|
-
renderCapability.resolve();
|
|
10704
|
-
}, function (error) {
|
|
10574
|
+
this.#renderAnnotationEditorLayer();
|
|
10575
|
+
}, error => {
|
|
10705
10576
|
if (!(error instanceof _pdfjsLib.RenderingCancelledException)) {
|
|
10706
|
-
showCanvas();
|
|
10577
|
+
showCanvas?.(true);
|
|
10707
10578
|
}
|
|
10708
|
-
|
|
10579
|
+
return this.#finishRenderTask(renderTask, error);
|
|
10709
10580
|
});
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10581
|
+
if (pdfPage.isPureXfa) {
|
|
10582
|
+
if (!this.xfaLayer) {
|
|
10583
|
+
const {
|
|
10584
|
+
annotationStorage,
|
|
10585
|
+
linkService
|
|
10586
|
+
} = this.#layerProperties();
|
|
10587
|
+
this.xfaLayer = new _xfa_layer_builder.XfaLayerBuilder({
|
|
10588
|
+
pageDiv: div,
|
|
10589
|
+
pdfPage,
|
|
10590
|
+
annotationStorage,
|
|
10591
|
+
linkService
|
|
10592
|
+
});
|
|
10593
|
+
} else if (this.xfaLayer.div) {
|
|
10594
|
+
div.append(this.xfaLayer.div);
|
|
10717
10595
|
}
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
annotationMode: this.#annotationMode
|
|
10725
|
-
}).then(opList => {
|
|
10726
|
-
ensureNotCancelled();
|
|
10727
|
-
const svgGfx = new _pdfjsLib.SVGGraphics(pdfPage.commonObjs, pdfPage.objs);
|
|
10728
|
-
return svgGfx.getSVG(opList, actualSizeViewport).then(svg => {
|
|
10729
|
-
ensureNotCancelled();
|
|
10730
|
-
this.svg = svg;
|
|
10731
|
-
this.paintedViewportMap.set(svg, actualSizeViewport);
|
|
10732
|
-
svg.style.width = wrapper.style.width;
|
|
10733
|
-
svg.style.height = wrapper.style.height;
|
|
10734
|
-
this.renderingState = _ui_utils.RenderingStates.FINISHED;
|
|
10735
|
-
wrapper.append(svg);
|
|
10736
|
-
});
|
|
10596
|
+
this.#renderXfaLayer();
|
|
10597
|
+
}
|
|
10598
|
+
div.setAttribute("data-loaded", true);
|
|
10599
|
+
this.eventBus.dispatch("pagerender", {
|
|
10600
|
+
source: this,
|
|
10601
|
+
pageNumber: this.id
|
|
10737
10602
|
});
|
|
10738
|
-
return
|
|
10739
|
-
promise,
|
|
10740
|
-
onRenderContinue(cont) {
|
|
10741
|
-
cont();
|
|
10742
|
-
},
|
|
10743
|
-
cancel() {
|
|
10744
|
-
cancelled = true;
|
|
10745
|
-
},
|
|
10746
|
-
get separateAnnots() {
|
|
10747
|
-
return false;
|
|
10748
|
-
}
|
|
10749
|
-
};
|
|
10603
|
+
return resultPromise;
|
|
10750
10604
|
}
|
|
10751
10605
|
setPageLabel(label) {
|
|
10752
10606
|
this.pageLabel = typeof label === "string" ? label : null;
|
|
@@ -10758,16 +10612,17 @@ class PDFPageView {
|
|
|
10758
10612
|
}
|
|
10759
10613
|
get thumbnailCanvas() {
|
|
10760
10614
|
const {
|
|
10615
|
+
directDrawing,
|
|
10761
10616
|
initialOptionalContent,
|
|
10762
10617
|
regularAnnotations
|
|
10763
10618
|
} = this.#useThumbnailCanvas;
|
|
10764
|
-
return initialOptionalContent && regularAnnotations ? this.canvas : null;
|
|
10619
|
+
return directDrawing && initialOptionalContent && regularAnnotations ? this.canvas : null;
|
|
10765
10620
|
}
|
|
10766
10621
|
}
|
|
10767
10622
|
exports.PDFPageView = PDFPageView;
|
|
10768
10623
|
|
|
10769
10624
|
/***/ }),
|
|
10770
|
-
/*
|
|
10625
|
+
/* 31 */
|
|
10771
10626
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10772
10627
|
|
|
10773
10628
|
|
|
@@ -10777,8 +10632,9 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
10777
10632
|
}));
|
|
10778
10633
|
exports.AnnotationEditorLayerBuilder = void 0;
|
|
10779
10634
|
var _pdfjsLib = __webpack_require__(4);
|
|
10780
|
-
var _l10n_utils = __webpack_require__(
|
|
10635
|
+
var _l10n_utils = __webpack_require__(29);
|
|
10781
10636
|
class AnnotationEditorLayerBuilder {
|
|
10637
|
+
#annotationLayer = null;
|
|
10782
10638
|
#uiManager;
|
|
10783
10639
|
constructor(options) {
|
|
10784
10640
|
this.pageDiv = options.pageDiv;
|
|
@@ -10789,6 +10645,7 @@ class AnnotationEditorLayerBuilder {
|
|
|
10789
10645
|
this.div = null;
|
|
10790
10646
|
this._cancelled = false;
|
|
10791
10647
|
this.#uiManager = options.uiManager;
|
|
10648
|
+
this.#annotationLayer = options.annotationLayer || null;
|
|
10792
10649
|
}
|
|
10793
10650
|
async render(viewport, intent = "display") {
|
|
10794
10651
|
if (intent !== "display") {
|
|
@@ -10818,7 +10675,8 @@ class AnnotationEditorLayerBuilder {
|
|
|
10818
10675
|
accessibilityManager: this.accessibilityManager,
|
|
10819
10676
|
pageIndex: this.pdfPage.pageNumber - 1,
|
|
10820
10677
|
l10n: this.l10n,
|
|
10821
|
-
viewport: clonedViewport
|
|
10678
|
+
viewport: clonedViewport,
|
|
10679
|
+
annotationLayer: this.#annotationLayer
|
|
10822
10680
|
});
|
|
10823
10681
|
const parameters = {
|
|
10824
10682
|
viewport: clonedViewport,
|
|
@@ -10854,7 +10712,7 @@ class AnnotationEditorLayerBuilder {
|
|
|
10854
10712
|
exports.AnnotationEditorLayerBuilder = AnnotationEditorLayerBuilder;
|
|
10855
10713
|
|
|
10856
10714
|
/***/ }),
|
|
10857
|
-
/*
|
|
10715
|
+
/* 32 */
|
|
10858
10716
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10859
10717
|
|
|
10860
10718
|
|
|
@@ -10864,10 +10722,9 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
10864
10722
|
}));
|
|
10865
10723
|
exports.AnnotationLayerBuilder = void 0;
|
|
10866
10724
|
var _pdfjsLib = __webpack_require__(4);
|
|
10867
|
-
var _l10n_utils = __webpack_require__(
|
|
10725
|
+
var _l10n_utils = __webpack_require__(29);
|
|
10868
10726
|
var _ui_utils = __webpack_require__(3);
|
|
10869
10727
|
class AnnotationLayerBuilder {
|
|
10870
|
-
#numAnnotations = 0;
|
|
10871
10728
|
#onPresentationModeChanged = null;
|
|
10872
10729
|
constructor({
|
|
10873
10730
|
pageDiv,
|
|
@@ -10897,21 +10754,20 @@ class AnnotationLayerBuilder {
|
|
|
10897
10754
|
this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null);
|
|
10898
10755
|
this._annotationCanvasMap = annotationCanvasMap;
|
|
10899
10756
|
this._accessibilityManager = accessibilityManager;
|
|
10757
|
+
this.annotationLayer = null;
|
|
10900
10758
|
this.div = null;
|
|
10901
10759
|
this._cancelled = false;
|
|
10902
10760
|
this._eventBus = linkService.eventBus;
|
|
10903
10761
|
}
|
|
10904
10762
|
async render(viewport, intent = "display") {
|
|
10905
10763
|
if (this.div) {
|
|
10906
|
-
if (this._cancelled || this
|
|
10764
|
+
if (this._cancelled || !this.annotationLayer) {
|
|
10907
10765
|
return;
|
|
10908
10766
|
}
|
|
10909
|
-
|
|
10767
|
+
this.annotationLayer.update({
|
|
10910
10768
|
viewport: viewport.clone({
|
|
10911
10769
|
dontFlip: true
|
|
10912
|
-
})
|
|
10913
|
-
div: this.div,
|
|
10914
|
-
annotationCanvasMap: this._annotationCanvasMap
|
|
10770
|
+
})
|
|
10915
10771
|
});
|
|
10916
10772
|
return;
|
|
10917
10773
|
}
|
|
@@ -10921,21 +10777,25 @@ class AnnotationLayerBuilder {
|
|
|
10921
10777
|
if (this._cancelled) {
|
|
10922
10778
|
return;
|
|
10923
10779
|
}
|
|
10924
|
-
this
|
|
10925
|
-
|
|
10926
|
-
this.div
|
|
10927
|
-
|
|
10928
|
-
if (this.#numAnnotations === 0) {
|
|
10780
|
+
const div = this.div = document.createElement("div");
|
|
10781
|
+
div.className = "annotationLayer";
|
|
10782
|
+
this.pageDiv.append(div);
|
|
10783
|
+
if (annotations.length === 0) {
|
|
10929
10784
|
this.hide();
|
|
10930
10785
|
return;
|
|
10931
10786
|
}
|
|
10932
|
-
_pdfjsLib.AnnotationLayer
|
|
10787
|
+
this.annotationLayer = new _pdfjsLib.AnnotationLayer({
|
|
10788
|
+
div,
|
|
10789
|
+
accessibilityManager: this._accessibilityManager,
|
|
10790
|
+
annotationCanvasMap: this._annotationCanvasMap,
|
|
10791
|
+
l10n: this.l10n,
|
|
10792
|
+
page: this.pdfPage,
|
|
10933
10793
|
viewport: viewport.clone({
|
|
10934
10794
|
dontFlip: true
|
|
10935
|
-
})
|
|
10936
|
-
|
|
10795
|
+
})
|
|
10796
|
+
});
|
|
10797
|
+
await this.annotationLayer.render({
|
|
10937
10798
|
annotations,
|
|
10938
|
-
page: this.pdfPage,
|
|
10939
10799
|
imageResourcesPath: this.imageResourcesPath,
|
|
10940
10800
|
renderForms: this.renderForms,
|
|
10941
10801
|
linkService: this.linkService,
|
|
@@ -10943,11 +10803,8 @@ class AnnotationLayerBuilder {
|
|
|
10943
10803
|
annotationStorage: this.annotationStorage,
|
|
10944
10804
|
enableScripting: this.enableScripting,
|
|
10945
10805
|
hasJSActions,
|
|
10946
|
-
fieldObjects
|
|
10947
|
-
annotationCanvasMap: this._annotationCanvasMap,
|
|
10948
|
-
accessibilityManager: this._accessibilityManager
|
|
10806
|
+
fieldObjects
|
|
10949
10807
|
});
|
|
10950
|
-
this.l10n.translate(this.div);
|
|
10951
10808
|
if (this.linkService.isInPresentationMode) {
|
|
10952
10809
|
this.#updatePresentationModeState(_ui_utils.PresentationModeState.FULLSCREEN);
|
|
10953
10810
|
}
|
|
@@ -10996,7 +10853,7 @@ class AnnotationLayerBuilder {
|
|
|
10996
10853
|
exports.AnnotationLayerBuilder = AnnotationLayerBuilder;
|
|
10997
10854
|
|
|
10998
10855
|
/***/ }),
|
|
10999
|
-
/*
|
|
10856
|
+
/* 33 */
|
|
11000
10857
|
/***/ ((__unused_webpack_module, exports) => {
|
|
11001
10858
|
|
|
11002
10859
|
|
|
@@ -11115,7 +10972,7 @@ class StructTreeLayerBuilder {
|
|
|
11115
10972
|
exports.StructTreeLayerBuilder = StructTreeLayerBuilder;
|
|
11116
10973
|
|
|
11117
10974
|
/***/ }),
|
|
11118
|
-
/*
|
|
10975
|
+
/* 34 */
|
|
11119
10976
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11120
10977
|
|
|
11121
10978
|
|
|
@@ -11273,7 +11130,7 @@ class TextAccessibilityManager {
|
|
|
11273
11130
|
exports.TextAccessibilityManager = TextAccessibilityManager;
|
|
11274
11131
|
|
|
11275
11132
|
/***/ }),
|
|
11276
|
-
/*
|
|
11133
|
+
/* 35 */
|
|
11277
11134
|
/***/ ((__unused_webpack_module, exports) => {
|
|
11278
11135
|
|
|
11279
11136
|
|
|
@@ -11423,9 +11280,16 @@ class TextHighlighter {
|
|
|
11423
11280
|
} else if (!isSelectedPage) {
|
|
11424
11281
|
return;
|
|
11425
11282
|
}
|
|
11283
|
+
let lastDivIdx = -1;
|
|
11284
|
+
let lastOffset = -1;
|
|
11426
11285
|
for (let i = i0; i < i1; i++) {
|
|
11427
11286
|
const match = matches[i];
|
|
11428
11287
|
const begin = match.begin;
|
|
11288
|
+
if (begin.divIdx === lastDivIdx && begin.offset === lastOffset) {
|
|
11289
|
+
continue;
|
|
11290
|
+
}
|
|
11291
|
+
lastDivIdx = begin.divIdx;
|
|
11292
|
+
lastOffset = begin.offset;
|
|
11429
11293
|
const end = match.end;
|
|
11430
11294
|
const isSelected = isSelectedPage && i === selectedMatchIdx;
|
|
11431
11295
|
const highlightSuffix = isSelected ? " selected" : "";
|
|
@@ -11496,7 +11360,7 @@ class TextHighlighter {
|
|
|
11496
11360
|
exports.TextHighlighter = TextHighlighter;
|
|
11497
11361
|
|
|
11498
11362
|
/***/ }),
|
|
11499
|
-
/*
|
|
11363
|
+
/* 36 */
|
|
11500
11364
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11501
11365
|
|
|
11502
11366
|
|
|
@@ -11506,14 +11370,17 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
11506
11370
|
}));
|
|
11507
11371
|
exports.TextLayerBuilder = void 0;
|
|
11508
11372
|
var _pdfjsLib = __webpack_require__(4);
|
|
11373
|
+
var _ui_utils = __webpack_require__(3);
|
|
11509
11374
|
class TextLayerBuilder {
|
|
11375
|
+
#enablePermissions = false;
|
|
11510
11376
|
#rotation = 0;
|
|
11511
11377
|
#scale = 0;
|
|
11512
11378
|
#textContentSource = null;
|
|
11513
11379
|
constructor({
|
|
11514
11380
|
highlighter = null,
|
|
11515
11381
|
accessibilityManager = null,
|
|
11516
|
-
isOffscreenCanvasSupported = true
|
|
11382
|
+
isOffscreenCanvasSupported = true,
|
|
11383
|
+
enablePermissions = false
|
|
11517
11384
|
}) {
|
|
11518
11385
|
this.textContentItemsStr = [];
|
|
11519
11386
|
this.renderingDone = false;
|
|
@@ -11523,6 +11390,7 @@ class TextLayerBuilder {
|
|
|
11523
11390
|
this.highlighter = highlighter;
|
|
11524
11391
|
this.accessibilityManager = accessibilityManager;
|
|
11525
11392
|
this.isOffscreenCanvasSupported = isOffscreenCanvasSupported;
|
|
11393
|
+
this.#enablePermissions = enablePermissions === true;
|
|
11526
11394
|
this.div = document.createElement("div");
|
|
11527
11395
|
this.div.className = "textLayer";
|
|
11528
11396
|
this.hide();
|
|
@@ -11637,12 +11505,20 @@ class TextLayerBuilder {
|
|
|
11637
11505
|
end.style.top = "";
|
|
11638
11506
|
end.classList.remove("active");
|
|
11639
11507
|
});
|
|
11508
|
+
div.addEventListener("copy", event => {
|
|
11509
|
+
if (!this.#enablePermissions) {
|
|
11510
|
+
const selection = document.getSelection();
|
|
11511
|
+
event.clipboardData.setData("text/plain", (0, _ui_utils.removeNullCharacters)((0, _pdfjsLib.normalizeUnicode)(selection.toString())));
|
|
11512
|
+
}
|
|
11513
|
+
event.preventDefault();
|
|
11514
|
+
event.stopPropagation();
|
|
11515
|
+
});
|
|
11640
11516
|
}
|
|
11641
11517
|
}
|
|
11642
11518
|
exports.TextLayerBuilder = TextLayerBuilder;
|
|
11643
11519
|
|
|
11644
11520
|
/***/ }),
|
|
11645
|
-
/*
|
|
11521
|
+
/* 37 */
|
|
11646
11522
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11647
11523
|
|
|
11648
11524
|
|
|
@@ -11722,7 +11598,7 @@ class XfaLayerBuilder {
|
|
|
11722
11598
|
exports.XfaLayerBuilder = XfaLayerBuilder;
|
|
11723
11599
|
|
|
11724
11600
|
/***/ }),
|
|
11725
|
-
/*
|
|
11601
|
+
/* 38 */
|
|
11726
11602
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11727
11603
|
|
|
11728
11604
|
|
|
@@ -11732,7 +11608,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
11732
11608
|
}));
|
|
11733
11609
|
exports.SecondaryToolbar = void 0;
|
|
11734
11610
|
var _ui_utils = __webpack_require__(3);
|
|
11735
|
-
var _pdf_viewer = __webpack_require__(
|
|
11611
|
+
var _pdf_viewer = __webpack_require__(28);
|
|
11736
11612
|
class SecondaryToolbar {
|
|
11737
11613
|
constructor(options, eventBus, externalServices) {
|
|
11738
11614
|
this.toolbar = options.toolbar;
|
|
@@ -11892,13 +11768,10 @@ class SecondaryToolbar {
|
|
|
11892
11768
|
} of this.buttons) {
|
|
11893
11769
|
element.addEventListener("click", evt => {
|
|
11894
11770
|
if (eventName !== null) {
|
|
11895
|
-
|
|
11896
|
-
source: this
|
|
11897
|
-
|
|
11898
|
-
|
|
11899
|
-
details[property] = eventDetails[property];
|
|
11900
|
-
}
|
|
11901
|
-
this.eventBus.dispatch(eventName, details);
|
|
11771
|
+
this.eventBus.dispatch(eventName, {
|
|
11772
|
+
source: this,
|
|
11773
|
+
...eventDetails
|
|
11774
|
+
});
|
|
11902
11775
|
}
|
|
11903
11776
|
if (close) {
|
|
11904
11777
|
this.close();
|
|
@@ -11916,15 +11789,11 @@ class SecondaryToolbar {
|
|
|
11916
11789
|
cursorSelectToolButton,
|
|
11917
11790
|
cursorHandToolButton
|
|
11918
11791
|
}) {
|
|
11919
|
-
this.eventBus._on("cursortoolchanged",
|
|
11792
|
+
this.eventBus._on("cursortoolchanged", ({
|
|
11920
11793
|
tool
|
|
11921
|
-
}) {
|
|
11922
|
-
|
|
11923
|
-
|
|
11924
|
-
cursorSelectToolButton.classList.toggle("toggled", isSelect);
|
|
11925
|
-
cursorHandToolButton.classList.toggle("toggled", isHand);
|
|
11926
|
-
cursorSelectToolButton.setAttribute("aria-checked", isSelect);
|
|
11927
|
-
cursorHandToolButton.setAttribute("aria-checked", isHand);
|
|
11794
|
+
}) => {
|
|
11795
|
+
(0, _ui_utils.toggleCheckedBtn)(cursorSelectToolButton, tool === _ui_utils.CursorTool.SELECT);
|
|
11796
|
+
(0, _ui_utils.toggleCheckedBtn)(cursorHandToolButton, tool === _ui_utils.CursorTool.HAND);
|
|
11928
11797
|
});
|
|
11929
11798
|
}
|
|
11930
11799
|
#bindScrollModeListener({
|
|
@@ -11939,23 +11808,16 @@ class SecondaryToolbar {
|
|
|
11939
11808
|
const scrollModeChanged = ({
|
|
11940
11809
|
mode
|
|
11941
11810
|
}) => {
|
|
11942
|
-
|
|
11943
|
-
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
scrollPageButton.classList.toggle("toggled", isPage);
|
|
11947
|
-
scrollVerticalButton.classList.toggle("toggled", isVertical);
|
|
11948
|
-
scrollHorizontalButton.classList.toggle("toggled", isHorizontal);
|
|
11949
|
-
scrollWrappedButton.classList.toggle("toggled", isWrapped);
|
|
11950
|
-
scrollPageButton.setAttribute("aria-checked", isPage);
|
|
11951
|
-
scrollVerticalButton.setAttribute("aria-checked", isVertical);
|
|
11952
|
-
scrollHorizontalButton.setAttribute("aria-checked", isHorizontal);
|
|
11953
|
-
scrollWrappedButton.setAttribute("aria-checked", isWrapped);
|
|
11811
|
+
(0, _ui_utils.toggleCheckedBtn)(scrollPageButton, mode === _ui_utils.ScrollMode.PAGE);
|
|
11812
|
+
(0, _ui_utils.toggleCheckedBtn)(scrollVerticalButton, mode === _ui_utils.ScrollMode.VERTICAL);
|
|
11813
|
+
(0, _ui_utils.toggleCheckedBtn)(scrollHorizontalButton, mode === _ui_utils.ScrollMode.HORIZONTAL);
|
|
11814
|
+
(0, _ui_utils.toggleCheckedBtn)(scrollWrappedButton, mode === _ui_utils.ScrollMode.WRAPPED);
|
|
11954
11815
|
const forceScrollModePage = this.pagesCount > _pdf_viewer.PagesCountLimit.FORCE_SCROLL_MODE_PAGE;
|
|
11955
11816
|
scrollPageButton.disabled = forceScrollModePage;
|
|
11956
11817
|
scrollVerticalButton.disabled = forceScrollModePage;
|
|
11957
11818
|
scrollHorizontalButton.disabled = forceScrollModePage;
|
|
11958
11819
|
scrollWrappedButton.disabled = forceScrollModePage;
|
|
11820
|
+
const isHorizontal = mode === _ui_utils.ScrollMode.HORIZONTAL;
|
|
11959
11821
|
spreadNoneButton.disabled = isHorizontal;
|
|
11960
11822
|
spreadOddButton.disabled = isHorizontal;
|
|
11961
11823
|
spreadEvenButton.disabled = isHorizontal;
|
|
@@ -11974,19 +11836,13 @@ class SecondaryToolbar {
|
|
|
11974
11836
|
spreadOddButton,
|
|
11975
11837
|
spreadEvenButton
|
|
11976
11838
|
}) {
|
|
11977
|
-
|
|
11839
|
+
const spreadModeChanged = ({
|
|
11978
11840
|
mode
|
|
11979
|
-
}) {
|
|
11980
|
-
|
|
11981
|
-
|
|
11982
|
-
|
|
11983
|
-
|
|
11984
|
-
spreadOddButton.classList.toggle("toggled", isOdd);
|
|
11985
|
-
spreadEvenButton.classList.toggle("toggled", isEven);
|
|
11986
|
-
spreadNoneButton.setAttribute("aria-checked", isNone);
|
|
11987
|
-
spreadOddButton.setAttribute("aria-checked", isOdd);
|
|
11988
|
-
spreadEvenButton.setAttribute("aria-checked", isEven);
|
|
11989
|
-
}
|
|
11841
|
+
}) => {
|
|
11842
|
+
(0, _ui_utils.toggleCheckedBtn)(spreadNoneButton, mode === _ui_utils.SpreadMode.NONE);
|
|
11843
|
+
(0, _ui_utils.toggleCheckedBtn)(spreadOddButton, mode === _ui_utils.SpreadMode.ODD);
|
|
11844
|
+
(0, _ui_utils.toggleCheckedBtn)(spreadEvenButton, mode === _ui_utils.SpreadMode.EVEN);
|
|
11845
|
+
};
|
|
11990
11846
|
this.eventBus._on("spreadmodechanged", spreadModeChanged);
|
|
11991
11847
|
this.eventBus._on("secondarytoolbarreset", evt => {
|
|
11992
11848
|
if (evt.source === this) {
|
|
@@ -12001,18 +11857,14 @@ class SecondaryToolbar {
|
|
|
12001
11857
|
return;
|
|
12002
11858
|
}
|
|
12003
11859
|
this.opened = true;
|
|
12004
|
-
this.toggleButton.
|
|
12005
|
-
this.toggleButton.setAttribute("aria-expanded", "true");
|
|
12006
|
-
this.toolbar.classList.remove("hidden");
|
|
11860
|
+
(0, _ui_utils.toggleExpandedBtn)(this.toggleButton, true, this.toolbar);
|
|
12007
11861
|
}
|
|
12008
11862
|
close() {
|
|
12009
11863
|
if (!this.opened) {
|
|
12010
11864
|
return;
|
|
12011
11865
|
}
|
|
12012
11866
|
this.opened = false;
|
|
12013
|
-
this.toolbar
|
|
12014
|
-
this.toggleButton.classList.remove("toggled");
|
|
12015
|
-
this.toggleButton.setAttribute("aria-expanded", "false");
|
|
11867
|
+
(0, _ui_utils.toggleExpandedBtn)(this.toggleButton, false, this.toolbar);
|
|
12016
11868
|
}
|
|
12017
11869
|
toggle() {
|
|
12018
11870
|
if (this.opened) {
|
|
@@ -12025,7 +11877,7 @@ class SecondaryToolbar {
|
|
|
12025
11877
|
exports.SecondaryToolbar = SecondaryToolbar;
|
|
12026
11878
|
|
|
12027
11879
|
/***/ }),
|
|
12028
|
-
/*
|
|
11880
|
+
/* 39 */
|
|
12029
11881
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12030
11882
|
|
|
12031
11883
|
|
|
@@ -12083,6 +11935,17 @@ class Toolbar {
|
|
|
12083
11935
|
return classList.contains("toggled") ? _pdfjsLib.AnnotationEditorType.NONE : _pdfjsLib.AnnotationEditorType.INK;
|
|
12084
11936
|
}
|
|
12085
11937
|
}
|
|
11938
|
+
}, {
|
|
11939
|
+
element: options.editorStampButton,
|
|
11940
|
+
eventName: "switchannotationeditormode",
|
|
11941
|
+
eventDetails: {
|
|
11942
|
+
get mode() {
|
|
11943
|
+
const {
|
|
11944
|
+
classList
|
|
11945
|
+
} = options.editorStampButton;
|
|
11946
|
+
return classList.contains("toggled") ? _pdfjsLib.AnnotationEditorType.NONE : _pdfjsLib.AnnotationEditorType.STAMP;
|
|
11947
|
+
}
|
|
11948
|
+
}
|
|
12086
11949
|
}];
|
|
12087
11950
|
this.buttons.push({
|
|
12088
11951
|
element: options.openFile,
|
|
@@ -12142,15 +12005,10 @@ class Toolbar {
|
|
|
12142
12005
|
} of this.buttons) {
|
|
12143
12006
|
element.addEventListener("click", evt => {
|
|
12144
12007
|
if (eventName !== null) {
|
|
12145
|
-
|
|
12146
|
-
source: this
|
|
12147
|
-
|
|
12148
|
-
|
|
12149
|
-
for (const property in eventDetails) {
|
|
12150
|
-
details[property] = eventDetails[property];
|
|
12151
|
-
}
|
|
12152
|
-
}
|
|
12153
|
-
this.eventBus.dispatch(eventName, details);
|
|
12008
|
+
this.eventBus.dispatch(eventName, {
|
|
12009
|
+
source: this,
|
|
12010
|
+
...eventDetails
|
|
12011
|
+
});
|
|
12154
12012
|
}
|
|
12155
12013
|
});
|
|
12156
12014
|
}
|
|
@@ -12190,36 +12048,26 @@ class Toolbar {
|
|
|
12190
12048
|
editorFreeTextButton,
|
|
12191
12049
|
editorFreeTextParamsToolbar,
|
|
12192
12050
|
editorInkButton,
|
|
12193
|
-
editorInkParamsToolbar
|
|
12051
|
+
editorInkParamsToolbar,
|
|
12052
|
+
editorStampButton
|
|
12194
12053
|
}) {
|
|
12195
|
-
const editorModeChanged = (
|
|
12196
|
-
|
|
12197
|
-
|
|
12198
|
-
|
|
12199
|
-
|
|
12200
|
-
|
|
12201
|
-
|
|
12202
|
-
|
|
12203
|
-
|
|
12204
|
-
|
|
12205
|
-
for (const {
|
|
12206
|
-
mode,
|
|
12207
|
-
button,
|
|
12208
|
-
toolbar
|
|
12209
|
-
} of editorButtons) {
|
|
12210
|
-
const checked = mode === evt.mode;
|
|
12211
|
-
button.classList.toggle("toggled", checked);
|
|
12212
|
-
button.setAttribute("aria-checked", checked);
|
|
12213
|
-
button.disabled = disableButtons;
|
|
12214
|
-
toolbar?.classList.toggle("hidden", !checked);
|
|
12215
|
-
}
|
|
12054
|
+
const editorModeChanged = ({
|
|
12055
|
+
mode
|
|
12056
|
+
}) => {
|
|
12057
|
+
(0, _ui_utils.toggleCheckedBtn)(editorFreeTextButton, mode === _pdfjsLib.AnnotationEditorType.FREETEXT, editorFreeTextParamsToolbar);
|
|
12058
|
+
(0, _ui_utils.toggleCheckedBtn)(editorInkButton, mode === _pdfjsLib.AnnotationEditorType.INK, editorInkParamsToolbar);
|
|
12059
|
+
(0, _ui_utils.toggleCheckedBtn)(editorStampButton, mode === _pdfjsLib.AnnotationEditorType.STAMP);
|
|
12060
|
+
const isDisable = mode === _pdfjsLib.AnnotationEditorType.DISABLE;
|
|
12061
|
+
editorFreeTextButton.disabled = isDisable;
|
|
12062
|
+
editorInkButton.disabled = isDisable;
|
|
12063
|
+
editorStampButton.disabled = isDisable;
|
|
12216
12064
|
};
|
|
12217
12065
|
this.eventBus._on("annotationeditormodechanged", editorModeChanged);
|
|
12218
12066
|
this.eventBus._on("toolbarreset", evt => {
|
|
12219
12067
|
if (evt.source === this) {
|
|
12220
12068
|
editorModeChanged({
|
|
12221
|
-
mode: _pdfjsLib.AnnotationEditorType.
|
|
12222
|
-
}
|
|
12069
|
+
mode: _pdfjsLib.AnnotationEditorType.DISABLE
|
|
12070
|
+
});
|
|
12223
12071
|
}
|
|
12224
12072
|
});
|
|
12225
12073
|
}
|
|
@@ -12321,7 +12169,7 @@ class Toolbar {
|
|
|
12321
12169
|
exports.Toolbar = Toolbar;
|
|
12322
12170
|
|
|
12323
12171
|
/***/ }),
|
|
12324
|
-
/*
|
|
12172
|
+
/* 40 */
|
|
12325
12173
|
/***/ ((__unused_webpack_module, exports) => {
|
|
12326
12174
|
|
|
12327
12175
|
|
|
@@ -12398,7 +12246,7 @@ class ViewHistory {
|
|
|
12398
12246
|
exports.ViewHistory = ViewHistory;
|
|
12399
12247
|
|
|
12400
12248
|
/***/ }),
|
|
12401
|
-
/*
|
|
12249
|
+
/* 41 */
|
|
12402
12250
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12403
12251
|
|
|
12404
12252
|
|
|
@@ -12419,6 +12267,7 @@ class BasePreferences {
|
|
|
12419
12267
|
"enablePermissions": false,
|
|
12420
12268
|
"enablePrintAutoRotate": true,
|
|
12421
12269
|
"enableScripting": true,
|
|
12270
|
+
"enableStampEditor": true,
|
|
12422
12271
|
"externalLinkTarget": 0,
|
|
12423
12272
|
"historyUpdateUrl": false,
|
|
12424
12273
|
"ignoreDestinationZoom": false,
|
|
@@ -12430,15 +12279,13 @@ class BasePreferences {
|
|
|
12430
12279
|
"scrollModeOnLoad": -1,
|
|
12431
12280
|
"spreadModeOnLoad": -1,
|
|
12432
12281
|
"textLayerMode": 1,
|
|
12433
|
-
"useOnlyCssZoom": false,
|
|
12434
12282
|
"viewerCssTheme": 0,
|
|
12435
12283
|
"viewOnLoad": 0,
|
|
12436
12284
|
"disableAutoFetch": false,
|
|
12437
12285
|
"disableFontFace": false,
|
|
12438
12286
|
"disableRange": false,
|
|
12439
12287
|
"disableStream": false,
|
|
12440
|
-
"enableXfa": true
|
|
12441
|
-
"renderer": "canvas"
|
|
12288
|
+
"enableXfa": true
|
|
12442
12289
|
});
|
|
12443
12290
|
#prefs = Object.create(null);
|
|
12444
12291
|
#initializedPromise = null;
|
|
@@ -12487,10 +12334,8 @@ class BasePreferences {
|
|
|
12487
12334
|
} else {
|
|
12488
12335
|
throw new Error(`Set preference: "${value}" is a ${valueType}, expected a ${defaultType}.`);
|
|
12489
12336
|
}
|
|
12490
|
-
} else {
|
|
12491
|
-
|
|
12492
|
-
throw new Error(`Set preference: "${value}" must be an integer.`);
|
|
12493
|
-
}
|
|
12337
|
+
} else if (valueType === "number" && !Number.isInteger(value)) {
|
|
12338
|
+
throw new Error(`Set preference: "${value}" must be an integer.`);
|
|
12494
12339
|
}
|
|
12495
12340
|
this.#prefs[name] = value;
|
|
12496
12341
|
return this._writeToStorage(this.#prefs).catch(reason => {
|
|
@@ -12518,7 +12363,7 @@ class BasePreferences {
|
|
|
12518
12363
|
exports.BasePreferences = BasePreferences;
|
|
12519
12364
|
|
|
12520
12365
|
/***/ }),
|
|
12521
|
-
/*
|
|
12366
|
+
/* 42 */
|
|
12522
12367
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12523
12368
|
|
|
12524
12369
|
|
|
@@ -12545,7 +12390,7 @@ function download(blobUrl, filename) {
|
|
|
12545
12390
|
}
|
|
12546
12391
|
class DownloadManager {
|
|
12547
12392
|
#openBlobUrls = new WeakMap();
|
|
12548
|
-
downloadUrl(url, filename) {
|
|
12393
|
+
downloadUrl(url, filename, _options) {
|
|
12549
12394
|
if (!(0, _pdfjsLib.createValidAbsoluteUrl)(url, "http://example.com")) {
|
|
12550
12395
|
console.error(`downloadUrl - not a valid URL: ${url}`);
|
|
12551
12396
|
return;
|
|
@@ -12583,7 +12428,7 @@ class DownloadManager {
|
|
|
12583
12428
|
this.downloadData(data, filename, contentType);
|
|
12584
12429
|
return false;
|
|
12585
12430
|
}
|
|
12586
|
-
download(blob, url, filename) {
|
|
12431
|
+
download(blob, url, filename, _options) {
|
|
12587
12432
|
const blobUrl = URL.createObjectURL(blob);
|
|
12588
12433
|
download(blobUrl, filename);
|
|
12589
12434
|
}
|
|
@@ -12591,7 +12436,7 @@ class DownloadManager {
|
|
|
12591
12436
|
exports.DownloadManager = DownloadManager;
|
|
12592
12437
|
|
|
12593
12438
|
/***/ }),
|
|
12594
|
-
/*
|
|
12439
|
+
/* 43 */
|
|
12595
12440
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12596
12441
|
|
|
12597
12442
|
|
|
@@ -12600,14 +12445,35 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
12600
12445
|
value: true
|
|
12601
12446
|
}));
|
|
12602
12447
|
exports.GenericL10n = void 0;
|
|
12603
|
-
__webpack_require__(
|
|
12604
|
-
var _l10n_utils = __webpack_require__(
|
|
12605
|
-
const
|
|
12448
|
+
__webpack_require__(44);
|
|
12449
|
+
var _l10n_utils = __webpack_require__(29);
|
|
12450
|
+
const PARTIAL_LANG_CODES = {
|
|
12451
|
+
en: "en-US",
|
|
12452
|
+
es: "es-ES",
|
|
12453
|
+
fy: "fy-NL",
|
|
12454
|
+
ga: "ga-IE",
|
|
12455
|
+
gu: "gu-IN",
|
|
12456
|
+
hi: "hi-IN",
|
|
12457
|
+
hy: "hy-AM",
|
|
12458
|
+
nb: "nb-NO",
|
|
12459
|
+
ne: "ne-NP",
|
|
12460
|
+
nn: "nn-NO",
|
|
12461
|
+
pa: "pa-IN",
|
|
12462
|
+
pt: "pt-PT",
|
|
12463
|
+
sv: "sv-SE",
|
|
12464
|
+
zh: "zh-CN"
|
|
12465
|
+
};
|
|
12466
|
+
function fixupLangCode(langCode) {
|
|
12467
|
+
return PARTIAL_LANG_CODES[langCode?.toLowerCase()] || langCode;
|
|
12468
|
+
}
|
|
12606
12469
|
class GenericL10n {
|
|
12607
12470
|
constructor(lang) {
|
|
12471
|
+
const {
|
|
12472
|
+
webL10n
|
|
12473
|
+
} = document;
|
|
12608
12474
|
this._lang = lang;
|
|
12609
12475
|
this._ready = new Promise((resolve, reject) => {
|
|
12610
|
-
webL10n.setLanguage(
|
|
12476
|
+
webL10n.setLanguage(fixupLangCode(lang), () => {
|
|
12611
12477
|
resolve(webL10n);
|
|
12612
12478
|
});
|
|
12613
12479
|
});
|
|
@@ -12632,12 +12498,12 @@ class GenericL10n {
|
|
|
12632
12498
|
exports.GenericL10n = GenericL10n;
|
|
12633
12499
|
|
|
12634
12500
|
/***/ }),
|
|
12635
|
-
/*
|
|
12501
|
+
/* 44 */
|
|
12636
12502
|
/***/ (() => {
|
|
12637
12503
|
|
|
12638
12504
|
|
|
12639
12505
|
|
|
12640
|
-
document.webL10n = function (window, document
|
|
12506
|
+
document.webL10n = function (window, document) {
|
|
12641
12507
|
var gL10nData = {};
|
|
12642
12508
|
var gTextData = '';
|
|
12643
12509
|
var gTextProp = 'textContent';
|
|
@@ -13357,7 +13223,7 @@ document.webL10n = function (window, document, undefined) {
|
|
|
13357
13223
|
}(window, document);
|
|
13358
13224
|
|
|
13359
13225
|
/***/ }),
|
|
13360
|
-
/*
|
|
13226
|
+
/* 45 */
|
|
13361
13227
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13362
13228
|
|
|
13363
13229
|
|
|
@@ -13366,9 +13232,9 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
13366
13232
|
value: true
|
|
13367
13233
|
}));
|
|
13368
13234
|
exports.GenericScripting = void 0;
|
|
13369
|
-
exports.
|
|
13235
|
+
exports.docProperties = docProperties;
|
|
13370
13236
|
var _pdfjsLib = __webpack_require__(4);
|
|
13371
|
-
async function
|
|
13237
|
+
async function docProperties(pdfDocument) {
|
|
13372
13238
|
const url = "",
|
|
13373
13239
|
baseUrl = url.split("#")[0];
|
|
13374
13240
|
let {
|
|
@@ -13416,7 +13282,7 @@ class GenericScripting {
|
|
|
13416
13282
|
exports.GenericScripting = GenericScripting;
|
|
13417
13283
|
|
|
13418
13284
|
/***/ }),
|
|
13419
|
-
/*
|
|
13285
|
+
/* 46 */
|
|
13420
13286
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13421
13287
|
|
|
13422
13288
|
|
|
@@ -13424,10 +13290,10 @@ exports.GenericScripting = GenericScripting;
|
|
|
13424
13290
|
Object.defineProperty(exports, "__esModule", ({
|
|
13425
13291
|
value: true
|
|
13426
13292
|
}));
|
|
13427
|
-
exports.PDFPrintService =
|
|
13293
|
+
exports.PDFPrintService = void 0;
|
|
13428
13294
|
var _pdfjsLib = __webpack_require__(4);
|
|
13429
13295
|
var _app = __webpack_require__(2);
|
|
13430
|
-
var _print_utils = __webpack_require__(
|
|
13296
|
+
var _print_utils = __webpack_require__(47);
|
|
13431
13297
|
let activeService = null;
|
|
13432
13298
|
let dialog = null;
|
|
13433
13299
|
let overlayManager = null;
|
|
@@ -13457,33 +13323,34 @@ function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size, printRe
|
|
|
13457
13323
|
return pdfPage.render(renderContext).promise;
|
|
13458
13324
|
});
|
|
13459
13325
|
}
|
|
13460
|
-
|
|
13461
|
-
|
|
13462
|
-
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13326
|
+
class PDFPrintService {
|
|
13327
|
+
constructor(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise = null, printAnnotationStoragePromise = null, l10n) {
|
|
13328
|
+
this.pdfDocument = pdfDocument;
|
|
13329
|
+
this.pagesOverview = pagesOverview;
|
|
13330
|
+
this.printContainer = printContainer;
|
|
13331
|
+
this._printResolution = printResolution || 150;
|
|
13332
|
+
this._optionalContentConfigPromise = optionalContentConfigPromise || pdfDocument.getOptionalContentConfig();
|
|
13333
|
+
this._printAnnotationStoragePromise = printAnnotationStoragePromise || Promise.resolve();
|
|
13334
|
+
this.l10n = l10n;
|
|
13335
|
+
this.currentPage = -1;
|
|
13336
|
+
this.scratchCanvas = document.createElement("canvas");
|
|
13337
|
+
}
|
|
13472
13338
|
layout() {
|
|
13473
13339
|
this.throwIfInactive();
|
|
13474
13340
|
const body = document.querySelector("body");
|
|
13475
13341
|
body.setAttribute("data-pdfjsprinting", true);
|
|
13476
|
-
const
|
|
13477
|
-
|
|
13478
|
-
|
|
13342
|
+
const {
|
|
13343
|
+
width,
|
|
13344
|
+
height
|
|
13345
|
+
} = this.pagesOverview[0];
|
|
13346
|
+
const hasEqualPageSizes = this.pagesOverview.every(size => size.width === width && size.height === height);
|
|
13479
13347
|
if (!hasEqualPageSizes) {
|
|
13480
|
-
console.warn("Not all pages have the same size. The printed
|
|
13348
|
+
console.warn("Not all pages have the same size. The printed result may be incorrect!");
|
|
13481
13349
|
}
|
|
13482
13350
|
this.pageStyleSheet = document.createElement("style");
|
|
13483
|
-
|
|
13484
|
-
this.pageStyleSheet.textContent = "@page { size: " + pageSize.width + "pt " + pageSize.height + "pt;}";
|
|
13351
|
+
this.pageStyleSheet.textContent = `@page { size: ${width}pt ${height}pt;}`;
|
|
13485
13352
|
body.append(this.pageStyleSheet);
|
|
13486
|
-
}
|
|
13353
|
+
}
|
|
13487
13354
|
destroy() {
|
|
13488
13355
|
if (activeService !== this) {
|
|
13489
13356
|
return;
|
|
@@ -13503,7 +13370,7 @@ PDFPrintService.prototype = {
|
|
|
13503
13370
|
overlayManager.close(dialog);
|
|
13504
13371
|
}
|
|
13505
13372
|
});
|
|
13506
|
-
}
|
|
13373
|
+
}
|
|
13507
13374
|
renderPages() {
|
|
13508
13375
|
if (this.pdfDocument.isPureXfa) {
|
|
13509
13376
|
(0, _print_utils.getXfaHtmlForPrinting)(this.printContainer, this.pdfDocument);
|
|
@@ -13524,7 +13391,7 @@ PDFPrintService.prototype = {
|
|
|
13524
13391
|
}, reject);
|
|
13525
13392
|
};
|
|
13526
13393
|
return new Promise(renderNextPage);
|
|
13527
|
-
}
|
|
13394
|
+
}
|
|
13528
13395
|
useRenderedPage() {
|
|
13529
13396
|
this.throwIfInactive();
|
|
13530
13397
|
const img = document.createElement("img");
|
|
@@ -13544,7 +13411,7 @@ PDFPrintService.prototype = {
|
|
|
13544
13411
|
img.onload = resolve;
|
|
13545
13412
|
img.onerror = reject;
|
|
13546
13413
|
});
|
|
13547
|
-
}
|
|
13414
|
+
}
|
|
13548
13415
|
performPrint() {
|
|
13549
13416
|
this.throwIfInactive();
|
|
13550
13417
|
return new Promise(resolve => {
|
|
@@ -13557,16 +13424,17 @@ PDFPrintService.prototype = {
|
|
|
13557
13424
|
setTimeout(resolve, 20);
|
|
13558
13425
|
}, 0);
|
|
13559
13426
|
});
|
|
13560
|
-
}
|
|
13427
|
+
}
|
|
13561
13428
|
get active() {
|
|
13562
13429
|
return this === activeService;
|
|
13563
|
-
}
|
|
13430
|
+
}
|
|
13564
13431
|
throwIfInactive() {
|
|
13565
13432
|
if (!this.active) {
|
|
13566
13433
|
throw new Error("This print request was cancelled or completed.");
|
|
13567
13434
|
}
|
|
13568
13435
|
}
|
|
13569
|
-
}
|
|
13436
|
+
}
|
|
13437
|
+
exports.PDFPrintService = PDFPrintService;
|
|
13570
13438
|
const print = window.print;
|
|
13571
13439
|
window.print = function () {
|
|
13572
13440
|
if (activeService) {
|
|
@@ -13601,8 +13469,11 @@ window.print = function () {
|
|
|
13601
13469
|
}
|
|
13602
13470
|
};
|
|
13603
13471
|
function dispatchEvent(eventType) {
|
|
13604
|
-
const event =
|
|
13605
|
-
|
|
13472
|
+
const event = new CustomEvent(eventType, {
|
|
13473
|
+
bubbles: false,
|
|
13474
|
+
cancelable: false,
|
|
13475
|
+
detail: "custom"
|
|
13476
|
+
});
|
|
13606
13477
|
window.dispatchEvent(event);
|
|
13607
13478
|
}
|
|
13608
13479
|
function abort() {
|
|
@@ -13665,7 +13536,7 @@ _app.PDFPrintServiceFactory.instance = {
|
|
|
13665
13536
|
};
|
|
13666
13537
|
|
|
13667
13538
|
/***/ }),
|
|
13668
|
-
/*
|
|
13539
|
+
/* 47 */
|
|
13669
13540
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13670
13541
|
|
|
13671
13542
|
|
|
@@ -13676,7 +13547,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
13676
13547
|
exports.getXfaHtmlForPrinting = getXfaHtmlForPrinting;
|
|
13677
13548
|
var _pdfjsLib = __webpack_require__(4);
|
|
13678
13549
|
var _pdf_link_service = __webpack_require__(7);
|
|
13679
|
-
var _xfa_layer_builder = __webpack_require__(
|
|
13550
|
+
var _xfa_layer_builder = __webpack_require__(37);
|
|
13680
13551
|
function getXfaHtmlForPrinting(printContainer, pdfDocument) {
|
|
13681
13552
|
const xfaHtml = pdfDocument.allXfaHtml;
|
|
13682
13553
|
const linkService = new _pdf_link_service.SimpleLinkService();
|
|
@@ -13750,13 +13621,13 @@ Object.defineProperty(exports, "PDFViewerApplicationOptions", ({
|
|
|
13750
13621
|
}
|
|
13751
13622
|
}));
|
|
13752
13623
|
__webpack_require__(1);
|
|
13753
|
-
__webpack_require__(
|
|
13624
|
+
__webpack_require__(46);
|
|
13754
13625
|
var _ui_utils = __webpack_require__(3);
|
|
13755
13626
|
var _app_options = __webpack_require__(5);
|
|
13756
13627
|
var _pdf_link_service = __webpack_require__(7);
|
|
13757
13628
|
var _app = __webpack_require__(2);
|
|
13758
|
-
const pdfjsVersion = '3.
|
|
13759
|
-
const pdfjsBuild = '
|
|
13629
|
+
const pdfjsVersion = '3.9.179';
|
|
13630
|
+
const pdfjsBuild = '1ef6fbc52';
|
|
13760
13631
|
const AppConstants = {
|
|
13761
13632
|
LinkTarget: _pdf_link_service.LinkTarget,
|
|
13762
13633
|
RenderingStates: _ui_utils.RenderingStates,
|
|
@@ -13789,6 +13660,7 @@ function getViewerConfiguration() {
|
|
|
13789
13660
|
editorFreeTextParamsToolbar: document.getElementById("editorFreeTextParamsToolbar"),
|
|
13790
13661
|
editorInkButton: document.getElementById("editorInk"),
|
|
13791
13662
|
editorInkParamsToolbar: document.getElementById("editorInkParamsToolbar"),
|
|
13663
|
+
editorStampButton: document.getElementById("editorStamp"),
|
|
13792
13664
|
download: document.getElementById("download")
|
|
13793
13665
|
},
|
|
13794
13666
|
secondaryToolbar: {
|
|
@@ -13818,6 +13690,7 @@ function getViewerConfiguration() {
|
|
|
13818
13690
|
outerContainer: document.getElementById("outerContainer"),
|
|
13819
13691
|
sidebarContainer: document.getElementById("sidebarContainer"),
|
|
13820
13692
|
toggleButton: document.getElementById("sidebarToggle"),
|
|
13693
|
+
resizer: document.getElementById("sidebarResizer"),
|
|
13821
13694
|
thumbnailButton: document.getElementById("viewThumbnail"),
|
|
13822
13695
|
outlineButton: document.getElementById("viewOutline"),
|
|
13823
13696
|
attachmentsButton: document.getElementById("viewAttachments"),
|
|
@@ -13829,10 +13702,6 @@ function getViewerConfiguration() {
|
|
|
13829
13702
|
outlineOptionsContainer: document.getElementById("outlineOptionsContainer"),
|
|
13830
13703
|
currentOutlineItemButton: document.getElementById("currentOutlineItem")
|
|
13831
13704
|
},
|
|
13832
|
-
sidebarResizer: {
|
|
13833
|
-
outerContainer: document.getElementById("outerContainer"),
|
|
13834
|
-
resizer: document.getElementById("sidebarResizer")
|
|
13835
|
-
},
|
|
13836
13705
|
findBar: {
|
|
13837
13706
|
bar: document.getElementById("findbar"),
|
|
13838
13707
|
toggleButton: document.getElementById("viewFind"),
|
|
@@ -13887,9 +13756,12 @@ function getViewerConfiguration() {
|
|
|
13887
13756
|
}
|
|
13888
13757
|
function webViewerLoad() {
|
|
13889
13758
|
const config = getViewerConfiguration();
|
|
13890
|
-
const event =
|
|
13891
|
-
|
|
13892
|
-
|
|
13759
|
+
const event = new CustomEvent("webviewerloaded", {
|
|
13760
|
+
bubbles: true,
|
|
13761
|
+
cancelable: true,
|
|
13762
|
+
detail: {
|
|
13763
|
+
source: window
|
|
13764
|
+
}
|
|
13893
13765
|
});
|
|
13894
13766
|
try {
|
|
13895
13767
|
parent.document.dispatchEvent(event);
|