From 49d5cfad618f834a8ea00030c18f931810755d4d Mon Sep 17 00:00:00 2001 From: j Date: Sun, 9 Jun 2024 14:48:11 +0100 Subject: [PATCH] update pdf.js --- pdf.js/compatibility.js | 593 - pdf.js/debugger.css | 111 + pdf.js/debugger.js | 615 - pdf.js/debugger.mjs | 623 + pdf.js/embeds.js | 148 - pdf.js/images/altText_add.svg | 3 + pdf.js/images/altText_done.svg | 3 + pdf.js/images/annotation-paperclip.svg | 6 + pdf.js/images/annotation-pushpin.svg | 7 + pdf.js/images/cursor-editorFreeHighlight.svg | 6 + pdf.js/images/cursor-editorFreeText.svg | 3 + pdf.js/images/cursor-editorInk.svg | 4 + pdf.js/images/cursor-editorTextHighlight.svg | 8 + pdf.js/images/editor-toolbar-delete.svg | 5 + pdf.js/images/findbarButton-next-rtl.png | Bin 199 -> 0 bytes pdf.js/images/findbarButton-next-rtl@2x.png | Bin 304 -> 0 bytes pdf.js/images/findbarButton-next.png | Bin 193 -> 0 bytes pdf.js/images/findbarButton-next.svg | 3 + pdf.js/images/findbarButton-next@2x.png | Bin 296 -> 0 bytes pdf.js/images/findbarButton-previous-rtl.png | Bin 193 -> 0 bytes .../images/findbarButton-previous-rtl@2x.png | Bin 296 -> 0 bytes pdf.js/images/findbarButton-previous.png | Bin 199 -> 0 bytes pdf.js/images/findbarButton-previous.svg | 3 + pdf.js/images/findbarButton-previous@2x.png | Bin 304 -> 0 bytes pdf.js/images/grab.cur | Bin 326 -> 0 bytes pdf.js/images/grabbing.cur | Bin 326 -> 0 bytes pdf.js/images/gv-toolbarButton-download.svg | 3 + pdf.js/images/loading-small.png | Bin 7402 -> 0 bytes pdf.js/images/loading-small@2x.png | Bin 16131 -> 0 bytes pdf.js/images/loading.svg | 1 + ...ondaryToolbarButton-documentProperties.png | Bin 403 -> 0 bytes ...ondaryToolbarButton-documentProperties.svg | 3 + ...aryToolbarButton-documentProperties@2x.png | Bin 933 -> 0 bytes .../secondaryToolbarButton-firstPage.png | Bin 179 -> 0 bytes .../secondaryToolbarButton-firstPage.svg | 3 + .../secondaryToolbarButton-firstPage@2x.png | Bin 266 -> 0 bytes .../secondaryToolbarButton-handTool.png | Bin 301 -> 0 bytes .../secondaryToolbarButton-handTool.svg | 3 + .../secondaryToolbarButton-handTool@2x.png | Bin 583 -> 0 bytes .../secondaryToolbarButton-lastPage.png | Bin 175 -> 0 bytes .../secondaryToolbarButton-lastPage.svg | 3 + .../secondaryToolbarButton-lastPage@2x.png | Bin 276 -> 0 bytes .../secondaryToolbarButton-rotateCcw.png | Bin 360 -> 0 bytes .../secondaryToolbarButton-rotateCcw.svg | 3 + .../secondaryToolbarButton-rotateCcw@2x.png | Bin 731 -> 0 bytes .../secondaryToolbarButton-rotateCw.png | Bin 359 -> 0 bytes .../secondaryToolbarButton-rotateCw.svg | 3 + .../secondaryToolbarButton-rotateCw@2x.png | Bin 714 -> 0 bytes ...econdaryToolbarButton-scrollHorizontal.png | Bin 218 -> 0 bytes ...econdaryToolbarButton-scrollHorizontal.svg | 3 + ...ndaryToolbarButton-scrollHorizontal@2x.png | Bin 332 -> 0 bytes .../secondaryToolbarButton-scrollPage.svg | 3 + .../secondaryToolbarButton-scrollVertical.png | Bin 228 -> 0 bytes .../secondaryToolbarButton-scrollVertical.svg | 3 + ...condaryToolbarButton-scrollVertical@2x.png | Bin 349 -> 0 bytes .../secondaryToolbarButton-scrollWrapped.png | Bin 297 -> 0 bytes .../secondaryToolbarButton-scrollWrapped.svg | 3 + ...econdaryToolbarButton-scrollWrapped@2x.png | Bin 490 -> 0 bytes .../secondaryToolbarButton-selectTool.png | Bin 461 -> 0 bytes .../secondaryToolbarButton-selectTool.svg | 3 + .../secondaryToolbarButton-selectTool@2x.png | Bin 1067 -> 0 bytes .../secondaryToolbarButton-spreadEven.png | Bin 347 -> 0 bytes .../secondaryToolbarButton-spreadEven.svg | 3 + .../secondaryToolbarButton-spreadEven@2x.png | Bin 694 -> 0 bytes .../secondaryToolbarButton-spreadNone.png | Bin 179 -> 0 bytes .../secondaryToolbarButton-spreadNone.svg | 3 + .../secondaryToolbarButton-spreadNone@2x.png | Bin 261 -> 0 bytes .../secondaryToolbarButton-spreadOdd.png | Bin 344 -> 0 bytes .../secondaryToolbarButton-spreadOdd.svg | 3 + .../secondaryToolbarButton-spreadOdd@2x.png | Bin 621 -> 0 bytes pdf.js/images/shadow.png | Bin 290 -> 0 bytes pdf.js/images/texture.png | Bin 2417 -> 0 bytes pdf.js/images/toolbarButton-bookmark.png | Bin 174 -> 0 bytes pdf.js/images/toolbarButton-bookmark.svg | 3 + pdf.js/images/toolbarButton-bookmark@2x.png | Bin 260 -> 0 bytes .../toolbarButton-currentOutlineItem.svg | 3 + pdf.js/images/toolbarButton-download.png | Bin 259 -> 0 bytes pdf.js/images/toolbarButton-download.svg | 4 + pdf.js/images/toolbarButton-download@2x.png | Bin 425 -> 0 bytes .../images/toolbarButton-editorFreeText.svg | 5 + .../images/toolbarButton-editorHighlight.svg | 6 + pdf.js/images/toolbarButton-editorInk.svg | 4 + pdf.js/images/toolbarButton-editorStamp.svg | 8 + pdf.js/images/toolbarButton-menuArrow.svg | 3 + pdf.js/images/toolbarButton-menuArrows.png | Bin 107 -> 0 bytes pdf.js/images/toolbarButton-menuArrows@2x.png | Bin 152 -> 0 bytes pdf.js/images/toolbarButton-openFile.png | Bin 295 -> 0 bytes pdf.js/images/toolbarButton-openFile.svg | 3 + pdf.js/images/toolbarButton-openFile@2x.png | Bin 550 -> 0 bytes pdf.js/images/toolbarButton-pageDown-rtl.png | Bin 242 -> 0 bytes .../images/toolbarButton-pageDown-rtl@2x.png | Bin 398 -> 0 bytes pdf.js/images/toolbarButton-pageDown.png | Bin 238 -> 0 bytes pdf.js/images/toolbarButton-pageDown.svg | 3 + pdf.js/images/toolbarButton-pageDown@2x.png | Bin 396 -> 0 bytes pdf.js/images/toolbarButton-pageUp-rtl.png | Bin 245 -> 0 bytes pdf.js/images/toolbarButton-pageUp-rtl@2x.png | Bin 405 -> 0 bytes pdf.js/images/toolbarButton-pageUp.png | Bin 246 -> 0 bytes pdf.js/images/toolbarButton-pageUp.svg | 3 + pdf.js/images/toolbarButton-pageUp@2x.png | Bin 403 -> 0 bytes .../images/toolbarButton-presentationMode.png | Bin 321 -> 0 bytes .../images/toolbarButton-presentationMode.svg | 3 + .../toolbarButton-presentationMode@2x.png | Bin 586 -> 0 bytes pdf.js/images/toolbarButton-print.png | Bin 257 -> 0 bytes pdf.js/images/toolbarButton-print.svg | 3 + pdf.js/images/toolbarButton-print@2x.png | Bin 464 -> 0 bytes pdf.js/images/toolbarButton-search.png | Bin 309 -> 0 bytes pdf.js/images/toolbarButton-search.svg | 3 + pdf.js/images/toolbarButton-search@2x.png | Bin 653 -> 0 bytes ...olbarButton-secondaryToolbarToggle-rtl.png | Bin 246 -> 0 bytes ...arButton-secondaryToolbarToggle-rtl@2x.png | Bin 456 -> 0 bytes .../toolbarButton-secondaryToolbarToggle.png | Bin 243 -> 0 bytes .../toolbarButton-secondaryToolbarToggle.svg | 3 + ...oolbarButton-secondaryToolbarToggle@2x.png | Bin 458 -> 0 bytes .../toolbarButton-sidebarToggle-rtl.png | Bin 225 -> 0 bytes .../toolbarButton-sidebarToggle-rtl@2x.png | Bin 344 -> 0 bytes pdf.js/images/toolbarButton-sidebarToggle.png | Bin 225 -> 0 bytes pdf.js/images/toolbarButton-sidebarToggle.svg | 3 + .../images/toolbarButton-sidebarToggle@2x.png | Bin 331 -> 0 bytes .../images/toolbarButton-viewAttachments.png | Bin 384 -> 0 bytes .../images/toolbarButton-viewAttachments.svg | 3 + .../toolbarButton-viewAttachments@2x.png | Bin 859 -> 0 bytes pdf.js/images/toolbarButton-viewLayers.svg | 3 + .../images/toolbarButton-viewOutline-rtl.png | Bin 177 -> 0 bytes .../toolbarButton-viewOutline-rtl@2x.png | Bin 394 -> 0 bytes pdf.js/images/toolbarButton-viewOutline.png | Bin 178 -> 0 bytes pdf.js/images/toolbarButton-viewOutline.svg | 3 + .../images/toolbarButton-viewOutline@2x.png | Bin 331 -> 0 bytes pdf.js/images/toolbarButton-viewThumbnail.png | Bin 185 -> 0 bytes pdf.js/images/toolbarButton-viewThumbnail.svg | 3 + .../images/toolbarButton-viewThumbnail@2x.png | Bin 219 -> 0 bytes pdf.js/images/toolbarButton-zoomIn.png | Bin 136 -> 0 bytes pdf.js/images/toolbarButton-zoomIn.svg | 3 + pdf.js/images/toolbarButton-zoomIn@2x.png | Bin 160 -> 0 bytes pdf.js/images/toolbarButton-zoomOut.png | Bin 88 -> 0 bytes pdf.js/images/toolbarButton-zoomOut.svg | 3 + pdf.js/images/toolbarButton-zoomOut@2x.png | Bin 109 -> 0 bytes pdf.js/images/treeitem-collapsed-rtl.png | Bin 143 -> 0 bytes pdf.js/images/treeitem-collapsed-rtl@2x.png | Bin 167 -> 0 bytes pdf.js/images/treeitem-collapsed.png | Bin 128 -> 0 bytes pdf.js/images/treeitem-collapsed.svg | 1 + pdf.js/images/treeitem-collapsed@2x.png | Bin 149 -> 0 bytes pdf.js/images/treeitem-expanded.png | Bin 125 -> 0 bytes pdf.js/images/treeitem-expanded.svg | 1 + pdf.js/images/treeitem-expanded@2x.png | Bin 172 -> 0 bytes pdf.js/l10n.js | 1033 - pdf.js/locale/ach/viewer.ftl | 225 + pdf.js/locale/ach/viewer.properties | 207 - pdf.js/locale/af/viewer.ftl | 212 + pdf.js/locale/af/viewer.properties | 184 - pdf.js/locale/ak/viewer.properties | 130 - pdf.js/locale/an/viewer.ftl | 257 + pdf.js/locale/an/viewer.properties | 184 - pdf.js/locale/ar/viewer.ftl | 404 + pdf.js/locale/ar/viewer.properties | 242 - pdf.js/locale/as/viewer.properties | 167 - pdf.js/locale/ast/viewer.ftl | 201 + pdf.js/locale/ast/viewer.properties | 201 - pdf.js/locale/az/viewer.ftl | 257 + pdf.js/locale/az/viewer.properties | 242 - pdf.js/locale/be/viewer.ftl | 404 + pdf.js/locale/be/viewer.properties | 242 - pdf.js/locale/bg/viewer.ftl | 384 + pdf.js/locale/bg/viewer.properties | 242 - pdf.js/locale/bn-BD/viewer.properties | 232 - pdf.js/locale/bn-IN/viewer.properties | 242 - pdf.js/locale/bn/viewer.ftl | 247 + pdf.js/locale/bo/viewer.ftl | 247 + pdf.js/locale/br/viewer.ftl | 313 + pdf.js/locale/br/viewer.properties | 242 - pdf.js/locale/brx/viewer.ftl | 218 + pdf.js/locale/brx/viewer.properties | 167 - pdf.js/locale/bs/viewer.ftl | 223 + pdf.js/locale/bs/viewer.properties | 201 - pdf.js/locale/ca/viewer.ftl | 299 + pdf.js/locale/ca/viewer.properties | 236 - pdf.js/locale/cak/viewer.ftl | 291 + pdf.js/locale/cak/viewer.properties | 242 - pdf.js/locale/ckb/viewer.ftl | 242 + pdf.js/locale/crh/viewer.properties | 242 - pdf.js/locale/cs/viewer.ftl | 406 + pdf.js/locale/cs/viewer.properties | 242 - pdf.js/locale/csb/viewer.properties | 134 - pdf.js/locale/cy/viewer.ftl | 410 + pdf.js/locale/cy/viewer.properties | 242 - pdf.js/locale/da/viewer.ftl | 402 + pdf.js/locale/da/viewer.properties | 242 - pdf.js/locale/de/viewer.ftl | 402 + pdf.js/locale/de/viewer.properties | 242 - pdf.js/locale/dsb/viewer.ftl | 406 + pdf.js/locale/el/viewer.ftl | 402 + pdf.js/locale/el/viewer.properties | 242 - pdf.js/locale/en-CA/viewer.ftl | 402 + pdf.js/locale/en-CA/viewer.properties | 242 - pdf.js/locale/en-GB/viewer.ftl | 402 + pdf.js/locale/en-GB/viewer.properties | 242 - pdf.js/locale/en-US/viewer.ftl | 418 + pdf.js/locale/en-US/viewer.properties | 242 - pdf.js/locale/en-ZA/viewer.properties | 170 - pdf.js/locale/eo/viewer.ftl | 396 + pdf.js/locale/eo/viewer.properties | 242 - pdf.js/locale/es-AR/viewer.ftl | 402 + pdf.js/locale/es-AR/viewer.properties | 242 - pdf.js/locale/es-CL/viewer.ftl | 402 + pdf.js/locale/es-CL/viewer.properties | 242 - pdf.js/locale/es-ES/viewer.ftl | 402 + pdf.js/locale/es-ES/viewer.properties | 242 - pdf.js/locale/es-MX/viewer.ftl | 299 + pdf.js/locale/es-MX/viewer.properties | 242 - pdf.js/locale/et/viewer.ftl | 268 + pdf.js/locale/et/viewer.properties | 242 - pdf.js/locale/eu/viewer.ftl | 402 + pdf.js/locale/eu/viewer.properties | 242 - pdf.js/locale/fa/viewer.ftl | 246 + pdf.js/locale/fa/viewer.properties | 223 - pdf.js/locale/ff/viewer.ftl | 247 + pdf.js/locale/ff/viewer.properties | 242 - pdf.js/locale/fi/viewer.ftl | 402 + pdf.js/locale/fi/viewer.properties | 242 - pdf.js/locale/fr/viewer.ftl | 398 + pdf.js/locale/fr/viewer.properties | 242 - pdf.js/locale/fur/viewer.ftl | 402 + pdf.js/locale/fy-NL/viewer.ftl | 402 + pdf.js/locale/fy-NL/viewer.properties | 242 - pdf.js/locale/ga-IE/viewer.ftl | 213 + pdf.js/locale/ga-IE/viewer.properties | 184 - pdf.js/locale/gd/viewer.ftl | 299 + pdf.js/locale/gd/viewer.properties | 242 - pdf.js/locale/gl/viewer.ftl | 364 + pdf.js/locale/gl/viewer.properties | 242 - pdf.js/locale/gn/viewer.ftl | 402 + pdf.js/locale/gn/viewer.properties | 242 - pdf.js/locale/gu-IN/viewer.ftl | 247 + pdf.js/locale/gu-IN/viewer.properties | 242 - pdf.js/locale/he/viewer.ftl | 402 + pdf.js/locale/he/viewer.properties | 240 - pdf.js/locale/hi-IN/viewer.ftl | 253 + pdf.js/locale/hi-IN/viewer.properties | 224 - pdf.js/locale/hr/viewer.ftl | 279 + pdf.js/locale/hr/viewer.properties | 208 - pdf.js/locale/hsb/viewer.ftl | 406 + pdf.js/locale/hsb/viewer.properties | 242 - pdf.js/locale/hto/viewer.properties | 127 - pdf.js/locale/hu/viewer.ftl | 396 + pdf.js/locale/hu/viewer.properties | 242 - pdf.js/locale/hy-AM/viewer.ftl | 272 + pdf.js/locale/hy-AM/viewer.properties | 201 - pdf.js/locale/hye/viewer.ftl | 268 + pdf.js/locale/ia/viewer.ftl | 394 + pdf.js/locale/ia/viewer.properties | 242 - pdf.js/locale/id/viewer.ftl | 293 + pdf.js/locale/id/viewer.properties | 242 - pdf.js/locale/is/viewer.ftl | 402 + pdf.js/locale/is/viewer.properties | 218 - pdf.js/locale/it/viewer.ftl | 399 + pdf.js/locale/it/viewer.properties | 157 - pdf.js/locale/ja/viewer.ftl | 394 + pdf.js/locale/ja/viewer.properties | 242 - pdf.js/locale/ka/viewer.ftl | 387 + pdf.js/locale/ka/viewer.properties | 242 - pdf.js/locale/kab/viewer.ftl | 337 + pdf.js/locale/kab/viewer.properties | 242 - pdf.js/locale/kk/viewer.ftl | 402 + pdf.js/locale/kk/viewer.properties | 242 - pdf.js/locale/km/viewer.ftl | 223 + pdf.js/locale/km/viewer.properties | 184 - pdf.js/locale/kn/viewer.ftl | 213 + pdf.js/locale/kn/viewer.properties | 193 - pdf.js/locale/ko/viewer.ftl | 394 + pdf.js/locale/ko/viewer.properties | 242 - pdf.js/locale/kok/viewer.properties | 167 - pdf.js/locale/ks/viewer.properties | 168 - pdf.js/locale/ku/viewer.properties | 146 - pdf.js/locale/lg/viewer.properties | 112 - pdf.js/locale/lij/viewer.ftl | 247 + pdf.js/locale/lij/viewer.properties | 242 - pdf.js/locale/lo/viewer.ftl | 299 + pdf.js/locale/lo/viewer.properties | 152 - pdf.js/locale/locale.json | 1 + pdf.js/locale/locale.properties | 369 - pdf.js/locale/lt/viewer.ftl | 268 + pdf.js/locale/lt/viewer.properties | 242 - pdf.js/locale/ltg/viewer.ftl | 246 + pdf.js/locale/ltg/viewer.properties | 220 - pdf.js/locale/lv/viewer.ftl | 247 + pdf.js/locale/lv/viewer.properties | 242 - pdf.js/locale/mai/viewer.properties | 168 - pdf.js/locale/meh/viewer.ftl | 87 + pdf.js/locale/meh/viewer.properties | 72 - pdf.js/locale/mk/viewer.ftl | 215 + pdf.js/locale/mk/viewer.properties | 145 - pdf.js/locale/ml/viewer.properties | 184 - pdf.js/locale/mn/viewer.properties | 82 - pdf.js/locale/mr/viewer.ftl | 239 + pdf.js/locale/mr/viewer.properties | 206 - pdf.js/locale/ms/viewer.ftl | 247 + pdf.js/locale/ms/viewer.properties | 242 - pdf.js/locale/my/viewer.ftl | 206 + pdf.js/locale/my/viewer.properties | 198 - pdf.js/locale/nb-NO/viewer.ftl | 396 + pdf.js/locale/nb-NO/viewer.properties | 242 - pdf.js/locale/ne-NP/viewer.ftl | 234 + pdf.js/locale/ne-NP/viewer.properties | 184 - pdf.js/locale/nl/viewer.ftl | 402 + pdf.js/locale/nl/viewer.properties | 242 - pdf.js/locale/nn-NO/viewer.ftl | 382 + pdf.js/locale/nn-NO/viewer.properties | 242 - pdf.js/locale/nso/viewer.properties | 130 - pdf.js/locale/oc/viewer.ftl | 354 + pdf.js/locale/oc/viewer.properties | 210 - pdf.js/locale/or/viewer.properties | 167 - pdf.js/locale/pa-IN/viewer.ftl | 396 + pdf.js/locale/pa-IN/viewer.properties | 225 - pdf.js/locale/pl/viewer.ftl | 404 + pdf.js/locale/pl/viewer.properties | 183 - pdf.js/locale/pt-BR/viewer.ftl | 396 + pdf.js/locale/pt-BR/viewer.properties | 242 - pdf.js/locale/pt-PT/viewer.ftl | 402 + pdf.js/locale/pt-PT/viewer.properties | 242 - pdf.js/locale/rm/viewer.ftl | 396 + pdf.js/locale/rm/viewer.properties | 242 - pdf.js/locale/ro/viewer.ftl | 251 + pdf.js/locale/ro/viewer.properties | 242 - pdf.js/locale/ru/viewer.ftl | 404 + pdf.js/locale/ru/viewer.properties | 242 - pdf.js/locale/rw/viewer.properties | 81 - pdf.js/locale/sah/viewer.properties | 166 - pdf.js/locale/sat/viewer.ftl | 311 + pdf.js/locale/sat/viewer.properties | 134 - pdf.js/locale/sc/viewer.ftl | 290 + pdf.js/locale/scn/viewer.ftl | 74 + pdf.js/locale/sco/viewer.ftl | 264 + pdf.js/locale/si/viewer.ftl | 253 + pdf.js/locale/si/viewer.properties | 171 - pdf.js/locale/sk/viewer.ftl | 406 + pdf.js/locale/sk/viewer.properties | 242 - pdf.js/locale/skr/viewer.ftl | 396 + pdf.js/locale/sl/viewer.ftl | 398 + pdf.js/locale/sl/viewer.properties | 242 - pdf.js/locale/son/viewer.ftl | 206 + pdf.js/locale/son/viewer.properties | 180 - pdf.js/locale/sq/viewer.ftl | 387 + pdf.js/locale/sq/viewer.properties | 235 - pdf.js/locale/sr/viewer.ftl | 299 + pdf.js/locale/sr/viewer.properties | 220 - pdf.js/locale/sv-SE/viewer.ftl | 402 + pdf.js/locale/sv-SE/viewer.properties | 242 - pdf.js/locale/sw/viewer.properties | 128 - pdf.js/locale/szl/viewer.ftl | 257 + pdf.js/locale/ta-LK/viewer.properties | 77 - pdf.js/locale/ta/viewer.ftl | 223 + pdf.js/locale/ta/viewer.properties | 201 - pdf.js/locale/te/viewer.ftl | 239 + pdf.js/locale/te/viewer.properties | 218 - pdf.js/locale/tg/viewer.ftl | 396 + pdf.js/locale/th/viewer.ftl | 394 + pdf.js/locale/th/viewer.properties | 242 - pdf.js/locale/tl/viewer.ftl | 257 + pdf.js/locale/tl/viewer.properties | 242 - pdf.js/locale/tn/viewer.properties | 83 - pdf.js/locale/tr/viewer.ftl | 396 + pdf.js/locale/tr/viewer.properties | 242 - pdf.js/locale/trs/viewer.ftl | 197 + pdf.js/locale/tsz/viewer.properties | 75 - pdf.js/locale/uk/viewer.ftl | 398 + pdf.js/locale/uk/viewer.properties | 242 - pdf.js/locale/ur/viewer.ftl | 248 + pdf.js/locale/ur/viewer.properties | 207 - pdf.js/locale/uz/viewer.ftl | 187 + pdf.js/locale/uz/viewer.properties | 169 - pdf.js/locale/vi/viewer.ftl | 394 + pdf.js/locale/vi/viewer.properties | 233 - pdf.js/locale/wo/viewer.ftl | 127 + pdf.js/locale/wo/viewer.properties | 124 - pdf.js/locale/xh/viewer.ftl | 212 + pdf.js/locale/xh/viewer.properties | 184 - pdf.js/locale/zam/viewer.properties | 90 - pdf.js/locale/zh-CN/viewer.ftl | 388 + pdf.js/locale/zh-CN/viewer.properties | 242 - pdf.js/locale/zh-TW/viewer.ftl | 394 + pdf.js/locale/zh-TW/viewer.properties | 242 - pdf.js/locale/zu/viewer.properties | 131 - pdf.js/minify.py | 3 - pdf.js/pdf.js | 23522 ------- pdf.js/pdf.mjs | 19466 ++++++ pdf.js/pdf.mjs.map | 1 + pdf.js/pdf.sandbox.mjs | 239 + pdf.js/pdf.sandbox.mjs.map | 1 + pdf.js/pdf.worker.js | 55252 --------------- pdf.js/pdf.worker.mjs | 56202 ++++++++++++++++ pdf.js/pdf.worker.mjs.map | 1 + pdf.js/viewer.css | 5782 +- pdf.js/viewer.js | 15525 ----- pdf.js/viewer.mjs | 14456 ++++ pdf.js/viewer.mjs.map | 1 + 394 files changed, 130617 insertions(+), 124356 deletions(-) delete mode 100644 pdf.js/compatibility.js create mode 100644 pdf.js/debugger.css delete mode 100644 pdf.js/debugger.js create mode 100644 pdf.js/debugger.mjs delete mode 100644 pdf.js/embeds.js create mode 100644 pdf.js/images/altText_add.svg create mode 100644 pdf.js/images/altText_done.svg create mode 100644 pdf.js/images/annotation-paperclip.svg create mode 100644 pdf.js/images/annotation-pushpin.svg create mode 100644 pdf.js/images/cursor-editorFreeHighlight.svg create mode 100644 pdf.js/images/cursor-editorFreeText.svg create mode 100644 pdf.js/images/cursor-editorInk.svg create mode 100644 pdf.js/images/cursor-editorTextHighlight.svg create mode 100644 pdf.js/images/editor-toolbar-delete.svg delete mode 100644 pdf.js/images/findbarButton-next-rtl.png delete mode 100644 pdf.js/images/findbarButton-next-rtl@2x.png delete mode 100644 pdf.js/images/findbarButton-next.png create mode 100644 pdf.js/images/findbarButton-next.svg delete mode 100644 pdf.js/images/findbarButton-next@2x.png delete mode 100644 pdf.js/images/findbarButton-previous-rtl.png delete mode 100644 pdf.js/images/findbarButton-previous-rtl@2x.png delete mode 100644 pdf.js/images/findbarButton-previous.png create mode 100644 pdf.js/images/findbarButton-previous.svg delete mode 100644 pdf.js/images/findbarButton-previous@2x.png delete mode 100644 pdf.js/images/grab.cur delete mode 100644 pdf.js/images/grabbing.cur create mode 100644 pdf.js/images/gv-toolbarButton-download.svg delete mode 100644 pdf.js/images/loading-small.png delete mode 100644 pdf.js/images/loading-small@2x.png create mode 100644 pdf.js/images/loading.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-documentProperties.png create mode 100644 pdf.js/images/secondaryToolbarButton-documentProperties.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-documentProperties@2x.png delete mode 100644 pdf.js/images/secondaryToolbarButton-firstPage.png create mode 100644 pdf.js/images/secondaryToolbarButton-firstPage.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-firstPage@2x.png delete mode 100644 pdf.js/images/secondaryToolbarButton-handTool.png create mode 100644 pdf.js/images/secondaryToolbarButton-handTool.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-handTool@2x.png delete mode 100644 pdf.js/images/secondaryToolbarButton-lastPage.png create mode 100644 pdf.js/images/secondaryToolbarButton-lastPage.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-lastPage@2x.png delete mode 100644 pdf.js/images/secondaryToolbarButton-rotateCcw.png create mode 100644 pdf.js/images/secondaryToolbarButton-rotateCcw.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-rotateCcw@2x.png delete mode 100644 pdf.js/images/secondaryToolbarButton-rotateCw.png create mode 100644 pdf.js/images/secondaryToolbarButton-rotateCw.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-rotateCw@2x.png delete mode 100644 pdf.js/images/secondaryToolbarButton-scrollHorizontal.png create mode 100644 pdf.js/images/secondaryToolbarButton-scrollHorizontal.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-scrollHorizontal@2x.png create mode 100644 pdf.js/images/secondaryToolbarButton-scrollPage.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-scrollVertical.png create mode 100644 pdf.js/images/secondaryToolbarButton-scrollVertical.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-scrollVertical@2x.png delete mode 100644 pdf.js/images/secondaryToolbarButton-scrollWrapped.png create mode 100644 pdf.js/images/secondaryToolbarButton-scrollWrapped.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-scrollWrapped@2x.png delete mode 100644 pdf.js/images/secondaryToolbarButton-selectTool.png create mode 100644 pdf.js/images/secondaryToolbarButton-selectTool.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-selectTool@2x.png delete mode 100644 pdf.js/images/secondaryToolbarButton-spreadEven.png create mode 100644 pdf.js/images/secondaryToolbarButton-spreadEven.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-spreadEven@2x.png delete mode 100644 pdf.js/images/secondaryToolbarButton-spreadNone.png create mode 100644 pdf.js/images/secondaryToolbarButton-spreadNone.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-spreadNone@2x.png delete mode 100644 pdf.js/images/secondaryToolbarButton-spreadOdd.png create mode 100644 pdf.js/images/secondaryToolbarButton-spreadOdd.svg delete mode 100644 pdf.js/images/secondaryToolbarButton-spreadOdd@2x.png delete mode 100644 pdf.js/images/shadow.png delete mode 100644 pdf.js/images/texture.png delete mode 100644 pdf.js/images/toolbarButton-bookmark.png create mode 100644 pdf.js/images/toolbarButton-bookmark.svg delete mode 100644 pdf.js/images/toolbarButton-bookmark@2x.png create mode 100644 pdf.js/images/toolbarButton-currentOutlineItem.svg delete mode 100644 pdf.js/images/toolbarButton-download.png create mode 100644 pdf.js/images/toolbarButton-download.svg delete mode 100644 pdf.js/images/toolbarButton-download@2x.png create mode 100644 pdf.js/images/toolbarButton-editorFreeText.svg create mode 100644 pdf.js/images/toolbarButton-editorHighlight.svg create mode 100644 pdf.js/images/toolbarButton-editorInk.svg create mode 100644 pdf.js/images/toolbarButton-editorStamp.svg create mode 100644 pdf.js/images/toolbarButton-menuArrow.svg delete mode 100644 pdf.js/images/toolbarButton-menuArrows.png delete mode 100644 pdf.js/images/toolbarButton-menuArrows@2x.png delete mode 100644 pdf.js/images/toolbarButton-openFile.png create mode 100644 pdf.js/images/toolbarButton-openFile.svg delete mode 100644 pdf.js/images/toolbarButton-openFile@2x.png delete mode 100644 pdf.js/images/toolbarButton-pageDown-rtl.png delete mode 100644 pdf.js/images/toolbarButton-pageDown-rtl@2x.png delete mode 100644 pdf.js/images/toolbarButton-pageDown.png create mode 100644 pdf.js/images/toolbarButton-pageDown.svg delete mode 100644 pdf.js/images/toolbarButton-pageDown@2x.png delete mode 100644 pdf.js/images/toolbarButton-pageUp-rtl.png delete mode 100644 pdf.js/images/toolbarButton-pageUp-rtl@2x.png delete mode 100644 pdf.js/images/toolbarButton-pageUp.png create mode 100644 pdf.js/images/toolbarButton-pageUp.svg delete mode 100644 pdf.js/images/toolbarButton-pageUp@2x.png delete mode 100644 pdf.js/images/toolbarButton-presentationMode.png create mode 100644 pdf.js/images/toolbarButton-presentationMode.svg delete mode 100644 pdf.js/images/toolbarButton-presentationMode@2x.png delete mode 100644 pdf.js/images/toolbarButton-print.png create mode 100644 pdf.js/images/toolbarButton-print.svg delete mode 100644 pdf.js/images/toolbarButton-print@2x.png delete mode 100644 pdf.js/images/toolbarButton-search.png create mode 100644 pdf.js/images/toolbarButton-search.svg delete mode 100644 pdf.js/images/toolbarButton-search@2x.png delete mode 100644 pdf.js/images/toolbarButton-secondaryToolbarToggle-rtl.png delete mode 100644 pdf.js/images/toolbarButton-secondaryToolbarToggle-rtl@2x.png delete mode 100644 pdf.js/images/toolbarButton-secondaryToolbarToggle.png create mode 100644 pdf.js/images/toolbarButton-secondaryToolbarToggle.svg delete mode 100644 pdf.js/images/toolbarButton-secondaryToolbarToggle@2x.png delete mode 100644 pdf.js/images/toolbarButton-sidebarToggle-rtl.png delete mode 100644 pdf.js/images/toolbarButton-sidebarToggle-rtl@2x.png delete mode 100644 pdf.js/images/toolbarButton-sidebarToggle.png create mode 100644 pdf.js/images/toolbarButton-sidebarToggle.svg delete mode 100644 pdf.js/images/toolbarButton-sidebarToggle@2x.png delete mode 100644 pdf.js/images/toolbarButton-viewAttachments.png create mode 100644 pdf.js/images/toolbarButton-viewAttachments.svg delete mode 100644 pdf.js/images/toolbarButton-viewAttachments@2x.png create mode 100644 pdf.js/images/toolbarButton-viewLayers.svg delete mode 100644 pdf.js/images/toolbarButton-viewOutline-rtl.png delete mode 100644 pdf.js/images/toolbarButton-viewOutline-rtl@2x.png delete mode 100644 pdf.js/images/toolbarButton-viewOutline.png create mode 100644 pdf.js/images/toolbarButton-viewOutline.svg delete mode 100644 pdf.js/images/toolbarButton-viewOutline@2x.png delete mode 100644 pdf.js/images/toolbarButton-viewThumbnail.png create mode 100644 pdf.js/images/toolbarButton-viewThumbnail.svg delete mode 100644 pdf.js/images/toolbarButton-viewThumbnail@2x.png delete mode 100644 pdf.js/images/toolbarButton-zoomIn.png create mode 100644 pdf.js/images/toolbarButton-zoomIn.svg delete mode 100644 pdf.js/images/toolbarButton-zoomIn@2x.png delete mode 100644 pdf.js/images/toolbarButton-zoomOut.png create mode 100644 pdf.js/images/toolbarButton-zoomOut.svg delete mode 100644 pdf.js/images/toolbarButton-zoomOut@2x.png delete mode 100644 pdf.js/images/treeitem-collapsed-rtl.png delete mode 100644 pdf.js/images/treeitem-collapsed-rtl@2x.png delete mode 100644 pdf.js/images/treeitem-collapsed.png create mode 100644 pdf.js/images/treeitem-collapsed.svg delete mode 100644 pdf.js/images/treeitem-collapsed@2x.png delete mode 100644 pdf.js/images/treeitem-expanded.png create mode 100644 pdf.js/images/treeitem-expanded.svg delete mode 100644 pdf.js/images/treeitem-expanded@2x.png delete mode 100644 pdf.js/l10n.js create mode 100644 pdf.js/locale/ach/viewer.ftl delete mode 100644 pdf.js/locale/ach/viewer.properties create mode 100644 pdf.js/locale/af/viewer.ftl delete mode 100644 pdf.js/locale/af/viewer.properties delete mode 100644 pdf.js/locale/ak/viewer.properties create mode 100644 pdf.js/locale/an/viewer.ftl delete mode 100644 pdf.js/locale/an/viewer.properties create mode 100644 pdf.js/locale/ar/viewer.ftl delete mode 100644 pdf.js/locale/ar/viewer.properties delete mode 100644 pdf.js/locale/as/viewer.properties create mode 100644 pdf.js/locale/ast/viewer.ftl delete mode 100644 pdf.js/locale/ast/viewer.properties create mode 100644 pdf.js/locale/az/viewer.ftl delete mode 100644 pdf.js/locale/az/viewer.properties create mode 100644 pdf.js/locale/be/viewer.ftl delete mode 100644 pdf.js/locale/be/viewer.properties create mode 100644 pdf.js/locale/bg/viewer.ftl delete mode 100644 pdf.js/locale/bg/viewer.properties delete mode 100644 pdf.js/locale/bn-BD/viewer.properties delete mode 100644 pdf.js/locale/bn-IN/viewer.properties create mode 100644 pdf.js/locale/bn/viewer.ftl create mode 100644 pdf.js/locale/bo/viewer.ftl create mode 100644 pdf.js/locale/br/viewer.ftl delete mode 100644 pdf.js/locale/br/viewer.properties create mode 100644 pdf.js/locale/brx/viewer.ftl delete mode 100644 pdf.js/locale/brx/viewer.properties create mode 100644 pdf.js/locale/bs/viewer.ftl delete mode 100644 pdf.js/locale/bs/viewer.properties create mode 100644 pdf.js/locale/ca/viewer.ftl delete mode 100644 pdf.js/locale/ca/viewer.properties create mode 100644 pdf.js/locale/cak/viewer.ftl delete mode 100644 pdf.js/locale/cak/viewer.properties create mode 100644 pdf.js/locale/ckb/viewer.ftl delete mode 100644 pdf.js/locale/crh/viewer.properties create mode 100644 pdf.js/locale/cs/viewer.ftl delete mode 100644 pdf.js/locale/cs/viewer.properties delete mode 100644 pdf.js/locale/csb/viewer.properties create mode 100644 pdf.js/locale/cy/viewer.ftl delete mode 100644 pdf.js/locale/cy/viewer.properties create mode 100644 pdf.js/locale/da/viewer.ftl delete mode 100644 pdf.js/locale/da/viewer.properties create mode 100644 pdf.js/locale/de/viewer.ftl delete mode 100644 pdf.js/locale/de/viewer.properties create mode 100644 pdf.js/locale/dsb/viewer.ftl create mode 100644 pdf.js/locale/el/viewer.ftl delete mode 100644 pdf.js/locale/el/viewer.properties create mode 100644 pdf.js/locale/en-CA/viewer.ftl delete mode 100644 pdf.js/locale/en-CA/viewer.properties create mode 100644 pdf.js/locale/en-GB/viewer.ftl delete mode 100644 pdf.js/locale/en-GB/viewer.properties create mode 100644 pdf.js/locale/en-US/viewer.ftl delete mode 100644 pdf.js/locale/en-US/viewer.properties delete mode 100644 pdf.js/locale/en-ZA/viewer.properties create mode 100644 pdf.js/locale/eo/viewer.ftl delete mode 100644 pdf.js/locale/eo/viewer.properties create mode 100644 pdf.js/locale/es-AR/viewer.ftl delete mode 100644 pdf.js/locale/es-AR/viewer.properties create mode 100644 pdf.js/locale/es-CL/viewer.ftl delete mode 100644 pdf.js/locale/es-CL/viewer.properties create mode 100644 pdf.js/locale/es-ES/viewer.ftl delete mode 100644 pdf.js/locale/es-ES/viewer.properties create mode 100644 pdf.js/locale/es-MX/viewer.ftl delete mode 100644 pdf.js/locale/es-MX/viewer.properties create mode 100644 pdf.js/locale/et/viewer.ftl delete mode 100644 pdf.js/locale/et/viewer.properties create mode 100644 pdf.js/locale/eu/viewer.ftl delete mode 100644 pdf.js/locale/eu/viewer.properties create mode 100644 pdf.js/locale/fa/viewer.ftl delete mode 100644 pdf.js/locale/fa/viewer.properties create mode 100644 pdf.js/locale/ff/viewer.ftl delete mode 100644 pdf.js/locale/ff/viewer.properties create mode 100644 pdf.js/locale/fi/viewer.ftl delete mode 100644 pdf.js/locale/fi/viewer.properties create mode 100644 pdf.js/locale/fr/viewer.ftl delete mode 100644 pdf.js/locale/fr/viewer.properties create mode 100644 pdf.js/locale/fur/viewer.ftl create mode 100644 pdf.js/locale/fy-NL/viewer.ftl delete mode 100644 pdf.js/locale/fy-NL/viewer.properties create mode 100644 pdf.js/locale/ga-IE/viewer.ftl delete mode 100644 pdf.js/locale/ga-IE/viewer.properties create mode 100644 pdf.js/locale/gd/viewer.ftl delete mode 100644 pdf.js/locale/gd/viewer.properties create mode 100644 pdf.js/locale/gl/viewer.ftl delete mode 100644 pdf.js/locale/gl/viewer.properties create mode 100644 pdf.js/locale/gn/viewer.ftl delete mode 100644 pdf.js/locale/gn/viewer.properties create mode 100644 pdf.js/locale/gu-IN/viewer.ftl delete mode 100644 pdf.js/locale/gu-IN/viewer.properties create mode 100644 pdf.js/locale/he/viewer.ftl delete mode 100644 pdf.js/locale/he/viewer.properties create mode 100644 pdf.js/locale/hi-IN/viewer.ftl delete mode 100644 pdf.js/locale/hi-IN/viewer.properties create mode 100644 pdf.js/locale/hr/viewer.ftl delete mode 100644 pdf.js/locale/hr/viewer.properties create mode 100644 pdf.js/locale/hsb/viewer.ftl delete mode 100644 pdf.js/locale/hsb/viewer.properties delete mode 100644 pdf.js/locale/hto/viewer.properties create mode 100644 pdf.js/locale/hu/viewer.ftl delete mode 100644 pdf.js/locale/hu/viewer.properties create mode 100644 pdf.js/locale/hy-AM/viewer.ftl delete mode 100644 pdf.js/locale/hy-AM/viewer.properties create mode 100644 pdf.js/locale/hye/viewer.ftl create mode 100644 pdf.js/locale/ia/viewer.ftl delete mode 100644 pdf.js/locale/ia/viewer.properties create mode 100644 pdf.js/locale/id/viewer.ftl delete mode 100644 pdf.js/locale/id/viewer.properties create mode 100644 pdf.js/locale/is/viewer.ftl delete mode 100644 pdf.js/locale/is/viewer.properties create mode 100644 pdf.js/locale/it/viewer.ftl delete mode 100644 pdf.js/locale/it/viewer.properties create mode 100644 pdf.js/locale/ja/viewer.ftl delete mode 100644 pdf.js/locale/ja/viewer.properties create mode 100644 pdf.js/locale/ka/viewer.ftl delete mode 100644 pdf.js/locale/ka/viewer.properties create mode 100644 pdf.js/locale/kab/viewer.ftl delete mode 100644 pdf.js/locale/kab/viewer.properties create mode 100644 pdf.js/locale/kk/viewer.ftl delete mode 100644 pdf.js/locale/kk/viewer.properties create mode 100644 pdf.js/locale/km/viewer.ftl delete mode 100644 pdf.js/locale/km/viewer.properties create mode 100644 pdf.js/locale/kn/viewer.ftl delete mode 100644 pdf.js/locale/kn/viewer.properties create mode 100644 pdf.js/locale/ko/viewer.ftl delete mode 100644 pdf.js/locale/ko/viewer.properties delete mode 100644 pdf.js/locale/kok/viewer.properties delete mode 100644 pdf.js/locale/ks/viewer.properties delete mode 100644 pdf.js/locale/ku/viewer.properties delete mode 100644 pdf.js/locale/lg/viewer.properties create mode 100644 pdf.js/locale/lij/viewer.ftl delete mode 100644 pdf.js/locale/lij/viewer.properties create mode 100644 pdf.js/locale/lo/viewer.ftl delete mode 100644 pdf.js/locale/lo/viewer.properties create mode 100644 pdf.js/locale/locale.json delete mode 100644 pdf.js/locale/locale.properties create mode 100644 pdf.js/locale/lt/viewer.ftl delete mode 100644 pdf.js/locale/lt/viewer.properties create mode 100644 pdf.js/locale/ltg/viewer.ftl delete mode 100644 pdf.js/locale/ltg/viewer.properties create mode 100644 pdf.js/locale/lv/viewer.ftl delete mode 100644 pdf.js/locale/lv/viewer.properties delete mode 100644 pdf.js/locale/mai/viewer.properties create mode 100644 pdf.js/locale/meh/viewer.ftl delete mode 100644 pdf.js/locale/meh/viewer.properties create mode 100644 pdf.js/locale/mk/viewer.ftl delete mode 100644 pdf.js/locale/mk/viewer.properties delete mode 100644 pdf.js/locale/ml/viewer.properties delete mode 100644 pdf.js/locale/mn/viewer.properties create mode 100644 pdf.js/locale/mr/viewer.ftl delete mode 100644 pdf.js/locale/mr/viewer.properties create mode 100644 pdf.js/locale/ms/viewer.ftl delete mode 100644 pdf.js/locale/ms/viewer.properties create mode 100644 pdf.js/locale/my/viewer.ftl delete mode 100644 pdf.js/locale/my/viewer.properties create mode 100644 pdf.js/locale/nb-NO/viewer.ftl delete mode 100644 pdf.js/locale/nb-NO/viewer.properties create mode 100644 pdf.js/locale/ne-NP/viewer.ftl delete mode 100644 pdf.js/locale/ne-NP/viewer.properties create mode 100644 pdf.js/locale/nl/viewer.ftl delete mode 100644 pdf.js/locale/nl/viewer.properties create mode 100644 pdf.js/locale/nn-NO/viewer.ftl delete mode 100644 pdf.js/locale/nn-NO/viewer.properties delete mode 100644 pdf.js/locale/nso/viewer.properties create mode 100644 pdf.js/locale/oc/viewer.ftl delete mode 100644 pdf.js/locale/oc/viewer.properties delete mode 100644 pdf.js/locale/or/viewer.properties create mode 100644 pdf.js/locale/pa-IN/viewer.ftl delete mode 100644 pdf.js/locale/pa-IN/viewer.properties create mode 100644 pdf.js/locale/pl/viewer.ftl delete mode 100644 pdf.js/locale/pl/viewer.properties create mode 100644 pdf.js/locale/pt-BR/viewer.ftl delete mode 100644 pdf.js/locale/pt-BR/viewer.properties create mode 100644 pdf.js/locale/pt-PT/viewer.ftl delete mode 100644 pdf.js/locale/pt-PT/viewer.properties create mode 100644 pdf.js/locale/rm/viewer.ftl delete mode 100644 pdf.js/locale/rm/viewer.properties create mode 100644 pdf.js/locale/ro/viewer.ftl delete mode 100644 pdf.js/locale/ro/viewer.properties create mode 100644 pdf.js/locale/ru/viewer.ftl delete mode 100644 pdf.js/locale/ru/viewer.properties delete mode 100644 pdf.js/locale/rw/viewer.properties delete mode 100644 pdf.js/locale/sah/viewer.properties create mode 100644 pdf.js/locale/sat/viewer.ftl delete mode 100644 pdf.js/locale/sat/viewer.properties create mode 100644 pdf.js/locale/sc/viewer.ftl create mode 100644 pdf.js/locale/scn/viewer.ftl create mode 100644 pdf.js/locale/sco/viewer.ftl create mode 100644 pdf.js/locale/si/viewer.ftl delete mode 100644 pdf.js/locale/si/viewer.properties create mode 100644 pdf.js/locale/sk/viewer.ftl delete mode 100644 pdf.js/locale/sk/viewer.properties create mode 100644 pdf.js/locale/skr/viewer.ftl create mode 100644 pdf.js/locale/sl/viewer.ftl delete mode 100644 pdf.js/locale/sl/viewer.properties create mode 100644 pdf.js/locale/son/viewer.ftl delete mode 100644 pdf.js/locale/son/viewer.properties create mode 100644 pdf.js/locale/sq/viewer.ftl delete mode 100644 pdf.js/locale/sq/viewer.properties create mode 100644 pdf.js/locale/sr/viewer.ftl delete mode 100644 pdf.js/locale/sr/viewer.properties create mode 100644 pdf.js/locale/sv-SE/viewer.ftl delete mode 100644 pdf.js/locale/sv-SE/viewer.properties delete mode 100644 pdf.js/locale/sw/viewer.properties create mode 100644 pdf.js/locale/szl/viewer.ftl delete mode 100644 pdf.js/locale/ta-LK/viewer.properties create mode 100644 pdf.js/locale/ta/viewer.ftl delete mode 100644 pdf.js/locale/ta/viewer.properties create mode 100644 pdf.js/locale/te/viewer.ftl delete mode 100644 pdf.js/locale/te/viewer.properties create mode 100644 pdf.js/locale/tg/viewer.ftl create mode 100644 pdf.js/locale/th/viewer.ftl delete mode 100644 pdf.js/locale/th/viewer.properties create mode 100644 pdf.js/locale/tl/viewer.ftl delete mode 100644 pdf.js/locale/tl/viewer.properties delete mode 100644 pdf.js/locale/tn/viewer.properties create mode 100644 pdf.js/locale/tr/viewer.ftl delete mode 100644 pdf.js/locale/tr/viewer.properties create mode 100644 pdf.js/locale/trs/viewer.ftl delete mode 100644 pdf.js/locale/tsz/viewer.properties create mode 100644 pdf.js/locale/uk/viewer.ftl delete mode 100644 pdf.js/locale/uk/viewer.properties create mode 100644 pdf.js/locale/ur/viewer.ftl delete mode 100644 pdf.js/locale/ur/viewer.properties create mode 100644 pdf.js/locale/uz/viewer.ftl delete mode 100644 pdf.js/locale/uz/viewer.properties create mode 100644 pdf.js/locale/vi/viewer.ftl delete mode 100644 pdf.js/locale/vi/viewer.properties create mode 100644 pdf.js/locale/wo/viewer.ftl delete mode 100644 pdf.js/locale/wo/viewer.properties create mode 100644 pdf.js/locale/xh/viewer.ftl delete mode 100644 pdf.js/locale/xh/viewer.properties delete mode 100644 pdf.js/locale/zam/viewer.properties create mode 100644 pdf.js/locale/zh-CN/viewer.ftl delete mode 100644 pdf.js/locale/zh-CN/viewer.properties create mode 100644 pdf.js/locale/zh-TW/viewer.ftl delete mode 100644 pdf.js/locale/zh-TW/viewer.properties delete mode 100644 pdf.js/locale/zu/viewer.properties delete mode 100644 pdf.js/minify.py delete mode 100644 pdf.js/pdf.js create mode 100644 pdf.js/pdf.mjs create mode 100644 pdf.js/pdf.mjs.map create mode 100644 pdf.js/pdf.sandbox.mjs create mode 100644 pdf.js/pdf.sandbox.mjs.map delete mode 100644 pdf.js/pdf.worker.js create mode 100644 pdf.js/pdf.worker.mjs create mode 100644 pdf.js/pdf.worker.mjs.map delete mode 100644 pdf.js/viewer.js create mode 100644 pdf.js/viewer.mjs create mode 100644 pdf.js/viewer.mjs.map diff --git a/pdf.js/compatibility.js b/pdf.js/compatibility.js deleted file mode 100644 index 1119a27..0000000 --- a/pdf.js/compatibility.js +++ /dev/null @@ -1,593 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* globals VBArray, PDFJS */ - -'use strict'; - -// Initializing PDFJS global object here, it case if we need to change/disable -// some PDF.js features, e.g. range requests -if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; -} - -// Checking if the typed arrays are supported -// Support: iOS<6.0 (subarray), IE<10, Android<4.0 -(function checkTypedArrayCompatibility() { - if (typeof Uint8Array !== 'undefined') { - // Support: iOS<6.0 - if (typeof Uint8Array.prototype.subarray === 'undefined') { - Uint8Array.prototype.subarray = function subarray(start, end) { - return new Uint8Array(this.slice(start, end)); - }; - Float32Array.prototype.subarray = function subarray(start, end) { - return new Float32Array(this.slice(start, end)); - }; - } - - // Support: Android<4.1 - if (typeof Float64Array === 'undefined') { - window.Float64Array = Float32Array; - } - return; - } - - function subarray(start, end) { - return new TypedArray(this.slice(start, end)); - } - - function setArrayOffset(array, offset) { - if (arguments.length < 2) { - offset = 0; - } - for (var i = 0, n = array.length; i < n; ++i, ++offset) { - this[offset] = array[i] & 0xFF; - } - } - - function TypedArray(arg1) { - var result, i, n; - if (typeof arg1 === 'number') { - result = []; - for (i = 0; i < arg1; ++i) { - result[i] = 0; - } - } else if ('slice' in arg1) { - result = arg1.slice(0); - } else { - result = []; - for (i = 0, n = arg1.length; i < n; ++i) { - result[i] = arg1[i]; - } - } - - result.subarray = subarray; - result.buffer = result; - result.byteLength = result.length; - result.set = setArrayOffset; - - if (typeof arg1 === 'object' && arg1.buffer) { - result.buffer = arg1.buffer; - } - return result; - } - - window.Uint8Array = TypedArray; - window.Int8Array = TypedArray; - - // we don't need support for set, byteLength for 32-bit array - // so we can use the TypedArray as well - window.Uint32Array = TypedArray; - window.Int32Array = TypedArray; - window.Uint16Array = TypedArray; - window.Float32Array = TypedArray; - window.Float64Array = TypedArray; -})(); - -// URL = URL || webkitURL -// Support: Safari<7, Android 4.2+ -(function normalizeURLObject() { - if (!window.URL) { - window.URL = window.webkitURL; - } -})(); - -// Object.defineProperty()? -// Support: Android<4.0, Safari<5.1 -(function checkObjectDefinePropertyCompatibility() { - if (typeof Object.defineProperty !== 'undefined') { - var definePropertyPossible = true; - try { - // some browsers (e.g. safari) cannot use defineProperty() on DOM objects - // and thus the native version is not sufficient - Object.defineProperty(new Image(), 'id', { value: 'test' }); - // ... another test for android gb browser for non-DOM objects - var Test = function Test() {}; - Test.prototype = { get id() { } }; - Object.defineProperty(new Test(), 'id', - { value: '', configurable: true, enumerable: true, writable: false }); - } catch (e) { - definePropertyPossible = false; - } - if (definePropertyPossible) { - return; - } - } - - Object.defineProperty = function objectDefineProperty(obj, name, def) { - delete obj[name]; - if ('get' in def) { - obj.__defineGetter__(name, def['get']); - } - if ('set' in def) { - obj.__defineSetter__(name, def['set']); - } - if ('value' in def) { - obj.__defineSetter__(name, function objectDefinePropertySetter(value) { - this.__defineGetter__(name, function objectDefinePropertyGetter() { - return value; - }); - return value; - }); - obj[name] = def.value; - } - }; -})(); - - -// No XMLHttpRequest#response? -// Support: IE<11, Android <4.0 -(function checkXMLHttpRequestResponseCompatibility() { - var xhrPrototype = XMLHttpRequest.prototype; - var xhr = new XMLHttpRequest(); - if (!('overrideMimeType' in xhr)) { - // IE10 might have response, but not overrideMimeType - // Support: IE10 - Object.defineProperty(xhrPrototype, 'overrideMimeType', { - value: function xmlHttpRequestOverrideMimeType(mimeType) {} - }); - } - if ('responseType' in xhr) { - return; - } - - // The worker will be using XHR, so we can save time and disable worker. - PDFJS.disableWorker = true; - - Object.defineProperty(xhrPrototype, 'responseType', { - get: function xmlHttpRequestGetResponseType() { - return this._responseType || 'text'; - }, - set: function xmlHttpRequestSetResponseType(value) { - if (value === 'text' || value === 'arraybuffer') { - this._responseType = value; - if (value === 'arraybuffer' && - typeof this.overrideMimeType === 'function') { - this.overrideMimeType('text/plain; charset=x-user-defined'); - } - } - } - }); - - // Support: IE9 - if (typeof VBArray !== 'undefined') { - Object.defineProperty(xhrPrototype, 'response', { - get: function xmlHttpRequestResponseGet() { - if (this.responseType === 'arraybuffer') { - return new Uint8Array(new VBArray(this.responseBody).toArray()); - } else { - return this.responseText; - } - } - }); - return; - } - - Object.defineProperty(xhrPrototype, 'response', { - get: function xmlHttpRequestResponseGet() { - if (this.responseType !== 'arraybuffer') { - return this.responseText; - } - var text = this.responseText; - var i, n = text.length; - var result = new Uint8Array(n); - for (i = 0; i < n; ++i) { - result[i] = text.charCodeAt(i) & 0xFF; - } - return result.buffer; - } - }); -})(); - -// window.btoa (base64 encode function) ? -// Support: IE<10 -(function checkWindowBtoaCompatibility() { - if ('btoa' in window) { - return; - } - - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - window.btoa = function windowBtoa(chars) { - var buffer = ''; - var i, n; - for (i = 0, n = chars.length; i < n; i += 3) { - var b1 = chars.charCodeAt(i) & 0xFF; - var b2 = chars.charCodeAt(i + 1) & 0xFF; - var b3 = chars.charCodeAt(i + 2) & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < n ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < n ? (b3 & 0x3F) : 64; - buffer += (digits.charAt(d1) + digits.charAt(d2) + - digits.charAt(d3) + digits.charAt(d4)); - } - return buffer; - }; -})(); - -// window.atob (base64 encode function)? -// Support: IE<10 -(function checkWindowAtobCompatibility() { - if ('atob' in window) { - return; - } - - // https://github.com/davidchambers/Base64.js - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - window.atob = function (input) { - input = input.replace(/=+$/, ''); - if (input.length % 4 === 1) { - throw new Error('bad atob input'); - } - for ( - // initialize result and counters - var bc = 0, bs, buffer, idx = 0, output = ''; - // get next character - buffer = input.charAt(idx++); - // character found in table? - // initialize bit storage and add its ascii value - ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - // and if not first of each 4 characters, - // convert the first 8 bits to one ascii character - bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 - ) { - // try to find character in table (0-63, not found => -1) - buffer = digits.indexOf(buffer); - } - return output; - }; -})(); - -// Function.prototype.bind? -// Support: Android<4.0, iOS<6.0 -(function checkFunctionPrototypeBindCompatibility() { - if (typeof Function.prototype.bind !== 'undefined') { - return; - } - - Function.prototype.bind = function functionPrototypeBind(obj) { - var fn = this, headArgs = Array.prototype.slice.call(arguments, 1); - var bound = function functionPrototypeBindBound() { - var args = headArgs.concat(Array.prototype.slice.call(arguments)); - return fn.apply(obj, args); - }; - return bound; - }; -})(); - -// HTMLElement dataset property -// Support: IE<11, Safari<5.1, Android<4.0 -(function checkDatasetProperty() { - var div = document.createElement('div'); - if ('dataset' in div) { - return; // dataset property exists - } - - Object.defineProperty(HTMLElement.prototype, 'dataset', { - get: function() { - if (this._dataset) { - return this._dataset; - } - - var dataset = {}; - for (var j = 0, jj = this.attributes.length; j < jj; j++) { - var attribute = this.attributes[j]; - if (attribute.name.substring(0, 5) !== 'data-') { - continue; - } - var key = attribute.name.substring(5).replace(/\-([a-z])/g, - function(all, ch) { - return ch.toUpperCase(); - }); - dataset[key] = attribute.value; - } - - Object.defineProperty(this, '_dataset', { - value: dataset, - writable: false, - enumerable: false - }); - return dataset; - }, - enumerable: true - }); -})(); - -// HTMLElement classList property -// Support: IE<10, Android<4.0, iOS<5.0 -(function checkClassListProperty() { - var div = document.createElement('div'); - if ('classList' in div) { - return; // classList property exists - } - - function changeList(element, itemName, add, remove) { - var s = element.className || ''; - var list = s.split(/\s+/g); - if (list[0] === '') { - list.shift(); - } - var index = list.indexOf(itemName); - if (index < 0 && add) { - list.push(itemName); - } - if (index >= 0 && remove) { - list.splice(index, 1); - } - element.className = list.join(' '); - return (index >= 0); - } - - var classListPrototype = { - add: function(name) { - changeList(this.element, name, true, false); - }, - contains: function(name) { - return changeList(this.element, name, false, false); - }, - remove: function(name) { - changeList(this.element, name, false, true); - }, - toggle: function(name) { - changeList(this.element, name, true, true); - } - }; - - Object.defineProperty(HTMLElement.prototype, 'classList', { - get: function() { - if (this._classList) { - return this._classList; - } - - var classList = Object.create(classListPrototype, { - element: { - value: this, - writable: false, - enumerable: true - } - }); - Object.defineProperty(this, '_classList', { - value: classList, - writable: false, - enumerable: false - }); - return classList; - }, - enumerable: true - }); -})(); - -// Check console compatibility -// In older IE versions the console object is not available -// unless console is open. -// Support: IE<10 -(function checkConsoleCompatibility() { - if (!('console' in window)) { - window.console = { - log: function() {}, - error: function() {}, - warn: function() {} - }; - } else if (!('bind' in console.log)) { - // native functions in IE9 might not have bind - console.log = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.log); - console.error = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.error); - console.warn = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.warn); - } -})(); - -// Check onclick compatibility in Opera -// Support: Opera<15 -(function checkOnClickCompatibility() { - // workaround for reported Opera bug DSK-354448: - // onclick fires on disabled buttons with opaque content - function ignoreIfTargetDisabled(event) { - if (isDisabled(event.target)) { - event.stopPropagation(); - } - } - function isDisabled(node) { - return node.disabled || (node.parentNode && isDisabled(node.parentNode)); - } - if (navigator.userAgent.indexOf('Opera') !== -1) { - // use browser detection since we cannot feature-check this bug - document.addEventListener('click', ignoreIfTargetDisabled, true); - } -})(); - -// Checks if possible to use URL.createObjectURL() -// Support: IE -(function checkOnBlobSupport() { - // sometimes IE loosing the data created with createObjectURL(), see #3977 - if (navigator.userAgent.indexOf('Trident') >= 0) { - PDFJS.disableCreateObjectURL = true; - } -})(); - -// Checks if navigator.language is supported -(function checkNavigatorLanguage() { - if ('language' in navigator) { - return; - } - PDFJS.locale = navigator.userLanguage || 'en-US'; -})(); - -(function checkRangeRequests() { - // Safari has issues with cached range requests see: - // https://github.com/mozilla/pdf.js/issues/3260 - // Last tested with version 6.0.4. - // Support: Safari 6.0+ - var isSafari = Object.prototype.toString.call( - window.HTMLElement).indexOf('Constructor') > 0; - - // Older versions of Android (pre 3.0) has issues with range requests, see: - // https://github.com/mozilla/pdf.js/issues/3381. - // Make sure that we only match webkit-based Android browsers, - // since Firefox/Fennec works as expected. - // Support: Android<3.0 - var regex = /Android\s[0-2][^\d]/; - var isOldAndroid = regex.test(navigator.userAgent); - - // Range requests are broken in Chrome 39 and 40, https://crbug.com/442318 - var isChromeWithRangeBug = /Chrome\/(39|40)\./.test(navigator.userAgent); - - if (isSafari || isOldAndroid || isChromeWithRangeBug) { - PDFJS.disableRange = true; - PDFJS.disableStream = true; - } -})(); - -// Check if the browser supports manipulation of the history. -// Support: IE<10, Android<4.2 -(function checkHistoryManipulation() { - // Android 2.x has so buggy pushState support that it was removed in - // Android 3.0 and restored as late as in Android 4.2. - // Support: Android 2.x - if (!history.pushState || navigator.userAgent.indexOf('Android 2.') >= 0) { - PDFJS.disableHistory = true; - } -})(); - -// Support: IE<11, Chrome<21, Android<4.4, Safari<6 -(function checkSetPresenceInImageData() { - // IE < 11 will use window.CanvasPixelArray which lacks set function. - if (window.CanvasPixelArray) { - if (typeof window.CanvasPixelArray.prototype.set !== 'function') { - window.CanvasPixelArray.prototype.set = function(arr) { - for (var i = 0, ii = this.length; i < ii; i++) { - this[i] = arr[i]; - } - }; - } - } else { - // Old Chrome and Android use an inaccessible CanvasPixelArray prototype. - // Because we cannot feature detect it, we rely on user agent parsing. - var polyfill = false, versionMatch; - if (navigator.userAgent.indexOf('Chrom') >= 0) { - versionMatch = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); - // Chrome < 21 lacks the set function. - polyfill = versionMatch && parseInt(versionMatch[2]) < 21; - } else if (navigator.userAgent.indexOf('Android') >= 0) { - // Android < 4.4 lacks the set function. - // Android >= 4.4 will contain Chrome in the user agent, - // thus pass the Chrome check above and not reach this block. - polyfill = /Android\s[0-4][^\d]/g.test(navigator.userAgent); - } else if (navigator.userAgent.indexOf('Safari') >= 0) { - versionMatch = navigator.userAgent. - match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//); - // Safari < 6 lacks the set function. - polyfill = versionMatch && parseInt(versionMatch[1]) < 6; - } - - if (polyfill) { - var contextPrototype = window.CanvasRenderingContext2D.prototype; - var createImageData = contextPrototype.createImageData; - contextPrototype.createImageData = function(w, h) { - var imageData = createImageData.call(this, w, h); - imageData.data.set = function(arr) { - for (var i = 0, ii = this.length; i < ii; i++) { - this[i] = arr[i]; - } - }; - return imageData; - }; - // this closure will be kept referenced, so clear its vars - contextPrototype = null; - } - } -})(); - -// Support: IE<10, Android<4.0, iOS -(function checkRequestAnimationFrame() { - function fakeRequestAnimationFrame(callback) { - window.setTimeout(callback, 20); - } - - var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); - if (isIOS) { - // requestAnimationFrame on iOS is broken, replacing with fake one. - window.requestAnimationFrame = fakeRequestAnimationFrame; - return; - } - if ('requestAnimationFrame' in window) { - return; - } - window.requestAnimationFrame = - window.mozRequestAnimationFrame || - window.webkitRequestAnimationFrame || - fakeRequestAnimationFrame; -})(); - -(function checkCanvasSizeLimitation() { - var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); - var isAndroid = /Android/g.test(navigator.userAgent); - if (isIOS || isAndroid) { - // 5MP - PDFJS.maxCanvasPixels = 5242880; - } -})(); - -// Disable fullscreen support for certain problematic configurations. -// Support: IE11+ (when embedded). -(function checkFullscreenSupport() { - var isEmbeddedIE = (navigator.userAgent.indexOf('Trident') >= 0 && - window.parent !== window); - if (isEmbeddedIE) { - PDFJS.disableFullscreen = true; - } -})(); - -// Provides document.currentScript support -// Support: IE, Chrome<29. -(function checkCurrentScript() { - if ('currentScript' in document) { - return; - } - Object.defineProperty(document, 'currentScript', { - get: function () { - var scripts = document.getElementsByTagName('script'); - return scripts[scripts.length - 1]; - }, - enumerable: true, - configurable: true - }); -})(); diff --git a/pdf.js/debugger.css b/pdf.js/debugger.css new file mode 100644 index 0000000..b9d9f81 --- /dev/null +++ b/pdf.js/debugger.css @@ -0,0 +1,111 @@ +/* Copyright 2014 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +:root { + --panel-width: 300px; +} + +#PDFBug, +#PDFBug :is(input, button, select) { + font: message-box; +} +#PDFBug { + background-color: rgb(255 255 255); + border: 1px solid rgb(102 102 102); + position: fixed; + top: 32px; + right: 0; + bottom: 0; + font-size: 10px; + padding: 0; + width: var(--panel-width); +} +#PDFBug .controls { + background: rgb(238 238 238); + border-bottom: 1px solid rgb(102 102 102); + padding: 3px; +} +#PDFBug .panels { + inset: 27px 0 0; + overflow: auto; + position: absolute; +} +#PDFBug .panels > div { + padding: 5px; +} +#PDFBug button.active { + font-weight: bold; +} +.debuggerShowText, +.debuggerHideText:hover { + background-color: rgb(255 255 0 / 0.25); +} +#PDFBug .stats { + font-family: courier; + font-size: 10px; + white-space: pre; +} +#PDFBug .stats .title { + font-weight: bold; +} +#PDFBug table { + font-size: 10px; + white-space: pre; +} +#PDFBug table.showText { + border-collapse: collapse; + text-align: center; +} +#PDFBug table.showText, +#PDFBug table.showText :is(tr, td) { + border: 1px solid black; + padding: 1px; +} +#PDFBug table.showText td.advance { + color: grey; +} + +#viewer.textLayer-visible .textLayer { + opacity: 1; +} + +#viewer.textLayer-visible .canvasWrapper { + background-color: rgb(128 255 128); +} + +#viewer.textLayer-visible .canvasWrapper canvas { + mix-blend-mode: screen; +} + +#viewer.textLayer-visible .textLayer span { + background-color: rgb(255 255 0 / 0.1); + color: rgb(0 0 0); + border: solid 1px rgb(255 0 0 / 0.5); + box-sizing: border-box; +} + +#viewer.textLayer-visible .textLayer span[aria-owns] { + background-color: rgb(255 0 0 / 0.3); +} + +#viewer.textLayer-hover .textLayer span:hover { + background-color: rgb(255 255 255); + color: rgb(0 0 0); +} + +#viewer.textLayer-shadow .textLayer span { + background-color: rgb(255 255 255 / 0.6); + color: rgb(0 0 0); +} diff --git a/pdf.js/debugger.js b/pdf.js/debugger.js deleted file mode 100644 index 501daa8..0000000 --- a/pdf.js/debugger.js +++ /dev/null @@ -1,615 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* eslint-disable no-var */ - -'use strict'; - -var FontInspector = (function FontInspectorClosure() { - var fonts, createObjectURL; - var active = false; - var fontAttribute = 'data-font-name'; - function removeSelection() { - let divs = document.querySelectorAll(`span[${fontAttribute}]`); - for (let div of divs) { - div.className = ''; - } - } - function resetSelection() { - let divs = document.querySelectorAll(`span[${fontAttribute}]`); - for (let div of divs) { - div.className = 'debuggerHideText'; - } - } - function selectFont(fontName, show) { - let divs = document.querySelectorAll(`span[${fontAttribute}=${fontName}]`); - for (let div of divs) { - div.className = show ? 'debuggerShowText' : 'debuggerHideText'; - } - } - function textLayerClick(e) { - if (!e.target.dataset.fontName || - e.target.tagName.toUpperCase() !== 'SPAN') { - return; - } - var fontName = e.target.dataset.fontName; - var selects = document.getElementsByTagName('input'); - for (var i = 0; i < selects.length; ++i) { - var select = selects[i]; - if (select.dataset.fontName !== fontName) { - continue; - } - select.checked = !select.checked; - selectFont(fontName, select.checked); - select.scrollIntoView(); - } - } - return { - // Properties/functions needed by PDFBug. - id: 'FontInspector', - name: 'Font Inspector', - panel: null, - manager: null, - init: function init(pdfjsLib) { - var panel = this.panel; - panel.setAttribute('style', 'padding: 5px;'); - var tmp = document.createElement('button'); - tmp.addEventListener('click', resetSelection); - tmp.textContent = 'Refresh'; - panel.appendChild(tmp); - - fonts = document.createElement('div'); - panel.appendChild(fonts); - - createObjectURL = pdfjsLib.createObjectURL; - }, - cleanup: function cleanup() { - fonts.textContent = ''; - }, - enabled: false, - get active() { - return active; - }, - set active(value) { - active = value; - if (active) { - document.body.addEventListener('click', textLayerClick, true); - resetSelection(); - } else { - document.body.removeEventListener('click', textLayerClick, true); - removeSelection(); - } - }, - // FontInspector specific functions. - fontAdded: function fontAdded(fontObj, url) { - function properties(obj, list) { - var moreInfo = document.createElement('table'); - for (var i = 0; i < list.length; i++) { - var tr = document.createElement('tr'); - var td1 = document.createElement('td'); - td1.textContent = list[i]; - tr.appendChild(td1); - var td2 = document.createElement('td'); - td2.textContent = obj[list[i]].toString(); - tr.appendChild(td2); - moreInfo.appendChild(tr); - } - return moreInfo; - } - var moreInfo = properties(fontObj, ['name', 'type']); - var fontName = fontObj.loadedName; - var font = document.createElement('div'); - var name = document.createElement('span'); - name.textContent = fontName; - var download = document.createElement('a'); - if (url) { - url = /url\(['"]?([^\)"']+)/.exec(url); - download.href = url[1]; - } else if (fontObj.data) { - download.href = createObjectURL(fontObj.data, fontObj.mimeType); - } - download.textContent = 'Download'; - var logIt = document.createElement('a'); - logIt.href = ''; - logIt.textContent = 'Log'; - logIt.addEventListener('click', function(event) { - event.preventDefault(); - console.log(fontObj); - }); - var select = document.createElement('input'); - select.setAttribute('type', 'checkbox'); - select.dataset.fontName = fontName; - select.addEventListener('click', (function(select, fontName) { - return (function() { - selectFont(fontName, select.checked); - }); - })(select, fontName)); - font.appendChild(select); - font.appendChild(name); - font.appendChild(document.createTextNode(' ')); - font.appendChild(download); - font.appendChild(document.createTextNode(' ')); - font.appendChild(logIt); - font.appendChild(moreInfo); - fonts.appendChild(font); - // Somewhat of a hack, should probably add a hook for when the text layer - // is done rendering. - setTimeout(() => { - if (this.active) { - resetSelection(); - } - }, 2000); - }, - }; -})(); - -var opMap; - -// Manages all the page steppers. -var StepperManager = (function StepperManagerClosure() { - var steppers = []; - var stepperDiv = null; - var stepperControls = null; - var stepperChooser = null; - var breakPoints = Object.create(null); - return { - // Properties/functions needed by PDFBug. - id: 'Stepper', - name: 'Stepper', - panel: null, - manager: null, - init: function init(pdfjsLib) { - var self = this; - this.panel.setAttribute('style', 'padding: 5px;'); - stepperControls = document.createElement('div'); - stepperChooser = document.createElement('select'); - stepperChooser.addEventListener('change', function(event) { - self.selectStepper(this.value); - }); - stepperControls.appendChild(stepperChooser); - stepperDiv = document.createElement('div'); - this.panel.appendChild(stepperControls); - this.panel.appendChild(stepperDiv); - if (sessionStorage.getItem('pdfjsBreakPoints')) { - breakPoints = JSON.parse(sessionStorage.getItem('pdfjsBreakPoints')); - } - - opMap = Object.create(null); - for (var key in pdfjsLib.OPS) { - opMap[pdfjsLib.OPS[key]] = key; - } - }, - cleanup: function cleanup() { - stepperChooser.textContent = ''; - stepperDiv.textContent = ''; - steppers = []; - }, - enabled: false, - active: false, - // Stepper specific functions. - create: function create(pageIndex) { - var debug = document.createElement('div'); - debug.id = 'stepper' + pageIndex; - debug.setAttribute('hidden', true); - debug.className = 'stepper'; - stepperDiv.appendChild(debug); - var b = document.createElement('option'); - b.textContent = 'Page ' + (pageIndex + 1); - b.value = pageIndex; - stepperChooser.appendChild(b); - var initBreakPoints = breakPoints[pageIndex] || []; - var stepper = new Stepper(debug, pageIndex, initBreakPoints); - steppers.push(stepper); - if (steppers.length === 1) { - this.selectStepper(pageIndex, false); - } - return stepper; - }, - selectStepper: function selectStepper(pageIndex, selectPanel) { - var i; - pageIndex = pageIndex | 0; - if (selectPanel) { - this.manager.selectPanel(this); - } - for (i = 0; i < steppers.length; ++i) { - var stepper = steppers[i]; - if (stepper.pageIndex === pageIndex) { - stepper.panel.removeAttribute('hidden'); - } else { - stepper.panel.setAttribute('hidden', true); - } - } - var options = stepperChooser.options; - for (i = 0; i < options.length; ++i) { - var option = options[i]; - option.selected = (option.value | 0) === pageIndex; - } - }, - saveBreakPoints: function saveBreakPoints(pageIndex, bps) { - breakPoints[pageIndex] = bps; - sessionStorage.setItem('pdfjsBreakPoints', JSON.stringify(breakPoints)); - }, - }; -})(); - -// The stepper for each page's IRQueue. -var Stepper = (function StepperClosure() { - // Shorter way to create element and optionally set textContent. - function c(tag, textContent) { - var d = document.createElement(tag); - if (textContent) { - d.textContent = textContent; - } - return d; - } - - function simplifyArgs(args) { - if (typeof args === 'string') { - var MAX_STRING_LENGTH = 75; - return args.length <= MAX_STRING_LENGTH ? args : - args.substring(0, MAX_STRING_LENGTH) + '...'; - } - if (typeof args !== 'object' || args === null) { - return args; - } - if ('length' in args) { // array - var simpleArgs = [], i, ii; - var MAX_ITEMS = 10; - for (i = 0, ii = Math.min(MAX_ITEMS, args.length); i < ii; i++) { - simpleArgs.push(simplifyArgs(args[i])); - } - if (i < args.length) { - simpleArgs.push('...'); - } - return simpleArgs; - } - var simpleObj = {}; - for (var key in args) { - simpleObj[key] = simplifyArgs(args[key]); - } - return simpleObj; - } - - function Stepper(panel, pageIndex, initialBreakPoints) { - this.panel = panel; - this.breakPoint = 0; - this.nextBreakPoint = null; - this.pageIndex = pageIndex; - this.breakPoints = initialBreakPoints; - this.currentIdx = -1; - this.operatorListIdx = 0; - } - Stepper.prototype = { - init: function init(operatorList) { - var panel = this.panel; - var content = c('div', 'c=continue, s=step'); - var table = c('table'); - content.appendChild(table); - table.cellSpacing = 0; - var headerRow = c('tr'); - table.appendChild(headerRow); - headerRow.appendChild(c('th', 'Break')); - headerRow.appendChild(c('th', 'Idx')); - headerRow.appendChild(c('th', 'fn')); - headerRow.appendChild(c('th', 'args')); - panel.appendChild(content); - this.table = table; - this.updateOperatorList(operatorList); - }, - updateOperatorList: function updateOperatorList(operatorList) { - var self = this; - - function cboxOnClick() { - var x = +this.dataset.idx; - if (this.checked) { - self.breakPoints.push(x); - } else { - self.breakPoints.splice(self.breakPoints.indexOf(x), 1); - } - StepperManager.saveBreakPoints(self.pageIndex, self.breakPoints); - } - - var MAX_OPERATORS_COUNT = 15000; - if (this.operatorListIdx > MAX_OPERATORS_COUNT) { - return; - } - - var chunk = document.createDocumentFragment(); - var operatorsToDisplay = Math.min(MAX_OPERATORS_COUNT, - operatorList.fnArray.length); - for (var i = this.operatorListIdx; i < operatorsToDisplay; i++) { - var line = c('tr'); - line.className = 'line'; - line.dataset.idx = i; - chunk.appendChild(line); - var checked = this.breakPoints.includes(i); - var args = operatorList.argsArray[i] || []; - - var breakCell = c('td'); - var cbox = c('input'); - cbox.type = 'checkbox'; - cbox.className = 'points'; - cbox.checked = checked; - cbox.dataset.idx = i; - cbox.onclick = cboxOnClick; - - breakCell.appendChild(cbox); - line.appendChild(breakCell); - line.appendChild(c('td', i.toString())); - var fn = opMap[operatorList.fnArray[i]]; - var decArgs = args; - if (fn === 'showText') { - var glyphs = args[0]; - var newArgs = []; - var str = []; - for (var j = 0; j < glyphs.length; j++) { - var glyph = glyphs[j]; - if (typeof glyph === 'object' && glyph !== null) { - str.push(glyph.fontChar); - } else { - if (str.length > 0) { - newArgs.push(str.join('')); - str = []; - } - newArgs.push(glyph); // null or number - } - } - if (str.length > 0) { - newArgs.push(str.join('')); - } - decArgs = [newArgs]; - } - line.appendChild(c('td', fn)); - line.appendChild(c('td', JSON.stringify(simplifyArgs(decArgs)))); - } - if (operatorsToDisplay < operatorList.fnArray.length) { - line = c('tr'); - var lastCell = c('td', '...'); - lastCell.colspan = 4; - chunk.appendChild(lastCell); - } - this.operatorListIdx = operatorList.fnArray.length; - this.table.appendChild(chunk); - }, - getNextBreakPoint: function getNextBreakPoint() { - this.breakPoints.sort(function(a, b) { - return a - b; - }); - for (var i = 0; i < this.breakPoints.length; i++) { - if (this.breakPoints[i] > this.currentIdx) { - return this.breakPoints[i]; - } - } - return null; - }, - breakIt: function breakIt(idx, callback) { - StepperManager.selectStepper(this.pageIndex, true); - var self = this; - var dom = document; - self.currentIdx = idx; - var listener = function(e) { - switch (e.keyCode) { - case 83: // step - dom.removeEventListener('keydown', listener); - self.nextBreakPoint = self.currentIdx + 1; - self.goTo(-1); - callback(); - break; - case 67: // continue - dom.removeEventListener('keydown', listener); - var breakPoint = self.getNextBreakPoint(); - self.nextBreakPoint = breakPoint; - self.goTo(-1); - callback(); - break; - } - }; - dom.addEventListener('keydown', listener); - self.goTo(idx); - }, - goTo: function goTo(idx) { - var allRows = this.panel.getElementsByClassName('line'); - for (var x = 0, xx = allRows.length; x < xx; ++x) { - var row = allRows[x]; - if ((row.dataset.idx | 0) === idx) { - row.style.backgroundColor = 'rgb(251,250,207)'; - row.scrollIntoView(); - } else { - row.style.backgroundColor = null; - } - } - }, - }; - return Stepper; -})(); - -var Stats = (function Stats() { - var stats = []; - function clear(node) { - while (node.hasChildNodes()) { - node.removeChild(node.lastChild); - } - } - function getStatIndex(pageNumber) { - for (var i = 0, ii = stats.length; i < ii; ++i) { - if (stats[i].pageNumber === pageNumber) { - return i; - } - } - return false; - } - return { - // Properties/functions needed by PDFBug. - id: 'Stats', - name: 'Stats', - panel: null, - manager: null, - init(pdfjsLib) { - this.panel.setAttribute('style', 'padding: 5px;'); - }, - enabled: false, - active: false, - // Stats specific functions. - add(pageNumber, stat) { - if (!stat) { - return; - } - var statsIndex = getStatIndex(pageNumber); - if (statsIndex !== false) { - var b = stats[statsIndex]; - this.panel.removeChild(b.div); - stats.splice(statsIndex, 1); - } - var wrapper = document.createElement('div'); - wrapper.className = 'stats'; - var title = document.createElement('div'); - title.className = 'title'; - title.textContent = 'Page: ' + pageNumber; - var statsDiv = document.createElement('div'); - statsDiv.textContent = stat.toString(); - wrapper.appendChild(title); - wrapper.appendChild(statsDiv); - stats.push({ pageNumber, div: wrapper, }); - stats.sort(function(a, b) { - return a.pageNumber - b.pageNumber; - }); - clear(this.panel); - for (var i = 0, ii = stats.length; i < ii; ++i) { - this.panel.appendChild(stats[i].div); - } - }, - cleanup() { - stats = []; - clear(this.panel); - }, - }; -})(); - -// Manages all the debugging tools. -window.PDFBug = (function PDFBugClosure() { - var panelWidth = 300; - var buttons = []; - var activePanel = null; - - return { - tools: [ - FontInspector, - StepperManager, - Stats - ], - enable(ids) { - var all = false, tools = this.tools; - if (ids.length === 1 && ids[0] === 'all') { - all = true; - } - for (var i = 0; i < tools.length; ++i) { - var tool = tools[i]; - if (all || ids.includes(tool.id)) { - tool.enabled = true; - } - } - if (!all) { - // Sort the tools by the order they are enabled. - tools.sort(function(a, b) { - var indexA = ids.indexOf(a.id); - indexA = indexA < 0 ? tools.length : indexA; - var indexB = ids.indexOf(b.id); - indexB = indexB < 0 ? tools.length : indexB; - return indexA - indexB; - }); - } - }, - init(pdfjsLib, container) { - /* - * Basic Layout: - * PDFBug - * Controls - * Panels - * Panel - * Panel - * ... - */ - var ui = document.createElement('div'); - ui.id = 'PDFBug'; - - var controls = document.createElement('div'); - controls.setAttribute('class', 'controls'); - ui.appendChild(controls); - - var panels = document.createElement('div'); - panels.setAttribute('class', 'panels'); - ui.appendChild(panels); - - container.appendChild(ui); - container.style.right = panelWidth + 'px'; - - // Initialize all the debugging tools. - var tools = this.tools; - var self = this; - for (var i = 0; i < tools.length; ++i) { - var tool = tools[i]; - var panel = document.createElement('div'); - var panelButton = document.createElement('button'); - panelButton.textContent = tool.name; - panelButton.addEventListener('click', (function(selected) { - return function(event) { - event.preventDefault(); - self.selectPanel(selected); - }; - })(i)); - controls.appendChild(panelButton); - panels.appendChild(panel); - tool.panel = panel; - tool.manager = this; - if (tool.enabled) { - tool.init(pdfjsLib); - } else { - panel.textContent = tool.name + ' is disabled. To enable add ' + - ' "' + tool.id + '" to the pdfBug parameter ' + - 'and refresh (separate multiple by commas).'; - } - buttons.push(panelButton); - } - this.selectPanel(0); - }, - cleanup() { - for (var i = 0, ii = this.tools.length; i < ii; i++) { - if (this.tools[i].enabled) { - this.tools[i].cleanup(); - } - } - }, - selectPanel(index) { - if (typeof index !== 'number') { - index = this.tools.indexOf(index); - } - if (index === activePanel) { - return; - } - activePanel = index; - var tools = this.tools; - for (var j = 0; j < tools.length; ++j) { - if (j === index) { - buttons[j].setAttribute('class', 'active'); - tools[j].active = true; - tools[j].panel.removeAttribute('hidden'); - } else { - buttons[j].setAttribute('class', ''); - tools[j].active = false; - tools[j].panel.setAttribute('hidden', 'true'); - } - } - }, - }; -})(); diff --git a/pdf.js/debugger.mjs b/pdf.js/debugger.mjs new file mode 100644 index 0000000..59c1871 --- /dev/null +++ b/pdf.js/debugger.mjs @@ -0,0 +1,623 @@ +/* Copyright 2012 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const { OPS } = globalThis.pdfjsLib || (await import("pdfjs-lib")); + +const opMap = Object.create(null); +for (const key in OPS) { + opMap[OPS[key]] = key; +} + +const FontInspector = (function FontInspectorClosure() { + let fonts; + let active = false; + const fontAttribute = "data-font-name"; + function removeSelection() { + const divs = document.querySelectorAll(`span[${fontAttribute}]`); + for (const div of divs) { + div.className = ""; + } + } + function resetSelection() { + const divs = document.querySelectorAll(`span[${fontAttribute}]`); + for (const div of divs) { + div.className = "debuggerHideText"; + } + } + function selectFont(fontName, show) { + const divs = document.querySelectorAll( + `span[${fontAttribute}=${fontName}]` + ); + for (const div of divs) { + div.className = show ? "debuggerShowText" : "debuggerHideText"; + } + } + function textLayerClick(e) { + if ( + !e.target.dataset.fontName || + e.target.tagName.toUpperCase() !== "SPAN" + ) { + return; + } + const fontName = e.target.dataset.fontName; + const selects = document.getElementsByTagName("input"); + for (const select of selects) { + if (select.dataset.fontName !== fontName) { + continue; + } + select.checked = !select.checked; + selectFont(fontName, select.checked); + select.scrollIntoView(); + } + } + return { + // Properties/functions needed by PDFBug. + id: "FontInspector", + name: "Font Inspector", + panel: null, + manager: null, + init() { + const panel = this.panel; + const tmp = document.createElement("button"); + tmp.addEventListener("click", resetSelection); + tmp.textContent = "Refresh"; + panel.append(tmp); + + fonts = document.createElement("div"); + panel.append(fonts); + }, + cleanup() { + fonts.textContent = ""; + }, + enabled: false, + get active() { + return active; + }, + set active(value) { + active = value; + if (active) { + document.body.addEventListener("click", textLayerClick, true); + resetSelection(); + } else { + document.body.removeEventListener("click", textLayerClick, true); + removeSelection(); + } + }, + // FontInspector specific functions. + fontAdded(fontObj, url) { + function properties(obj, list) { + const moreInfo = document.createElement("table"); + for (const entry of list) { + const tr = document.createElement("tr"); + const td1 = document.createElement("td"); + td1.textContent = entry; + tr.append(td1); + const td2 = document.createElement("td"); + td2.textContent = obj[entry].toString(); + tr.append(td2); + moreInfo.append(tr); + } + return moreInfo; + } + + const moreInfo = fontObj.css + ? properties(fontObj, ["baseFontName"]) + : properties(fontObj, ["name", "type"]); + + const fontName = fontObj.loadedName; + const font = document.createElement("div"); + const name = document.createElement("span"); + name.textContent = fontName; + let download; + if (!fontObj.css) { + download = document.createElement("a"); + if (url) { + url = /url\(['"]?([^)"']+)/.exec(url); + download.href = url[1]; + } else if (fontObj.data) { + download.href = URL.createObjectURL( + new Blob([fontObj.data], { type: fontObj.mimetype }) + ); + } + download.textContent = "Download"; + } + + const logIt = document.createElement("a"); + logIt.href = ""; + logIt.textContent = "Log"; + logIt.addEventListener("click", function (event) { + event.preventDefault(); + console.log(fontObj); + }); + const select = document.createElement("input"); + select.setAttribute("type", "checkbox"); + select.dataset.fontName = fontName; + select.addEventListener("click", function () { + selectFont(fontName, select.checked); + }); + if (download) { + font.append(select, name, " ", download, " ", logIt, moreInfo); + } else { + font.append(select, name, " ", logIt, moreInfo); + } + fonts.append(font); + // Somewhat of a hack, should probably add a hook for when the text layer + // is done rendering. + setTimeout(() => { + if (this.active) { + resetSelection(); + } + }, 2000); + }, + }; +})(); + +// Manages all the page steppers. +const StepperManager = (function StepperManagerClosure() { + let steppers = []; + let stepperDiv = null; + let stepperControls = null; + let stepperChooser = null; + let breakPoints = Object.create(null); + return { + // Properties/functions needed by PDFBug. + id: "Stepper", + name: "Stepper", + panel: null, + manager: null, + init() { + const self = this; + stepperControls = document.createElement("div"); + stepperChooser = document.createElement("select"); + stepperChooser.addEventListener("change", function (event) { + self.selectStepper(this.value); + }); + stepperControls.append(stepperChooser); + stepperDiv = document.createElement("div"); + this.panel.append(stepperControls, stepperDiv); + if (sessionStorage.getItem("pdfjsBreakPoints")) { + breakPoints = JSON.parse(sessionStorage.getItem("pdfjsBreakPoints")); + } + }, + cleanup() { + stepperChooser.textContent = ""; + stepperDiv.textContent = ""; + steppers = []; + }, + enabled: false, + active: false, + // Stepper specific functions. + create(pageIndex) { + const debug = document.createElement("div"); + debug.id = "stepper" + pageIndex; + debug.hidden = true; + debug.className = "stepper"; + stepperDiv.append(debug); + const b = document.createElement("option"); + b.textContent = "Page " + (pageIndex + 1); + b.value = pageIndex; + stepperChooser.append(b); + const initBreakPoints = breakPoints[pageIndex] || []; + const stepper = new Stepper(debug, pageIndex, initBreakPoints); + steppers.push(stepper); + if (steppers.length === 1) { + this.selectStepper(pageIndex, false); + } + return stepper; + }, + selectStepper(pageIndex, selectPanel) { + pageIndex |= 0; + if (selectPanel) { + this.manager.selectPanel(this); + } + for (const stepper of steppers) { + stepper.panel.hidden = stepper.pageIndex !== pageIndex; + } + for (const option of stepperChooser.options) { + option.selected = (option.value | 0) === pageIndex; + } + }, + saveBreakPoints(pageIndex, bps) { + breakPoints[pageIndex] = bps; + sessionStorage.setItem("pdfjsBreakPoints", JSON.stringify(breakPoints)); + }, + }; +})(); + +// The stepper for each page's operatorList. +class Stepper { + // Shorter way to create element and optionally set textContent. + #c(tag, textContent) { + const d = document.createElement(tag); + if (textContent) { + d.textContent = textContent; + } + return d; + } + + #simplifyArgs(args) { + if (typeof args === "string") { + const MAX_STRING_LENGTH = 75; + return args.length <= MAX_STRING_LENGTH + ? args + : args.substring(0, MAX_STRING_LENGTH) + "..."; + } + if (typeof args !== "object" || args === null) { + return args; + } + if ("length" in args) { + // array + const MAX_ITEMS = 10, + simpleArgs = []; + let i, ii; + for (i = 0, ii = Math.min(MAX_ITEMS, args.length); i < ii; i++) { + simpleArgs.push(this.#simplifyArgs(args[i])); + } + if (i < args.length) { + simpleArgs.push("..."); + } + return simpleArgs; + } + const simpleObj = {}; + for (const key in args) { + simpleObj[key] = this.#simplifyArgs(args[key]); + } + return simpleObj; + } + + constructor(panel, pageIndex, initialBreakPoints) { + this.panel = panel; + this.breakPoint = 0; + this.nextBreakPoint = null; + this.pageIndex = pageIndex; + this.breakPoints = initialBreakPoints; + this.currentIdx = -1; + this.operatorListIdx = 0; + this.indentLevel = 0; + } + + init(operatorList) { + const panel = this.panel; + const content = this.#c("div", "c=continue, s=step"); + const table = this.#c("table"); + content.append(table); + table.cellSpacing = 0; + const headerRow = this.#c("tr"); + table.append(headerRow); + headerRow.append( + this.#c("th", "Break"), + this.#c("th", "Idx"), + this.#c("th", "fn"), + this.#c("th", "args") + ); + panel.append(content); + this.table = table; + this.updateOperatorList(operatorList); + } + + updateOperatorList(operatorList) { + const self = this; + + function cboxOnClick() { + const x = +this.dataset.idx; + if (this.checked) { + self.breakPoints.push(x); + } else { + self.breakPoints.splice(self.breakPoints.indexOf(x), 1); + } + StepperManager.saveBreakPoints(self.pageIndex, self.breakPoints); + } + + const MAX_OPERATORS_COUNT = 15000; + if (this.operatorListIdx > MAX_OPERATORS_COUNT) { + return; + } + + const chunk = document.createDocumentFragment(); + const operatorsToDisplay = Math.min( + MAX_OPERATORS_COUNT, + operatorList.fnArray.length + ); + for (let i = this.operatorListIdx; i < operatorsToDisplay; i++) { + const line = this.#c("tr"); + line.className = "line"; + line.dataset.idx = i; + chunk.append(line); + const checked = this.breakPoints.includes(i); + const args = operatorList.argsArray[i] || []; + + const breakCell = this.#c("td"); + const cbox = this.#c("input"); + cbox.type = "checkbox"; + cbox.className = "points"; + cbox.checked = checked; + cbox.dataset.idx = i; + cbox.onclick = cboxOnClick; + + breakCell.append(cbox); + line.append(breakCell, this.#c("td", i.toString())); + const fn = opMap[operatorList.fnArray[i]]; + let decArgs = args; + if (fn === "showText") { + const glyphs = args[0]; + const charCodeRow = this.#c("tr"); + const fontCharRow = this.#c("tr"); + const unicodeRow = this.#c("tr"); + for (const glyph of glyphs) { + if (typeof glyph === "object" && glyph !== null) { + charCodeRow.append(this.#c("td", glyph.originalCharCode)); + fontCharRow.append(this.#c("td", glyph.fontChar)); + unicodeRow.append(this.#c("td", glyph.unicode)); + } else { + // null or number + const advanceEl = this.#c("td", glyph); + advanceEl.classList.add("advance"); + charCodeRow.append(advanceEl); + fontCharRow.append(this.#c("td")); + unicodeRow.append(this.#c("td")); + } + } + decArgs = this.#c("td"); + const table = this.#c("table"); + table.classList.add("showText"); + decArgs.append(table); + table.append(charCodeRow, fontCharRow, unicodeRow); + } else if (fn === "restore" && this.indentLevel > 0) { + this.indentLevel--; + } + line.append(this.#c("td", " ".repeat(this.indentLevel * 2) + fn)); + if (fn === "save") { + this.indentLevel++; + } + + if (decArgs instanceof HTMLElement) { + line.append(decArgs); + } else { + line.append(this.#c("td", JSON.stringify(this.#simplifyArgs(decArgs)))); + } + } + if (operatorsToDisplay < operatorList.fnArray.length) { + const lastCell = this.#c("td", "..."); + lastCell.colspan = 4; + chunk.append(lastCell); + } + this.operatorListIdx = operatorList.fnArray.length; + this.table.append(chunk); + } + + getNextBreakPoint() { + this.breakPoints.sort(function (a, b) { + return a - b; + }); + for (const breakPoint of this.breakPoints) { + if (breakPoint > this.currentIdx) { + return breakPoint; + } + } + return null; + } + + breakIt(idx, callback) { + StepperManager.selectStepper(this.pageIndex, true); + this.currentIdx = idx; + + const listener = evt => { + switch (evt.keyCode) { + case 83: // step + document.removeEventListener("keydown", listener); + this.nextBreakPoint = this.currentIdx + 1; + this.goTo(-1); + callback(); + break; + case 67: // continue + document.removeEventListener("keydown", listener); + this.nextBreakPoint = this.getNextBreakPoint(); + this.goTo(-1); + callback(); + break; + } + }; + document.addEventListener("keydown", listener); + this.goTo(idx); + } + + goTo(idx) { + const allRows = this.panel.getElementsByClassName("line"); + for (const row of allRows) { + if ((row.dataset.idx | 0) === idx) { + row.style.backgroundColor = "rgb(251,250,207)"; + row.scrollIntoView(); + } else { + row.style.backgroundColor = null; + } + } + } +} + +const Stats = (function Stats() { + let stats = []; + function clear(node) { + node.textContent = ""; // Remove any `node` contents from the DOM. + } + function getStatIndex(pageNumber) { + for (const [i, stat] of stats.entries()) { + if (stat.pageNumber === pageNumber) { + return i; + } + } + return false; + } + return { + // Properties/functions needed by PDFBug. + id: "Stats", + name: "Stats", + panel: null, + manager: null, + init() {}, + enabled: false, + active: false, + // Stats specific functions. + add(pageNumber, stat) { + if (!stat) { + return; + } + const statsIndex = getStatIndex(pageNumber); + if (statsIndex !== false) { + stats[statsIndex].div.remove(); + stats.splice(statsIndex, 1); + } + const wrapper = document.createElement("div"); + wrapper.className = "stats"; + const title = document.createElement("div"); + title.className = "title"; + title.textContent = "Page: " + pageNumber; + const statsDiv = document.createElement("div"); + statsDiv.textContent = stat.toString(); + wrapper.append(title, statsDiv); + stats.push({ pageNumber, div: wrapper }); + stats.sort(function (a, b) { + return a.pageNumber - b.pageNumber; + }); + clear(this.panel); + for (const entry of stats) { + this.panel.append(entry.div); + } + }, + cleanup() { + stats = []; + clear(this.panel); + }, + }; +})(); + +// Manages all the debugging tools. +class PDFBug { + static #buttons = []; + + static #activePanel = null; + + static tools = [FontInspector, StepperManager, Stats]; + + static enable(ids) { + const all = ids.length === 1 && ids[0] === "all"; + const tools = this.tools; + for (const tool of tools) { + if (all || ids.includes(tool.id)) { + tool.enabled = true; + } + } + if (!all) { + // Sort the tools by the order they are enabled. + tools.sort(function (a, b) { + let indexA = ids.indexOf(a.id); + indexA = indexA < 0 ? tools.length : indexA; + let indexB = ids.indexOf(b.id); + indexB = indexB < 0 ? tools.length : indexB; + return indexA - indexB; + }); + } + } + + static init(container, ids) { + this.loadCSS(); + this.enable(ids); + /* + * Basic Layout: + * PDFBug + * Controls + * Panels + * Panel + * Panel + * ... + */ + const ui = document.createElement("div"); + ui.id = "PDFBug"; + + const controls = document.createElement("div"); + controls.setAttribute("class", "controls"); + ui.append(controls); + + const panels = document.createElement("div"); + panels.setAttribute("class", "panels"); + ui.append(panels); + + container.append(ui); + container.style.right = "var(--panel-width)"; + + // Initialize all the debugging tools. + for (const tool of this.tools) { + const panel = document.createElement("div"); + const panelButton = document.createElement("button"); + panelButton.textContent = tool.name; + panelButton.addEventListener("click", event => { + event.preventDefault(); + this.selectPanel(tool); + }); + controls.append(panelButton); + panels.append(panel); + tool.panel = panel; + tool.manager = this; + if (tool.enabled) { + tool.init(); + } else { + panel.textContent = + `${tool.name} is disabled. To enable add "${tool.id}" to ` + + "the pdfBug parameter and refresh (separate multiple by commas)."; + } + this.#buttons.push(panelButton); + } + this.selectPanel(0); + } + + static loadCSS() { + const { url } = import.meta; + + const link = document.createElement("link"); + link.rel = "stylesheet"; + link.href = url.replace(/\.mjs$/, ".css"); + + document.head.append(link); + } + + static cleanup() { + for (const tool of this.tools) { + if (tool.enabled) { + tool.cleanup(); + } + } + } + + static selectPanel(index) { + if (typeof index !== "number") { + index = this.tools.indexOf(index); + } + if (index === this.#activePanel) { + return; + } + this.#activePanel = index; + for (const [j, tool] of this.tools.entries()) { + const isActive = j === index; + this.#buttons[j].classList.toggle("active", isActive); + tool.active = isActive; + tool.panel.hidden = !isActive; + } + } +} + +globalThis.FontInspector = FontInspector; +globalThis.StepperManager = StepperManager; +globalThis.Stats = Stats; + +export { PDFBug }; diff --git a/pdf.js/embeds.js b/pdf.js/embeds.js deleted file mode 100644 index fbdd308..0000000 --- a/pdf.js/embeds.js +++ /dev/null @@ -1,148 +0,0 @@ -Ox.load({ - 'UI': { - loadCSS: false - } -}, function() { - var currentPage = PDFView.page; - window.addEventListener('pagechange', function (evt) { - var page = evt.pageNumber; - if (page && page != currentPage) { - currentPage = page; - Ox.$parent.postMessage('page', { - page: Math.round(page) - }); - } - }); - Ox.$parent.bindMessage({ - page: function(data) { - if (data.page != PDFView.page) { - PDFView.page = data.page; - } - }, - pdf: function(data) { - if (PDFView.url != data.pdf) { - PDFView.open(data.pdf); - } - } - }); -}); - -function getVideoOverlay(page) { - var links = (window.embeds || []).filter(function(embed) { - return embed.page == page && embed.type =='inline'; - }); - return (window.editable || links.length) ? { - beginLayout: function() { - this.counter = 0; - }, - endLayout: function() { - }, - appendImage: function(image) { - var id = ++this.counter, - video = links.filter(function(embed) { - return embed.id == id; - })[0], - $interface, $playButton, $editButton; - if (editable || video) { - $interface = Ox.$('
') - .addClass('interface') - .css({ - left: image.left + 'px', - top: image.top + 'px', - width: image.width + 'px', - height: image.height + 'px' - }); - $playButton = Ox.$('') - .addClass('button playButton') - .attr({ - src: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2Ij48cG9seWdvbiBwb2ludHM9IjU2LDMyIDI0OCwxMjggNTYsMjI0IiBmaWxsPSIjRkZGRkZGIi8+PC9zdmc+PCEtLXsiY29sb3IiOiJ2aWRlbyIsIm5hbWUiOiJzeW1ib2xQbGF5IiwidGhlbWUiOiJveGRhcmsifS0tPg==' - }) - .hide() - .appendTo($interface); - $editButton = Ox.$('') - .addClass('button editButton') - .attr({ - src: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2Ij48cG9seWdvbiBwb2ludHM9IjMyLDIyNCA2NCwxNjAgOTYsMTkyIiBmaWxsPSIjRkZGRkZGIi8+PGxpbmUgeDE9Ijg4IiB5MT0iMTY4IiB4Mj0iMTg0IiB5Mj0iNzIiIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSI0OCIvPjxsaW5lIHgxPSIxOTIiIHkxPSI2NCIgeDI9IjIwOCIgeTI9IjQ4IiBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iNDgiLz48bGluZSB4MT0iMTEyIiB5MT0iMjIwIiB4Mj0iMjI0IiB5Mj0iMjIwIiBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iOCIvPjxsaW5lIHgxPSIxMjgiIHkxPSIyMDQiIHgyPSIyMjQiIHkyPSIyMDQiIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSI4Ii8+PGxpbmUgeDE9IjE0NCIgeTE9IjE4OCIgeDI9IjIyNCIgeTI9IjE4OCIgc3Ryb2tlPSIjRkZGRkZGIiBzdHJva2Utd2lkdGg9IjgiLz48L3N2Zz4=', - title: 'Click to add video' - }) - .on({click: edit}) - .hide() - .appendTo($interface); - if (editable) { - $editButton.show(); - } - if (video) { - enableVideoUI(); - } - this.div.appendChild($interface[0]); - Ox.$parent.bindMessage('update', function(data) { - if (video && data.id == video.id && data.page == video.page) { - video.src = data.src; - video.src !== '' ? enableVideoUI() : disableVideoUI(); - } - }); - } - function play(e) { - e.preventDefault(); - e.stopPropagation(); - var videoId = 'video' + page + id + Ox.uid(), - $iframe = Ox.Element('