From 65cd370618646f54f250eeabb4d215e41d95e0e7 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Mon, 8 Mar 2021 16:22:26 -0600 Subject: Update to PDF.js 2.6.347 This removes all Epiphany customizations, so it will not actually work. Epiphany customizations will be reapplied in the next commit. --- third-party/pdfjs/build/pdf.js | 1083 +- third-party/pdfjs/build/pdf.worker.js | 18761 ++++++++++--------- third-party/pdfjs/pdfjs.gresource.xml | 153 +- third-party/pdfjs/pdfjs_generate_resource.py | 1 + .../pdfjs/web/images/findbarButton-next-dark.svg | 6 + .../pdfjs/web/images/findbarButton-next.png | Bin 193 -> 0 bytes .../pdfjs/web/images/findbarButton-next.svg | 4 + .../pdfjs/web/images/findbarButton-next@2x.png | Bin 296 -> 0 bytes .../web/images/findbarButton-previous-dark.svg | 5 + .../pdfjs/web/images/findbarButton-previous.png | Bin 199 -> 0 bytes .../pdfjs/web/images/findbarButton-previous.svg | 4 + .../pdfjs/web/images/findbarButton-previous@2x.png | Bin 304 -> 0 bytes third-party/pdfjs/web/images/loading-dark.svg | 24 + third-party/pdfjs/web/images/loading-small.png | Bin 7402 -> 0 bytes third-party/pdfjs/web/images/loading-small@2x.png | Bin 16131 -> 0 bytes third-party/pdfjs/web/images/loading.svg | 1 + ...ondaryToolbarButton-documentProperties-dark.svg | 16 + .../secondaryToolbarButton-documentProperties.png | Bin 403 -> 0 bytes .../secondaryToolbarButton-documentProperties.svg | 15 + ...econdaryToolbarButton-documentProperties@2x.png | Bin 933 -> 0 bytes .../secondaryToolbarButton-firstPage-dark.svg | 2 + .../images/secondaryToolbarButton-firstPage.png | Bin 179 -> 0 bytes .../images/secondaryToolbarButton-firstPage.svg | 1 + .../images/secondaryToolbarButton-firstPage@2x.png | Bin 266 -> 0 bytes .../secondaryToolbarButton-handTool-dark.svg | 2 + .../web/images/secondaryToolbarButton-handTool.png | Bin 301 -> 0 bytes .../web/images/secondaryToolbarButton-handTool.svg | 1 + .../images/secondaryToolbarButton-handTool@2x.png | Bin 583 -> 0 bytes .../secondaryToolbarButton-lastPage-dark.svg | 2 + .../web/images/secondaryToolbarButton-lastPage.png | Bin 175 -> 0 bytes .../web/images/secondaryToolbarButton-lastPage.svg | 1 + .../images/secondaryToolbarButton-lastPage@2x.png | Bin 276 -> 0 bytes .../secondaryToolbarButton-rotateCcw-dark.svg | 2 + .../images/secondaryToolbarButton-rotateCcw.png | Bin 360 -> 0 bytes .../images/secondaryToolbarButton-rotateCcw.svg | 1 + .../images/secondaryToolbarButton-rotateCcw@2x.png | Bin 731 -> 0 bytes .../secondaryToolbarButton-rotateCw-dark.svg | 5 + .../web/images/secondaryToolbarButton-rotateCw.png | Bin 359 -> 0 bytes .../web/images/secondaryToolbarButton-rotateCw.svg | 4 + .../images/secondaryToolbarButton-rotateCw@2x.png | Bin 714 -> 0 bytes ...econdaryToolbarButton-scrollHorizontal-dark.svg | 2 + .../secondaryToolbarButton-scrollHorizontal.png | Bin 218 -> 0 bytes .../secondaryToolbarButton-scrollHorizontal.svg | 1 + .../secondaryToolbarButton-scrollHorizontal@2x.png | Bin 332 -> 0 bytes .../secondaryToolbarButton-scrollVertical-dark.svg | 2 + .../secondaryToolbarButton-scrollVertical.png | Bin 228 -> 0 bytes .../secondaryToolbarButton-scrollVertical.svg | 1 + .../secondaryToolbarButton-scrollVertical@2x.png | Bin 349 -> 0 bytes .../secondaryToolbarButton-scrollWrapped-dark.svg | 2 + .../secondaryToolbarButton-scrollWrapped.png | Bin 297 -> 0 bytes .../secondaryToolbarButton-scrollWrapped.svg | 1 + .../secondaryToolbarButton-scrollWrapped@2x.png | Bin 490 -> 0 bytes .../secondaryToolbarButton-selectTool-dark.svg | 5 + .../images/secondaryToolbarButton-selectTool.png | Bin 461 -> 0 bytes .../images/secondaryToolbarButton-selectTool.svg | 4 + .../secondaryToolbarButton-selectTool@2x.png | Bin 1067 -> 0 bytes .../secondaryToolbarButton-spreadEven-dark.svg | 2 + .../images/secondaryToolbarButton-spreadEven.png | Bin 347 -> 0 bytes .../images/secondaryToolbarButton-spreadEven.svg | 1 + .../secondaryToolbarButton-spreadEven@2x.png | Bin 694 -> 0 bytes .../secondaryToolbarButton-spreadNone-dark.svg | 2 + .../images/secondaryToolbarButton-spreadNone.png | Bin 179 -> 0 bytes .../images/secondaryToolbarButton-spreadNone.svg | 1 + .../secondaryToolbarButton-spreadNone@2x.png | Bin 261 -> 0 bytes .../secondaryToolbarButton-spreadOdd-dark.svg | 2 + .../images/secondaryToolbarButton-spreadOdd.png | Bin 344 -> 0 bytes .../images/secondaryToolbarButton-spreadOdd.svg | 1 + .../images/secondaryToolbarButton-spreadOdd@2x.png | Bin 621 -> 0 bytes third-party/pdfjs/web/images/shadow.png | Bin 290 -> 269 bytes third-party/pdfjs/web/images/texture.png | Bin 2417 -> 0 bytes .../web/images/toolbarButton-bookmark-dark.svg | 2 + .../pdfjs/web/images/toolbarButton-bookmark.png | Bin 174 -> 0 bytes .../pdfjs/web/images/toolbarButton-bookmark.svg | 1 + .../pdfjs/web/images/toolbarButton-bookmark@2x.png | Bin 260 -> 0 bytes .../web/images/toolbarButton-download-dark.svg | 5 + .../pdfjs/web/images/toolbarButton-download.png | Bin 259 -> 0 bytes .../pdfjs/web/images/toolbarButton-download.svg | 4 + .../pdfjs/web/images/toolbarButton-download@2x.png | Bin 425 -> 0 bytes .../web/images/toolbarButton-menuArrow-dark.svg | 1 + .../pdfjs/web/images/toolbarButton-menuArrow.svg | 1 + .../pdfjs/web/images/toolbarButton-menuArrows.png | Bin 107 -> 0 bytes .../web/images/toolbarButton-menuArrows@2x.png | Bin 152 -> 0 bytes .../web/images/toolbarButton-openFile-dark.svg | 5 + .../pdfjs/web/images/toolbarButton-openFile.png | Bin 295 -> 0 bytes .../pdfjs/web/images/toolbarButton-openFile.svg | 4 + .../pdfjs/web/images/toolbarButton-openFile@2x.png | Bin 550 -> 0 bytes .../web/images/toolbarButton-pageDown-dark.svg | 8 + .../pdfjs/web/images/toolbarButton-pageDown.png | Bin 238 -> 0 bytes .../pdfjs/web/images/toolbarButton-pageDown.svg | 7 + .../pdfjs/web/images/toolbarButton-pageDown@2x.png | Bin 396 -> 0 bytes .../pdfjs/web/images/toolbarButton-pageUp-dark.svg | 13 + .../pdfjs/web/images/toolbarButton-pageUp.png | Bin 246 -> 0 bytes .../pdfjs/web/images/toolbarButton-pageUp.svg | 12 + .../pdfjs/web/images/toolbarButton-pageUp@2x.png | Bin 403 -> 0 bytes .../images/toolbarButton-presentationMode-dark.svg | 2 + .../web/images/toolbarButton-presentationMode.png | Bin 321 -> 0 bytes .../web/images/toolbarButton-presentationMode.svg | 1 + .../images/toolbarButton-presentationMode@2x.png | Bin 586 -> 0 bytes .../pdfjs/web/images/toolbarButton-print-dark.svg | 5 + .../pdfjs/web/images/toolbarButton-print.png | Bin 257 -> 0 bytes .../pdfjs/web/images/toolbarButton-print.svg | 4 + .../pdfjs/web/images/toolbarButton-print@2x.png | Bin 464 -> 0 bytes .../pdfjs/web/images/toolbarButton-search-dark.svg | 5 + .../pdfjs/web/images/toolbarButton-search.png | Bin 309 -> 0 bytes .../pdfjs/web/images/toolbarButton-search.svg | 4 + .../pdfjs/web/images/toolbarButton-search@2x.png | Bin 653 -> 0 bytes .../toolbarButton-secondaryToolbarToggle-dark.svg | 5 + .../toolbarButton-secondaryToolbarToggle.png | Bin 243 -> 0 bytes .../toolbarButton-secondaryToolbarToggle.svg | 4 + .../toolbarButton-secondaryToolbarToggle@2x.png | Bin 458 -> 0 bytes .../images/toolbarButton-sidebarToggle-dark.svg | 5 + .../web/images/toolbarButton-sidebarToggle.png | Bin 225 -> 0 bytes .../web/images/toolbarButton-sidebarToggle.svg | 4 + .../web/images/toolbarButton-sidebarToggle@2x.png | Bin 331 -> 0 bytes .../images/toolbarButton-viewAttachments-dark.svg | 2 + .../web/images/toolbarButton-viewAttachments.png | Bin 384 -> 0 bytes .../web/images/toolbarButton-viewAttachments.svg | 1 + .../images/toolbarButton-viewAttachments@2x.png | Bin 859 -> 0 bytes .../web/images/toolbarButton-viewLayers-dark.svg | 1 + .../pdfjs/web/images/toolbarButton-viewLayers.svg | 1 + .../web/images/toolbarButton-viewOutline-dark.svg | 2 + .../pdfjs/web/images/toolbarButton-viewOutline.png | Bin 178 -> 0 bytes .../pdfjs/web/images/toolbarButton-viewOutline.svg | 1 + .../web/images/toolbarButton-viewOutline@2x.png | Bin 331 -> 0 bytes .../images/toolbarButton-viewThumbnail-dark.svg | 5 + .../web/images/toolbarButton-viewThumbnail.png | Bin 185 -> 0 bytes .../web/images/toolbarButton-viewThumbnail.svg | 4 + .../web/images/toolbarButton-viewThumbnail@2x.png | Bin 219 -> 0 bytes .../pdfjs/web/images/toolbarButton-zoomIn-dark.svg | 5 + .../pdfjs/web/images/toolbarButton-zoomIn.png | Bin 136 -> 0 bytes .../pdfjs/web/images/toolbarButton-zoomIn.svg | 4 + .../pdfjs/web/images/toolbarButton-zoomIn@2x.png | Bin 160 -> 0 bytes .../web/images/toolbarButton-zoomOut-dark.svg | 5 + .../pdfjs/web/images/toolbarButton-zoomOut.png | Bin 88 -> 0 bytes .../pdfjs/web/images/toolbarButton-zoomOut.svg | 4 + .../pdfjs/web/images/toolbarButton-zoomOut@2x.png | Bin 109 -> 0 bytes .../pdfjs/web/images/treeitem-collapsed-dark.svg | 2 + .../pdfjs/web/images/treeitem-collapsed.png | Bin 128 -> 0 bytes .../pdfjs/web/images/treeitem-collapsed.svg | 1 + .../pdfjs/web/images/treeitem-collapsed@2x.png | Bin 149 -> 0 bytes .../pdfjs/web/images/treeitem-expanded-dark.svg | 2 + third-party/pdfjs/web/images/treeitem-expanded.png | Bin 125 -> 0 bytes third-party/pdfjs/web/images/treeitem-expanded.svg | 1 + .../pdfjs/web/images/treeitem-expanded@2x.png | Bin 172 -> 0 bytes third-party/pdfjs/web/locale/ach/viewer.properties | 1 - third-party/pdfjs/web/locale/af/viewer.properties | 1 - third-party/pdfjs/web/locale/an/viewer.properties | 1 - third-party/pdfjs/web/locale/ar/viewer.properties | 1 - third-party/pdfjs/web/locale/ast/viewer.properties | 1 - third-party/pdfjs/web/locale/az/viewer.properties | 1 - third-party/pdfjs/web/locale/be/viewer.properties | 1 - third-party/pdfjs/web/locale/bg/viewer.properties | 1 - third-party/pdfjs/web/locale/bn/viewer.properties | 1 - third-party/pdfjs/web/locale/bo/viewer.properties | 1 - third-party/pdfjs/web/locale/br/viewer.properties | 1 - third-party/pdfjs/web/locale/brx/viewer.properties | 1 - third-party/pdfjs/web/locale/bs/viewer.properties | 1 - third-party/pdfjs/web/locale/ca/viewer.properties | 1 - third-party/pdfjs/web/locale/cak/viewer.properties | 9 +- third-party/pdfjs/web/locale/ckb/viewer.properties | 111 + third-party/pdfjs/web/locale/cs/viewer.properties | 1 - third-party/pdfjs/web/locale/cy/viewer.properties | 1 - third-party/pdfjs/web/locale/da/viewer.properties | 5 +- third-party/pdfjs/web/locale/de/viewer.properties | 1 - third-party/pdfjs/web/locale/dsb/viewer.properties | 1 - third-party/pdfjs/web/locale/el/viewer.properties | 3 +- .../pdfjs/web/locale/en-CA/viewer.properties | 1 - .../pdfjs/web/locale/en-GB/viewer.properties | 1 - .../pdfjs/web/locale/en-US/viewer.properties | 5 +- third-party/pdfjs/web/locale/eo/viewer.properties | 1 - .../pdfjs/web/locale/es-AR/viewer.properties | 1 - .../pdfjs/web/locale/es-CL/viewer.properties | 5 +- .../pdfjs/web/locale/es-ES/viewer.properties | 1 - .../pdfjs/web/locale/es-MX/viewer.properties | 1 - third-party/pdfjs/web/locale/et/viewer.properties | 1 - third-party/pdfjs/web/locale/eu/viewer.properties | 1 - third-party/pdfjs/web/locale/fa/viewer.properties | 1 - third-party/pdfjs/web/locale/ff/viewer.properties | 1 - third-party/pdfjs/web/locale/fi/viewer.properties | 3 +- third-party/pdfjs/web/locale/fr/viewer.properties | 1 - .../pdfjs/web/locale/fy-NL/viewer.properties | 1 - .../pdfjs/web/locale/ga-IE/viewer.properties | 1 - third-party/pdfjs/web/locale/gd/viewer.properties | 1 - third-party/pdfjs/web/locale/gl/viewer.properties | 7 +- third-party/pdfjs/web/locale/gn/viewer.properties | 51 +- .../pdfjs/web/locale/gu-IN/viewer.properties | 1 - third-party/pdfjs/web/locale/he/viewer.properties | 1 - .../pdfjs/web/locale/hi-IN/viewer.properties | 1 - third-party/pdfjs/web/locale/hr/viewer.properties | 3 +- third-party/pdfjs/web/locale/hsb/viewer.properties | 1 - third-party/pdfjs/web/locale/hu/viewer.properties | 1 - .../pdfjs/web/locale/hy-AM/viewer.properties | 3 +- third-party/pdfjs/web/locale/hye/viewer.properties | 1 - third-party/pdfjs/web/locale/ia/viewer.properties | 1 - third-party/pdfjs/web/locale/id/viewer.properties | 1 - third-party/pdfjs/web/locale/is/viewer.properties | 1 - third-party/pdfjs/web/locale/it/viewer.properties | 32 +- third-party/pdfjs/web/locale/ka/viewer.properties | 3 +- third-party/pdfjs/web/locale/kab/viewer.properties | 1 - third-party/pdfjs/web/locale/kk/viewer.properties | 1 - third-party/pdfjs/web/locale/km/viewer.properties | 1 - third-party/pdfjs/web/locale/kn/viewer.properties | 1 - third-party/pdfjs/web/locale/ko/viewer.properties | 7 +- third-party/pdfjs/web/locale/lij/viewer.properties | 1 - third-party/pdfjs/web/locale/locale.properties | 6 + third-party/pdfjs/web/locale/lt/viewer.properties | 1 - third-party/pdfjs/web/locale/ltg/viewer.properties | 1 - third-party/pdfjs/web/locale/lv/viewer.properties | 1 - third-party/pdfjs/web/locale/mk/viewer.properties | 1 - third-party/pdfjs/web/locale/mr/viewer.properties | 1 - third-party/pdfjs/web/locale/ms/viewer.properties | 1 - third-party/pdfjs/web/locale/my/viewer.properties | 1 - .../pdfjs/web/locale/nb-NO/viewer.properties | 1 - .../pdfjs/web/locale/ne-NP/viewer.properties | 1 - third-party/pdfjs/web/locale/nl/viewer.properties | 1 - .../pdfjs/web/locale/nn-NO/viewer.properties | 1 - third-party/pdfjs/web/locale/oc/viewer.properties | 3 +- .../pdfjs/web/locale/pa-IN/viewer.properties | 1 - third-party/pdfjs/web/locale/pl/viewer.properties | 1 - .../pdfjs/web/locale/pt-BR/viewer.properties | 5 +- .../pdfjs/web/locale/pt-PT/viewer.properties | 1 - third-party/pdfjs/web/locale/rm/viewer.properties | 1 - third-party/pdfjs/web/locale/ro/viewer.properties | 21 +- third-party/pdfjs/web/locale/ru/viewer.properties | 1 - third-party/pdfjs/web/locale/sk/viewer.properties | 1 - third-party/pdfjs/web/locale/sl/viewer.properties | 1 - third-party/pdfjs/web/locale/son/viewer.properties | 1 - third-party/pdfjs/web/locale/sq/viewer.properties | 1 - third-party/pdfjs/web/locale/sr/viewer.properties | 1 - .../pdfjs/web/locale/sv-SE/viewer.properties | 6 +- third-party/pdfjs/web/locale/szl/viewer.properties | 247 + third-party/pdfjs/web/locale/ta/viewer.properties | 1 - third-party/pdfjs/web/locale/te/viewer.properties | 1 - third-party/pdfjs/web/locale/th/viewer.properties | 1 - third-party/pdfjs/web/locale/tl/viewer.properties | 1 - third-party/pdfjs/web/locale/tr/viewer.properties | 1 - third-party/pdfjs/web/locale/uk/viewer.properties | 9 +- third-party/pdfjs/web/locale/ur/viewer.properties | 3 +- third-party/pdfjs/web/locale/uz/viewer.properties | 1 - third-party/pdfjs/web/locale/vi/viewer.properties | 1 - third-party/pdfjs/web/locale/xh/viewer.properties | 1 - .../pdfjs/web/locale/zh-CN/viewer.properties | 1 - .../pdfjs/web/locale/zh-TW/viewer.properties | 1 - third-party/pdfjs/web/viewer.css | 2984 ++- third-party/pdfjs/web/viewer.html | 11 +- third-party/pdfjs/web/viewer.js | 1161 +- 246 files changed, 15098 insertions(+), 9946 deletions(-) create mode 100644 third-party/pdfjs/web/images/findbarButton-next-dark.svg delete mode 100644 third-party/pdfjs/web/images/findbarButton-next.png create mode 100644 third-party/pdfjs/web/images/findbarButton-next.svg delete mode 100644 third-party/pdfjs/web/images/findbarButton-next@2x.png create mode 100644 third-party/pdfjs/web/images/findbarButton-previous-dark.svg delete mode 100644 third-party/pdfjs/web/images/findbarButton-previous.png create mode 100644 third-party/pdfjs/web/images/findbarButton-previous.svg delete mode 100644 third-party/pdfjs/web/images/findbarButton-previous@2x.png create mode 100644 third-party/pdfjs/web/images/loading-dark.svg delete mode 100644 third-party/pdfjs/web/images/loading-small.png delete mode 100644 third-party/pdfjs/web/images/loading-small@2x.png create mode 100644 third-party/pdfjs/web/images/loading.svg create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-firstPage-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-firstPage@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-handTool-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-handTool.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-handTool.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-handTool@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-lastPage-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-lastPage@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-selectTool-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone@2x.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd-dark.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.png create mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg delete mode 100644 third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd@2x.png delete mode 100644 third-party/pdfjs/web/images/texture.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-bookmark-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-bookmark.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-bookmark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-bookmark@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-download-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-download.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-download.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-download@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-menuArrow-dark.svg create mode 100644 third-party/pdfjs/web/images/toolbarButton-menuArrow.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-menuArrows.png delete mode 100644 third-party/pdfjs/web/images/toolbarButton-menuArrows@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-openFile-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-openFile.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-openFile.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-openFile@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-pageDown-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-pageDown.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-pageDown.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-pageDown@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-pageUp-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-pageUp.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-pageUp.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-pageUp@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-presentationMode-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-presentationMode.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-presentationMode.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-presentationMode@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-print-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-print.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-print.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-print@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-search-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-search.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-search.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-search@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-sidebarToggle-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-sidebarToggle.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-sidebarToggle.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-sidebarToggle@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-viewAttachments-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-viewAttachments.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-viewAttachments.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-viewAttachments@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-viewLayers-dark.svg create mode 100644 third-party/pdfjs/web/images/toolbarButton-viewLayers.svg create mode 100644 third-party/pdfjs/web/images/toolbarButton-viewOutline-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-viewOutline.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-viewOutline.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-viewOutline@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-viewThumbnail-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-viewThumbnail.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-viewThumbnail.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-zoomIn-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-zoomIn.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-zoomIn.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-zoomIn@2x.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-zoomOut-dark.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-zoomOut.png create mode 100644 third-party/pdfjs/web/images/toolbarButton-zoomOut.svg delete mode 100644 third-party/pdfjs/web/images/toolbarButton-zoomOut@2x.png create mode 100644 third-party/pdfjs/web/images/treeitem-collapsed-dark.svg delete mode 100644 third-party/pdfjs/web/images/treeitem-collapsed.png create mode 100644 third-party/pdfjs/web/images/treeitem-collapsed.svg delete mode 100644 third-party/pdfjs/web/images/treeitem-collapsed@2x.png create mode 100644 third-party/pdfjs/web/images/treeitem-expanded-dark.svg delete mode 100644 third-party/pdfjs/web/images/treeitem-expanded.png create mode 100644 third-party/pdfjs/web/images/treeitem-expanded.svg delete mode 100644 third-party/pdfjs/web/images/treeitem-expanded@2x.png create mode 100644 third-party/pdfjs/web/locale/ckb/viewer.properties create mode 100644 third-party/pdfjs/web/locale/szl/viewer.properties diff --git a/third-party/pdfjs/build/pdf.js b/third-party/pdfjs/build/pdf.js index a2ee957dd..8d59e6dd9 100644 --- a/third-party/pdfjs/build/pdf.js +++ b/third-party/pdfjs/build/pdf.js @@ -325,36 +325,36 @@ var _api = __w_pdfjs_require__(5); var _util = __w_pdfjs_require__(2); -var _annotation_layer = __w_pdfjs_require__(16); +var _annotation_layer = __w_pdfjs_require__(19); -var _api_compatibility = __w_pdfjs_require__(7); +var _api_compatibility = __w_pdfjs_require__(9); -var _worker_options = __w_pdfjs_require__(10); +var _worker_options = __w_pdfjs_require__(12); -var _text_layer = __w_pdfjs_require__(17); +var _text_layer = __w_pdfjs_require__(20); -var _svg = __w_pdfjs_require__(18); +var _svg = __w_pdfjs_require__(21); -const pdfjsVersion = '2.5.207'; -const pdfjsBuild = '0974d6052'; +const pdfjsVersion = '2.6.347'; +const pdfjsBuild = '3be9c65f'; { const { isNodeJS } = __w_pdfjs_require__(4); if (isNodeJS) { - const PDFNodeStream = __w_pdfjs_require__(19).PDFNodeStream; + const PDFNodeStream = __w_pdfjs_require__(22).PDFNodeStream; (0, _api.setPDFNetworkStreamFactory)(params => { return new PDFNodeStream(params); }); } else { - const PDFNetworkStream = __w_pdfjs_require__(22).PDFNetworkStream; + const PDFNetworkStream = __w_pdfjs_require__(25).PDFNetworkStream; let PDFFetchStream; if ((0, _display_utils.isFetchSupported)()) { - PDFFetchStream = __w_pdfjs_require__(23).PDFFetchStream; + PDFFetchStream = __w_pdfjs_require__(26).PDFFetchStream; } (0, _api.setPDFNetworkStreamFactory)(params => { @@ -383,7 +383,7 @@ exports.isFetchSupported = isFetchSupported; exports.isValidFetchUrl = isValidFetchUrl; exports.loadScript = loadScript; exports.deprecated = deprecated; -exports.PDFDateString = exports.StatTimer = exports.DOMSVGFactory = exports.DOMCMapReaderFactory = exports.DOMCanvasFactory = exports.DEFAULT_LINK_REL = exports.LinkTarget = exports.RenderingCancelledException = exports.PageViewport = void 0; +exports.PDFDateString = exports.StatTimer = exports.DOMSVGFactory = exports.DOMCMapReaderFactory = exports.BaseCMapReaderFactory = exports.DOMCanvasFactory = exports.BaseCanvasFactory = exports.DEFAULT_LINK_REL = exports.LinkTarget = exports.RenderingCancelledException = exports.PageViewport = void 0; var _util = __w_pdfjs_require__(2); @@ -391,20 +391,15 @@ const DEFAULT_LINK_REL = "noopener noreferrer nofollow"; exports.DEFAULT_LINK_REL = DEFAULT_LINK_REL; const SVG_NS = "http://www.w3.org/2000/svg"; -class DOMCanvasFactory { - create(width, height) { - if (width <= 0 || height <= 0) { - throw new Error("Invalid canvas size"); +class BaseCanvasFactory { + constructor() { + if (this.constructor === BaseCanvasFactory) { + (0, _util.unreachable)("Cannot initialize BaseCanvasFactory."); } + } - const canvas = document.createElement("canvas"); - const context = canvas.getContext("2d"); - canvas.width = width; - canvas.height = height; - return { - canvas, - context - }; + create(width, height) { + (0, _util.unreachable)("Abstract method `create` called."); } reset(canvasAndContext, width, height) { @@ -433,13 +428,45 @@ class DOMCanvasFactory { } +exports.BaseCanvasFactory = BaseCanvasFactory; + +class DOMCanvasFactory extends BaseCanvasFactory { + constructor({ + ownerDocument = globalThis.document + } = {}) { + super(); + this._document = ownerDocument; + } + + create(width, height) { + if (width <= 0 || height <= 0) { + throw new Error("Invalid canvas size"); + } + + const canvas = this._document.createElement("canvas"); + + const context = canvas.getContext("2d"); + canvas.width = width; + canvas.height = height; + return { + canvas, + context + }; + } + +} + exports.DOMCanvasFactory = DOMCanvasFactory; -class DOMCMapReaderFactory { +class BaseCMapReaderFactory { constructor({ baseUrl = null, isCompressed = false }) { + if (this.constructor === BaseCMapReaderFactory) { + (0, _util.unreachable)("Cannot initialize BaseCMapReaderFactory."); + } + this.baseUrl = baseUrl; this.isCompressed = isCompressed; } @@ -457,7 +484,21 @@ class DOMCMapReaderFactory { const url = this.baseUrl + name + (this.isCompressed ? ".bcmap" : ""); const compressionType = this.isCompressed ? _util.CMapCompressionType.BINARY : _util.CMapCompressionType.NONE; + return this._fetchData(url, compressionType).catch(reason => { + throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${url}`); + }); + } + + _fetchData(url, compressionType) { + (0, _util.unreachable)("Abstract method `_fetchData` called."); + } +} + +exports.BaseCMapReaderFactory = BaseCMapReaderFactory; + +class DOMCMapReaderFactory extends BaseCMapReaderFactory { + _fetchData(url, compressionType) { if (isFetchSupported() && isValidFetchUrl(url, document.baseURI)) { return fetch(url).then(async response => { if (!response.ok) { @@ -476,8 +517,6 @@ class DOMCMapReaderFactory { cMapData, compressionType }; - }).catch(reason => { - throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}` + `CMap at: ${url}`); }); } @@ -516,8 +555,6 @@ class DOMCMapReaderFactory { }; request.send(null); - }).catch(reason => { - throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}` + `CMap at: ${url}`); }); } @@ -882,12 +919,13 @@ exports.arraysToBytes = arraysToBytes; exports.assert = assert; exports.bytesToString = bytesToString; exports.createPromiseCapability = createPromiseCapability; +exports.escapeString = escapeString; +exports.getModificationDate = getModificationDate; exports.getVerbosityLevel = getVerbosityLevel; exports.info = info; exports.isArrayBuffer = isArrayBuffer; exports.isArrayEqual = isArrayEqual; exports.isBool = isBool; -exports.isEmptyObj = isEmptyObj; exports.isNum = isNum; exports.isString = isString; exports.isSameOrigin = isSameOrigin; @@ -1186,7 +1224,8 @@ const UNSUPPORTED_FEATURES = { errorOperatorList: "errorOperatorList", errorFontToUnicode: "errorFontToUnicode", errorFontLoadNative: "errorFontLoadNative", - errorFontGetPath: "errorFontGetPath" + errorFontGetPath: "errorFontGetPath", + errorMarkedContent: "errorMarkedContent" }; exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; const PasswordResponses = { @@ -1601,6 +1640,10 @@ function stringToPDFString(str) { return strBuf.join(""); } +function escapeString(str) { + return str.replace(/([\(\)\\])/g, "\\$1"); +} + function stringToUTF8String(str) { return decodeURIComponent(escape(str)); } @@ -1609,14 +1652,6 @@ function utf8StringToString(str) { return unescape(encodeURIComponent(str)); } -function isEmptyObj(obj) { - for (const key in obj) { - return false; - } - - return true; -} - function isBool(v) { return typeof v === "boolean"; } @@ -1643,6 +1678,11 @@ function isArrayEqual(arr1, arr2) { }); } +function getModificationDate(date = new Date(Date.now())) { + const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), (date.getUTCDate() + 1).toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; + return buffer.join(""); +} + function createPromiseCapability() { const capability = Object.create(null); let isSettled = false; @@ -1717,7 +1757,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.isNodeJS = void 0; -const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !process.versions.electron; +const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); exports.isNodeJS = isNodeJS; /***/ }), @@ -1740,24 +1780,32 @@ var _display_utils = __w_pdfjs_require__(1); var _font_loader = __w_pdfjs_require__(6); -var _api_compatibility = __w_pdfjs_require__(7); +var _node_utils = __w_pdfjs_require__(7); + +var _annotation_storage = __w_pdfjs_require__(8); -var _canvas = __w_pdfjs_require__(8); +var _api_compatibility = __w_pdfjs_require__(9); -var _worker_options = __w_pdfjs_require__(10); +var _canvas = __w_pdfjs_require__(10); + +var _worker_options = __w_pdfjs_require__(12); var _is_node = __w_pdfjs_require__(4); -var _message_handler = __w_pdfjs_require__(11); +var _message_handler = __w_pdfjs_require__(13); + +var _metadata = __w_pdfjs_require__(14); -var _metadata = __w_pdfjs_require__(12); +var _optional_content_config = __w_pdfjs_require__(16); -var _transport_stream = __w_pdfjs_require__(14); +var _transport_stream = __w_pdfjs_require__(17); -var _webgl = __w_pdfjs_require__(15); +var _webgl = __w_pdfjs_require__(18); const DEFAULT_RANGE_CHUNK_SIZE = 65536; const RENDERING_CANCELLED_TIMEOUT = 100; +const DefaultCanvasFactory = _is_node.isNodeJS ? _node_utils.NodeCanvasFactory : _display_utils.DOMCanvasFactory; +const DefaultCMapReaderFactory = _is_node.isNodeJS ? _node_utils.NodeCMapReaderFactory : _display_utils.DOMCMapReaderFactory; let createPDFNetworkStream; function setPDFNetworkStreamFactory(pdfNetworkStreamFactory) { @@ -1826,7 +1874,7 @@ function getDocument(src) { } params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE; - params.CMapReaderFactory = params.CMapReaderFactory || _display_utils.DOMCMapReaderFactory; + params.CMapReaderFactory = params.CMapReaderFactory || DefaultCMapReaderFactory; params.ignoreErrors = params.stopAtErrors !== true; params.fontExtraProperties = params.fontExtraProperties === true; params.pdfBug = params.pdfBug === true; @@ -1843,6 +1891,10 @@ function getDocument(src) { params.disableFontFace = _api_compatibility.apiCompatibilityParams.disableFontFace || false; } + if (typeof params.ownerDocument === "undefined") { + params.ownerDocument = globalThis.document; + } + if (typeof params.disableRange !== "boolean") { params.disableRange = false; } @@ -1927,7 +1979,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { return worker.messageHandler.sendWithPromise("GetDocRequest", { docId, - apiVersion: '2.5.207', + apiVersion: '2.6.347', source: { data: source.data, url: source.url, @@ -2068,6 +2120,10 @@ class PDFDocumentProxy { this._transport = transport; } + get annotationStorage() { + return (0, _util.shadow)(this, "annotationStorage", new _annotation_storage.AnnotationStorage()); + } + get numPages() { return this._pdfInfo.numPages; } @@ -2112,13 +2168,6 @@ class PDFDocumentProxy { return this._transport.getOpenAction(); } - getOpenActionDestination() { - (0, _display_utils.deprecated)("getOpenActionDestination, use getOpenAction instead."); - return this.getOpenAction().then(function (openAction) { - return openAction && openAction.dest ? openAction.dest : null; - }); - } - getAttachments() { return this._transport.getAttachments(); } @@ -2131,6 +2180,10 @@ class PDFDocumentProxy { return this._transport.getOutline(); } + getOptionalContentConfig() { + return this._transport.getOptionalContentConfig(); + } + getPermissions() { return this._transport.getPermissions(); } @@ -2167,14 +2220,19 @@ class PDFDocumentProxy { return this._transport.loadingTask; } + saveDocument(annotationStorage) { + return this._transport.saveDocument(annotationStorage); + } + } exports.PDFDocumentProxy = PDFDocumentProxy; class PDFPageProxy { - constructor(pageIndex, pageInfo, transport, pdfBug = false) { + constructor(pageIndex, pageInfo, transport, ownerDocument, pdfBug = false) { this._pageIndex = pageIndex; this._pageInfo = pageInfo; + this._ownerDocument = ownerDocument; this._transport = transport; this._stats = pdfBug ? new _display_utils.StatTimer() : null; this._pdfBug = pdfBug; @@ -2182,7 +2240,7 @@ class PDFPageProxy { this.objs = new PDFObjects(); this.cleanupAfterRender = false; this.pendingCleanup = false; - this.intentStates = Object.create(null); + this._intentStates = new Map(); this.destroyed = false; } @@ -2243,7 +2301,9 @@ class PDFPageProxy { transform = null, imageLayer = null, canvasFactory = null, - background = null + background = null, + annotationStorage = null, + optionalContentConfigPromise = null }) { if (this._stats) { this._stats.time("Overall"); @@ -2252,18 +2312,26 @@ class PDFPageProxy { const renderingIntent = intent === "print" ? "print" : "display"; this.pendingCleanup = false; - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = Object.create(null); + if (!optionalContentConfigPromise) { + optionalContentConfigPromise = this._transport.getOptionalContentConfig(); } - const intentState = this.intentStates[renderingIntent]; + let intentState = this._intentStates.get(renderingIntent); + + if (!intentState) { + intentState = Object.create(null); + + this._intentStates.set(renderingIntent, intentState); + } if (intentState.streamReaderCancelTimeout) { clearTimeout(intentState.streamReaderCancelTimeout); intentState.streamReaderCancelTimeout = null; } - const canvasFactoryInstance = canvasFactory || new _display_utils.DOMCanvasFactory(); + const canvasFactoryInstance = canvasFactory || new DefaultCanvasFactory({ + ownerDocument: this._ownerDocument + }); const webGLContext = new _webgl.WebGLContext({ enable: enableWebGL }); @@ -2283,7 +2351,8 @@ class PDFPageProxy { this._pumpOperatorList({ pageIndex: this._pageIndex, intent: renderingIntent, - renderInteractiveForms: renderInteractiveForms === true + renderInteractiveForms: renderInteractiveForms === true, + annotationStorage: annotationStorage && annotationStorage.getAll() || null }); } @@ -2343,7 +2412,7 @@ class PDFPageProxy { intentState.renderTasks.push(internalRenderTask); const renderTask = internalRenderTask.task; - intentState.displayReadyCapability.promise.then(transparency => { + Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(([transparency, optionalContentConfig]) => { if (this.pendingCleanup) { complete(); return; @@ -2353,7 +2422,10 @@ class PDFPageProxy { this._stats.time("Rendering"); } - internalRenderTask.initializeGraphics(transparency); + internalRenderTask.initializeGraphics({ + transparency, + optionalContentConfig + }); internalRenderTask.operatorListChanged(); }).catch(complete); return renderTask; @@ -2373,15 +2445,18 @@ class PDFPageProxy { const renderingIntent = "oplist"; - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = Object.create(null); + let intentState = this._intentStates.get(renderingIntent); + + if (!intentState) { + intentState = Object.create(null); + + this._intentStates.set(renderingIntent, intentState); } - const intentState = this.intentStates[renderingIntent]; let opListTask; if (!intentState.opListReadCapability) { - opListTask = {}; + opListTask = Object.create(null); opListTask.operatorListChanged = operatorListChanged; intentState.opListReadCapability = (0, _util.createPromiseCapability)(); intentState.renderTasks = []; @@ -2456,9 +2531,8 @@ class PDFPageProxy { this.destroyed = true; this._transport.pageCache[this._pageIndex] = null; const waitOn = []; - Object.keys(this.intentStates).forEach(intent => { - const intentState = this.intentStates[intent]; + for (const [intent, intentState] of this._intentStates) { this._abortOperatorList({ intentState, reason: new Error("Page was destroyed."), @@ -2466,15 +2540,15 @@ class PDFPageProxy { }); if (intent === "oplist") { - return; + continue; } - intentState.renderTasks.forEach(function (renderTask) { - const renderCompleted = renderTask.capability.promise.catch(function () {}); - waitOn.push(renderCompleted); - renderTask.cancel(); - }); - }); + for (const internalRenderTask of intentState.renderTasks) { + waitOn.push(internalRenderTask.completed); + internalRenderTask.cancel(); + } + } + this.objs.clear(); this.annotationsPromise = null; this.pendingCleanup = false; @@ -2487,16 +2561,21 @@ class PDFPageProxy { } _tryCleanup(resetStats = false) { - if (!this.pendingCleanup || Object.keys(this.intentStates).some(intent => { - const intentState = this.intentStates[intent]; - return intentState.renderTasks.length !== 0 || !intentState.operatorList.lastChunk; - })) { + if (!this.pendingCleanup) { return false; } - Object.keys(this.intentStates).forEach(intent => { - delete this.intentStates[intent]; - }); + for (const { + renderTasks, + operatorList + } of this._intentStates.values()) { + if (renderTasks.length !== 0 || !operatorList.lastChunk) { + return false; + } + } + + this._intentStates.clear(); + this.objs.clear(); this.annotationsPromise = null; @@ -2509,7 +2588,7 @@ class PDFPageProxy { } _startRenderPage(transparency, intent) { - const intentState = this.intentStates[intent]; + const intentState = this._intentStates.get(intent); if (!intentState) { return; @@ -2547,7 +2626,9 @@ class PDFPageProxy { const readableStream = this._transport.messageHandler.sendWithStream("GetOperatorList", args); const reader = readableStream.getReader(); - const intentState = this.intentStates[args.intent]; + + const intentState = this._intentStates.get(args.intent); + intentState.streamReader = reader; const pump = () => { @@ -2634,14 +2715,14 @@ class PDFPageProxy { return; } - Object.keys(this.intentStates).some(intent => { - if (this.intentStates[intent] === intentState) { - delete this.intentStates[intent]; - return true; + for (const [intent, curIntentState] of this._intentStates) { + if (curIntentState === intentState) { + this._intentStates.delete(intent); + + break; } + } - return false; - }); this.cleanup(); } @@ -3058,7 +3139,8 @@ class WorkerTransport { this.commonObjs = new PDFObjects(); this.fontLoader = new _font_loader.FontLoader({ docId: loadingTask.docId, - onUnsupportedFeature: this._onUnsupportedFeature.bind(this) + onUnsupportedFeature: this._onUnsupportedFeature.bind(this), + ownerDocument: params.ownerDocument }); this._params = params; this.CMapReaderFactory = new params.CMapReaderFactory({ @@ -3151,6 +3233,14 @@ class WorkerTransport { sink.onCancel = reason => { this._fullReader.cancel(reason); + + sink.ready.catch(readyReason => { + if (this.destroyed) { + return; + } + + throw readyReason; + }); }; }); messageHandler.on("ReaderHeadersReady", data => { @@ -3209,6 +3299,13 @@ class WorkerTransport { sink.onCancel = reason => { rangeReader.cancel(reason); + sink.ready.catch(readyReason => { + if (this.destroyed) { + return; + } + + throw readyReason; + }); }; }); messageHandler.on("GetDoc", ({ @@ -3243,6 +3340,11 @@ class WorkerTransport { break; } + if (!(reason instanceof Error)) { + const msg = "DocException - expected a valid Error."; + (0, _util.warn)(msg); + } + loadingTask._capability.reject(reason); }); messageHandler.on("PasswordRequest", exception => { @@ -3339,7 +3441,6 @@ class WorkerTransport { break; case "FontPath": - case "FontType3Res": case "Image": this.commonObjs.resolve(id, exportedData); break; @@ -3448,7 +3549,7 @@ class WorkerTransport { throw new Error("Transport destroyed"); } - const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.pdfBug); + const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.ownerDocument, this._params.pdfBug); this.pageCache[pageIndex] = page; return page; }); @@ -3471,6 +3572,18 @@ class WorkerTransport { }); } + saveDocument(annotationStorage) { + return this.messageHandler.sendWithPromise("SaveDocument", { + numPages: this._numPages, + annotationStorage: annotationStorage && annotationStorage.getAll() || null, + filename: this._fullReader ? this._fullReader.filename : null + }).finally(() => { + if (annotationStorage) { + annotationStorage.resetModified(); + } + }); + } + getDestinations() { return this.messageHandler.sendWithPromise("GetDestinations", null); } @@ -3517,6 +3630,12 @@ class WorkerTransport { return this.messageHandler.sendWithPromise("GetOutline", null); } + getOptionalContentConfig() { + return this.messageHandler.sendWithPromise("GetOptionalContentConfig", null).then(results => { + return new _optional_content_config.OptionalContentConfig(results); + }); + } + getPermissions() { return this.messageHandler.sendWithPromise("GetPermissions", null); } @@ -3671,7 +3790,14 @@ const InternalRenderTask = function InternalRenderTaskClosure() { this._canvas = params.canvasContext.canvas; } - initializeGraphics(transparency = false) { + get completed() { + return this.capability.promise.catch(function () {}); + } + + initializeGraphics({ + transparency = false, + optionalContentConfig + }) { if (this.cancelled) { return; } @@ -3697,7 +3823,7 @@ const InternalRenderTask = function InternalRenderTaskClosure() { imageLayer, background } = this.params; - this.gfx = new _canvas.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, this.webGLContext, imageLayer); + this.gfx = new _canvas.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, this.webGLContext, imageLayer, optionalContentConfig); this.gfx.beginDrawing({ transform, viewport, @@ -3798,9 +3924,9 @@ const InternalRenderTask = function InternalRenderTaskClosure() { return InternalRenderTask; }(); -const version = '2.5.207'; +const version = '2.6.347'; exports.version = version; -const build = '0974d6052'; +const build = '3be9c65f'; exports.build = build; /***/ }), @@ -3820,7 +3946,8 @@ var _util = __w_pdfjs_require__(2); class BaseFontLoader { constructor({ docId, - onUnsupportedFeature + onUnsupportedFeature, + ownerDocument = globalThis.document }) { if (this.constructor === BaseFontLoader) { (0, _util.unreachable)("Cannot initialize BaseFontLoader."); @@ -3828,22 +3955,25 @@ class BaseFontLoader { this.docId = docId; this._onUnsupportedFeature = onUnsupportedFeature; + this._document = ownerDocument; this.nativeFontFaces = []; this.styleElement = null; } addNativeFontFace(nativeFontFace) { this.nativeFontFaces.push(nativeFontFace); - document.fonts.add(nativeFontFace); + + this._document.fonts.add(nativeFontFace); } insertRule(rule) { let styleElement = this.styleElement; if (!styleElement) { - styleElement = this.styleElement = document.createElement("style"); + styleElement = this.styleElement = this._document.createElement("style"); styleElement.id = `PDFJS_FONT_STYLE_TAG_${this.docId}`; - document.documentElement.getElementsByTagName("head")[0].appendChild(styleElement); + + this._document.documentElement.getElementsByTagName("head")[0].appendChild(styleElement); } const styleSheet = styleElement.sheet; @@ -3851,8 +3981,8 @@ class BaseFontLoader { } clear() { - this.nativeFontFaces.forEach(function (nativeFontFace) { - document.fonts.delete(nativeFontFace); + this.nativeFontFaces.forEach(nativeFontFace => { + this._document.fonts.delete(nativeFontFace); }); this.nativeFontFaces.length = 0; @@ -3913,7 +4043,7 @@ class BaseFontLoader { } get isFontLoadingAPISupported() { - const supported = typeof document !== "undefined" && !!document.fonts; + const supported = typeof this._document !== "undefined" && !!this._document.fonts; return (0, _util.shadow)(this, "isFontLoadingAPISupported", supported); } @@ -3935,8 +4065,8 @@ let FontLoader; exports.FontLoader = FontLoader; { exports.FontLoader = FontLoader = class GenericFontLoader extends BaseFontLoader { - constructor(docId) { - super(docId); + constructor(params) { + super(params); this.loadingContext = { requests: [], nextRequestId: 0 @@ -4002,7 +4132,9 @@ exports.FontLoader = FontLoader; } let i, ii; - const canvas = document.createElement("canvas"); + + const canvas = this._document.createElement("canvas"); + canvas.width = 1; canvas.height = 1; const ctx = canvas.getContext("2d"); @@ -4056,22 +4188,27 @@ exports.FontLoader = FontLoader; } names.push(loadTestFontId); - const div = document.createElement("div"); + + const div = this._document.createElement("div"); + div.style.visibility = "hidden"; div.style.width = div.style.height = "10px"; div.style.position = "absolute"; div.style.top = div.style.left = "0px"; for (i = 0, ii = names.length; i < ii; ++i) { - const span = document.createElement("span"); + const span = this._document.createElement("span"); + span.textContent = "Hi"; span.style.fontFamily = names[i]; div.appendChild(span); } - document.body.appendChild(div); - isFontReady(loadTestFontId, function () { - document.body.removeChild(div); + this._document.body.appendChild(div); + + isFontReady(loadTestFontId, () => { + this._document.body.removeChild(div); + request.complete(); }); } @@ -4197,6 +4334,152 @@ exports.FontFaceObject = FontFaceObject; "use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NodeCMapReaderFactory = exports.NodeCanvasFactory = void 0; + +var _display_utils = __w_pdfjs_require__(1); + +var _is_node = __w_pdfjs_require__(4); + +var _util = __w_pdfjs_require__(2); + +let NodeCanvasFactory = class { + constructor() { + (0, _util.unreachable)("Not implemented: NodeCanvasFactory"); + } + +}; +exports.NodeCanvasFactory = NodeCanvasFactory; +let NodeCMapReaderFactory = class { + constructor() { + (0, _util.unreachable)("Not implemented: NodeCMapReaderFactory"); + } + +}; +exports.NodeCMapReaderFactory = NodeCMapReaderFactory; + +if (_is_node.isNodeJS) { + exports.NodeCanvasFactory = NodeCanvasFactory = class extends _display_utils.BaseCanvasFactory { + create(width, height) { + if (width <= 0 || height <= 0) { + throw new Error("Invalid canvas size"); + } + + const Canvas = require("canvas"); + + const canvas = Canvas.createCanvas(width, height); + return { + canvas, + context: canvas.getContext("2d") + }; + } + + }; + exports.NodeCMapReaderFactory = NodeCMapReaderFactory = class extends _display_utils.BaseCMapReaderFactory { + _fetchData(url, compressionType) { + return new Promise((resolve, reject) => { + const fs = require("fs"); + + fs.readFile(url, (error, data) => { + if (error || !data) { + reject(new Error(error)); + return; + } + + resolve({ + cMapData: new Uint8Array(data), + compressionType + }); + }); + }); + } + + }; +} + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __w_pdfjs_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AnnotationStorage = void 0; + +class AnnotationStorage { + constructor() { + this._storage = new Map(); + this._modified = false; + this.onSetModified = null; + this.onResetModified = null; + } + + getOrCreateValue(key, defaultValue) { + if (this._storage.has(key)) { + return this._storage.get(key); + } + + this._storage.set(key, defaultValue); + + return defaultValue; + } + + setValue(key, value) { + if (this._storage.get(key) !== value) { + this._setModified(); + } + + this._storage.set(key, value); + } + + getAll() { + if (this._storage.size === 0) { + return null; + } + + return Object.fromEntries(this._storage); + } + + get size() { + return this._storage.size; + } + + _setModified() { + if (!this._modified) { + this._modified = true; + + if (typeof this.onSetModified === "function") { + this.onSetModified(); + } + } + } + + resetModified() { + if (this._modified) { + this._modified = false; + + if (typeof this.onResetModified === "function") { + this.onResetModified(); + } + } + } + +} + +exports.AnnotationStorage = AnnotationStorage; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __w_pdfjs_require__) { + +"use strict"; + + Object.defineProperty(exports, "__esModule", { value: true }); @@ -4216,7 +4499,7 @@ const apiCompatibilityParams = Object.freeze(compatibilityParams); exports.apiCompatibilityParams = apiCompatibilityParams; /***/ }), -/* 8 */ +/* 10 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -4229,7 +4512,7 @@ exports.CanvasGraphics = void 0; var _util = __w_pdfjs_require__(2); -var _pattern_helper = __w_pdfjs_require__(9); +var _pattern_helper = __w_pdfjs_require__(11); var MIN_FONT_SIZE = 16; var MAX_FONT_SIZE = 100; @@ -4574,6 +4857,7 @@ var CanvasExtraState = function CanvasExtraStateClosure() { this.lineWidth = 1; this.activeSMask = null; this.resumeSMaskCtx = null; + this.transferMaps = null; } CanvasExtraState.prototype = { @@ -4592,7 +4876,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() { var EXECUTION_TIME = 15; var EXECUTION_STEPS = 10; - function CanvasGraphics(canvasCtx, commonObjs, objs, canvasFactory, webGLContext, imageLayer) { + function CanvasGraphics(canvasCtx, commonObjs, objs, canvasFactory, webGLContext, imageLayer, optionalContentConfig) { this.ctx = canvasCtx; this.current = new CanvasExtraState(); this.stateStack = []; @@ -4613,6 +4897,9 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.smaskStack = []; this.smaskCounter = 0; this.tempSMask = null; + this.contentVisible = true; + this.markedContentStack = []; + this.optionalContentConfig = optionalContentConfig; this.cachedCanvases = new CachedCanvases(this.canvasFactory); if (canvasCtx) { @@ -4622,7 +4909,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this._cachedGetSinglePixelWidth = null; } - function putBinaryImageData(ctx, imgData) { + function putBinaryImageData(ctx, imgData, transferMaps = null) { if (typeof ImageData !== "undefined" && imgData instanceof ImageData) { ctx.putImageData(imgData, 0, 0); return; @@ -4639,6 +4926,25 @@ var CanvasGraphics = function CanvasGraphicsClosure() { var src = imgData.data; var dest = chunkImgData.data; var i, j, thisChunkHeight, elemsInThisChunk; + let transferMapRed, transferMapGreen, transferMapBlue, transferMapGray; + + if (transferMaps) { + switch (transferMaps.length) { + case 1: + transferMapRed = transferMaps[0]; + transferMapGreen = transferMaps[0]; + transferMapBlue = transferMaps[0]; + transferMapGray = transferMaps[0]; + break; + + case 4: + transferMapRed = transferMaps[0]; + transferMapGreen = transferMaps[1]; + transferMapBlue = transferMaps[2]; + transferMapGray = transferMaps[3]; + break; + } + } if (imgData.kind === _util.ImageKind.GRAYSCALE_1BPP) { var srcLength = src.byteLength; @@ -4648,13 +4954,19 @@ var CanvasGraphics = function CanvasGraphicsClosure() { var white = 0xffffffff; var black = _util.IsLittleEndianCached.value ? 0xff000000 : 0x000000ff; + if (transferMapGray) { + if (transferMapGray[0] === 0xff && transferMapGray[0xff] === 0) { + [white, black] = [black, white]; + } + } + for (i = 0; i < totalChunks; i++) { thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight; destPos = 0; for (j = 0; j < thisChunkHeight; j++) { var srcDiff = srcLength - srcPos; - var k = 0; + let k = 0; var kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7; var kEndUnrolled = kEnd & ~7; var mask = 0; @@ -4690,12 +5002,30 @@ var CanvasGraphics = function CanvasGraphicsClosure() { ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); } } else if (imgData.kind === _util.ImageKind.RGBA_32BPP) { + const hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue); j = 0; elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; for (i = 0; i < fullChunks; i++) { dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); srcPos += elemsInThisChunk; + + if (hasTransferMaps) { + for (let k = 0; k < elemsInThisChunk; k += 4) { + if (transferMapRed) { + dest[k + 0] = transferMapRed[dest[k + 0]]; + } + + if (transferMapGreen) { + dest[k + 1] = transferMapGreen[dest[k + 1]]; + } + + if (transferMapBlue) { + dest[k + 2] = transferMapBlue[dest[k + 2]]; + } + } + } + ctx.putImageData(chunkImgData, 0, j); j += FULL_CHUNK_HEIGHT; } @@ -4703,9 +5033,27 @@ var CanvasGraphics = function CanvasGraphicsClosure() { if (i < totalChunks) { elemsInThisChunk = width * partialChunkHeight * 4; dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); + + if (hasTransferMaps) { + for (let k = 0; k < elemsInThisChunk; k += 4) { + if (transferMapRed) { + dest[k + 0] = transferMapRed[dest[k + 0]]; + } + + if (transferMapGreen) { + dest[k + 1] = transferMapGreen[dest[k + 1]]; + } + + if (transferMapBlue) { + dest[k + 2] = transferMapBlue[dest[k + 2]]; + } + } + } + ctx.putImageData(chunkImgData, 0, j); } } else if (imgData.kind === _util.ImageKind.RGB_24BPP) { + const hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue); thisChunkHeight = FULL_CHUNK_HEIGHT; elemsInThisChunk = width * thisChunkHeight; @@ -4724,6 +5072,22 @@ var CanvasGraphics = function CanvasGraphicsClosure() { dest[destPos++] = 255; } + if (hasTransferMaps) { + for (let k = 0; k < destPos; k += 4) { + if (transferMapRed) { + dest[k + 0] = transferMapRed[dest[k + 0]]; + } + + if (transferMapGreen) { + dest[k + 1] = transferMapGreen[dest[k + 1]]; + } + + if (transferMapBlue) { + dest[k + 2] = transferMapBlue[dest[k + 2]]; + } + } + } + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); } } else { @@ -5106,6 +5470,9 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.tempSMask = null; break; + + case "TR": + this.current.transferMaps = value; } } }, @@ -5207,22 +5574,22 @@ var CanvasGraphics = function CanvasGraphicsClosure() { var width = args[j++]; var height = args[j++]; - if (width === 0) { + if (width === 0 && ctx.lineWidth < this.getSinglePixelWidth()) { width = this.getSinglePixelWidth(); } - if (height === 0) { + if (height === 0 && ctx.lineWidth < this.getSinglePixelWidth()) { height = this.getSinglePixelWidth(); } var xw = x + width; var yh = y + height; - this.ctx.moveTo(x, y); - this.ctx.lineTo(xw, y); - this.ctx.lineTo(xw, yh); - this.ctx.lineTo(x, yh); - this.ctx.lineTo(x, y); - this.ctx.closePath(); + ctx.moveTo(x, y); + ctx.lineTo(xw, y); + ctx.lineTo(xw, yh); + ctx.lineTo(x, yh); + ctx.lineTo(x, y); + ctx.closePath(); break; case _util.OPS.moveTo: @@ -5275,19 +5642,21 @@ var CanvasGraphics = function CanvasGraphicsClosure() { var strokeColor = this.current.strokeColor; ctx.globalAlpha = this.current.strokeAlpha; - if (strokeColor && strokeColor.hasOwnProperty("type") && strokeColor.type === "Pattern") { - ctx.save(); - const transform = ctx.mozCurrentTransform; + if (this.contentVisible) { + if (strokeColor && strokeColor.hasOwnProperty("type") && strokeColor.type === "Pattern") { + ctx.save(); + const transform = ctx.mozCurrentTransform; - const scale = _util.Util.singularValueDecompose2dScale(transform)[0]; + const scale = _util.Util.singularValueDecompose2dScale(transform)[0]; - ctx.strokeStyle = strokeColor.getPattern(ctx, this); - ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, this.current.lineWidth * scale); - ctx.stroke(); - ctx.restore(); - } else { - ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, this.current.lineWidth); - ctx.stroke(); + ctx.strokeStyle = strokeColor.getPattern(ctx, this); + ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, this.current.lineWidth * scale); + ctx.stroke(); + ctx.restore(); + } else { + ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, this.current.lineWidth); + ctx.stroke(); + } } if (consumePath) { @@ -5318,11 +5687,13 @@ var CanvasGraphics = function CanvasGraphicsClosure() { needRestore = true; } - if (this.pendingEOFill) { - ctx.fill("evenodd"); - this.pendingEOFill = false; - } else { - ctx.fill(); + if (this.contentVisible) { + if (this.pendingEOFill) { + ctx.fill("evenodd"); + this.pendingEOFill = false; + } else { + ctx.fill(); + } } if (needRestore) { @@ -5667,15 +6038,15 @@ var CanvasGraphics = function CanvasGraphicsClosure() { } } - if (glyph.isInFont || font.missingFile) { + if (this.contentVisible && (glyph.isInFont || font.missingFile)) { if (simpleFillText && !accent) { ctx.fillText(character, scaledX, scaledY); } else { this.paintChar(character, scaledX, scaledY, patternTransform); if (accent) { - scaledAccentX = scaledX + accent.offset.x / fontSizeScale; - scaledAccentY = scaledY - accent.offset.y / fontSizeScale; + scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale; + scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale; this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY, patternTransform); } } @@ -5747,12 +6118,14 @@ var CanvasGraphics = function CanvasGraphicsClosure() { continue; } - this.processingType3 = glyph; - this.save(); - ctx.scale(fontSize, fontSize); - ctx.transform.apply(ctx, fontMatrix); - this.executeOperatorList(operatorList); - this.restore(); + if (this.contentVisible) { + this.processingType3 = glyph; + this.save(); + ctx.scale(fontSize, fontSize); + ctx.transform.apply(ctx, fontMatrix); + this.executeOperatorList(operatorList); + this.restore(); + } var transformed = _util.Util.applyTransform([glyph.width, 0], fontMatrix); @@ -5809,6 +6182,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.current.patternFill = false; }, shadingFill: function CanvasGraphics_shadingFill(patternIR) { + if (!this.contentVisible) { + return; + } + var ctx = this.ctx; this.save(); var pattern = (0, _pattern_helper.getShadingPatternFromIR)(patternIR); @@ -5846,6 +6223,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { (0, _util.unreachable)("Should not call beginImageData"); }, paintFormXObjectBegin: function CanvasGraphics_paintFormXObjectBegin(matrix, bbox) { + if (!this.contentVisible) { + return; + } + this.save(); this.baseTransformStack.push(this.baseTransform); @@ -5864,10 +6245,18 @@ var CanvasGraphics = function CanvasGraphicsClosure() { } }, paintFormXObjectEnd: function CanvasGraphics_paintFormXObjectEnd() { + if (!this.contentVisible) { + return; + } + this.restore(); this.baseTransform = this.baseTransformStack.pop(); }, beginGroup: function CanvasGraphics_beginGroup(group) { + if (!this.contentVisible) { + return; + } + this.save(); var currentCtx = this.ctx; @@ -5949,6 +6338,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.current.activeSMask = null; }, endGroup: function CanvasGraphics_endGroup(group) { + if (!this.contentVisible) { + return; + } + this.groupLevel--; var groupCtx = this.ctx; this.ctx = this.groupStack.pop(); @@ -5997,6 +6390,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.restore(); }, paintImageMaskXObject: function CanvasGraphics_paintImageMaskXObject(img) { + if (!this.contentVisible) { + return; + } + var ctx = this.ctx; var width = img.width, height = img.height; @@ -6031,7 +6428,12 @@ var CanvasGraphics = function CanvasGraphicsClosure() { maskCtx.restore(); this.paintInlineImageXObject(maskCanvas.canvas); }, - paintImageMaskXObjectRepeat: function CanvasGraphics_paintImageMaskXObjectRepeat(imgData, scaleX, scaleY, positions) { + + paintImageMaskXObjectRepeat(imgData, scaleX, skewX = 0, skewY = 0, scaleY, positions) { + if (!this.contentVisible) { + return; + } + var width = imgData.width; var height = imgData.height; var fillColor = this.current.fillColor; @@ -6048,13 +6450,18 @@ var CanvasGraphics = function CanvasGraphicsClosure() { for (var i = 0, ii = positions.length; i < ii; i += 2) { ctx.save(); - ctx.transform(scaleX, 0, 0, scaleY, positions[i], positions[i + 1]); + ctx.transform(scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]); ctx.scale(1, -1); ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1); ctx.restore(); } }, + paintImageMaskXObjectGroup: function CanvasGraphics_paintImageMaskXObjectGroup(images) { + if (!this.contentVisible) { + return; + } + var ctx = this.ctx; var fillColor = this.current.fillColor; var isPatternFill = this.current.patternFill; @@ -6079,6 +6486,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { } }, paintImageXObject: function CanvasGraphics_paintImageXObject(objId) { + if (!this.contentVisible) { + return; + } + const imgData = objId.startsWith("g_") ? this.commonObjs.get(objId) : this.objs.get(objId); if (!imgData) { @@ -6089,6 +6500,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.paintInlineImageXObject(imgData); }, paintImageXObjectRepeat: function CanvasGraphics_paintImageXObjectRepeat(objId, scaleX, scaleY, positions) { + if (!this.contentVisible) { + return; + } + const imgData = objId.startsWith("g_") ? this.commonObjs.get(objId) : this.objs.get(objId); if (!imgData) { @@ -6113,6 +6528,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.paintInlineImageXObjectGroup(imgData, map); }, paintInlineImageXObject: function CanvasGraphics_paintInlineImageXObject(imgData) { + if (!this.contentVisible) { + return; + } + var width = imgData.width; var height = imgData.height; var ctx = this.ctx; @@ -6132,7 +6551,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() { } else { tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", width, height); var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); + putBinaryImageData(tmpCtx, imgData, this.current.transferMaps); imgToPaint = tmpCanvas.canvas; } @@ -6180,12 +6599,16 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.restore(); }, paintInlineImageXObjectGroup: function CanvasGraphics_paintInlineImageXObjectGroup(imgData, map) { + if (!this.contentVisible) { + return; + } + var ctx = this.ctx; var w = imgData.width; var h = imgData.height; var tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", w, h); var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); + putBinaryImageData(tmpCtx, imgData, this.current.transferMaps); for (var i = 0, ii = map.length; i < ii; i++) { var entry = map[i]; @@ -6209,16 +6632,36 @@ var CanvasGraphics = function CanvasGraphicsClosure() { } }, paintSolidColorImageMask: function CanvasGraphics_paintSolidColorImageMask() { + if (!this.contentVisible) { + return; + } + this.ctx.fillRect(0, 0, 1, 1); }, - paintXObject: function CanvasGraphics_paintXObject() { - (0, _util.warn)("Unsupported 'paintXObject' command."); - }, markPoint: function CanvasGraphics_markPoint(tag) {}, markPointProps: function CanvasGraphics_markPointProps(tag, properties) {}, - beginMarkedContent: function CanvasGraphics_beginMarkedContent(tag) {}, - beginMarkedContentProps: function CanvasGraphics_beginMarkedContentProps(tag, properties) {}, - endMarkedContent: function CanvasGraphics_endMarkedContent() {}, + beginMarkedContent: function CanvasGraphics_beginMarkedContent(tag) { + this.markedContentStack.push({ + visible: true + }); + }, + beginMarkedContentProps: function CanvasGraphics_beginMarkedContentProps(tag, properties) { + if (tag === "OC") { + this.markedContentStack.push({ + visible: this.optionalContentConfig.isVisible(properties) + }); + } else { + this.markedContentStack.push({ + visible: true + }); + } + + this.contentVisible = this.isContentVisible(); + }, + endMarkedContent: function CanvasGraphics_endMarkedContent() { + this.markedContentStack.pop(); + this.contentVisible = this.isContentVisible(); + }, beginCompat: function CanvasGraphics_beginCompat() {}, endCompat: function CanvasGraphics_endCompat() {}, consumePath: function CanvasGraphics_consumePath() { @@ -6249,6 +6692,15 @@ var CanvasGraphics = function CanvasGraphicsClosure() { getCanvasPosition: function CanvasGraphics_getCanvasPosition(x, y) { var transform = this.ctx.mozCurrentTransform; return [transform[0] * x + transform[2] * y + transform[4], transform[1] * x + transform[3] * y + transform[5]]; + }, + isContentVisible: function CanvasGraphics_isContentVisible() { + for (let i = this.markedContentStack.length - 1; i >= 0; i--) { + if (!this.markedContentStack[i].visible) { + return false; + } + } + + return true; } }; @@ -6262,7 +6714,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() { exports.CanvasGraphics = CanvasGraphics; /***/ }), -/* 9 */ +/* 11 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -6743,7 +7195,7 @@ var TilingPattern = function TilingPatternClosure() { exports.TilingPattern = TilingPattern; /***/ }), -/* 10 */ +/* 12 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -6759,7 +7211,7 @@ GlobalWorkerOptions.workerPort = GlobalWorkerOptions.workerPort === undefined ? GlobalWorkerOptions.workerSrc = GlobalWorkerOptions.workerSrc === undefined ? "" : GlobalWorkerOptions.workerSrc; /***/ }), -/* 11 */ +/* 13 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -7260,7 +7712,7 @@ class MessageHandler { exports.MessageHandler = MessageHandler; /***/ }), -/* 12 */ +/* 14 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -7273,7 +7725,7 @@ exports.Metadata = void 0; var _util = __w_pdfjs_require__(2); -var _xml_parser = __w_pdfjs_require__(13); +var _xml_parser = __w_pdfjs_require__(15); class Metadata { constructor(data) { @@ -7370,13 +7822,7 @@ class Metadata { } getAll() { - const obj = Object.create(null); - - for (const [key, value] of this._metadataMap) { - obj[key] = value; - } - - return obj; + return Object.fromEntries(this._metadataMap); } has(name) { @@ -7388,7 +7834,7 @@ class Metadata { exports.Metadata = Metadata; /***/ }), -/* 13 */ +/* 15 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -7831,7 +8277,176 @@ class SimpleXMLParser extends XMLParserBase { exports.SimpleXMLParser = SimpleXMLParser; /***/ }), -/* 14 */ +/* 16 */ +/***/ (function(module, exports, __w_pdfjs_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.OptionalContentConfig = void 0; + +var _util = __w_pdfjs_require__(2); + +class OptionalContentGroup { + constructor(name, intent) { + this.visible = true; + this.name = name; + this.intent = intent; + } + +} + +class OptionalContentConfig { + constructor(data) { + this.name = null; + this.creator = null; + this._order = null; + this._groups = new Map(); + + if (data === null) { + return; + } + + this.name = data.name; + this.creator = data.creator; + this._order = data.order; + + for (const group of data.groups) { + this._groups.set(group.id, new OptionalContentGroup(group.name, group.intent)); + } + + if (data.baseState === "OFF") { + for (const group of this._groups) { + group.visible = false; + } + } + + for (const on of data.on) { + this._groups.get(on).visible = true; + } + + for (const off of data.off) { + this._groups.get(off).visible = false; + } + } + + isVisible(group) { + if (group.type === "OCG") { + if (!this._groups.has(group.id)) { + (0, _util.warn)(`Optional content group not found: ${group.id}`); + return true; + } + + return this._groups.get(group.id).visible; + } else if (group.type === "OCMD") { + if (group.expression) { + (0, _util.warn)("Visibility expression not supported yet."); + } + + if (!group.policy || group.policy === "AnyOn") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (this._groups.get(id).visible) { + return true; + } + } + + return false; + } else if (group.policy === "AllOn") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (!this._groups.get(id).visible) { + return false; + } + } + + return true; + } else if (group.policy === "AnyOff") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (!this._groups.get(id).visible) { + return true; + } + } + + return false; + } else if (group.policy === "AllOff") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (this._groups.get(id).visible) { + return false; + } + } + + return true; + } + + (0, _util.warn)(`Unknown optional content policy ${group.policy}.`); + return true; + } + + (0, _util.warn)(`Unknown group type ${group.type}.`); + return true; + } + + setVisibility(id, visible = true) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return; + } + + this._groups.get(id).visible = !!visible; + } + + getOrder() { + if (!this._groups.size) { + return null; + } + + if (this._order) { + return this._order.slice(); + } + + return Array.from(this._groups.keys()); + } + + getGroups() { + if (!this._groups.size) { + return null; + } + + return Object.fromEntries(this._groups); + } + + getGroup(id) { + return this._groups.get(id) || null; + } + +} + +exports.OptionalContentConfig = OptionalContentConfig; + +/***/ }), +/* 17 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -8186,7 +8801,7 @@ class PDFDataTransportStreamRangeReader { } /***/ }), -/* 15 */ +/* 18 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -8633,7 +9248,7 @@ var WebGLUtils = function WebGLUtilsClosure() { }(); /***/ }), -/* 16 */ +/* 19 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -8648,6 +9263,8 @@ var _display_utils = __w_pdfjs_require__(1); var _util = __w_pdfjs_require__(2); +var _annotation_storage = __w_pdfjs_require__(8); + class AnnotationElementFactory { static create(parameters) { const subtype = parameters.data.annotationType; @@ -8745,6 +9362,7 @@ class AnnotationElement { this.imageResourcesPath = parameters.imageResourcesPath; this.renderInteractiveForms = parameters.renderInteractiveForms; this.svgFactory = parameters.svgFactory; + this.annotationStorage = parameters.annotationStorage; if (isRenderable) { this.container = this._createContainer(ignoreBorder); @@ -8951,19 +9569,26 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement { render() { const TEXT_ALIGNMENT = ["left", "center", "right"]; + const storage = this.annotationStorage; + const id = this.data.id; this.container.className = "textWidgetAnnotation"; let element = null; if (this.renderInteractiveForms) { + const textContent = storage.getOrCreateValue(id, this.data.fieldValue); + if (this.data.multiLine) { element = document.createElement("textarea"); - element.textContent = this.data.fieldValue; + element.textContent = textContent; } else { element = document.createElement("input"); element.type = "text"; - element.setAttribute("value", this.data.fieldValue); + element.setAttribute("value", textContent); } + element.addEventListener("input", function (event) { + storage.setValue(id, event.target.value); + }); element.disabled = this.data.readOnly; element.name = this.data.fieldName; @@ -9031,16 +9656,23 @@ class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement { } render() { + const storage = this.annotationStorage; + const data = this.data; + const id = data.id; + const value = storage.getOrCreateValue(id, data.fieldValue && data.fieldValue !== "Off"); this.container.className = "buttonWidgetAnnotation checkBox"; const element = document.createElement("input"); - element.disabled = this.data.readOnly; + element.disabled = data.readOnly; element.type = "checkbox"; element.name = this.data.fieldName; - if (this.data.fieldValue && this.data.fieldValue !== "Off") { + if (value) { element.setAttribute("checked", true); } + element.addEventListener("change", function (event) { + storage.setValue(id, event.target.checked); + }); this.container.appendChild(element); return this.container; } @@ -9054,15 +9686,30 @@ class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement { render() { this.container.className = "buttonWidgetAnnotation radioButton"; + const storage = this.annotationStorage; + const data = this.data; + const id = data.id; + const value = storage.getOrCreateValue(id, data.fieldValue === data.buttonValue); const element = document.createElement("input"); - element.disabled = this.data.readOnly; + element.disabled = data.readOnly; element.type = "radio"; - element.name = this.data.fieldName; + element.name = data.fieldName; - if (this.data.fieldValue === this.data.buttonValue) { + if (value) { element.setAttribute("checked", true); } + element.addEventListener("change", function (event) { + const name = event.target.name; + + for (const radio of document.getElementsByName(name)) { + if (radio !== event.target) { + storage.setValue(radio.parentNode.getAttribute("data-annotation-id"), false); + } + } + + storage.setValue(id, event.target.checked); + }); this.container.appendChild(element); return this.container; } @@ -9085,6 +9732,9 @@ class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement { render() { this.container.className = "choiceWidgetAnnotation"; + const storage = this.annotationStorage; + const id = this.data.id; + storage.getOrCreateValue(id, this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null); const selectElement = document.createElement("select"); selectElement.disabled = this.data.readOnly; selectElement.name = this.data.fieldName; @@ -9102,13 +9752,18 @@ class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement { optionElement.textContent = option.displayValue; optionElement.value = option.exportValue; - if (this.data.fieldValue.includes(option.displayValue)) { + if (this.data.fieldValue.includes(option.exportValue)) { optionElement.setAttribute("selected", true); } selectElement.appendChild(optionElement); } + selectElement.addEventListener("input", function (event) { + const options = event.target.options; + const value = options[options.selectedIndex].value; + storage.setValue(id, value); + }); this.container.appendChild(selectElement); return this.container; } @@ -9642,8 +10297,9 @@ class AnnotationLayer { linkService: parameters.linkService, downloadManager: parameters.downloadManager, imageResourcesPath: parameters.imageResourcesPath || "", - renderInteractiveForms: parameters.renderInteractiveForms || false, - svgFactory: new _display_utils.DOMSVGFactory() + renderInteractiveForms: typeof parameters.renderInteractiveForms === "boolean" ? parameters.renderInteractiveForms : true, + svgFactory: new _display_utils.DOMSVGFactory(), + annotationStorage: parameters.annotationStorage || new _annotation_storage.AnnotationStorage() }); if (element.isRenderable) { @@ -9669,7 +10325,7 @@ class AnnotationLayer { exports.AnnotationLayer = AnnotationLayer; /***/ }), -/* 17 */ +/* 20 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -10116,6 +10772,7 @@ var renderTextLayer = function renderTextLayerClosure() { this._textContent = textContent; this._textContentStream = textContentStream; this._container = container; + this._document = container.ownerDocument; this._viewport = viewport; this._textDivs = textDivs || []; this._textContentItemsStr = textContentItemsStr || []; @@ -10222,7 +10879,9 @@ var renderTextLayer = function renderTextLayerClosure() { _render: function TextLayer_render(timeout) { const capability = (0, _util.createPromiseCapability)(); let styleCache = Object.create(null); - const canvas = document.createElement("canvas"); + + const canvas = this._document.createElement("canvas"); + canvas.mozOpaque = true; this._layoutTextCtx = canvas.getContext("2d", { alpha: false @@ -10364,7 +11023,7 @@ var renderTextLayer = function renderTextLayerClosure() { exports.renderTextLayer = renderTextLayer; /***/ }), -/* 18 */ +/* 21 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -11769,7 +12428,7 @@ exports.SVGGraphics = SVGGraphics; } paintImageXObject(objId) { - const imgData = this.objs.get(objId); + const imgData = objId.startsWith("g_") ? this.commonObjs.get(objId) : this.objs.get(objId); if (!imgData) { (0, _util.warn)(`Dependent image with object ID ${objId} is not ready yet`); @@ -11890,7 +12549,7 @@ exports.SVGGraphics = SVGGraphics; } /***/ }), -/* 19 */ +/* 22 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -11903,7 +12562,7 @@ exports.PDFNodeStream = void 0; var _util = __w_pdfjs_require__(2); -var _network_utils = __w_pdfjs_require__(20); +var _network_utils = __w_pdfjs_require__(23); ; @@ -12359,7 +13018,7 @@ class PDFNodeStreamFsRangeReader extends BaseRangeReader { } /***/ }), -/* 20 */ +/* 23 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -12375,7 +13034,7 @@ exports.validateResponseStatus = validateResponseStatus; var _util = __w_pdfjs_require__(2); -var _content_disposition = __w_pdfjs_require__(21); +var _content_disposition = __w_pdfjs_require__(24); function validateRangeRequestCapabilities({ getResponseHeader, @@ -12451,7 +13110,7 @@ function validateResponseStatus(status) { } /***/ }), -/* 21 */ +/* 24 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -12639,7 +13298,7 @@ function getFilenameFromContentDispositionHeader(contentDisposition) { } /***/ }), -/* 22 */ +/* 25 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -12652,7 +13311,7 @@ exports.PDFNetworkStream = void 0; var _util = __w_pdfjs_require__(2); -var _network_utils = __w_pdfjs_require__(20); +var _network_utils = __w_pdfjs_require__(23); ; const OK_RESPONSE = 200; @@ -12820,14 +13479,6 @@ class NetworkManager { } } - hasPendingRequests() { - for (const xhrId in this.pendingRequests) { - return true; - } - - return false; - } - getRequestXhr(xhrId) { return this.pendingRequests[xhrId].xhr; } @@ -12836,12 +13487,6 @@ class NetworkManager { return xhrId in this.pendingRequests; } - abortAllRequests() { - for (const xhrId in this.pendingRequests) { - this.abortRequest(xhrId | 0); - } - } - abortRequest(xhrId) { const xhr = this.pendingRequests[xhrId].xhr; delete this.pendingRequests[xhrId]; @@ -13196,7 +13841,7 @@ class PDFNetworkStreamRangeRequestReader { } /***/ }), -/* 23 */ +/* 26 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -13209,7 +13854,7 @@ exports.PDFFetchStream = void 0; var _util = __w_pdfjs_require__(2); -var _network_utils = __w_pdfjs_require__(20); +var _network_utils = __w_pdfjs_require__(23); ; @@ -13434,6 +14079,12 @@ class PDFFetchStreamRangeReader { this._readCapability.resolve(); this._reader = response.body.getReader(); + }).catch(reason => { + if (reason && reason.name === "AbortError") { + return; + } + + throw reason; }); this.onProgress = null; } diff --git a/third-party/pdfjs/build/pdf.worker.js b/third-party/pdfjs/build/pdf.worker.js index af4e46699..58bdf7c19 100644 --- a/third-party/pdfjs/build/pdf.worker.js +++ b/third-party/pdfjs/build/pdf.worker.js @@ -135,8 +135,8 @@ Object.defineProperty(exports, "WorkerMessageHandler", { var _worker = __w_pdfjs_require__(1); -const pdfjsVersion = '2.5.207'; -const pdfjsBuild = '0974d6052'; +const pdfjsVersion = '2.6.347'; +const pdfjsBuild = '3be9c65f'; /***/ }), /* 1 */ @@ -156,47 +156,47 @@ var _primitives = __w_pdfjs_require__(5); var _pdf_manager = __w_pdfjs_require__(6); +var _writer = __w_pdfjs_require__(27); + var _is_node = __w_pdfjs_require__(4); -var _message_handler = __w_pdfjs_require__(45); +var _message_handler = __w_pdfjs_require__(46); -var _worker_stream = __w_pdfjs_require__(46); +var _worker_stream = __w_pdfjs_require__(47); var _core_utils = __w_pdfjs_require__(8); -var WorkerTask = function WorkerTaskClosure() { - function WorkerTask(name) { +class WorkerTask { + constructor(name) { this.name = name; this.terminated = false; this._capability = (0, _util.createPromiseCapability)(); } - WorkerTask.prototype = { - get finished() { - return this._capability.promise; - }, + get finished() { + return this._capability.promise; + } - finish() { - this._capability.resolve(); - }, + finish() { + this._capability.resolve(); + } - terminate() { - this.terminated = true; - }, + terminate() { + this.terminated = true; + } - ensureNotTerminated() { - if (this.terminated) { - throw new Error("Worker task was terminated"); - } + ensureNotTerminated() { + if (this.terminated) { + throw new Error("Worker task was terminated"); } + } - }; - return WorkerTask; -}(); +} exports.WorkerTask = WorkerTask; -var WorkerMessageHandler = { - setup(handler, port) { + +class WorkerMessageHandler { + static setup(handler, port) { var testMessageProcessed = false; handler.on("test", function wphSetupTest(data) { if (testMessageProcessed) { @@ -222,16 +222,16 @@ var WorkerMessageHandler = { handler.on("GetDocRequest", function wphSetupDoc(data) { return WorkerMessageHandler.createDocumentHandler(data, port); }); - }, + } - createDocumentHandler(docParams, port) { + static createDocumentHandler(docParams, port) { var pdfManager; var terminated = false; var cancelXHRs = null; var WorkerTasks = []; const verbosity = (0, _util.getVerbosityLevel)(); const apiVersion = docParams.apiVersion; - const workerVersion = '2.5.207'; + const workerVersion = '2.6.347'; if (apiVersion !== workerVersion) { throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); @@ -445,11 +445,11 @@ var WorkerMessageHandler = { function pdfManagerReady() { ensureNotTerminated(); - loadDocument(false).then(onSuccess, function loadFailure(ex) { + loadDocument(false).then(onSuccess, function (reason) { ensureNotTerminated(); - if (!(ex instanceof _core_utils.XRefParseException)) { - onFailure(ex); + if (!(reason instanceof _core_utils.XRefParseException)) { + onFailure(reason); return; } @@ -458,7 +458,7 @@ var WorkerMessageHandler = { ensureNotTerminated(); loadDocument(true).then(onSuccess, onFailure); }); - }, onFailure); + }); } ensureNotTerminated(); @@ -496,11 +496,12 @@ var WorkerMessageHandler = { }); }); }); - handler.on("GetPageIndex", function wphSetupGetPageIndex(data) { - var ref = _primitives.Ref.get(data.ref.num, data.ref.gen); + handler.on("GetPageIndex", function wphSetupGetPageIndex({ + ref + }) { + const pageRef = _primitives.Ref.get(ref.num, ref.gen); - var catalog = pdfManager.pdfDocument.catalog; - return catalog.getPageIndex(ref); + return pdfManager.ensureCatalog("getPageIndex", [pageRef]); }); handler.on("GetDestinations", function wphSetupGetDestinations(data) { return pdfManager.ensureCatalog("destinations"); @@ -532,6 +533,9 @@ var WorkerMessageHandler = { handler.on("GetOutline", function wphSetupGetOutline(data) { return pdfManager.ensureCatalog("documentOutline"); }); + handler.on("GetOptionalContentConfig", function (data) { + return pdfManager.ensureCatalog("optionalContentConfig"); + }); handler.on("GetPermissions", function (data) { return pdfManager.ensureCatalog("permissions"); }); @@ -545,7 +549,7 @@ var WorkerMessageHandler = { }); }); handler.on("GetStats", function wphSetupGetStats(data) { - return pdfManager.pdfDocument.xref.stats; + return pdfManager.ensureXRef("stats"); }); handler.on("GetAnnotations", function ({ pageIndex, @@ -555,6 +559,65 @@ var WorkerMessageHandler = { return page.getAnnotationsData(intent); }); }); + handler.on("SaveDocument", function ({ + numPages, + annotationStorage, + filename + }) { + pdfManager.requestLoadedStream(); + const promises = [pdfManager.onLoadedStream()]; + const document = pdfManager.pdfDocument; + + for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { + promises.push(pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`Save: page ${pageIndex}`); + return page.save(handler, task, annotationStorage); + })); + } + + return Promise.all(promises).then(([stream, ...refs]) => { + let newRefs = []; + + for (const ref of refs) { + newRefs = ref.filter(x => x !== null).reduce((a, b) => a.concat(b), newRefs); + } + + if (newRefs.length === 0) { + return stream.bytes; + } + + const xref = document.xref; + let newXrefInfo = Object.create(null); + + if (xref.trailer) { + const _info = Object.create(null); + + const xrefInfo = xref.trailer.get("Info") || null; + + if (xrefInfo) { + xrefInfo.forEach((key, value) => { + if ((0, _util.isString)(key) && (0, _util.isString)(value)) { + _info[key] = (0, _util.stringToPDFString)(value); + } + }); + } + + newXrefInfo = { + rootRef: xref.trailer.getRaw("Root") || null, + encrypt: xref.trailer.getRaw("Encrypt") || null, + newRef: xref.getNewRef(), + infoRef: xref.trailer.getRaw("Info") || null, + info: _info, + fileIds: xref.trailer.getRaw("ID") || null, + startXRef: document.startXRef, + filename + }; + } + + xref.resetNewRef(); + return (0, _writer.incrementalUpdate)(stream.bytes, newXrefInfo, newRefs); + }); + }); handler.on("GetOperatorList", function wphSetupRenderPage(data, sink) { var pageIndex = data.pageIndex; pdfManager.getPage(pageIndex).then(function (page) { @@ -566,7 +629,8 @@ var WorkerMessageHandler = { sink, task, intent: data.intent, - renderInteractiveForms: data.renderInteractiveForms + renderInteractiveForms: data.renderInteractiveForms, + annotationStorage: data.annotationStorage }).then(function (operatorListInfo) { finishWorkerTask(task); @@ -662,15 +726,16 @@ var WorkerMessageHandler = { docParams = null; }); return workerHandlerName; - }, + } - initializeFromPort(port) { + static initializeFromPort(port) { var handler = new _message_handler.MessageHandler("worker", "main", port); WorkerMessageHandler.setup(handler, port); handler.send("ready", null); } -}; +} + exports.WorkerMessageHandler = WorkerMessageHandler; function isMessagePort(maybePort) { @@ -696,12 +761,13 @@ exports.arraysToBytes = arraysToBytes; exports.assert = assert; exports.bytesToString = bytesToString; exports.createPromiseCapability = createPromiseCapability; +exports.escapeString = escapeString; +exports.getModificationDate = getModificationDate; exports.getVerbosityLevel = getVerbosityLevel; exports.info = info; exports.isArrayBuffer = isArrayBuffer; exports.isArrayEqual = isArrayEqual; exports.isBool = isBool; -exports.isEmptyObj = isEmptyObj; exports.isNum = isNum; exports.isString = isString; exports.isSameOrigin = isSameOrigin; @@ -1000,7 +1066,8 @@ const UNSUPPORTED_FEATURES = { errorOperatorList: "errorOperatorList", errorFontToUnicode: "errorFontToUnicode", errorFontLoadNative: "errorFontLoadNative", - errorFontGetPath: "errorFontGetPath" + errorFontGetPath: "errorFontGetPath", + errorMarkedContent: "errorMarkedContent" }; exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; const PasswordResponses = { @@ -1415,6 +1482,10 @@ function stringToPDFString(str) { return strBuf.join(""); } +function escapeString(str) { + return str.replace(/([\(\)\\])/g, "\\$1"); +} + function stringToUTF8String(str) { return decodeURIComponent(escape(str)); } @@ -1423,14 +1494,6 @@ function utf8StringToString(str) { return unescape(encodeURIComponent(str)); } -function isEmptyObj(obj) { - for (const key in obj) { - return false; - } - - return true; -} - function isBool(v) { return typeof v === "boolean"; } @@ -1457,6 +1520,11 @@ function isArrayEqual(arr1, arr2) { }); } +function getModificationDate(date = new Date(Date.now())) { + const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), (date.getUTCDate() + 1).toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; + return buffer.join(""); +} + function createPromiseCapability() { const capability = Object.create(null); let isSettled = false; @@ -1531,7 +1599,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.isNodeJS = void 0; -const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !process.versions.electron; +const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); exports.isNodeJS = isNodeJS; /***/ }), @@ -1623,6 +1691,10 @@ var Dict = function DictClosure() { this.xref = newXref; }, + get size() { + return Object.keys(this._map).length; + }, + get(key1, key2, key3) { let value = this._map[key1]; @@ -1685,6 +1757,9 @@ var Dict = function DictClosure() { getKeys: function Dict_getKeys() { return Object.keys(this._map); }, + getRawValues: function Dict_getRawValues() { + return Object.values(this._map); + }, set: function Dict_set(key, value) { this._map[key] = value; }, @@ -1699,26 +1774,75 @@ var Dict = function DictClosure() { }; Dict.empty = new Dict(null); - Dict.merge = function (xref, dictArray) { + Dict.merge = function ({ + xref, + dictArray, + mergeSubDicts = false + }) { const mergedDict = new Dict(xref); - for (let i = 0, ii = dictArray.length; i < ii; i++) { - const dict = dictArray[i]; + if (!mergeSubDicts) { + for (const dict of dictArray) { + if (!(dict instanceof Dict)) { + continue; + } + + for (const [key, value] of Object.entries(dict._map)) { + if (mergedDict._map[key] === undefined) { + mergedDict._map[key] = value; + } + } + } + + return mergedDict.size > 0 ? mergedDict : Dict.empty; + } + + const properties = new Map(); - if (!isDict(dict)) { + for (const dict of dictArray) { + if (!(dict instanceof Dict)) { continue; } - for (const keyName in dict._map) { - if (mergedDict._map[keyName] !== undefined) { + for (const [key, value] of Object.entries(dict._map)) { + let property = properties.get(key); + + if (property === undefined) { + property = []; + properties.set(key, property); + } + + property.push(value); + } + } + + for (const [name, values] of properties) { + if (values.length === 1 || !(values[0] instanceof Dict)) { + mergedDict._map[name] = values[0]; + continue; + } + + const subDict = new Dict(xref); + + for (const dict of values) { + if (!(dict instanceof Dict)) { continue; } - mergedDict._map[keyName] = dict._map[keyName]; + for (const [key, value] of Object.entries(dict._map)) { + if (subDict._map[key] === undefined) { + subDict._map[key] = value; + } + } + } + + if (subDict.size > 0) { + mergedDict._map[name] = subDict; } } - return mergedDict; + properties.clear(); + return mergedDict.size > 0 ? mergedDict : Dict.empty; }; return Dict; @@ -1759,60 +1883,63 @@ var Ref = function RefClosure() { exports.Ref = Ref; -var RefSet = function RefSetClosure() { - function RefSet() { - this.dict = Object.create(null); +class RefSet { + constructor() { + this._set = new Set(); + } + + has(ref) { + return this._set.has(ref.toString()); } - RefSet.prototype = { - has: function RefSet_has(ref) { - return ref.toString() in this.dict; - }, - put: function RefSet_put(ref) { - this.dict[ref.toString()] = true; - }, - remove: function RefSet_remove(ref) { - delete this.dict[ref.toString()]; - } - }; - return RefSet; -}(); + put(ref) { + this._set.add(ref.toString()); + } + + remove(ref) { + this._set.delete(ref.toString()); + } + +} exports.RefSet = RefSet; -var RefSetCache = function RefSetCacheClosure() { - function RefSetCache() { - this.dict = Object.create(null); +class RefSetCache { + constructor() { + this._map = new Map(); } - RefSetCache.prototype = { - get size() { - return Object.keys(this.dict).length; - }, + get size() { + return this._map.size; + } - get: function RefSetCache_get(ref) { - return this.dict[ref.toString()]; - }, - has: function RefSetCache_has(ref) { - return ref.toString() in this.dict; - }, - put: function RefSetCache_put(ref, obj) { - this.dict[ref.toString()] = obj; - }, - putAlias: function RefSetCache_putAlias(ref, aliasRef) { - this.dict[ref.toString()] = this.get(aliasRef); - }, - forEach: function RefSetCache_forEach(callback) { - for (const i in this.dict) { - callback(this.dict[i]); - } - }, - clear: function RefSetCache_clear() { - this.dict = Object.create(null); + get(ref) { + return this._map.get(ref.toString()); + } + + has(ref) { + return this._map.has(ref.toString()); + } + + put(ref, obj) { + this._map.set(ref.toString(), obj); + } + + putAlias(ref, aliasRef) { + this._map.set(ref.toString(), this.get(aliasRef)); + } + + forEach(callback) { + for (const value of this._map.values()) { + callback(value); } - }; - return RefSetCache; -}(); + } + + clear() { + this._map.clear(); + } + +} exports.RefSetCache = RefSetCache; @@ -2082,8 +2209,7 @@ class ChunkedStream { this.pos = 0; this.end = length; this.chunkSize = chunkSize; - this.loadedChunks = []; - this.numChunksLoaded = 0; + this._loadedChunks = new Set(); this.numChunks = Math.ceil(length / chunkSize); this.manager = manager; this.progressiveDataLength = 0; @@ -2094,7 +2220,7 @@ class ChunkedStream { const chunks = []; for (let chunk = 0, n = this.numChunks; chunk < n; ++chunk) { - if (!this.loadedChunks[chunk]) { + if (!this._loadedChunks.has(chunk)) { chunks.push(chunk); } } @@ -2106,6 +2232,10 @@ class ChunkedStream { return [this]; } + get numChunksLoaded() { + return this._loadedChunks.size; + } + allChunksLoaded() { return this.numChunksLoaded === this.numChunks; } @@ -2128,10 +2258,7 @@ class ChunkedStream { const endChunk = Math.floor((end - 1) / chunkSize) + 1; for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } + this._loadedChunks.add(curChunk); } } @@ -2144,10 +2271,7 @@ class ChunkedStream { const endChunk = position >= this.end ? this.numChunks : Math.floor(position / this.chunkSize); for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } + this._loadedChunks.add(curChunk); } } @@ -2162,7 +2286,7 @@ class ChunkedStream { return; } - if (!this.loadedChunks[chunk]) { + if (!this._loadedChunks.has(chunk)) { throw new _core_utils.MissingDataException(pos, pos + 1); } @@ -2183,7 +2307,7 @@ class ChunkedStream { const endChunk = Math.floor((end - 1) / chunkSize) + 1; for (let chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { + if (!this._loadedChunks.has(chunk)) { throw new _core_utils.MissingDataException(begin, end); } } @@ -2195,7 +2319,7 @@ class ChunkedStream { for (let i = 0; i < numChunks; ++i) { const chunk = (beginChunk + i) % numChunks; - if (!this.loadedChunks[chunk]) { + if (!this._loadedChunks.has(chunk)) { return chunk; } } @@ -2204,7 +2328,7 @@ class ChunkedStream { } hasChunk(chunk) { - return !!this.loadedChunks[chunk]; + return this._loadedChunks.has(chunk); } get length() { @@ -2347,7 +2471,7 @@ class ChunkedStream { const missingChunks = []; for (let chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { + if (!this._loadedChunks.has(chunk)) { missingChunks.push(chunk); } } @@ -2383,9 +2507,9 @@ class ChunkedStreamManager { this.disableAutoFetch = args.disableAutoFetch; this.msgHandler = args.msgHandler; this.currRequestId = 0; - this.chunksNeededByRequest = Object.create(null); - this.requestsByChunk = Object.create(null); - this.promisesByRequest = Object.create(null); + this._chunksNeededByRequest = new Map(); + this._requestsByChunk = new Map(); + this._promisesByRequest = new Map(); this.progressiveDataLength = 0; this.aborted = false; this._loadedStreamCapability = (0, _util.createPromiseCapability)(); @@ -2454,47 +2578,57 @@ class ChunkedStreamManager { _requestChunks(chunks) { const requestId = this.currRequestId++; - const chunksNeeded = Object.create(null); - this.chunksNeededByRequest[requestId] = chunksNeeded; + const chunksNeeded = new Set(); + + this._chunksNeededByRequest.set(requestId, chunksNeeded); for (const chunk of chunks) { if (!this.stream.hasChunk(chunk)) { - chunksNeeded[chunk] = true; + chunksNeeded.add(chunk); } } - if ((0, _util.isEmptyObj)(chunksNeeded)) { + if (chunksNeeded.size === 0) { return Promise.resolve(); } const capability = (0, _util.createPromiseCapability)(); - this.promisesByRequest[requestId] = capability; + + this._promisesByRequest.set(requestId, capability); + const chunksToRequest = []; - for (let chunk in chunksNeeded) { - chunk = chunk | 0; + for (const chunk of chunksNeeded) { + let requestIds = this._requestsByChunk.get(chunk); + + if (!requestIds) { + requestIds = []; + + this._requestsByChunk.set(chunk, requestIds); - if (!(chunk in this.requestsByChunk)) { - this.requestsByChunk[chunk] = []; chunksToRequest.push(chunk); } - this.requestsByChunk[chunk].push(requestId); - } - - if (!chunksToRequest.length) { - return capability.promise; + requestIds.push(requestId); } - const groupedChunksToRequest = this.groupChunks(chunksToRequest); + if (chunksToRequest.length > 0) { + const groupedChunksToRequest = this.groupChunks(chunksToRequest); - for (const groupedChunk of groupedChunksToRequest) { - const begin = groupedChunk.beginChunk * this.chunkSize; - const end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); - this.sendRequest(begin, end); + for (const groupedChunk of groupedChunksToRequest) { + const begin = groupedChunk.beginChunk * this.chunkSize; + const end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); + this.sendRequest(begin, end); + } } - return capability.promise; + return capability.promise.catch(reason => { + if (this.aborted) { + return; + } + + throw reason; + }); } getStream() { @@ -2596,17 +2730,22 @@ class ChunkedStreamManager { const loadedRequests = []; for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - const requestIds = this.requestsByChunk[curChunk] || []; - delete this.requestsByChunk[curChunk]; + const requestIds = this._requestsByChunk.get(curChunk); + + if (!requestIds) { + continue; + } + + this._requestsByChunk.delete(curChunk); for (const requestId of requestIds) { - const chunksNeeded = this.chunksNeededByRequest[requestId]; + const chunksNeeded = this._chunksNeededByRequest.get(requestId); - if (curChunk in chunksNeeded) { - delete chunksNeeded[curChunk]; + if (chunksNeeded.has(curChunk)) { + chunksNeeded.delete(curChunk); } - if (!(0, _util.isEmptyObj)(chunksNeeded)) { + if (chunksNeeded.size > 0) { continue; } @@ -2614,7 +2753,7 @@ class ChunkedStreamManager { } } - if (!this.disableAutoFetch && (0, _util.isEmptyObj)(this.requestsByChunk)) { + if (!this.disableAutoFetch && this._requestsByChunk.size === 0) { let nextEmptyChunk; if (this.stream.numChunksLoaded === 1) { @@ -2633,8 +2772,10 @@ class ChunkedStreamManager { } for (const requestId of loadedRequests) { - const capability = this.promisesByRequest[requestId]; - delete this.promisesByRequest[requestId]; + const capability = this._promisesByRequest.get(requestId); + + this._promisesByRequest.delete(requestId); + capability.resolve(); } @@ -2663,8 +2804,8 @@ class ChunkedStreamManager { this.pdfNetworkStream.cancelAllRequests(reason); } - for (const requestId in this.promisesByRequest) { - this.promisesByRequest[requestId].reject(reason); + for (const capability of this._promisesByRequest.values()) { + capability.reject(reason); } } @@ -2839,9 +2980,7 @@ var _parser = __w_pdfjs_require__(11); var _operator_list = __w_pdfjs_require__(26); -var _evaluator = __w_pdfjs_require__(27); - -var _function = __w_pdfjs_require__(41); +var _evaluator = __w_pdfjs_require__(28); const DEFAULT_USER_UNIT = 1.0; const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; @@ -2857,10 +2996,10 @@ class Page { pageIndex, pageDict, ref, + globalIdFactory, fontCache, builtInCMapCache, - globalImageCache, - pdfFunctionFactory + globalImageCache }) { this.pdfManager = pdfManager; this.pageIndex = pageIndex; @@ -2870,19 +3009,14 @@ class Page { this.fontCache = fontCache; this.builtInCMapCache = builtInCMapCache; this.globalImageCache = globalImageCache; - this.pdfFunctionFactory = pdfFunctionFactory; this.evaluatorOptions = pdfManager.evaluatorOptions; this.resourcesPromise = null; const idCounters = { obj: 0 }; - this.idFactory = { - createObjId() { + this._localIdFactory = class extends globalIdFactory { + static createObjId() { return `p${pageIndex}_${++idCounters.obj}`; - }, - - getDocId() { - return `g_${pdfManager.docId}`; } }; @@ -2904,7 +3038,10 @@ class Page { return value[0]; } - return _primitives.Dict.merge(this.xref, value); + return _primitives.Dict.merge({ + xref: this.xref, + dictArray: value + }); } get content() { @@ -3005,6 +3142,35 @@ class Page { return stream; } + save(handler, task, annotationStorage) { + const partialEvaluator = new _evaluator.PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + globalImageCache: this.globalImageCache, + options: this.evaluatorOptions + }); + return this._parsedAnnotations.then(function (annotations) { + const newRefsPromises = []; + + for (const annotation of annotations) { + if (!isAnnotationRenderable(annotation, "print")) { + continue; + } + + newRefsPromises.push(annotation.save(partialEvaluator, task, annotationStorage).catch(function (reason) { + (0, _util.warn)("save - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); + return null; + })); + } + + return Promise.all(newRefsPromises); + }); + } + loadResources(keys) { if (!this.resourcesPromise) { this.resourcesPromise = this.pdfManager.ensure(this, "resources"); @@ -3021,7 +3187,8 @@ class Page { sink, task, intent, - renderInteractiveForms + renderInteractiveForms, + annotationStorage }) { const contentStreamPromise = this.pdfManager.ensure(this, "getContentStream"); const resourcesPromise = this.loadResources(["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"]); @@ -3029,16 +3196,15 @@ class Page { xref: this.xref, handler, pageIndex: this.pageIndex, - idFactory: this.idFactory, + idFactory: this._localIdFactory, fontCache: this.fontCache, builtInCMapCache: this.builtInCMapCache, globalImageCache: this.globalImageCache, - options: this.evaluatorOptions, - pdfFunctionFactory: this.pdfFunctionFactory + options: this.evaluatorOptions }); const dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); const pageListPromise = dataPromises.then(([contentStream]) => { - const opList = new _operator_list.OperatorList(intent, sink, this.pageIndex); + const opList = new _operator_list.OperatorList(intent, sink); handler.send("StartRenderPage", { transparency: partialEvaluator.hasBlendModes(this.resources), pageIndex: this.pageIndex, @@ -3065,7 +3231,7 @@ class Page { for (const annotation of annotations) { if (isAnnotationRenderable(annotation, intent)) { - opListPromises.push(annotation.getOperatorList(partialEvaluator, task, renderInteractiveForms).catch(function (reason) { + opListPromises.push(annotation.getOperatorList(partialEvaluator, task, renderInteractiveForms, annotationStorage).catch(function (reason) { (0, _util.warn)("getOperatorList - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); return null; })); @@ -3103,12 +3269,11 @@ class Page { xref: this.xref, handler, pageIndex: this.pageIndex, - idFactory: this.idFactory, + idFactory: this._localIdFactory, fontCache: this.fontCache, builtInCMapCache: this.builtInCMapCache, globalImageCache: this.globalImageCache, - options: this.evaluatorOptions, - pdfFunctionFactory: this.pdfFunctionFactory + options: this.evaluatorOptions }); return partialEvaluator.getTextContent({ stream: contentStream, @@ -3144,7 +3309,7 @@ class Page { const annotationPromises = []; for (const annotationRef of this.annotations) { - annotationPromises.push(_annotation.AnnotationFactory.create(this.xref, annotationRef, this.pdfManager, this.idFactory).catch(function (reason) { + annotationPromises.push(_annotation.AnnotationFactory.create(this.xref, annotationRef, this.pdfManager, this._localIdFactory).catch(function (reason) { (0, _util.warn)(`_parsedAnnotations: "${reason}".`); return null; })); @@ -3235,53 +3400,33 @@ class PDFDocument { this.pdfManager = pdfManager; this.stream = stream; this.xref = new _obj.XRef(stream, pdfManager); - this.pdfFunctionFactory = new _function.PDFFunctionFactory({ - xref: this.xref, - isEvalSupported: pdfManager.evaluatorOptions.isEvalSupported - }); this._pagePromises = []; - } - - parse(recoveryMode) { - this.setup(recoveryMode); - const version = this.catalog.catDict.get("Version"); - - if ((0, _primitives.isName)(version)) { - this.pdfFormatVersion = version.name; - } - - try { - this.acroForm = this.catalog.catDict.get("AcroForm"); - - if (this.acroForm) { - this.xfa = this.acroForm.get("XFA"); - const fields = this.acroForm.get("Fields"); - - if ((!Array.isArray(fields) || fields.length === 0) && !this.xfa) { - this.acroForm = null; - } + this._version = null; + const idCounters = { + font: 0 + }; + this._globalIdFactory = class { + static getDocId() { + return `g_${pdfManager.docId}`; } - } catch (ex) { - if (ex instanceof _core_utils.MissingDataException) { - throw ex; + + static createFontId() { + return `f${++idCounters.font}`; } - (0, _util.info)("Cannot fetch AcroForm entry; assuming no AcroForms are present"); - this.acroForm = null; - } + static createObjId() { + (0, _util.unreachable)("Abstract method `createObjId` called."); + } - try { - const collection = this.catalog.catDict.get("Collection"); + }; + } - if ((0, _primitives.isDict)(collection) && collection.getKeys().length > 0) { - this.collection = collection; - } - } catch (ex) { - if (ex instanceof _core_utils.MissingDataException) { - throw ex; - } + parse(recoveryMode) { + this.xref.parse(recoveryMode); + this.catalog = new _obj.Catalog(this.pdfManager, this.xref); - (0, _util.info)("Cannot fetch Collection dictionary."); + if (this.catalog.version) { + this._version = this.catalog.version; } } @@ -3375,8 +3520,8 @@ class PDFDocument { version += String.fromCharCode(ch); } - if (!this.pdfFormatVersion) { - this.pdfFormatVersion = version.substring(5); + if (!this._version) { + this._version = version.substring(5); } } @@ -3384,17 +3529,66 @@ class PDFDocument { this.xref.setStartXRef(this.startXRef); } - setup(recoveryMode) { - this.xref.parse(recoveryMode); - this.catalog = new _obj.Catalog(this.pdfManager, this.xref); - } - get numPages() { const linearization = this.linearization; const num = linearization ? linearization.numPages : this.catalog.numPages; return (0, _util.shadow)(this, "numPages", num); } + _hasOnlyDocumentSignatures(fields, recursionDepth = 0) { + const RECURSION_LIMIT = 10; + return fields.every(field => { + field = this.xref.fetchIfRef(field); + + if (field.has("Kids")) { + if (++recursionDepth > RECURSION_LIMIT) { + (0, _util.warn)("_hasOnlyDocumentSignatures: maximum recursion depth reached"); + return false; + } + + return this._hasOnlyDocumentSignatures(field.get("Kids"), recursionDepth); + } + + const isSignature = (0, _primitives.isName)(field.get("FT"), "Sig"); + const rectangle = field.get("Rect"); + const isInvisible = Array.isArray(rectangle) && rectangle.every(value => value === 0); + return isSignature && isInvisible; + }); + } + + get formInfo() { + const formInfo = { + hasAcroForm: false, + hasXfa: false + }; + const acroForm = this.catalog.acroForm; + + if (!acroForm) { + return (0, _util.shadow)(this, "formInfo", formInfo); + } + + try { + const xfa = acroForm.get("XFA"); + const hasXfa = Array.isArray(xfa) && xfa.length > 0 || (0, _primitives.isStream)(xfa) && !xfa.isEmpty; + formInfo.hasXfa = hasXfa; + const fields = acroForm.get("Fields"); + const hasFields = Array.isArray(fields) && fields.length > 0; + const sigFlags = acroForm.get("SigFlags"); + + const hasOnlyDocumentSignatures = !!(sigFlags & 0x1) && this._hasOnlyDocumentSignatures(fields); + + formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures; + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } + + (0, _util.info)("Cannot fetch form information."); + } + + return (0, _util.shadow)(this, "formInfo", formInfo); + } + get documentInfo() { const DocumentInfoValidators = { Title: _util.isString, @@ -3407,7 +3601,7 @@ class PDFDocument { ModDate: _util.isString, Trapped: _primitives.isName }; - let version = this.pdfFormatVersion; + let version = this._version; if (typeof version !== "string" || !PDF_HEADER_VERSION_REGEXP.test(version)) { (0, _util.warn)(`Invalid PDF header version number: ${version}`); @@ -3417,9 +3611,9 @@ class PDFDocument { const docInfo = { PDFFormatVersion: version, IsLinearized: !!this.linearization, - IsAcroFormPresent: !!this.acroForm, - IsXFAPresent: !!this.xfa, - IsCollectionPresent: !!this.collection + IsAcroFormPresent: this.formInfo.hasAcroForm, + IsXFAPresent: this.formInfo.hasXfa, + IsCollectionPresent: !!this.catalog.collection }; let infoDict; @@ -3528,10 +3722,10 @@ class PDFDocument { pageIndex, pageDict, ref, + globalIdFactory: this._globalIdFactory, fontCache: catalog.fontCache, builtInCMapCache: catalog.builtInCMapCache, - globalImageCache: catalog.globalImageCache, - pdfFunctionFactory: this.pdfFunctionFactory + globalImageCache: catalog.globalImageCache }); }); } @@ -3592,9 +3786,9 @@ class Catalog { constructor(pdfManager, xref) { this.pdfManager = pdfManager; this.xref = xref; - this.catDict = xref.getCatalogObj(); + this._catDict = xref.getCatalogObj(); - if (!(0, _primitives.isDict)(this.catDict)) { + if (!(0, _primitives.isDict)(this._catDict)) { throw new _util.FormatError("Catalog object is not a dictionary."); } @@ -3604,8 +3798,58 @@ class Catalog { this.pageKidsCountCache = new _primitives.RefSetCache(); } + get version() { + const version = this._catDict.get("Version"); + + if (!(0, _primitives.isName)(version)) { + return (0, _util.shadow)(this, "version", null); + } + + return (0, _util.shadow)(this, "version", version.name); + } + + get collection() { + let collection = null; + + try { + const obj = this._catDict.get("Collection"); + + if ((0, _primitives.isDict)(obj) && obj.size > 0) { + collection = obj; + } + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } + + (0, _util.info)("Cannot fetch Collection entry; assuming no collection is present."); + } + + return (0, _util.shadow)(this, "collection", collection); + } + + get acroForm() { + let acroForm = null; + + try { + const obj = this._catDict.get("AcroForm"); + + if ((0, _primitives.isDict)(obj) && obj.size > 0) { + acroForm = obj; + } + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } + + (0, _util.info)("Cannot fetch AcroForm entry; assuming no forms are present."); + } + + return (0, _util.shadow)(this, "acroForm", acroForm); + } + get metadata() { - const streamRef = this.catDict.getRaw("Metadata"); + const streamRef = this._catDict.getRaw("Metadata"); if (!(0, _primitives.isRef)(streamRef)) { return (0, _util.shadow)(this, "metadata", null); @@ -3636,7 +3880,7 @@ class Catalog { } get toplevelPagesDict() { - const pagesObj = this.catDict.get("Pages"); + const pagesObj = this._catDict.get("Pages"); if (!(0, _primitives.isDict)(pagesObj)) { throw new _util.FormatError("Invalid top-level pages dictionary."); @@ -3662,7 +3906,7 @@ class Catalog { } _readDocumentOutline() { - let obj = this.catDict.get("Outlines"); + let obj = this._catDict.get("Outlines"); if (!(0, _primitives.isDict)(obj)) { return null; @@ -3797,6 +4041,166 @@ class Catalog { return permissions; } + get optionalContentConfig() { + let config = null; + + try { + const properties = this._catDict.get("OCProperties"); + + if (!properties) { + return (0, _util.shadow)(this, "optionalContentConfig", null); + } + + const defaultConfig = properties.get("D"); + + if (!defaultConfig) { + return (0, _util.shadow)(this, "optionalContentConfig", null); + } + + const groupsData = properties.get("OCGs"); + + if (!Array.isArray(groupsData)) { + return (0, _util.shadow)(this, "optionalContentConfig", null); + } + + const groups = []; + const groupRefs = []; + + for (const groupRef of groupsData) { + if (!(0, _primitives.isRef)(groupRef)) { + continue; + } + + groupRefs.push(groupRef); + const group = this.xref.fetchIfRef(groupRef); + groups.push({ + id: groupRef.toString(), + name: (0, _util.isString)(group.get("Name")) ? (0, _util.stringToPDFString)(group.get("Name")) : null, + intent: (0, _util.isString)(group.get("Intent")) ? (0, _util.stringToPDFString)(group.get("Intent")) : null + }); + } + + config = this._readOptionalContentConfig(defaultConfig, groupRefs); + config.groups = groups; + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } + + (0, _util.warn)(`Unable to read optional content config: ${ex}`); + } + + return (0, _util.shadow)(this, "optionalContentConfig", config); + } + + _readOptionalContentConfig(config, contentGroupRefs) { + function parseOnOff(refs) { + const onParsed = []; + + if (Array.isArray(refs)) { + for (const value of refs) { + if (!(0, _primitives.isRef)(value)) { + continue; + } + + if (contentGroupRefs.includes(value)) { + onParsed.push(value.toString()); + } + } + } + + return onParsed; + } + + function parseOrder(refs, nestedLevels = 0) { + if (!Array.isArray(refs)) { + return null; + } + + const order = []; + + for (const value of refs) { + if ((0, _primitives.isRef)(value) && contentGroupRefs.includes(value)) { + parsedOrderRefs.put(value); + order.push(value.toString()); + continue; + } + + const nestedOrder = parseNestedOrder(value, nestedLevels); + + if (nestedOrder) { + order.push(nestedOrder); + } + } + + if (nestedLevels > 0) { + return order; + } + + const hiddenGroups = []; + + for (const groupRef of contentGroupRefs) { + if (parsedOrderRefs.has(groupRef)) { + continue; + } + + hiddenGroups.push(groupRef.toString()); + } + + if (hiddenGroups.length) { + order.push({ + name: null, + order: hiddenGroups + }); + } + + return order; + } + + function parseNestedOrder(ref, nestedLevels) { + if (++nestedLevels > MAX_NESTED_LEVELS) { + (0, _util.warn)("parseNestedOrder - reached MAX_NESTED_LEVELS."); + return null; + } + + const value = xref.fetchIfRef(ref); + + if (!Array.isArray(value)) { + return null; + } + + const nestedName = xref.fetchIfRef(value[0]); + + if (typeof nestedName !== "string") { + return null; + } + + const nestedOrder = parseOrder(value.slice(1), nestedLevels); + + if (!nestedOrder || !nestedOrder.length) { + return null; + } + + return { + name: (0, _util.stringToPDFString)(nestedName), + order: nestedOrder + }; + } + + const xref = this.xref, + parsedOrderRefs = new _primitives.RefSet(), + MAX_NESTED_LEVELS = 10; + return { + name: (0, _util.isString)(config.get("Name")) ? (0, _util.stringToPDFString)(config.get("Name")) : null, + creator: (0, _util.isString)(config.get("Creator")) ? (0, _util.stringToPDFString)(config.get("Creator")) : null, + baseState: (0, _primitives.isName)(config.get("BaseState")) ? config.get("BaseState").name : null, + on: parseOnOff(config.get("ON")), + off: parseOnOff(config.get("OFF")), + order: parseOrder(config.get("Order")), + groups: null + }; + } + get numPages() { const obj = this.toplevelPagesDict.get("Count"); @@ -3839,12 +4243,12 @@ class Catalog { } _readDests() { - const obj = this.catDict.get("Names"); + const obj = this._catDict.get("Names"); if (obj && obj.has("Dests")) { return new NameTree(obj.getRaw("Dests"), this.xref); - } else if (this.catDict.has("Dests")) { - return this.catDict.get("Dests"); + } else if (this._catDict.has("Dests")) { + return this._catDict.get("Dests"); } return undefined; @@ -3867,7 +4271,7 @@ class Catalog { } _readPageLabels() { - const obj = this.catDict.getRaw("PageLabels"); + const obj = this._catDict.getRaw("PageLabels"); if (!obj) { return null; @@ -3973,7 +4377,8 @@ class Catalog { } get pageLayout() { - const obj = this.catDict.get("PageLayout"); + const obj = this._catDict.get("PageLayout"); + let pageLayout = ""; if ((0, _primitives.isName)(obj)) { @@ -3992,7 +4397,8 @@ class Catalog { } get pageMode() { - const obj = this.catDict.get("PageMode"); + const obj = this._catDict.get("PageMode"); + let pageMode = "UseNone"; if ((0, _primitives.isName)(obj)) { @@ -4030,7 +4436,9 @@ class Catalog { PrintPageRange: Array.isArray, NumCopies: Number.isInteger }; - const obj = this.catDict.get("ViewerPreferences"); + + const obj = this._catDict.get("ViewerPreferences"); + let prefs = null; if ((0, _primitives.isDict)(obj)) { @@ -4171,7 +4579,8 @@ class Catalog { } get openAction() { - const obj = this.catDict.get("OpenAction"); + const obj = this._catDict.get("OpenAction"); + let openAction = null; if ((0, _primitives.isDict)(obj)) { @@ -4212,7 +4621,8 @@ class Catalog { } get attachments() { - const obj = this.catDict.get("Names"); + const obj = this._catDict.get("Names"); + let attachments = null; if (obj && obj.has("EmbeddedFiles")) { @@ -4234,7 +4644,8 @@ class Catalog { } get javaScript() { - const obj = this.catDict.get("Names"); + const obj = this._catDict.get("Names"); + let javaScript = null; function appendIfJavaScriptDict(jsDict) { @@ -4272,7 +4683,7 @@ class Catalog { } } - const openAction = this.catDict.get("OpenAction"); + const openAction = this._catDict.get("OpenAction"); if ((0, _primitives.isDict)(openAction) && (0, _primitives.isName)(openAction.get("S"), "JavaScript")) { appendIfJavaScriptDict(openAction); @@ -4318,7 +4729,7 @@ class Catalog { getPageDict(pageIndex) { const capability = (0, _util.createPromiseCapability)(); - const nodesToVisit = [this.catDict.getRaw("Pages")]; + const nodesToVisit = [this._catDict.getRaw("Pages")]; const visitedNodes = new _primitives.RefSet(); const xref = this.xref, pageKidsCountCache = this.pageKidsCountCache; @@ -4683,9 +5094,20 @@ var XRef = function XRefClosure() { streamTypes: Object.create(null), fontTypes: Object.create(null) }; + this._newRefNum = null; } XRef.prototype = { + getNewRef: function XRef_getNewRef() { + if (this._newRefNum === null) { + this._newRefNum = this.entries.length; + } + + return _primitives.Ref.get(this._newRefNum++, 0); + }, + resetNewRef: function XRef_resetNewRef() { + this._newRefNum = null; + }, setStartXRef: function XRef_setStartXRef(startXRef) { this.startXRefQueue = [startXRef]; }, @@ -5687,24 +6109,17 @@ const ObjectLoader = function () { } function addChildren(node, nodesToVisit) { - if (node instanceof _primitives.Dict || (0, _primitives.isStream)(node)) { - const dict = node instanceof _primitives.Dict ? node : node.dict; - const dictKeys = dict.getKeys(); - - for (let i = 0, ii = dictKeys.length; i < ii; i++) { - const rawValue = dict.getRaw(dictKeys[i]); - - if (mayHaveChildren(rawValue)) { - nodesToVisit.push(rawValue); - } - } - } else if (Array.isArray(node)) { - for (let i = 0, ii = node.length; i < ii; i++) { - const value = node[i]; + if (node instanceof _primitives.Dict) { + node = node.getRawValues(); + } else if ((0, _primitives.isStream)(node)) { + node = node.dict.getRawValues(); + } else if (!Array.isArray(node)) { + return; + } - if (mayHaveChildren(value)) { - nodesToVisit.push(value); - } + for (const rawValue of node) { + if (mayHaveChildren(rawValue)) { + nodesToVisit.push(rawValue); } } } @@ -5998,10 +6413,11 @@ class Parser { I = 0x49, SPACE = 0x20, LF = 0xa, - CR = 0xd; - const n = 10, + CR = 0xd, NUL = 0x0; - const startPos = stream.pos; + const lexer = this.lexer, + startPos = stream.pos, + n = 10; let state = 0, ch, maybeEIPos; @@ -6031,6 +6447,20 @@ class Parser { } } + if (state !== 2) { + continue; + } + + if (lexer.knownCommands) { + const nextObj = lexer.peekObj(); + + if (nextObj instanceof _primitives.Cmd && !lexer.knownCommands[nextObj.cmd]) { + state = 0; + } + } else { + (0, _util.warn)("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined."); + } + if (state === 2) { break; } @@ -7036,6 +7466,28 @@ class Lexer { return _primitives.Cmd.get(str); } + peekObj() { + const streamPos = this.stream.pos, + currentChar = this.currentChar, + beginInlineImagePos = this.beginInlineImagePos; + let nextObj; + + try { + nextObj = this.getObj(); + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } + + (0, _util.warn)(`peekObj: ${ex}`); + } + + this.stream.pos = streamPos; + this.currentChar = currentChar; + this.beginInlineImagePos = beginInlineImagePos; + return nextObj; + } + skipToNextLine() { let ch = this.currentChar; @@ -12090,9 +12542,9 @@ var JpegImage = function JpegImageClosure() { } } else if (nextByte === 0xd9) { if (parseDNLMarker) { - const maybeScanLines = blockRow * 8; + const maybeScanLines = blockRow * (frame.precision === 8 ? 8 : 0); - if (maybeScanLines > 0 && maybeScanLines < frame.scanLines / 10) { + if (maybeScanLines > 0 && Math.round(frame.scanLines / maybeScanLines) >= 10) { throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, " + "possibly caused by incorrect `scanLines` parameter", maybeScanLines); } } @@ -12912,8 +13364,10 @@ var JpegImage = function JpegImageClosure() { component; for (i = 0; i < selectorsCount; i++) { - var componentIndex = frame.componentIds[data[offset++]]; + const index = data[offset++]; + var componentIndex = frame.componentIds[index]; component = frame.components[componentIndex]; + component.index = index; var tableSpec = data[offset++]; component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; @@ -12990,6 +13444,7 @@ var JpegImage = function JpegImageClosure() { } this.components.push({ + index: component.index, output: buildComponentData(frame, component), scaleX: component.h / frame.maxH, scaleY: component.v / frame.maxV, @@ -13070,6 +13525,8 @@ var JpegImage = function JpegImageClosure() { if (this.numComponents === 3) { if (this._colorTransform === 0) { return false; + } else if (this.components[0].index === 0x52 && this.components[1].index === 0x47 && this.components[2].index === 0x42) { + return false; } return true; @@ -15683,6 +16140,7 @@ var ARCFourCipher = function ARCFourCipherClosure() { } }; ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock; + ARCFourCipher.prototype.encrypt = ARCFourCipher.prototype.encryptBlock; return ARCFourCipher; }(); @@ -16222,6 +16680,9 @@ var NullCipher = function NullCipherClosure() { NullCipher.prototype = { decryptBlock: function NullCipher_decryptBlock(data) { return data; + }, + encrypt: function NullCipher_encrypt(data) { + return data; } }; return NullCipher; @@ -16835,6 +17296,39 @@ var CipherTransform = function CipherTransformClosure() { var data = (0, _util.stringToBytes)(s); data = cipher.decryptBlock(data, true); return (0, _util.bytesToString)(data); + }, + encryptString: function CipherTransform_encryptString(s) { + const cipher = new this.StringCipherConstructor(); + + if (cipher instanceof AESBaseCipher) { + const strLen = s.length; + const pad = 16 - strLen % 16; + + if (pad !== 16) { + s = s.padEnd(16 * Math.ceil(strLen / 16), String.fromCharCode(pad)); + } + + const iv = new Uint8Array(16); + + if (typeof crypto !== "undefined") { + crypto.getRandomValues(iv); + } else { + for (let i = 0; i < 16; i++) { + iv[i] = Math.floor(256 * Math.random()); + } + } + + let data = (0, _util.stringToBytes)(s); + data = cipher.encrypt(data, iv); + const buf = new Uint8Array(16 + data.length); + buf.set(iv); + buf.set(data, 16); + return (0, _util.bytesToString)(buf); + } + + let data = (0, _util.stringToBytes)(s); + data = cipher.encrypt(data); + return (0, _util.bytesToString)(data); } }; return CipherTransform; @@ -17220,6 +17714,8 @@ var _util = __w_pdfjs_require__(2); var _primitives = __w_pdfjs_require__(5); +var _core_utils = __w_pdfjs_require__(8); + function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) { const COMPONENTS = 3; alpha01 = alpha01 !== 1 ? 0 : alpha01; @@ -17352,135 +17848,162 @@ class ColorSpace { return (0, _util.shadow)(this, "usesZeroToOneRange", true); } - static parse(cs, xref, res, pdfFunctionFactory) { - const IR = this.parseToIR(cs, xref, res, pdfFunctionFactory); - return this.fromIR(IR); - } + static _cache(cacheKey, xref, localColorSpaceCache, parsedColorSpace) { + if (!localColorSpaceCache) { + throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.'); + } - static fromIR(IR) { - const name = Array.isArray(IR) ? IR[0] : IR; - let whitePoint, blackPoint, gamma; + if (!parsedColorSpace) { + throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.'); + } - switch (name) { - case "DeviceGrayCS": - return this.singletons.gray; + let csName, csRef; - case "DeviceRgbCS": - return this.singletons.rgb; + if (cacheKey instanceof _primitives.Ref) { + csRef = cacheKey; + cacheKey = xref.fetch(cacheKey); + } - case "DeviceCmykCS": - return this.singletons.cmyk; + if (cacheKey instanceof _primitives.Name) { + csName = cacheKey.name; + } + + if (csName || csRef) { + localColorSpaceCache.set(csName, csRef, parsedColorSpace); + } + } - case "CalGrayCS": - whitePoint = IR[1]; - blackPoint = IR[2]; - gamma = IR[3]; - return new CalGrayCS(whitePoint, blackPoint, gamma); + static getCached(cacheKey, xref, localColorSpaceCache) { + if (!localColorSpaceCache) { + throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.'); + } - case "CalRGBCS": - whitePoint = IR[1]; - blackPoint = IR[2]; - gamma = IR[3]; - const matrix = IR[4]; - return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); + if (cacheKey instanceof _primitives.Ref) { + const localColorSpace = localColorSpaceCache.getByRef(cacheKey); - case "PatternCS": - let basePatternCS = IR[1]; + if (localColorSpace) { + return localColorSpace; + } - if (basePatternCS) { - basePatternCS = this.fromIR(basePatternCS); + try { + cacheKey = xref.fetch(cacheKey); + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; } + } + } - return new PatternCS(basePatternCS); + if (cacheKey instanceof _primitives.Name) { + const localColorSpace = localColorSpaceCache.getByName(cacheKey.name); - case "IndexedCS": - const baseIndexedCS = IR[1]; - const hiVal = IR[2]; - const lookup = IR[3]; - return new IndexedCS(this.fromIR(baseIndexedCS), hiVal, lookup); + if (localColorSpace) { + return localColorSpace; + } + } - case "AlternateCS": - const numComps = IR[1]; - const alt = IR[2]; - const tintFn = IR[3]; - return new AlternateCS(numComps, this.fromIR(alt), tintFn); + return null; + } - case "LabCS": - whitePoint = IR[1]; - blackPoint = IR[2]; - const range = IR[3]; - return new LabCS(whitePoint, blackPoint, range); + static async parseAsync({ + cs, + xref, + resources = null, + pdfFunctionFactory, + localColorSpaceCache + }) { + const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory); - default: - throw new _util.FormatError(`Unknown colorspace name: ${name}`); + this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); + + return parsedColorSpace; + } + + static parse({ + cs, + xref, + resources = null, + pdfFunctionFactory, + localColorSpaceCache + }) { + const cachedColorSpace = this.getCached(cs, xref, localColorSpaceCache); + + if (cachedColorSpace) { + return cachedColorSpace; } + + const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory); + + this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); + + return parsedColorSpace; } - static parseToIR(cs, xref, res = null, pdfFunctionFactory) { + static _parse(cs, xref, resources = null, pdfFunctionFactory) { cs = xref.fetchIfRef(cs); if ((0, _primitives.isName)(cs)) { switch (cs.name) { case "DeviceGray": case "G": - return "DeviceGrayCS"; + return this.singletons.gray; case "DeviceRGB": case "RGB": - return "DeviceRgbCS"; + return this.singletons.rgb; case "DeviceCMYK": case "CMYK": - return "DeviceCmykCS"; + return this.singletons.cmyk; case "Pattern": - return ["PatternCS", null]; + return new PatternCS(null); default: - if ((0, _primitives.isDict)(res)) { - const colorSpaces = res.get("ColorSpace"); + if ((0, _primitives.isDict)(resources)) { + const colorSpaces = resources.get("ColorSpace"); if ((0, _primitives.isDict)(colorSpaces)) { - const resCS = colorSpaces.get(cs.name); + const resourcesCS = colorSpaces.get(cs.name); - if (resCS) { - if ((0, _primitives.isName)(resCS)) { - return this.parseToIR(resCS, xref, res, pdfFunctionFactory); + if (resourcesCS) { + if ((0, _primitives.isName)(resourcesCS)) { + return this._parse(resourcesCS, xref, resources, pdfFunctionFactory); } - cs = resCS; + cs = resourcesCS; break; } } } - throw new _util.FormatError(`unrecognized colorspace ${cs.name}`); + throw new _util.FormatError(`Unrecognized ColorSpace: ${cs.name}`); } } if (Array.isArray(cs)) { const mode = xref.fetchIfRef(cs[0]).name; - let numComps, params, alt, whitePoint, blackPoint, gamma; + let params, numComps, baseCS, whitePoint, blackPoint, gamma; switch (mode) { case "DeviceGray": case "G": - return "DeviceGrayCS"; + return this.singletons.gray; case "DeviceRGB": case "RGB": - return "DeviceRgbCS"; + return this.singletons.rgb; case "DeviceCMYK": case "CMYK": - return "DeviceCmykCS"; + return this.singletons.cmyk; case "CalGray": params = xref.fetchIfRef(cs[1]); whitePoint = params.getArray("WhitePoint"); blackPoint = params.getArray("BlackPoint"); gamma = params.get("Gamma"); - return ["CalGrayCS", whitePoint, blackPoint, gamma]; + return new CalGrayCS(whitePoint, blackPoint, gamma); case "CalRGB": params = xref.fetchIfRef(cs[1]); @@ -17488,77 +18011,71 @@ class ColorSpace { blackPoint = params.getArray("BlackPoint"); gamma = params.getArray("Gamma"); const matrix = params.getArray("Matrix"); - return ["CalRGBCS", whitePoint, blackPoint, gamma, matrix]; + return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); case "ICCBased": const stream = xref.fetchIfRef(cs[1]); const dict = stream.dict; numComps = dict.get("N"); - alt = dict.get("Alternate"); + const alt = dict.get("Alternate"); if (alt) { - const altIR = this.parseToIR(alt, xref, res, pdfFunctionFactory); - const altCS = this.fromIR(altIR, pdfFunctionFactory); + const altCS = this._parse(alt, xref, resources, pdfFunctionFactory); if (altCS.numComps === numComps) { - return altIR; + return altCS; } (0, _util.warn)("ICCBased color space: Ignoring incorrect /Alternate entry."); } if (numComps === 1) { - return "DeviceGrayCS"; + return this.singletons.gray; } else if (numComps === 3) { - return "DeviceRgbCS"; + return this.singletons.rgb; } else if (numComps === 4) { - return "DeviceCmykCS"; + return this.singletons.cmyk; } break; case "Pattern": - let basePatternCS = cs[1] || null; + baseCS = cs[1] || null; - if (basePatternCS) { - basePatternCS = this.parseToIR(basePatternCS, xref, res, pdfFunctionFactory); + if (baseCS) { + baseCS = this._parse(baseCS, xref, resources, pdfFunctionFactory); } - return ["PatternCS", basePatternCS]; + return new PatternCS(baseCS); case "Indexed": case "I": - const baseIndexedCS = this.parseToIR(cs[1], xref, res, pdfFunctionFactory); + baseCS = this._parse(cs[1], xref, resources, pdfFunctionFactory); const hiVal = xref.fetchIfRef(cs[2]) + 1; - let lookup = xref.fetchIfRef(cs[3]); - - if ((0, _primitives.isStream)(lookup)) { - lookup = lookup.getBytes(); - } - - return ["IndexedCS", baseIndexedCS, hiVal, lookup]; + const lookup = xref.fetchIfRef(cs[3]); + return new IndexedCS(baseCS, hiVal, lookup); case "Separation": case "DeviceN": const name = xref.fetchIfRef(cs[1]); numComps = Array.isArray(name) ? name.length : 1; - alt = this.parseToIR(cs[2], xref, res, pdfFunctionFactory); - const tintFn = pdfFunctionFactory.create(xref.fetchIfRef(cs[3])); - return ["AlternateCS", numComps, alt, tintFn]; + baseCS = this._parse(cs[2], xref, resources, pdfFunctionFactory); + const tintFn = pdfFunctionFactory.create(cs[3]); + return new AlternateCS(numComps, baseCS, tintFn); case "Lab": params = xref.fetchIfRef(cs[1]); whitePoint = params.getArray("WhitePoint"); blackPoint = params.getArray("BlackPoint"); const range = params.getArray("Range"); - return ["LabCS", whitePoint, blackPoint, range]; + return new LabCS(whitePoint, blackPoint, range); default: - throw new _util.FormatError(`unimplemented color space object "${mode}"`); + throw new _util.FormatError(`Unimplemented ColorSpace object: ${mode}`); } } - throw new _util.FormatError(`unrecognized color space object: "${cs}"`); + throw new _util.FormatError(`Unrecognized ColorSpace object: ${cs}`); } static isDefaultDecode(decode, numComps) { @@ -17674,23 +18191,18 @@ class IndexedCS extends ColorSpace { super("Indexed", 1); this.base = base; this.highVal = highVal; - const baseNumComps = base.numComps; - const length = baseNumComps * highVal; + const length = base.numComps * highVal; + this.lookup = new Uint8Array(length); if ((0, _primitives.isStream)(lookup)) { - this.lookup = new Uint8Array(length); const bytes = lookup.getBytes(length); this.lookup.set(bytes); - } else if ((0, _util.isString)(lookup)) { - this.lookup = new Uint8Array(length); - + } else if (typeof lookup === "string") { for (let i = 0; i < length; ++i) { - this.lookup[i] = lookup.charCodeAt(i); + this.lookup[i] = lookup.charCodeAt(i) & 0xff; } - } else if (lookup instanceof Uint8Array) { - this.lookup = lookup; } else { - throw new _util.FormatError(`Unrecognized lookup table: ${lookup}`); + throw new _util.FormatError(`IndexedCS - unrecognized lookup table: ${lookup}`); } } @@ -17952,6 +18464,10 @@ const CalRGBCS = function CalRGBCSClosure() { return adjustToRange(0, 1, 12.92 * color); } + if (color >= 0.99554525) { + return 1; + } + return adjustToRange(0, 1, (1 + 0.055) * color ** (1 / 2.4) - 0.055); } @@ -18024,9 +18540,9 @@ const CalRGBCS = function CalRGBCSClosure() { const A = adjustToRange(0, 1, src[srcOffset] * scale); const B = adjustToRange(0, 1, src[srcOffset + 1] * scale); const C = adjustToRange(0, 1, src[srcOffset + 2] * scale); - const AGR = A ** cs.GR; - const BGG = B ** cs.GG; - const CGB = C ** cs.GB; + const AGR = A === 1 ? 1 : A ** cs.GR; + const BGG = B === 1 ? 1 : B ** cs.GG; + const CGB = C === 1 ? 1 : C ** cs.GB; const X = cs.MXA * AGR + cs.MXB * BGG + cs.MXC * CGB; const Y = cs.MYA * AGR + cs.MYB * BGG + cs.MYC * CGB; const Z = cs.MZA * AGR + cs.MZB * BGG + cs.MZC * CGB; @@ -18260,16 +18776,23 @@ const LabCS = function LabCSClosure() { Object.defineProperty(exports, "__esModule", { value: true }); -exports.GlobalImageCache = exports.LocalImageCache = void 0; +exports.GlobalImageCache = exports.LocalGStateCache = exports.LocalFunctionCache = exports.LocalColorSpaceCache = exports.LocalImageCache = void 0; var _util = __w_pdfjs_require__(2); var _primitives = __w_pdfjs_require__(5); -class LocalImageCache { - constructor() { - this._nameRefMap = new Map(); - this._imageMap = new Map(); +class BaseLocalCache { + constructor(options) { + if (this.constructor === BaseLocalCache) { + (0, _util.unreachable)("Cannot initialize BaseLocalCache."); + } + + if (!options || !options.onlyRefs) { + this._nameRefMap = new Map(); + this._imageMap = new Map(); + } + this._imageCache = new _primitives.RefSetCache(); } @@ -18287,6 +18810,13 @@ class LocalImageCache { return this._imageCache.get(ref) || null; } + set(name, ref, data) { + (0, _util.unreachable)("Abstract method `set` called."); + } + +} + +class LocalImageCache extends BaseLocalCache { set(name, ref = null, data) { if (!name) { throw new Error('LocalImageCache.set - expected "name" argument.'); @@ -18315,6 +18845,93 @@ class LocalImageCache { exports.LocalImageCache = LocalImageCache; +class LocalColorSpaceCache extends BaseLocalCache { + set(name = null, ref = null, data) { + if (!name && !ref) { + throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.'); + } + + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + + if (name) { + this._nameRefMap.set(name, ref); + } + + this._imageCache.put(ref, data); + + return; + } + + if (this._imageMap.has(name)) { + return; + } + + this._imageMap.set(name, data); + } + +} + +exports.LocalColorSpaceCache = LocalColorSpaceCache; + +class LocalFunctionCache extends BaseLocalCache { + constructor(options) { + super({ + onlyRefs: true + }); + } + + getByName(name) { + (0, _util.unreachable)("Should not call `getByName` method."); + } + + set(name = null, ref, data) { + if (!ref) { + throw new Error('LocalFunctionCache.set - expected "ref" argument.'); + } + + if (this._imageCache.has(ref)) { + return; + } + + this._imageCache.put(ref, data); + } + +} + +exports.LocalFunctionCache = LocalFunctionCache; + +class LocalGStateCache extends BaseLocalCache { + set(name, ref = null, data) { + if (!name) { + throw new Error('LocalGStateCache.set - expected "name" argument.'); + } + + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + + this._nameRefMap.set(name, ref); + + this._imageCache.put(ref, data); + + return; + } + + if (this._imageMap.has(name)) { + return; + } + + this._imageMap.set(name, data); + } + +} + +exports.LocalGStateCache = LocalGStateCache; + class GlobalImageCache { static get NUM_PAGES_THRESHOLD() { return (0, _util.shadow)(this, "NUM_PAGES_THRESHOLD", 2); @@ -18358,12 +18975,12 @@ class GlobalImageCache { } getData(ref, pageIndex) { - if (!this._refCache.has(ref)) { + const pageIndexSet = this._refCache.get(ref); + + if (!pageIndexSet) { return null; } - const pageIndexSet = this._refCache.get(ref); - if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) { return null; } @@ -18432,12 +19049,16 @@ var _operator_list = __w_pdfjs_require__(26); var _stream = __w_pdfjs_require__(12); +var _writer = __w_pdfjs_require__(27); + class AnnotationFactory { static create(xref, ref, pdfManager, idFactory) { - return pdfManager.ensure(this, "_create", [xref, ref, pdfManager, idFactory]); + return pdfManager.ensureCatalog("acroForm").then(acroForm => { + return pdfManager.ensure(this, "_create", [xref, ref, pdfManager, idFactory, acroForm]); + }); } - static _create(xref, ref, pdfManager, idFactory) { + static _create(xref, ref, pdfManager, idFactory, acroForm) { const dict = xref.fetchIfRef(ref); if (!(0, _primitives.isDict)(dict)) { @@ -18449,10 +19070,12 @@ class AnnotationFactory { subtype = (0, _primitives.isName)(subtype) ? subtype.name : null; const parameters = { xref, + ref, dict, subtype, id, - pdfManager + pdfManager, + acroForm: acroForm instanceof _primitives.Dict ? acroForm : _primitives.Dict.empty }; switch (subtype) { @@ -18775,13 +19398,14 @@ class Annotation { }); } - getOperatorList(evaluator, task, renderForms) { + getOperatorList(evaluator, task, renderForms, annotationStorage) { if (!this.appearance) { return Promise.resolve(new _operator_list.OperatorList()); } + const appearance = this.appearance; const data = this.data; - const appearanceDict = this.appearance.dict; + const appearanceDict = appearance.dict; const resourcesPromise = this.loadResources(["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"]); const bbox = appearanceDict.getArray("BBox") || [0, 0, 1, 1]; const matrix = appearanceDict.getArray("Matrix") || [1, 0, 0, 1, 0, 0]; @@ -18790,18 +19414,22 @@ class Annotation { const opList = new _operator_list.OperatorList(); opList.addOp(_util.OPS.beginAnnotation, [data.rect, transform, matrix]); return evaluator.getOperatorList({ - stream: this.appearance, + stream: appearance, task, resources, operatorList: opList }).then(() => { opList.addOp(_util.OPS.endAnnotation, []); - this.appearance.reset(); + appearance.reset(); return opList; }); }); } + async save(evaluator, task, annotationStorage) { + return null; + } + } exports.Annotation = Annotation; @@ -18974,18 +19602,20 @@ class WidgetAnnotation extends Annotation { super(params); const dict = params.dict; const data = this.data; + this.ref = params.ref; data.annotationType = _util.AnnotationType.WIDGET; data.fieldName = this._constructFieldName(dict); - data.fieldValue = (0, _core_utils.getInheritableProperty)({ + const fieldValue = (0, _core_utils.getInheritableProperty)({ dict, key: "V", getArray: true }); + data.fieldValue = this._decodeFormValue(fieldValue); data.alternativeText = (0, _util.stringToPDFString)(dict.get("TU") || ""); data.defaultAppearance = (0, _core_utils.getInheritableProperty)({ dict, key: "DA" - }) || ""; + }) || params.acroForm.get("DA") || ""; const fieldType = (0, _core_utils.getInheritableProperty)({ dict, key: "FT" @@ -18994,7 +19624,7 @@ class WidgetAnnotation extends Annotation { this.fieldResources = (0, _core_utils.getInheritableProperty)({ dict, key: "DR" - }) || _primitives.Dict.empty; + }) || params.acroForm.get("DR") || _primitives.Dict.empty; data.fieldFlags = (0, _core_utils.getInheritableProperty)({ dict, key: "Ff" @@ -19045,16 +19675,225 @@ class WidgetAnnotation extends Annotation { return fieldName.join("."); } + _decodeFormValue(formValue) { + if (Array.isArray(formValue)) { + return formValue.filter(item => (0, _util.isString)(item)).map(item => (0, _util.stringToPDFString)(item)); + } else if ((0, _primitives.isName)(formValue)) { + return (0, _util.stringToPDFString)(formValue.name); + } else if ((0, _util.isString)(formValue)) { + return (0, _util.stringToPDFString)(formValue); + } + + return null; + } + hasFieldFlag(flag) { return !!(this.data.fieldFlags & flag); } - getOperatorList(evaluator, task, renderForms) { + getOperatorList(evaluator, task, renderForms, annotationStorage) { if (renderForms) { return Promise.resolve(new _operator_list.OperatorList()); } - return super.getOperatorList(evaluator, task, renderForms); + if (!this._hasText) { + return super.getOperatorList(evaluator, task, renderForms, annotationStorage); + } + + return this._getAppearance(evaluator, task, annotationStorage).then(content => { + if (this.appearance && content === null) { + return super.getOperatorList(evaluator, task, renderForms, annotationStorage); + } + + const operatorList = new _operator_list.OperatorList(); + + if (!this.data.defaultAppearance || content === null) { + return operatorList; + } + + const matrix = [1, 0, 0, 1, 0, 0]; + const bbox = [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]; + const transform = getTransformMatrix(this.data.rect, bbox, matrix); + operatorList.addOp(_util.OPS.beginAnnotation, [this.data.rect, transform, matrix]); + const stream = new _stream.StringStream(content); + return evaluator.getOperatorList({ + stream, + task, + resources: this.fieldResources, + operatorList + }).then(function () { + operatorList.addOp(_util.OPS.endAnnotation, []); + return operatorList; + }); + }); + } + + async save(evaluator, task, annotationStorage) { + if (this.data.fieldValue === annotationStorage[this.data.id]) { + return null; + } + + let appearance = await this._getAppearance(evaluator, task, annotationStorage); + + if (appearance === null) { + return null; + } + + const dict = evaluator.xref.fetchIfRef(this.ref); + + if (!(0, _primitives.isDict)(dict)) { + return null; + } + + const bbox = [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]; + const newRef = evaluator.xref.getNewRef(); + const AP = new _primitives.Dict(evaluator.xref); + AP.set("N", newRef); + const value = annotationStorage[this.data.id]; + const encrypt = evaluator.xref.encrypt; + let originalTransform = null; + let newTransform = null; + + if (encrypt) { + originalTransform = encrypt.createCipherTransform(this.ref.num, this.ref.gen); + newTransform = encrypt.createCipherTransform(newRef.num, newRef.gen); + appearance = newTransform.encryptString(appearance); + } + + dict.set("V", value); + dict.set("AP", AP); + dict.set("M", `D:${(0, _util.getModificationDate)()}`); + const appearanceDict = new _primitives.Dict(evaluator.xref); + appearanceDict.set("Length", appearance.length); + appearanceDict.set("Subtype", _primitives.Name.get("Form")); + appearanceDict.set("Resources", this.fieldResources); + appearanceDict.set("BBox", bbox); + const bufferOriginal = [`${this.ref.num} ${this.ref.gen} obj\n`]; + (0, _writer.writeDict)(dict, bufferOriginal, originalTransform); + bufferOriginal.push("\nendobj\n"); + const bufferNew = [`${newRef.num} ${newRef.gen} obj\n`]; + (0, _writer.writeDict)(appearanceDict, bufferNew, newTransform); + bufferNew.push(" stream\n"); + bufferNew.push(appearance); + bufferNew.push("\nendstream\nendobj\n"); + return [{ + ref: this.ref, + data: bufferOriginal.join("") + }, { + ref: newRef, + data: bufferNew.join("") + }]; + } + + async _getAppearance(evaluator, task, annotationStorage) { + const isPassword = this.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD); + + if (!annotationStorage || isPassword) { + return null; + } + + const value = annotationStorage[this.data.id]; + + if (value === "") { + return ""; + } + + const defaultPadding = 2; + const hPadding = defaultPadding; + const totalHeight = this.data.rect[3] - this.data.rect[1]; + const totalWidth = this.data.rect[2] - this.data.rect[0]; + const fontInfo = await this._getFontData(evaluator, task); + const [font, fontName] = fontInfo; + let fontSize = fontInfo[2]; + fontSize = this._computeFontSize(font, fontName, fontSize, totalHeight); + let descent = font.descent; + + if (isNaN(descent)) { + descent = 0; + } + + const vPadding = defaultPadding + Math.abs(descent) * fontSize; + const defaultAppearance = this.data.defaultAppearance; + const alignment = this.data.textAlignment; + + if (this.data.comb) { + return this._getCombAppearance(defaultAppearance, value, totalWidth, hPadding, vPadding); + } + + if (this.data.multiLine) { + return this._getMultilineAppearance(defaultAppearance, value, font, fontSize, totalWidth, totalHeight, alignment, hPadding, vPadding); + } + + if (alignment === 0 || alignment > 2) { + return "/Tx BMC q BT " + defaultAppearance + ` 1 0 0 1 ${hPadding} ${vPadding} Tm (${(0, _util.escapeString)(value)}) Tj` + " ET Q EMC"; + } + + const renderedText = this._renderText(value, font, fontSize, totalWidth, alignment, hPadding, vPadding); + + return "/Tx BMC q BT " + defaultAppearance + ` 1 0 0 1 0 0 Tm ${renderedText}` + " ET Q EMC"; + } + + async _getFontData(evaluator, task) { + const operatorList = new _operator_list.OperatorList(); + const initialState = { + fontSize: 0, + font: null, + fontName: null, + + clone() { + return this; + } + + }; + await evaluator.getOperatorList({ + stream: new _stream.StringStream(this.data.defaultAppearance), + task, + resources: this.fieldResources, + operatorList, + initialState + }); + return [initialState.font, initialState.fontName, initialState.fontSize]; + } + + _computeFontSize(font, fontName, fontSize, height) { + if (fontSize === null || fontSize === 0) { + const em = font.charsToGlyphs("M", true)[0].width / 1000; + const capHeight = 0.7 * em; + fontSize = Math.max(1, Math.floor(height / (1.5 * capHeight))); + let fontRegex = new RegExp(`/${fontName}\\s+[0-9\.]+\\s+Tf`); + + if (this.data.defaultAppearance.search(fontRegex) === -1) { + fontRegex = new RegExp(`/${fontName}\\s+Tf`); + } + + this.data.defaultAppearance = this.data.defaultAppearance.replace(fontRegex, `/${fontName} ${fontSize} Tf`); + } + + return fontSize; + } + + _renderText(text, font, fontSize, totalWidth, alignment, hPadding, vPadding) { + const glyphs = font.charsToGlyphs(text); + const scale = fontSize / 1000; + let width = 0; + + for (const glyph of glyphs) { + width += glyph.width * scale; + } + + let shift; + + if (alignment === 1) { + shift = (totalWidth - width) / 2; + } else if (alignment === 2) { + shift = totalWidth - width - hPadding; + } else { + shift = hPadding; + } + + shift = shift.toFixed(2); + vPadding = vPadding.toFixed(2); + return `${shift} ${vPadding} Td (${(0, _util.escapeString)(text)}) Tj`; } } @@ -19062,8 +19901,13 @@ class WidgetAnnotation extends Annotation { class TextWidgetAnnotation extends WidgetAnnotation { constructor(params) { super(params); + this._hasText = true; const dict = params.dict; - this.data.fieldValue = (0, _util.stringToPDFString)(this.data.fieldValue || ""); + + if (!(0, _util.isString)(this.data.fieldValue)) { + this.data.fieldValue = ""; + } + let alignment = (0, _core_utils.getInheritableProperty)({ dict, key: "Q" @@ -19088,26 +19932,86 @@ class TextWidgetAnnotation extends WidgetAnnotation { this.data.comb = this.hasFieldFlag(_util.AnnotationFieldFlag.COMB) && !this.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD) && !this.hasFieldFlag(_util.AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== null; } - getOperatorList(evaluator, task, renderForms) { - if (renderForms || this.appearance) { - return super.getOperatorList(evaluator, task, renderForms); + _getCombAppearance(defaultAppearance, text, width, hPadding, vPadding) { + const combWidth = (width / this.data.maxLen).toFixed(2); + const buf = []; + + for (const character of text) { + buf.push(`(${(0, _util.escapeString)(character)}) Tj`); } - const operatorList = new _operator_list.OperatorList(); + const renderedComb = buf.join(` ${combWidth} 0 Td `); + return "/Tx BMC q BT " + defaultAppearance + ` 1 0 0 1 ${hPadding} ${vPadding} Tm ${renderedComb}` + " ET Q EMC"; + } + + _getMultilineAppearance(defaultAppearance, text, font, fontSize, width, height, alignment, hPadding, vPadding) { + const lines = text.split(/\r\n|\r|\n/); + const buf = []; + const totalWidth = width - 2 * hPadding; - if (!this.data.defaultAppearance) { - return Promise.resolve(operatorList); + for (const line of lines) { + const chunks = this._splitLine(line, font, fontSize, totalWidth); + + for (const chunk of chunks) { + const padding = buf.length === 0 ? hPadding : 0; + buf.push(this._renderText(chunk, font, fontSize, width, alignment, padding, -fontSize)); + } } - const stream = new _stream.Stream((0, _util.stringToBytes)(this.data.defaultAppearance)); - return evaluator.getOperatorList({ - stream, - task, - resources: this.fieldResources, - operatorList - }).then(function () { - return operatorList; - }); + const renderedText = buf.join("\n"); + return "/Tx BMC q BT " + defaultAppearance + ` 1 0 0 1 0 ${height} Tm ${renderedText}` + " ET Q EMC"; + } + + _splitLine(line, font, fontSize, width) { + if (line.length <= 1) { + return [line]; + } + + const scale = fontSize / 1000; + const whitespace = font.charsToGlyphs(" ", true)[0].width * scale; + const chunks = []; + let lastSpacePos = -1, + startChunk = 0, + currentWidth = 0; + + for (let i = 0, ii = line.length; i < ii; i++) { + const character = line.charAt(i); + + if (character === " ") { + if (currentWidth + whitespace > width) { + chunks.push(line.substring(startChunk, i)); + startChunk = i; + currentWidth = whitespace; + lastSpacePos = -1; + } else { + currentWidth += whitespace; + lastSpacePos = i; + } + } else { + const charWidth = font.charsToGlyphs(character, false)[0].width * scale; + + if (currentWidth + charWidth > width) { + if (lastSpacePos !== -1) { + chunks.push(line.substring(startChunk, lastSpacePos + 1)); + startChunk = i = lastSpacePos + 1; + lastSpacePos = -1; + currentWidth = 0; + } else { + chunks.push(line.substring(startChunk, i)); + startChunk = i; + currentWidth = charWidth; + } + } else { + currentWidth += charWidth; + } + } + } + + if (startChunk < line.length) { + chunks.push(line.substring(startChunk, line.length)); + } + + return chunks; } } @@ -19115,6 +20019,8 @@ class TextWidgetAnnotation extends WidgetAnnotation { class ButtonWidgetAnnotation extends WidgetAnnotation { constructor(params) { super(params); + this.checkedAppearance = null; + this.uncheckedAppearance = null; this.data.checkBox = !this.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); this.data.radioButton = this.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); this.data.pushButton = this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); @@ -19130,31 +20036,171 @@ class ButtonWidgetAnnotation extends WidgetAnnotation { } } - _processCheckBox(params) { - if ((0, _primitives.isName)(this.data.fieldValue)) { - this.data.fieldValue = this.data.fieldValue.name; + getOperatorList(evaluator, task, renderForms, annotationStorage) { + if (this.data.pushButton) { + return super.getOperatorList(evaluator, task, false, annotationStorage); + } + + if (annotationStorage) { + const value = annotationStorage[this.data.id] || false; + let appearance; + + if (value) { + appearance = this.checkedAppearance; + } else { + appearance = this.uncheckedAppearance; + } + + if (appearance) { + const savedAppearance = this.appearance; + this.appearance = appearance; + const operatorList = super.getOperatorList(evaluator, task, renderForms, annotationStorage); + this.appearance = savedAppearance; + return operatorList; + } + + return Promise.resolve(new _operator_list.OperatorList()); + } + + return super.getOperatorList(evaluator, task, renderForms, annotationStorage); + } + + async save(evaluator, task, annotationStorage) { + if (this.data.checkBox) { + return this._saveCheckbox(evaluator, task, annotationStorage); + } + + if (this.data.radioButton) { + return this._saveRadioButton(evaluator, task, annotationStorage); + } + + return super.save(evaluator, task, annotationStorage); + } + + async _saveCheckbox(evaluator, task, annotationStorage) { + const defaultValue = this.data.fieldValue && this.data.fieldValue !== "Off"; + const value = annotationStorage[this.data.id]; + + if (defaultValue === value) { + return null; + } + + const dict = evaluator.xref.fetchIfRef(this.ref); + + if (!(0, _primitives.isDict)(dict)) { + return null; + } + + const name = _primitives.Name.get(value ? this.data.exportValue : "Off"); + + dict.set("V", name); + dict.set("AS", name); + dict.set("M", `D:${(0, _util.getModificationDate)()}`); + const encrypt = evaluator.xref.encrypt; + let originalTransform = null; + + if (encrypt) { + originalTransform = encrypt.createCipherTransform(this.ref.num, this.ref.gen); + } + + const buffer = [`${this.ref.num} ${this.ref.gen} obj\n`]; + (0, _writer.writeDict)(dict, buffer, originalTransform); + buffer.push("\nendobj\n"); + return [{ + ref: this.ref, + data: buffer.join("") + }]; + } + + async _saveRadioButton(evaluator, task, annotationStorage) { + const defaultValue = this.data.fieldValue === this.data.buttonValue; + const value = annotationStorage[this.data.id]; + + if (defaultValue === value) { + return null; + } + + const dict = evaluator.xref.fetchIfRef(this.ref); + + if (!(0, _primitives.isDict)(dict)) { + return null; + } + + const name = _primitives.Name.get(value ? this.data.buttonValue : "Off"); + + let parentBuffer = null; + const encrypt = evaluator.xref.encrypt; + + if (value) { + if ((0, _primitives.isRef)(this.parent)) { + const parent = evaluator.xref.fetch(this.parent); + let parentTransform = null; + + if (encrypt) { + parentTransform = encrypt.createCipherTransform(this.parent.num, this.parent.gen); + } + + parent.set("V", name); + parentBuffer = [`${this.parent.num} ${this.parent.gen} obj\n`]; + (0, _writer.writeDict)(parent, parentBuffer, parentTransform); + parentBuffer.push("\nendobj\n"); + } else if ((0, _primitives.isDict)(this.parent)) { + this.parent.set("V", name); + } } + dict.set("AS", name); + dict.set("M", `D:${(0, _util.getModificationDate)()}`); + let originalTransform = null; + + if (encrypt) { + originalTransform = encrypt.createCipherTransform(this.ref.num, this.ref.gen); + } + + const buffer = [`${this.ref.num} ${this.ref.gen} obj\n`]; + (0, _writer.writeDict)(dict, buffer, originalTransform); + buffer.push("\nendobj\n"); + const newRefs = [{ + ref: this.ref, + data: buffer.join("") + }]; + + if (parentBuffer !== null) { + newRefs.push({ + ref: this.parent, + data: parentBuffer.join("") + }); + } + + return newRefs; + } + + _processCheckBox(params) { const customAppearance = params.dict.get("AP"); if (!(0, _primitives.isDict)(customAppearance)) { return; } - const exportValueOptionsDict = customAppearance.get("D"); + const normalAppearance = customAppearance.get("N"); - if (!(0, _primitives.isDict)(exportValueOptionsDict)) { + if (!(0, _primitives.isDict)(normalAppearance)) { return; } - const exportValues = exportValueOptionsDict.getKeys(); - const hasCorrectOptionCount = exportValues.length === 2; + const exportValues = normalAppearance.getKeys(); + + if (!exportValues.includes("Off")) { + exportValues.push("Off"); + } - if (!hasCorrectOptionCount) { + if (exportValues.length !== 2) { return; } this.data.exportValue = exportValues[0] === "Off" ? exportValues[1] : exportValues[0]; + this.checkedAppearance = normalAppearance.get(this.data.exportValue); + this.uncheckedAppearance = normalAppearance.get("Off") || null; } _processRadioButton(params) { @@ -19165,7 +20211,8 @@ class ButtonWidgetAnnotation extends WidgetAnnotation { const fieldParentValue = fieldParent.get("V"); if ((0, _primitives.isName)(fieldParentValue)) { - this.data.fieldValue = fieldParentValue.name; + this.parent = params.dict.getRaw("Parent"); + this.data.fieldValue = this._decodeFormValue(fieldParentValue); } } @@ -19175,18 +20222,21 @@ class ButtonWidgetAnnotation extends WidgetAnnotation { return; } - const normalAppearanceState = appearanceStates.get("N"); + const normalAppearance = appearanceStates.get("N"); - if (!(0, _primitives.isDict)(normalAppearanceState)) { + if (!(0, _primitives.isDict)(normalAppearance)) { return; } - for (const key of normalAppearanceState.getKeys()) { + for (const key of normalAppearance.getKeys()) { if (key !== "Off") { this.data.buttonValue = key; break; } } + + this.checkedAppearance = normalAppearance.get(this.data.buttonValue); + this.uncheckedAppearance = normalAppearance.get("Off") || null; } _processPushButton(params) { @@ -19220,18 +20270,21 @@ class ChoiceWidgetAnnotation extends WidgetAnnotation { const option = xref.fetchIfRef(options[i]); const isOptionArray = Array.isArray(option); this.data.options[i] = { - exportValue: isOptionArray ? xref.fetchIfRef(option[0]) : option, - displayValue: (0, _util.stringToPDFString)(isOptionArray ? xref.fetchIfRef(option[1]) : option) + exportValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[0]) : option), + displayValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[1]) : option) }; } } - if (!Array.isArray(this.data.fieldValue)) { + if ((0, _util.isString)(this.data.fieldValue)) { this.data.fieldValue = [this.data.fieldValue]; + } else if (!this.data.fieldValue) { + this.data.fieldValue = []; } this.data.combo = this.hasFieldFlag(_util.AnnotationFieldFlag.COMBO); this.data.multiSelect = this.hasFieldFlag(_util.AnnotationFieldFlag.MULTISELECT); + this._hasText = true; } } @@ -19686,18 +20739,20 @@ var QueueOptimizer = function QueueOptimizerClosure() { var isSameImage = false; var iTransform, transformArgs; var firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; + const firstTransformArg0 = argsArray[iFirstTransform][0], + firstTransformArg1 = argsArray[iFirstTransform][1], + firstTransformArg2 = argsArray[iFirstTransform][2], + firstTransformArg3 = argsArray[iFirstTransform][3]; - if (argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0) { + if (firstTransformArg1 === firstTransformArg2) { isSameImage = true; - var firstTransformArg0 = argsArray[iFirstTransform][0]; - var firstTransformArg3 = argsArray[iFirstTransform][3]; iTransform = iFirstTransform + 4; var iPIMXO = iFirstPIMXO + 4; for (q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { transformArgs = argsArray[iTransform]; - if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== 0 || transformArgs[2] !== 0 || transformArgs[3] !== firstTransformArg3) { + if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== firstTransformArg1 || transformArgs[2] !== firstTransformArg2 || transformArgs[3] !== firstTransformArg3) { if (q < MIN_IMAGES_IN_MASKS_BLOCK) { isSameImage = false; } else { @@ -19721,7 +20776,7 @@ var QueueOptimizer = function QueueOptimizerClosure() { } fnArray.splice(iFirstSave, count * 4, _util.OPS.paintImageMaskXObjectRepeat); - argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg3, positions]); + argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg1, firstTransformArg2, firstTransformArg3, positions]); } else { count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); var images = []; @@ -20017,7 +21072,7 @@ var OperatorList = function OperatorListClosure() { var CHUNK_SIZE = 1000; var CHUNK_SIZE_ABOUT = CHUNK_SIZE - 5; - function OperatorList(intent, streamSink, pageIndex) { + function OperatorList(intent, streamSink) { this._streamSink = streamSink; this.fnArray = []; this.argsArray = []; @@ -20028,10 +21083,8 @@ var OperatorList = function OperatorListClosure() { this.optimizer = new NullOptimizer(this); } - this.dependencies = Object.create(null); + this.dependencies = new Set(); this._totalLength = 0; - this.pageIndex = pageIndex; - this.intent = intent; this.weight = 0; this._resolved = streamSink ? null : Promise.resolve(); } @@ -20063,17 +21116,17 @@ var OperatorList = function OperatorListClosure() { }, addDependency(dependency) { - if (dependency in this.dependencies) { + if (this.dependencies.has(dependency)) { return; } - this.dependencies[dependency] = true; + this.dependencies.add(dependency); this.addOp(_util.OPS.dependency, [dependency]); }, addDependencies(dependencies) { - for (var key in dependencies) { - this.addDependency(key); + for (const dependency of dependencies) { + this.addDependency(dependency); } }, @@ -20083,7 +21136,9 @@ var OperatorList = function OperatorListClosure() { return; } - Object.assign(this.dependencies, opList.dependencies); + for (const dependency of opList.dependencies) { + this.dependencies.add(dependency); + } for (var i = 0, ii = opList.length; i < ii; i++) { this.addOp(opList.fnArray[i], opList.argsArray[i]); @@ -20137,7 +21192,7 @@ var OperatorList = function OperatorListClosure() { length }, 1, this._transfers); - this.dependencies = Object.create(null); + this.dependencies.clear(); this.fnArray.length = 0; this.argsArray.length = 0; this.weight = 0; @@ -20160,2833 +21215,3319 @@ exports.OperatorList = OperatorList; Object.defineProperty(exports, "__esModule", { value: true }); -exports.PartialEvaluator = void 0; +exports.writeDict = writeDict; +exports.incrementalUpdate = incrementalUpdate; var _util = __w_pdfjs_require__(2); -var _cmap = __w_pdfjs_require__(28); - var _primitives = __w_pdfjs_require__(5); -var _fonts = __w_pdfjs_require__(29); +var _crypto = __w_pdfjs_require__(22); -var _encodings = __w_pdfjs_require__(32); +function writeDict(dict, buffer, transform) { + buffer.push("<<"); -var _core_utils = __w_pdfjs_require__(8); + for (const key of dict.getKeys()) { + buffer.push(` /${key} `); + writeValue(dict.getRaw(key), buffer, transform); + } -var _unicode = __w_pdfjs_require__(35); + buffer.push(">>"); +} -var _standard_fonts = __w_pdfjs_require__(34); +function writeStream(stream, buffer, transform) { + writeDict(stream.dict, buffer, transform); + buffer.push(" stream\n"); + let string = (0, _util.bytesToString)(stream.getBytes()); -var _pattern = __w_pdfjs_require__(38); + if (transform !== null) { + string = transform.encryptString(string); + } -var _parser = __w_pdfjs_require__(11); + buffer.push(string); + buffer.push("\nendstream\n"); +} -var _bidi = __w_pdfjs_require__(39); +function writeArray(array, buffer, transform) { + buffer.push("["); + let first = true; -var _colorspace = __w_pdfjs_require__(23); + for (const val of array) { + if (!first) { + buffer.push(" "); + } else { + first = false; + } -var _stream = __w_pdfjs_require__(12); + writeValue(val, buffer, transform); + } -var _glyphlist = __w_pdfjs_require__(33); + buffer.push("]"); +} -var _metrics = __w_pdfjs_require__(40); +function numberToString(value) { + if (Number.isInteger(value)) { + return value.toString(); + } -var _function = __w_pdfjs_require__(41); + const roundedValue = Math.round(value * 100); -var _image_utils = __w_pdfjs_require__(24); + if (roundedValue % 100 === 0) { + return (roundedValue / 100).toString(); + } -var _murmurhash = __w_pdfjs_require__(43); + if (roundedValue % 10 === 0) { + return value.toFixed(1); + } -var _operator_list = __w_pdfjs_require__(26); + return value.toFixed(2); +} -var _image = __w_pdfjs_require__(44); +function writeValue(value, buffer, transform) { + if ((0, _primitives.isName)(value)) { + buffer.push(`/${value.name}`); + } else if ((0, _primitives.isRef)(value)) { + buffer.push(`${value.num} ${value.gen} R`); + } else if (Array.isArray(value)) { + writeArray(value, buffer, transform); + } else if (typeof value === "string") { + if (transform !== null) { + value = transform.encryptString(value); + } + + buffer.push(`(${(0, _util.escapeString)(value)})`); + } else if (typeof value === "number") { + buffer.push(numberToString(value)); + } else if ((0, _primitives.isDict)(value)) { + writeDict(value, buffer, transform); + } else if ((0, _primitives.isStream)(value)) { + writeStream(value, buffer, transform); + } +} -var PartialEvaluator = function PartialEvaluatorClosure() { - const DefaultPartialEvaluatorOptions = { - maxImageSize: -1, - disableFontFace: false, - ignoreErrors: false, - isEvalSupported: true, - fontExtraProperties: false - }; +function writeInt(number, size, offset, buffer) { + for (let i = size + offset - 1; i > offset - 1; i--) { + buffer[i] = number & 0xff; + number >>= 8; + } - function PartialEvaluator({ - xref, - handler, - pageIndex, - idFactory, - fontCache, - builtInCMapCache, - globalImageCache, - options = null, - pdfFunctionFactory - }) { - this.xref = xref; - this.handler = handler; - this.pageIndex = pageIndex; - this.idFactory = idFactory; - this.fontCache = fontCache; - this.builtInCMapCache = builtInCMapCache; - this.globalImageCache = globalImageCache; - this.options = options || DefaultPartialEvaluatorOptions; - this.pdfFunctionFactory = pdfFunctionFactory; - this.parsingType3Font = false; + return offset + size; +} - this.fetchBuiltInCMap = async name => { - if (this.builtInCMapCache.has(name)) { - return this.builtInCMapCache.get(name); - } +function writeString(string, offset, buffer) { + for (let i = 0, len = string.length; i < len; i++) { + buffer[offset + i] = string.charCodeAt(i) & 0xff; + } +} - const readableStream = this.handler.sendWithStream("FetchBuiltInCMap", { - name - }); - const reader = readableStream.getReader(); - const data = await new Promise(function (resolve, reject) { - function pump() { - reader.read().then(function ({ - value, - done - }) { - if (done) { - return; - } +function computeMD5(filesize, xrefInfo) { + const time = Math.floor(Date.now() / 1000); + const filename = xrefInfo.filename || ""; + const md5Buffer = [time.toString(), filename, filesize.toString()]; + let md5BufferLen = md5Buffer.reduce((a, str) => a + str.length, 0); - resolve(value); - pump(); - }, reject); - } + for (const value of Object.values(xrefInfo.info)) { + md5Buffer.push(value); + md5BufferLen += value.length; + } - pump(); - }); + const array = new Uint8Array(md5BufferLen); + let offset = 0; - if (data.compressionType !== _util.CMapCompressionType.NONE) { - this.builtInCMapCache.set(name, data); - } + for (const str of md5Buffer) { + writeString(str, offset, array); + offset += str.length; + } - return data; - }; + return (0, _util.bytesToString)((0, _crypto.calculateMD5)(array)); +} + +function incrementalUpdate(originalData, xrefInfo, newRefs) { + const newXref = new _primitives.Dict(null); + const refForXrefTable = xrefInfo.newRef; + let buffer, baseOffset; + const lastByte = originalData[originalData.length - 1]; + + if (lastByte === 0x0a || lastByte === 0x0d) { + buffer = []; + baseOffset = originalData.length; + } else { + buffer = ["\n"]; + baseOffset = originalData.length + 1; } - var TIME_SLOT_DURATION_MS = 20; - var CHECK_TIME_EVERY = 100; + newXref.set("Size", refForXrefTable.num + 1); + newXref.set("Prev", xrefInfo.startXRef); + newXref.set("Type", _primitives.Name.get("XRef")); - function TimeSlotManager() { - this.reset(); + if (xrefInfo.rootRef !== null) { + newXref.set("Root", xrefInfo.rootRef); } - TimeSlotManager.prototype = { - check: function TimeSlotManager_check() { - if (++this.checked < CHECK_TIME_EVERY) { - return false; - } + if (xrefInfo.infoRef !== null) { + newXref.set("Info", xrefInfo.infoRef); + } - this.checked = 0; - return this.endTime <= Date.now(); - }, - reset: function TimeSlotManager_reset() { - this.endTime = Date.now() + TIME_SLOT_DURATION_MS; - this.checked = 0; - } - }; + if (xrefInfo.encrypt !== null) { + newXref.set("Encrypt", xrefInfo.encrypt); + } - function normalizeBlendMode(value, parsingArray = false) { - if (Array.isArray(value)) { - for (let i = 0, ii = value.length; i < ii; i++) { - const maybeBM = normalizeBlendMode(value[i], true); + newRefs.push({ + ref: refForXrefTable, + data: "" + }); + newRefs = newRefs.sort((a, b) => { + return a.ref.num - b.ref.num; + }); + const xrefTableData = [[0, 1, 0xffff]]; + const indexes = [0, 1]; + let maxOffset = 0; - if (maybeBM) { - return maybeBM; - } - } + for (const { + ref, + data + } of newRefs) { + maxOffset = Math.max(maxOffset, baseOffset); + xrefTableData.push([1, baseOffset, Math.min(ref.gen, 0xffff)]); + baseOffset += data.length; + indexes.push(ref.num); + indexes.push(1); + buffer.push(data); + } + + newXref.set("Index", indexes); + + if (xrefInfo.fileIds.length !== 0) { + const md5 = computeMD5(baseOffset, xrefInfo); + newXref.set("ID", [xrefInfo.fileIds[0], md5]); + } + + const offsetSize = Math.ceil(Math.log2(maxOffset) / 8); + const sizes = [1, offsetSize, 2]; + const structSize = sizes[0] + sizes[1] + sizes[2]; + const tableLength = structSize * xrefTableData.length; + newXref.set("W", sizes); + newXref.set("Length", tableLength); + buffer.push(`${refForXrefTable.num} ${refForXrefTable.gen} obj\n`); + writeDict(newXref, buffer, null); + buffer.push(" stream\n"); + const bufferLen = buffer.reduce((a, str) => a + str.length, 0); + const footer = `\nendstream\nendobj\nstartxref\n${baseOffset}\n%%EOF\n`; + const array = new Uint8Array(originalData.length + bufferLen + tableLength + footer.length); + array.set(originalData); + let offset = originalData.length; + + for (const str of buffer) { + writeString(str, offset, array); + offset += str.length; + } + + for (const [type, objOffset, gen] of xrefTableData) { + offset = writeInt(type, sizes[0], offset, array); + offset = writeInt(objOffset, sizes[1], offset, array); + offset = writeInt(gen, sizes[2], offset, array); + } + + writeString(footer, offset, array); + return array; +} - (0, _util.warn)(`Unsupported blend mode Array: ${value}`); - return "source-over"; - } +/***/ }), +/* 28 */ +/***/ (function(module, exports, __w_pdfjs_require__) { - if (!(0, _primitives.isName)(value)) { - if (parsingArray) { - return null; - } +"use strict"; - return "source-over"; - } - switch (value.name) { - case "Normal": - case "Compatible": - return "source-over"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PartialEvaluator = void 0; + +var _util = __w_pdfjs_require__(2); + +var _cmap = __w_pdfjs_require__(29); + +var _primitives = __w_pdfjs_require__(5); + +var _fonts = __w_pdfjs_require__(30); + +var _encodings = __w_pdfjs_require__(33); + +var _core_utils = __w_pdfjs_require__(8); + +var _unicode = __w_pdfjs_require__(36); - case "Multiply": - return "multiply"; +var _standard_fonts = __w_pdfjs_require__(35); - case "Screen": - return "screen"; +var _pattern = __w_pdfjs_require__(39); - case "Overlay": - return "overlay"; +var _function = __w_pdfjs_require__(40); - case "Darken": - return "darken"; +var _parser = __w_pdfjs_require__(11); + +var _image_utils = __w_pdfjs_require__(24); - case "Lighten": - return "lighten"; +var _bidi = __w_pdfjs_require__(42); - case "ColorDodge": - return "color-dodge"; +var _colorspace = __w_pdfjs_require__(23); - case "ColorBurn": - return "color-burn"; +var _stream = __w_pdfjs_require__(12); - case "HardLight": - return "hard-light"; +var _glyphlist = __w_pdfjs_require__(34); - case "SoftLight": - return "soft-light"; +var _metrics = __w_pdfjs_require__(43); - case "Difference": - return "difference"; +var _murmurhash = __w_pdfjs_require__(44); - case "Exclusion": - return "exclusion"; +var _operator_list = __w_pdfjs_require__(26); - case "Hue": - return "hue"; +var _image = __w_pdfjs_require__(45); - case "Saturation": - return "saturation"; +const DefaultPartialEvaluatorOptions = Object.freeze({ + maxImageSize: -1, + disableFontFace: false, + ignoreErrors: false, + isEvalSupported: true, + fontExtraProperties: false +}); +const PatternType = { + TILING: 1, + SHADING: 2 +}; +const deferred = Promise.resolve(); - case "Color": - return "color"; +function normalizeBlendMode(value, parsingArray = false) { + if (Array.isArray(value)) { + for (let i = 0, ii = value.length; i < ii; i++) { + const maybeBM = normalizeBlendMode(value[i], true); - case "Luminosity": - return "luminosity"; + if (maybeBM) { + return maybeBM; + } } + (0, _util.warn)(`Unsupported blend mode Array: ${value}`); + return "source-over"; + } + + if (!(0, _primitives.isName)(value)) { if (parsingArray) { return null; } - (0, _util.warn)(`Unsupported blend mode: ${value.name}`); return "source-over"; } - var deferred = Promise.resolve(); - var TILING_PATTERN = 1, - SHADING_PATTERN = 2; - PartialEvaluator.prototype = { - clone(newOptions = DefaultPartialEvaluatorOptions) { - var newEvaluator = Object.create(this); - newEvaluator.options = newOptions; - return newEvaluator; - }, + switch (value.name) { + case "Normal": + case "Compatible": + return "source-over"; - hasBlendModes: function PartialEvaluator_hasBlendModes(resources) { - if (!(resources instanceof _primitives.Dict)) { - return false; - } + case "Multiply": + return "multiply"; - var processed = Object.create(null); + case "Screen": + return "screen"; - if (resources.objId) { - processed[resources.objId] = true; - } + case "Overlay": + return "overlay"; - var nodes = [resources], - xref = this.xref; + case "Darken": + return "darken"; - while (nodes.length) { - var node = nodes.shift(); - var graphicStates = node.get("ExtGState"); + case "Lighten": + return "lighten"; - if (graphicStates instanceof _primitives.Dict) { - var graphicStatesKeys = graphicStates.getKeys(); + case "ColorDodge": + return "color-dodge"; - for (let i = 0, ii = graphicStatesKeys.length; i < ii; i++) { - const key = graphicStatesKeys[i]; - let graphicState = graphicStates.getRaw(key); + case "ColorBurn": + return "color-burn"; - if (graphicState instanceof _primitives.Ref) { - if (processed[graphicState.toString()]) { - continue; - } + case "HardLight": + return "hard-light"; - try { - graphicState = xref.fetch(graphicState); - } catch (ex) { - if (ex instanceof _core_utils.MissingDataException) { - throw ex; - } + case "SoftLight": + return "soft-light"; - if (this.options.ignoreErrors) { - if (graphicState instanceof _primitives.Ref) { - processed[graphicState.toString()] = true; - } + case "Difference": + return "difference"; - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorExtGState - }); - (0, _util.warn)(`hasBlendModes - ignoring ExtGState: "${ex}".`); - continue; - } + case "Exclusion": + return "exclusion"; - throw ex; - } - } + case "Hue": + return "hue"; - if (!(graphicState instanceof _primitives.Dict)) { - continue; - } + case "Saturation": + return "saturation"; - if (graphicState.objId) { - processed[graphicState.objId] = true; - } + case "Color": + return "color"; - const bm = graphicState.get("BM"); + case "Luminosity": + return "luminosity"; + } - if (bm instanceof _primitives.Name) { - if (bm.name !== "Normal") { - return true; - } + if (parsingArray) { + return null; + } - continue; - } + (0, _util.warn)(`Unsupported blend mode: ${value.name}`); + return "source-over"; +} - if (bm !== undefined && Array.isArray(bm)) { - for (let j = 0, jj = bm.length; j < jj; j++) { - if (bm[j] instanceof _primitives.Name && bm[j].name !== "Normal") { - return true; - } - } - } - } - } +class TimeSlotManager { + static get TIME_SLOT_DURATION_MS() { + return (0, _util.shadow)(this, "TIME_SLOT_DURATION_MS", 20); + } - var xObjects = node.get("XObject"); + static get CHECK_TIME_EVERY() { + return (0, _util.shadow)(this, "CHECK_TIME_EVERY", 100); + } - if (!(xObjects instanceof _primitives.Dict)) { - continue; - } + constructor() { + this.reset(); + } + + check() { + if (++this.checked < TimeSlotManager.CHECK_TIME_EVERY) { + return false; + } + + this.checked = 0; + return this.endTime <= Date.now(); + } + + reset() { + this.endTime = Date.now() + TimeSlotManager.TIME_SLOT_DURATION_MS; + this.checked = 0; + } + +} + +class PartialEvaluator { + constructor({ + xref, + handler, + pageIndex, + idFactory, + fontCache, + builtInCMapCache, + globalImageCache, + options = null + }) { + this.xref = xref; + this.handler = handler; + this.pageIndex = pageIndex; + this.idFactory = idFactory; + this.fontCache = fontCache; + this.builtInCMapCache = builtInCMapCache; + this.globalImageCache = globalImageCache; + this.options = options || DefaultPartialEvaluatorOptions; + this.parsingType3Font = false; + this._fetchBuiltInCMapBound = this.fetchBuiltInCMap.bind(this); + } + + get _pdfFunctionFactory() { + const pdfFunctionFactory = new _function.PDFFunctionFactory({ + xref: this.xref, + isEvalSupported: this.options.isEvalSupported + }); + return (0, _util.shadow)(this, "_pdfFunctionFactory", pdfFunctionFactory); + } + + clone(newOptions = DefaultPartialEvaluatorOptions) { + var newEvaluator = Object.create(this); + newEvaluator.options = newOptions; + return newEvaluator; + } + + hasBlendModes(resources) { + if (!(resources instanceof _primitives.Dict)) { + return false; + } - var xObjectsKeys = xObjects.getKeys(); + const processed = new _primitives.RefSet(); + + if (resources.objId) { + processed.put(resources.objId); + } + + var nodes = [resources], + xref = this.xref; - for (let i = 0, ii = xObjectsKeys.length; i < ii; i++) { - const key = xObjectsKeys[i]; - var xObject = xObjects.getRaw(key); + while (nodes.length) { + var node = nodes.shift(); + var graphicStates = node.get("ExtGState"); - if (xObject instanceof _primitives.Ref) { - if (processed[xObject.toString()]) { + if (graphicStates instanceof _primitives.Dict) { + for (let graphicState of graphicStates.getRawValues()) { + if (graphicState instanceof _primitives.Ref) { + if (processed.has(graphicState)) { continue; } try { - xObject = xref.fetch(xObject); + graphicState = xref.fetch(graphicState); } catch (ex) { if (ex instanceof _core_utils.MissingDataException) { throw ex; } - if (this.options.ignoreErrors) { - if (xObject instanceof _primitives.Ref) { - processed[xObject.toString()] = true; - } - - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorXObject - }); - (0, _util.warn)(`hasBlendModes - ignoring XObject: "${ex}".`); - continue; - } - - throw ex; + processed.put(graphicState); + (0, _util.info)(`hasBlendModes - ignoring ExtGState: "${ex}".`); + continue; } } - if (!(0, _primitives.isStream)(xObject)) { + if (!(graphicState instanceof _primitives.Dict)) { continue; } - if (xObject.dict.objId) { - if (processed[xObject.dict.objId]) { - continue; - } - - processed[xObject.dict.objId] = true; + if (graphicState.objId) { + processed.put(graphicState.objId); } - var xResources = xObject.dict.get("Resources"); + const bm = graphicState.get("BM"); - if (xResources instanceof _primitives.Dict && (!xResources.objId || !processed[xResources.objId])) { - nodes.push(xResources); + if (bm instanceof _primitives.Name) { + if (bm.name !== "Normal") { + return true; + } + + continue; + } - if (xResources.objId) { - processed[xResources.objId] = true; + if (bm !== undefined && Array.isArray(bm)) { + for (const element of bm) { + if (element instanceof _primitives.Name && element.name !== "Normal") { + return true; + } } } } } - return false; - }, - - async buildFormXObject(resources, xobj, smask, operatorList, task, initialState) { - var dict = xobj.dict; - var matrix = dict.getArray("Matrix"); - var bbox = dict.getArray("BBox"); + var xObjects = node.get("XObject"); - if (Array.isArray(bbox) && bbox.length === 4) { - bbox = _util.Util.normalizeRect(bbox); - } else { - bbox = null; + if (!(xObjects instanceof _primitives.Dict)) { + continue; } - var group = dict.get("Group"); - - if (group) { - var groupOptions = { - matrix, - bbox, - smask, - isolated: false, - knockout: false - }; - var groupSubtype = group.get("S"); - var colorSpace = null; + for (let xObject of xObjects.getRawValues()) { + if (xObject instanceof _primitives.Ref) { + if (processed.has(xObject)) { + continue; + } - if ((0, _primitives.isName)(groupSubtype, "Transparency")) { - groupOptions.isolated = group.get("I") || false; - groupOptions.knockout = group.get("K") || false; + try { + xObject = xref.fetch(xObject); + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } - if (group.has("CS")) { - colorSpace = await this.parseColorSpace({ - cs: group.get("CS"), - resources - }); + processed.put(xObject); + (0, _util.info)(`hasBlendModes - ignoring XObject: "${ex}".`); + continue; } } - if (smask && smask.backdrop) { - colorSpace = colorSpace || _colorspace.ColorSpace.singletons.rgb; - smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); + if (!(0, _primitives.isStream)(xObject)) { + continue; } - operatorList.addOp(_util.OPS.beginGroup, [groupOptions]); - } + if (xObject.dict.objId) { + processed.put(xObject.dict.objId); + } - operatorList.addOp(_util.OPS.paintFormXObjectBegin, [matrix, bbox]); - return this.getOperatorList({ - stream: xobj, - task, - resources: dict.get("Resources") || resources, - operatorList, - initialState - }).then(function () { - operatorList.addOp(_util.OPS.paintFormXObjectEnd, []); + var xResources = xObject.dict.get("Resources"); - if (group) { - operatorList.addOp(_util.OPS.endGroup, [groupOptions]); + if (!(xResources instanceof _primitives.Dict)) { + continue; } - }); - }, - - async buildPaintImageXObject({ - resources, - image, - isInline = false, - operatorList, - cacheKey, - localImageCache - }) { - var dict = image.dict; - const imageRef = dict.objId; - var w = dict.get("Width", "W"); - var h = dict.get("Height", "H"); - if (!(w && (0, _util.isNum)(w)) || !(h && (0, _util.isNum)(h))) { - (0, _util.warn)("Image dimensions are missing, or not numbers."); - return undefined; - } + if (xResources.objId && processed.has(xResources.objId)) { + continue; + } - var maxImageSize = this.options.maxImageSize; + nodes.push(xResources); - if (maxImageSize !== -1 && w * h > maxImageSize) { - (0, _util.warn)("Image exceeded maximum allowed size and was removed."); - return undefined; + if (xResources.objId) { + processed.put(xResources.objId); + } } + } - var imageMask = dict.get("ImageMask", "IM") || false; - var imgData, args; - - if (imageMask) { - var width = dict.get("Width", "W"); - var height = dict.get("Height", "H"); - var bitStrideLength = width + 7 >> 3; - var imgArray = image.getBytes(bitStrideLength * height, true); - var decode = dict.getArray("Decode", "D"); - imgData = _image.PDFImage.createMask({ - imgArray, - width, - height, - imageIsFromDecodeStream: image instanceof _stream.DecodeStream, - inverseDecode: !!decode && decode[0] > 0 - }); - imgData.cached = !!cacheKey; - args = [imgData]; - operatorList.addOp(_util.OPS.paintImageMaskXObject, args); + return false; + } - if (cacheKey) { - localImageCache.set(cacheKey, imageRef, { - fn: _util.OPS.paintImageMaskXObject, - args - }); - } + async fetchBuiltInCMap(name) { + const cachedData = this.builtInCMapCache.get(name); - return undefined; - } + if (cachedData) { + return cachedData; + } - var softMask = dict.get("SMask", "SM") || false; - var mask = dict.get("Mask") || false; - var SMALL_IMAGE_DIMENSIONS = 200; + const readableStream = this.handler.sendWithStream("FetchBuiltInCMap", { + name + }); + const reader = readableStream.getReader(); + const data = await new Promise(function (resolve, reject) { + function pump() { + reader.read().then(function ({ + value, + done + }) { + if (done) { + return; + } - if (isInline && !softMask && !mask && w + h < SMALL_IMAGE_DIMENSIONS) { - const imageObj = new _image.PDFImage({ - xref: this.xref, - res: resources, - image, - isInline, - pdfFunctionFactory: this.pdfFunctionFactory - }); - imgData = imageObj.createImageData(true); - operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]); - return undefined; + resolve(value); + pump(); + }, reject); } - let objId = `img_${this.idFactory.createObjId()}`, - cacheGlobally = false; - - if (this.parsingType3Font) { - objId = `${this.idFactory.getDocId()}_type3res_${objId}`; - } else if (imageRef) { - cacheGlobally = this.globalImageCache.shouldCache(imageRef, this.pageIndex); + pump(); + }); - if (cacheGlobally) { - objId = `${this.idFactory.getDocId()}_${objId}`; - } - } + if (data.compressionType !== _util.CMapCompressionType.NONE) { + this.builtInCMapCache.set(name, data); + } - operatorList.addDependency(objId); - args = [objId, w, h]; + return data; + } - const imgPromise = _image.PDFImage.buildImage({ - xref: this.xref, - res: resources, - image, - isInline, - pdfFunctionFactory: this.pdfFunctionFactory - }).then(imageObj => { - imgData = imageObj.createImageData(false); + async buildFormXObject(resources, xobj, smask, operatorList, task, initialState, localColorSpaceCache) { + var dict = xobj.dict; + var matrix = dict.getArray("Matrix"); + var bbox = dict.getArray("BBox"); - if (this.parsingType3Font) { - return this.handler.sendWithPromise("commonobj", [objId, "FontType3Res", imgData], [imgData.data.buffer]); - } else if (cacheGlobally) { - this.handler.send("commonobj", [objId, "Image", imgData], [imgData.data.buffer]); - return undefined; - } + if (Array.isArray(bbox) && bbox.length === 4) { + bbox = _util.Util.normalizeRect(bbox); + } else { + bbox = null; + } - this.handler.send("obj", [objId, this.pageIndex, "Image", imgData], [imgData.data.buffer]); - return undefined; - }).catch(reason => { - (0, _util.warn)("Unable to decode image: " + reason); + let optionalContent = null; - if (this.parsingType3Font) { - return this.handler.sendWithPromise("commonobj", [objId, "FontType3Res", null]); - } else if (cacheGlobally) { - this.handler.send("commonobj", [objId, "Image", null]); - return undefined; - } + if (dict.has("OC")) { + optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources); + operatorList.addOp(_util.OPS.beginMarkedContentProps, ["OC", optionalContent]); + } - this.handler.send("obj", [objId, this.pageIndex, "Image", null]); - return undefined; - }); + var group = dict.get("Group"); - if (this.parsingType3Font) { - await imgPromise; - } + if (group) { + var groupOptions = { + matrix, + bbox, + smask, + isolated: false, + knockout: false + }; + var groupSubtype = group.get("S"); + var colorSpace = null; - operatorList.addOp(_util.OPS.paintImageXObject, args); + if ((0, _primitives.isName)(groupSubtype, "Transparency")) { + groupOptions.isolated = group.get("I") || false; + groupOptions.knockout = group.get("K") || false; - if (cacheKey) { - localImageCache.set(cacheKey, imageRef, { - fn: _util.OPS.paintImageXObject, - args - }); + if (group.has("CS")) { + const cs = group.getRaw("CS"); - if (imageRef) { - (0, _util.assert)(!isInline, "Cannot cache an inline image globally."); - this.globalImageCache.addPageIndex(imageRef, this.pageIndex); + const cachedColorSpace = _colorspace.ColorSpace.getCached(cs, this.xref, localColorSpaceCache); - if (cacheGlobally) { - this.globalImageCache.setData(imageRef, { - objId, - fn: _util.OPS.paintImageXObject, - args + if (cachedColorSpace) { + colorSpace = cachedColorSpace; + } else { + colorSpace = await this.parseColorSpace({ + cs, + resources, + localColorSpaceCache }); } } } - return undefined; - }, + if (smask && smask.backdrop) { + colorSpace = colorSpace || _colorspace.ColorSpace.singletons.rgb; + smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); + } - handleSMask: function PartialEvaluator_handleSmask(smask, resources, operatorList, task, stateManager) { - var smaskContent = smask.get("G"); - var smaskOptions = { - subtype: smask.get("S").name, - backdrop: smask.get("BC") - }; - var transferObj = smask.get("TR"); + operatorList.addOp(_util.OPS.beginGroup, [groupOptions]); + } - if ((0, _function.isPDFFunction)(transferObj)) { - const transferFn = this.pdfFunctionFactory.create(transferObj); - var transferMap = new Uint8Array(256); - var tmp = new Float32Array(1); + operatorList.addOp(_util.OPS.paintFormXObjectBegin, [matrix, bbox]); + return this.getOperatorList({ + stream: xobj, + task, + resources: dict.get("Resources") || resources, + operatorList, + initialState + }).then(function () { + operatorList.addOp(_util.OPS.paintFormXObjectEnd, []); - for (var i = 0; i < 256; i++) { - tmp[0] = i / 255; - transferFn(tmp, 0, tmp, 0); - transferMap[i] = tmp[0] * 255 | 0; - } + if (group) { + operatorList.addOp(_util.OPS.endGroup, [groupOptions]); + } - smaskOptions.transferMap = transferMap; + if (optionalContent) { + operatorList.addOp(_util.OPS.endMarkedContent, []); } + }); + } - return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone()); - }, + _sendImgData(objId, imgData, cacheGlobally = false) { + const transfers = imgData ? [imgData.data.buffer] : null; - handleTilingType(fn, args, resources, pattern, patternDict, operatorList, task) { - const tilingOpList = new _operator_list.OperatorList(); - const resourcesArray = [patternDict.get("Resources"), resources]; + if (this.parsingType3Font || cacheGlobally) { + return this.handler.send("commonobj", [objId, "Image", imgData], transfers); + } - const patternResources = _primitives.Dict.merge(this.xref, resourcesArray); + return this.handler.send("obj", [objId, this.pageIndex, "Image", imgData], transfers); + } - return this.getOperatorList({ - stream: pattern, - task, - resources: patternResources, - operatorList: tilingOpList - }).then(function () { - return (0, _pattern.getTilingPatternIR)({ - fnArray: tilingOpList.fnArray, - argsArray: tilingOpList.argsArray - }, patternDict, args); - }).then(function (tilingPatternIR) { - operatorList.addDependencies(tilingOpList.dependencies); - operatorList.addOp(fn, tilingPatternIR); - }, reason => { - if (reason instanceof _util.AbortException) { - return; - } + async buildPaintImageXObject({ + resources, + image, + isInline = false, + operatorList, + cacheKey, + localImageCache, + localColorSpaceCache + }) { + var dict = image.dict; + const imageRef = dict.objId; + var w = dict.get("Width", "W"); + var h = dict.get("Height", "H"); - if (this.options.ignoreErrors) { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorTilingPattern - }); - (0, _util.warn)(`handleTilingType - ignoring pattern: "${reason}".`); - return; - } + if (!(w && (0, _util.isNum)(w)) || !(h && (0, _util.isNum)(h))) { + (0, _util.warn)("Image dimensions are missing, or not numbers."); + return undefined; + } - throw reason; - }); - }, + var maxImageSize = this.options.maxImageSize; - handleSetFont: function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, operatorList, task, state) { - var fontName; + if (maxImageSize !== -1 && w * h > maxImageSize) { + (0, _util.warn)("Image exceeded maximum allowed size and was removed."); + return undefined; + } - if (fontArgs) { - fontArgs = fontArgs.slice(); - fontName = fontArgs[0].name; - } + var imageMask = dict.get("ImageMask", "IM") || false; + var imgData, args; - return this.loadFont(fontName, fontRef, resources).then(translated => { - if (!translated.font.isType3Font) { - return translated; - } + if (imageMask) { + var width = dict.get("Width", "W"); + var height = dict.get("Height", "H"); + var bitStrideLength = width + 7 >> 3; + var imgArray = image.getBytes(bitStrideLength * height, true); + var decode = dict.getArray("Decode", "D"); + imgData = _image.PDFImage.createMask({ + imgArray, + width, + height, + imageIsFromDecodeStream: image instanceof _stream.DecodeStream, + inverseDecode: !!decode && decode[0] > 0 + }); + imgData.cached = !!cacheKey; + args = [imgData]; + operatorList.addOp(_util.OPS.paintImageMaskXObject, args); - return translated.loadType3Data(this, resources, operatorList, task).then(function () { - return translated; - }).catch(reason => { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorFontLoadType3 - }); - return new TranslatedFont({ - loadedName: "g_font_error", - font: new _fonts.ErrorFont(`Type3 font load error: ${reason}`), - dict: translated.font, - extraProperties: this.options.fontExtraProperties - }); + if (cacheKey) { + localImageCache.set(cacheKey, imageRef, { + fn: _util.OPS.paintImageMaskXObject, + args }); - }).then(translated => { - state.font = translated.font; - translated.send(this.handler); - return translated.loadedName; + } + + return undefined; + } + + var softMask = dict.get("SMask", "SM") || false; + var mask = dict.get("Mask") || false; + var SMALL_IMAGE_DIMENSIONS = 200; + + if (isInline && !softMask && !mask && w + h < SMALL_IMAGE_DIMENSIONS) { + const imageObj = new _image.PDFImage({ + xref: this.xref, + res: resources, + image, + isInline, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache }); - }, + imgData = imageObj.createImageData(true); + operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]); + return undefined; + } - handleText(chars, state) { - const font = state.font; - const glyphs = font.charsToGlyphs(chars); + let objId = `img_${this.idFactory.createObjId()}`, + cacheGlobally = false; - if (font.data) { - const isAddToPathSet = !!(state.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG); + if (this.parsingType3Font) { + objId = `${this.idFactory.getDocId()}_type3_${objId}`; + } else if (imageRef) { + cacheGlobally = this.globalImageCache.shouldCache(imageRef, this.pageIndex); - if (isAddToPathSet || state.fillColorSpace.name === "Pattern" || font.disableFontFace || this.options.disableFontFace) { - PartialEvaluator.buildFontPaths(font, glyphs, this.handler); - } + if (cacheGlobally) { + objId = `${this.idFactory.getDocId()}_${objId}`; } + } - return glyphs; - }, + operatorList.addDependency(objId); + args = [objId, w, h]; - ensureStateFont(state) { - if (state.font) { - return; - } + _image.PDFImage.buildImage({ + xref: this.xref, + res: resources, + image, + isInline, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache + }).then(imageObj => { + imgData = imageObj.createImageData(false); + return this._sendImgData(objId, imgData, cacheGlobally); + }).catch(reason => { + (0, _util.warn)(`Unable to decode image "${objId}": "${reason}".`); + return this._sendImgData(objId, null, cacheGlobally); + }); - const reason = new _util.FormatError("Missing setFont (Tf) operator before text rendering operator."); + operatorList.addOp(_util.OPS.paintImageXObject, args); - if (this.options.ignoreErrors) { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorFontState - }); - (0, _util.warn)(`ensureStateFont: "${reason}".`); - return; + if (cacheKey) { + localImageCache.set(cacheKey, imageRef, { + fn: _util.OPS.paintImageXObject, + args + }); + + if (imageRef) { + (0, _util.assert)(!isInline, "Cannot cache an inline image globally."); + this.globalImageCache.addPageIndex(imageRef, this.pageIndex); + + if (cacheGlobally) { + this.globalImageCache.setData(imageRef, { + objId, + fn: _util.OPS.paintImageXObject, + args + }); + } } + } - throw reason; - }, + return undefined; + } - setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, stateManager) { - var gStateObj = []; - var gStateKeys = gState.getKeys(); - var promise = Promise.resolve(); + handleSMask(smask, resources, operatorList, task, stateManager, localColorSpaceCache) { + var smaskContent = smask.get("G"); + var smaskOptions = { + subtype: smask.get("S").name, + backdrop: smask.get("BC") + }; + var transferObj = smask.get("TR"); - for (var i = 0, ii = gStateKeys.length; i < ii; i++) { - const key = gStateKeys[i]; - const value = gState.get(key); + if ((0, _function.isPDFFunction)(transferObj)) { + const transferFn = this._pdfFunctionFactory.create(transferObj); - switch (key) { - case "Type": - break; + var transferMap = new Uint8Array(256); + var tmp = new Float32Array(1); - case "LW": - case "LC": - case "LJ": - case "ML": - case "D": - case "RI": - case "FL": - case "CA": - case "ca": - gStateObj.push([key, value]); - break; + for (var i = 0; i < 256; i++) { + tmp[0] = i / 255; + transferFn(tmp, 0, tmp, 0); + transferMap[i] = tmp[0] * 255 | 0; + } - case "Font": - promise = promise.then(() => { - return this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) { - operatorList.addDependency(loadedName); - gStateObj.push([key, [loadedName, value[1]]]); - }); - }); - break; + smaskOptions.transferMap = transferMap; + } - case "BM": - gStateObj.push([key, normalizeBlendMode(value)]); - break; + return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone(), localColorSpaceCache); + } - case "SMask": - if ((0, _primitives.isName)(value, "None")) { - gStateObj.push([key, false]); - break; - } + handleTransferFunction(tr) { + let transferArray; - if ((0, _primitives.isDict)(value)) { - promise = promise.then(() => { - return this.handleSMask(value, resources, operatorList, task, stateManager); - }); - gStateObj.push([key, true]); - } else { - (0, _util.warn)("Unsupported SMask type"); - } + if (Array.isArray(tr)) { + transferArray = tr; + } else if ((0, _function.isPDFFunction)(tr)) { + transferArray = [tr]; + } else { + return null; + } - break; + const transferMaps = []; + let numFns = 0, + numEffectfulFns = 0; - case "OP": - case "op": - case "OPM": - case "BG": - case "BG2": - case "UCR": - case "UCR2": - case "TR": - case "TR2": - case "HT": - case "SM": - case "SA": - case "AIS": - case "TK": - (0, _util.info)("graphic state operator " + key); - break; + for (const entry of transferArray) { + const transferObj = this.xref.fetchIfRef(entry); + numFns++; - default: - (0, _util.info)("Unknown graphic state operator " + key); - break; - } + if ((0, _primitives.isName)(transferObj, "Identity")) { + transferMaps.push(null); + continue; + } else if (!(0, _function.isPDFFunction)(transferObj)) { + return null; } - return promise.then(function () { - if (gStateObj.length > 0) { - operatorList.addOp(_util.OPS.setGState, [gStateObj]); - } - }); - }, - loadFont: function PartialEvaluator_loadFont(fontName, font, resources) { - const errorFont = () => { - return Promise.resolve(new TranslatedFont({ - loadedName: "g_font_error", - font: new _fonts.ErrorFont(`Font "${fontName}" is not available.`), - dict: font, - extraProperties: this.options.fontExtraProperties - })); - }; + const transferFn = this._pdfFunctionFactory.create(transferObj); - var fontRef, - xref = this.xref; + const transferMap = new Uint8Array(256), + tmp = new Float32Array(1); - if (font) { - if (!(0, _primitives.isRef)(font)) { - throw new _util.FormatError('The "font" object should be a reference.'); - } + for (let j = 0; j < 256; j++) { + tmp[0] = j / 255; + transferFn(tmp, 0, tmp, 0); + transferMap[j] = tmp[0] * 255 | 0; + } - fontRef = font; - } else { - var fontRes = resources.get("Font"); + transferMaps.push(transferMap); + numEffectfulFns++; + } - if (fontRes) { - fontRef = fontRes.getRaw(fontName); - } - } + if (!(numFns === 1 || numFns === 4)) { + return null; + } + + if (numEffectfulFns === 0) { + return null; + } + + return transferMaps; + } - if (!fontRef) { - const partialMsg = `Font "${fontName || font && font.toString()}" is not available`; + handleTilingType(fn, args, resources, pattern, patternDict, operatorList, task) { + const tilingOpList = new _operator_list.OperatorList(); - if (!this.options.ignoreErrors && !this.parsingType3Font) { - (0, _util.warn)(`${partialMsg}.`); - return errorFont(); - } + const patternResources = _primitives.Dict.merge({ + xref: this.xref, + dictArray: [patternDict.get("Resources"), resources] + }); + + return this.getOperatorList({ + stream: pattern, + task, + resources: patternResources, + operatorList: tilingOpList + }).then(function () { + return (0, _pattern.getTilingPatternIR)({ + fnArray: tilingOpList.fnArray, + argsArray: tilingOpList.argsArray + }, patternDict, args); + }).then(function (tilingPatternIR) { + operatorList.addDependencies(tilingOpList.dependencies); + operatorList.addOp(fn, tilingPatternIR); + }, reason => { + if (reason instanceof _util.AbortException) { + return; + } + if (this.options.ignoreErrors) { this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorFontMissing + featureId: _util.UNSUPPORTED_FEATURES.errorTilingPattern }); - (0, _util.warn)(`${partialMsg} -- attempting to fallback to a default font.`); - fontRef = PartialEvaluator.getFallbackFontDict(); + (0, _util.warn)(`handleTilingType - ignoring pattern: "${reason}".`); + return; } - if (this.fontCache.has(fontRef)) { - return this.fontCache.get(fontRef); - } + throw reason; + }); + } - font = xref.fetchIfRef(fontRef); + handleSetFont(resources, fontArgs, fontRef, operatorList, task, state) { + var fontName, + fontSize = 0; - if (!(0, _primitives.isDict)(font)) { - return errorFont(); - } + if (fontArgs) { + fontArgs = fontArgs.slice(); + fontName = fontArgs[0].name; + fontSize = fontArgs[1]; + } - if (font.translated) { - return font.translated; + return this.loadFont(fontName, fontRef, resources).then(translated => { + if (!translated.font.isType3Font) { + return translated; } - var fontCapability = (0, _util.createPromiseCapability)(); - var preEvaluatedFont = this.preEvaluateFont(font); - const { - descriptor, - hash - } = preEvaluatedFont; - var fontRefIsRef = (0, _primitives.isRef)(fontRef), - fontID; + return translated.loadType3Data(this, resources, task).then(function () { + operatorList.addDependencies(translated.type3Dependencies); + return translated; + }).catch(reason => { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorFontLoadType3 + }); + return new TranslatedFont({ + loadedName: "g_font_error", + font: new _fonts.ErrorFont(`Type3 font load error: ${reason}`), + dict: translated.font, + extraProperties: this.options.fontExtraProperties + }); + }); + }).then(translated => { + state.font = translated.font; + state.fontSize = fontSize; + state.fontName = fontName; + translated.send(this.handler); + return translated.loadedName; + }); + } - if (fontRefIsRef) { - fontID = fontRef.toString(); + handleText(chars, state) { + const font = state.font; + const glyphs = font.charsToGlyphs(chars); + + if (font.data) { + const isAddToPathSet = !!(state.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG); + + if (isAddToPathSet || state.fillColorSpace.name === "Pattern" || font.disableFontFace || this.options.disableFontFace) { + PartialEvaluator.buildFontPaths(font, glyphs, this.handler); } + } - if (hash && (0, _primitives.isDict)(descriptor)) { - if (!descriptor.fontAliases) { - descriptor.fontAliases = Object.create(null); - } + return glyphs; + } + + ensureStateFont(state) { + if (state.font) { + return; + } + + const reason = new _util.FormatError("Missing setFont (Tf) operator before text rendering operator."); + + if (this.options.ignoreErrors) { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorFontState + }); + (0, _util.warn)(`ensureStateFont: "${reason}".`); + return; + } + + throw reason; + } + + async setGState({ + resources, + gState, + operatorList, + cacheKey, + task, + stateManager, + localGStateCache, + localColorSpaceCache + }) { + const gStateRef = gState.objId; + let isSimpleGState = true; + var gStateObj = []; + var gStateKeys = gState.getKeys(); + var promise = Promise.resolve(); + + for (var i = 0, ii = gStateKeys.length; i < ii; i++) { + const key = gStateKeys[i]; + const value = gState.get(key); + + switch (key) { + case "Type": + break; + + case "LW": + case "LC": + case "LJ": + case "ML": + case "D": + case "RI": + case "FL": + case "CA": + case "ca": + gStateObj.push([key, value]); + break; - var fontAliases = descriptor.fontAliases; + case "Font": + isSimpleGState = false; + promise = promise.then(() => { + return this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) { + operatorList.addDependency(loadedName); + gStateObj.push([key, [loadedName, value[1]]]); + }); + }); + break; - if (fontAliases[hash]) { - var aliasFontRef = fontAliases[hash].aliasRef; + case "BM": + gStateObj.push([key, normalizeBlendMode(value)]); + break; - if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) { - this.fontCache.putAlias(fontRef, aliasFontRef); - return this.fontCache.get(fontRef); + case "SMask": + if ((0, _primitives.isName)(value, "None")) { + gStateObj.push([key, false]); + break; } - } else { - fontAliases[hash] = { - fontID: _fonts.Font.getFontID() - }; - } - if (fontRefIsRef) { - fontAliases[hash].aliasRef = fontRef; - } + if ((0, _primitives.isDict)(value)) { + isSimpleGState = false; + promise = promise.then(() => { + return this.handleSMask(value, resources, operatorList, task, stateManager, localColorSpaceCache); + }); + gStateObj.push([key, true]); + } else { + (0, _util.warn)("Unsupported SMask type"); + } + + break; + + case "TR": + const transferMaps = this.handleTransferFunction(value); + gStateObj.push([key, transferMaps]); + break; + + case "OP": + case "op": + case "OPM": + case "BG": + case "BG2": + case "UCR": + case "UCR2": + case "TR2": + case "HT": + case "SM": + case "SA": + case "AIS": + case "TK": + (0, _util.info)("graphic state operator " + key); + break; - fontID = fontAliases[hash].fontID; + default: + (0, _util.info)("Unknown graphic state operator " + key); + break; } + } - if (fontRefIsRef) { - this.fontCache.put(fontRef, fontCapability.promise); - } else { - if (!fontID) { - fontID = this.idFactory.createObjId(); - } + return promise.then(function () { + if (gStateObj.length > 0) { + operatorList.addOp(_util.OPS.setGState, [gStateObj]); + } - this.fontCache.put(`id_${fontID}`, fontCapability.promise); + if (isSimpleGState) { + localGStateCache.set(cacheKey, gStateRef, gStateObj); } + }); + } - (0, _util.assert)(fontID, 'The "fontID" must be defined.'); - font.loadedName = `${this.idFactory.getDocId()}_f${fontID}`; - font.translated = fontCapability.promise; - var translatedPromise; + loadFont(fontName, font, resources) { + const errorFont = () => { + return Promise.resolve(new TranslatedFont({ + loadedName: "g_font_error", + font: new _fonts.ErrorFont(`Font "${fontName}" is not available.`), + dict: font, + extraProperties: this.options.fontExtraProperties + })); + }; - try { - translatedPromise = this.translateFont(preEvaluatedFont); - } catch (e) { - translatedPromise = Promise.reject(e); + var fontRef, + xref = this.xref; + + if (font) { + if (!(0, _primitives.isRef)(font)) { + throw new _util.FormatError('The "font" object should be a reference.'); } - translatedPromise.then(translatedFont => { - if (translatedFont.fontType !== undefined) { - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[translatedFont.fontType] = true; - } + fontRef = font; + } else { + var fontRes = resources.get("Font"); - fontCapability.resolve(new TranslatedFont({ - loadedName: font.loadedName, - font: translatedFont, - dict: font, - extraProperties: this.options.fontExtraProperties - })); - }).catch(reason => { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorFontTranslate - }); + if (fontRes) { + fontRef = fontRes.getRaw(fontName); + } + } - try { - var fontFile3 = descriptor && descriptor.get("FontFile3"); - var subtype = fontFile3 && fontFile3.get("Subtype"); - var fontType = (0, _fonts.getFontType)(preEvaluatedFont.type, subtype && subtype.name); - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[fontType] = true; - } catch (ex) {} - - fontCapability.resolve(new TranslatedFont({ - loadedName: font.loadedName, - font: new _fonts.ErrorFont(reason instanceof Error ? reason.message : reason), - dict: font, - extraProperties: this.options.fontExtraProperties - })); + if (!fontRef) { + const partialMsg = `Font "${fontName || font && font.toString()}" is not available`; + + if (!this.options.ignoreErrors && !this.parsingType3Font) { + (0, _util.warn)(`${partialMsg}.`); + return errorFont(); + } + + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorFontMissing }); - return fontCapability.promise; - }, + (0, _util.warn)(`${partialMsg} -- attempting to fallback to a default font.`); + fontRef = PartialEvaluator.fallbackFontDict; + } + + if (this.fontCache.has(fontRef)) { + return this.fontCache.get(fontRef); + } + + font = xref.fetchIfRef(fontRef); + + if (!(0, _primitives.isDict)(font)) { + return errorFont(); + } + + if (font.translated) { + return font.translated; + } + + var fontCapability = (0, _util.createPromiseCapability)(); + var preEvaluatedFont = this.preEvaluateFont(font); + const { + descriptor, + hash + } = preEvaluatedFont; + var fontRefIsRef = (0, _primitives.isRef)(fontRef), + fontID; - buildPath(operatorList, fn, args, parsingText = false) { - var lastIndex = operatorList.length - 1; + if (fontRefIsRef) { + fontID = `f${fontRef.toString()}`; + } - if (!args) { - args = []; + if (hash && (0, _primitives.isDict)(descriptor)) { + if (!descriptor.fontAliases) { + descriptor.fontAliases = Object.create(null); } - if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== _util.OPS.constructPath) { - if (parsingText) { - (0, _util.warn)(`Encountered path operator "${fn}" inside of a text object.`); - operatorList.addOp(_util.OPS.save, null); - } + var fontAliases = descriptor.fontAliases; - operatorList.addOp(_util.OPS.constructPath, [[fn], args]); + if (fontAliases[hash]) { + var aliasFontRef = fontAliases[hash].aliasRef; - if (parsingText) { - operatorList.addOp(_util.OPS.restore, null); + if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) { + this.fontCache.putAlias(fontRef, aliasFontRef); + return this.fontCache.get(fontRef); } } else { - var opArgs = operatorList.argsArray[lastIndex]; - opArgs[0].push(fn); - Array.prototype.push.apply(opArgs[1], args); + fontAliases[hash] = { + fontID: this.idFactory.createFontId() + }; } - }, - parseColorSpace({ - cs, - resources - }) { - return new Promise(resolve => { - resolve(_colorspace.ColorSpace.parse(cs, this.xref, resources, this.pdfFunctionFactory)); - }).catch(reason => { - if (reason instanceof _util.AbortException) { - return null; - } + if (fontRefIsRef) { + fontAliases[hash].aliasRef = fontRef; + } - if (this.options.ignoreErrors) { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorColorSpace - }); - (0, _util.warn)(`parseColorSpace - ignoring ColorSpace: "${reason}".`); - return null; - } + fontID = fontAliases[hash].fontID; + } - throw reason; + if (fontRefIsRef) { + this.fontCache.put(fontRef, fontCapability.promise); + } else { + if (!fontID) { + fontID = this.idFactory.createFontId(); + } + + this.fontCache.put(`id_${fontID}`, fontCapability.promise); + } + + (0, _util.assert)(fontID && fontID.startsWith("f"), 'The "fontID" must be (correctly) defined.'); + font.loadedName = `${this.idFactory.getDocId()}_${fontID}`; + font.translated = fontCapability.promise; + var translatedPromise; + + try { + translatedPromise = this.translateFont(preEvaluatedFont); + } catch (e) { + translatedPromise = Promise.reject(e); + } + + translatedPromise.then(translatedFont => { + if (translatedFont.fontType !== undefined) { + var xrefFontStats = xref.stats.fontTypes; + xrefFontStats[translatedFont.fontType] = true; + } + + fontCapability.resolve(new TranslatedFont({ + loadedName: font.loadedName, + font: translatedFont, + dict: font, + extraProperties: this.options.fontExtraProperties + })); + }).catch(reason => { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorFontTranslate }); - }, - async handleColorN(operatorList, fn, args, cs, patterns, resources, task) { - var patternName = args[args.length - 1]; - var pattern; + try { + var fontFile3 = descriptor && descriptor.get("FontFile3"); + var subtype = fontFile3 && fontFile3.get("Subtype"); + var fontType = (0, _fonts.getFontType)(preEvaluatedFont.type, subtype && subtype.name); + var xrefFontStats = xref.stats.fontTypes; + xrefFontStats[fontType] = true; + } catch (ex) {} + + fontCapability.resolve(new TranslatedFont({ + loadedName: font.loadedName, + font: new _fonts.ErrorFont(reason instanceof Error ? reason.message : reason), + dict: font, + extraProperties: this.options.fontExtraProperties + })); + }); + return fontCapability.promise; + } - if ((0, _primitives.isName)(patternName) && (pattern = patterns.get(patternName.name))) { - var dict = (0, _primitives.isStream)(pattern) ? pattern.dict : pattern; - var typeNum = dict.get("PatternType"); + buildPath(operatorList, fn, args, parsingText = false) { + var lastIndex = operatorList.length - 1; - if (typeNum === TILING_PATTERN) { - var color = cs.base ? cs.base.getRgb(args, 0) : null; - return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task); - } else if (typeNum === SHADING_PATTERN) { - var shading = dict.get("Shading"); - var matrix = dict.getArray("Matrix"); - pattern = _pattern.Pattern.parseShading(shading, matrix, this.xref, resources, this.handler, this.pdfFunctionFactory); - operatorList.addOp(fn, pattern.getIR()); - return undefined; - } + if (!args) { + args = []; + } - throw new _util.FormatError(`Unknown PatternType: ${typeNum}`); + if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== _util.OPS.constructPath) { + if (parsingText) { + (0, _util.warn)(`Encountered path operator "${fn}" inside of a text object.`); + operatorList.addOp(_util.OPS.save, null); } - throw new _util.FormatError(`Unknown PatternName: ${patternName}`); - }, + operatorList.addOp(_util.OPS.constructPath, [[fn], args]); - getOperatorList({ - stream, - task, + if (parsingText) { + operatorList.addOp(_util.OPS.restore, null); + } + } else { + var opArgs = operatorList.argsArray[lastIndex]; + opArgs[0].push(fn); + Array.prototype.push.apply(opArgs[1], args); + } + } + + parseColorSpace({ + cs, + resources, + localColorSpaceCache + }) { + return _colorspace.ColorSpace.parseAsync({ + cs, + xref: this.xref, resources, - operatorList, - initialState = null - }) { - resources = resources || _primitives.Dict.empty; - initialState = initialState || new EvalState(); + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache + }).catch(reason => { + if (reason instanceof _util.AbortException) { + return null; + } + + if (this.options.ignoreErrors) { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorColorSpace + }); + (0, _util.warn)(`parseColorSpace - ignoring ColorSpace: "${reason}".`); + return null; + } + + throw reason; + }); + } - if (!operatorList) { - throw new Error('getOperatorList: missing "operatorList" parameter'); + async handleColorN(operatorList, fn, args, cs, patterns, resources, task, localColorSpaceCache) { + var patternName = args[args.length - 1]; + var pattern; + + if ((0, _primitives.isName)(patternName) && (pattern = patterns.get(patternName.name))) { + var dict = (0, _primitives.isStream)(pattern) ? pattern.dict : pattern; + var typeNum = dict.get("PatternType"); + + if (typeNum === PatternType.TILING) { + var color = cs.base ? cs.base.getRgb(args, 0) : null; + return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task); + } else if (typeNum === PatternType.SHADING) { + var shading = dict.get("Shading"); + var matrix = dict.getArray("Matrix"); + pattern = _pattern.Pattern.parseShading(shading, matrix, this.xref, resources, this.handler, this._pdfFunctionFactory, localColorSpaceCache); + operatorList.addOp(fn, pattern.getIR()); + return undefined; } - var self = this; - var xref = this.xref; - let parsingText = false; - const localImageCache = new _image_utils.LocalImageCache(); + throw new _util.FormatError(`Unknown PatternType: ${typeNum}`); + } + + throw new _util.FormatError(`Unknown PatternName: ${patternName}`); + } + + async parseMarkedContentProps(contentProperties, resources) { + let optionalContent; + + if ((0, _primitives.isName)(contentProperties)) { + const properties = resources.get("Properties"); + optionalContent = properties.get(contentProperties.name); + } else if ((0, _primitives.isDict)(contentProperties)) { + optionalContent = contentProperties; + } else { + throw new _util.FormatError("Optional content properties malformed."); + } - var xobjs = resources.get("XObject") || _primitives.Dict.empty; + const optionalContentType = optionalContent.get("Type").name; - var patterns = resources.get("Pattern") || _primitives.Dict.empty; + if (optionalContentType === "OCG") { + return { + type: optionalContentType, + id: optionalContent.objId + }; + } else if (optionalContentType === "OCMD") { + const optionalContentGroups = optionalContent.get("OCGs"); - var stateManager = new StateManager(initialState); - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - var timeSlotManager = new TimeSlotManager(); + if (Array.isArray(optionalContentGroups) || (0, _primitives.isDict)(optionalContentGroups)) { + const groupIds = []; - function closePendingRestoreOPS(argument) { - for (var i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { - operatorList.addOp(_util.OPS.restore, []); + if (Array.isArray(optionalContentGroups)) { + optionalContent.get("OCGs").forEach(ocg => { + groupIds.push(ocg.toString()); + }); + } else { + groupIds.push(optionalContentGroups.objId); } - } - return new Promise(function promiseBody(resolve, reject) { - const next = function (promise) { - Promise.all([promise, operatorList.ready]).then(function () { - try { - promiseBody(resolve, reject); - } catch (ex) { - reject(ex); - } - }, reject); + let expression = null; + + if (optionalContent.get("VE")) { + expression = true; + } + + return { + type: optionalContentType, + ids: groupIds, + policy: (0, _primitives.isName)(optionalContent.get("P")) ? optionalContent.get("P").name : null, + expression + }; + } else if ((0, _primitives.isRef)(optionalContentGroups)) { + return { + type: optionalContentType, + id: optionalContentGroups.toString() }; + } + } - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, - operation = {}, - i, - ii, - cs; + return null; + } - while (!(stop = timeSlotManager.check())) { - operation.args = null; + getOperatorList({ + stream, + task, + resources, + operatorList, + initialState = null + }) { + resources = resources || _primitives.Dict.empty; + initialState = initialState || new EvalState(); - if (!preprocessor.read(operation)) { - break; - } + if (!operatorList) { + throw new Error('getOperatorList: missing "operatorList" parameter'); + } - var args = operation.args; - var fn = operation.fn; + var self = this; + var xref = this.xref; + let parsingText = false; + const localImageCache = new _image_utils.LocalImageCache(); + const localColorSpaceCache = new _image_utils.LocalColorSpaceCache(); + const localGStateCache = new _image_utils.LocalGStateCache(); - switch (fn | 0) { - case _util.OPS.paintXObject: - var name = args[0].name; + var xobjs = resources.get("XObject") || _primitives.Dict.empty; - if (name) { - const localImage = localImageCache.getByName(name); + var patterns = resources.get("Pattern") || _primitives.Dict.empty; - if (localImage) { - operatorList.addOp(localImage.fn, localImage.args); - args = null; - continue; - } - } + var stateManager = new StateManager(initialState); + var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); + var timeSlotManager = new TimeSlotManager(); - next(new Promise(function (resolveXObject, rejectXObject) { - if (!name) { - throw new _util.FormatError("XObject must be referred to by name."); - } + function closePendingRestoreOPS(argument) { + for (var i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { + operatorList.addOp(_util.OPS.restore, []); + } + } - let xobj = xobjs.getRaw(name); + return new Promise(function promiseBody(resolve, reject) { + const next = function (promise) { + Promise.all([promise, operatorList.ready]).then(function () { + try { + promiseBody(resolve, reject); + } catch (ex) { + reject(ex); + } + }, reject); + }; - if (xobj instanceof _primitives.Ref) { - const localImage = localImageCache.getByRef(xobj); + task.ensureNotTerminated(); + timeSlotManager.reset(); + var stop, + operation = {}, + i, + ii, + cs, + name; - if (localImage) { - operatorList.addOp(localImage.fn, localImage.args); - resolveXObject(); - return; - } + while (!(stop = timeSlotManager.check())) { + operation.args = null; - const globalImage = self.globalImageCache.getData(xobj, self.pageIndex); + if (!preprocessor.read(operation)) { + break; + } - if (globalImage) { - operatorList.addDependency(globalImage.objId); - operatorList.addOp(globalImage.fn, globalImage.args); - resolveXObject(); - return; - } + var args = operation.args; + var fn = operation.fn; - xobj = xref.fetch(xobj); - } + switch (fn | 0) { + case _util.OPS.paintXObject: + name = args[0].name; - if (!xobj) { - operatorList.addOp(fn, args); - resolveXObject(); - return; - } + if (name) { + const localImage = localImageCache.getByName(name); - if (!(0, _primitives.isStream)(xobj)) { - throw new _util.FormatError("XObject should be a stream"); - } + if (localImage) { + operatorList.addOp(localImage.fn, localImage.args); + args = null; + continue; + } + } - const type = xobj.dict.get("Subtype"); + next(new Promise(function (resolveXObject, rejectXObject) { + if (!name) { + throw new _util.FormatError("XObject must be referred to by name."); + } - if (!(0, _primitives.isName)(type)) { - throw new _util.FormatError("XObject should have a Name subtype"); - } + let xobj = xobjs.getRaw(name); - if (type.name === "Form") { - stateManager.save(); - self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone()).then(function () { - stateManager.restore(); - resolveXObject(); - }, rejectXObject); - return; - } else if (type.name === "Image") { - self.buildPaintImageXObject({ - resources, - image: xobj, - operatorList, - cacheKey: name, - localImageCache - }).then(resolveXObject, rejectXObject); - return; - } else if (type.name === "PS") { - (0, _util.info)("Ignored XObject subtype PS"); - } else { - throw new _util.FormatError(`Unhandled XObject subtype ${type.name}`); - } + if (xobj instanceof _primitives.Ref) { + const localImage = localImageCache.getByRef(xobj); - resolveXObject(); - }).catch(function (reason) { - if (reason instanceof _util.AbortException) { + if (localImage) { + operatorList.addOp(localImage.fn, localImage.args); + resolveXObject(); return; } - if (self.options.ignoreErrors) { - self.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorXObject - }); - (0, _util.warn)(`getOperatorList - ignoring XObject: "${reason}".`); + const globalImage = self.globalImageCache.getData(xobj, self.pageIndex); + + if (globalImage) { + operatorList.addDependency(globalImage.objId); + operatorList.addOp(globalImage.fn, globalImage.args); + resolveXObject(); return; } - throw reason; - })); - return; + xobj = xref.fetch(xobj); + } - case _util.OPS.setFont: - var fontSize = args[1]; - next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state).then(function (loadedName) { - operatorList.addDependency(loadedName); - operatorList.addOp(_util.OPS.setFont, [loadedName, fontSize]); - })); - return; + if (!(0, _primitives.isStream)(xobj)) { + throw new _util.FormatError("XObject should be a stream"); + } - case _util.OPS.beginText: - parsingText = true; - break; + const type = xobj.dict.get("Subtype"); - case _util.OPS.endText: - parsingText = false; - break; + if (!(0, _primitives.isName)(type)) { + throw new _util.FormatError("XObject should have a Name subtype"); + } - case _util.OPS.endInlineImage: - var cacheKey = args[0].cacheKey; + if (type.name === "Form") { + stateManager.save(); + self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone(), localColorSpaceCache).then(function () { + stateManager.restore(); + resolveXObject(); + }, rejectXObject); + return; + } else if (type.name === "Image") { + self.buildPaintImageXObject({ + resources, + image: xobj, + operatorList, + cacheKey: name, + localImageCache, + localColorSpaceCache + }).then(resolveXObject, rejectXObject); + return; + } else if (type.name === "PS") { + (0, _util.info)("Ignored XObject subtype PS"); + } else { + throw new _util.FormatError(`Unhandled XObject subtype ${type.name}`); + } - if (cacheKey) { - const localImage = localImageCache.getByName(cacheKey); + resolveXObject(); + }).catch(function (reason) { + if (reason instanceof _util.AbortException) { + return; + } - if (localImage) { - operatorList.addOp(localImage.fn, localImage.args); - args = null; - continue; - } + if (self.options.ignoreErrors) { + self.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorXObject + }); + (0, _util.warn)(`getOperatorList - ignoring XObject: "${reason}".`); + return; } - next(self.buildPaintImageXObject({ - resources, - image: args[0], - isInline: true, - operatorList, - cacheKey, - localImageCache - })); - return; + throw reason; + })); + return; - case _util.OPS.showText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; - } + case _util.OPS.setFont: + var fontSize = args[1]; + next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state).then(function (loadedName) { + operatorList.addDependency(loadedName); + operatorList.addOp(_util.OPS.setFont, [loadedName, fontSize]); + })); + return; - args[0] = self.handleText(args[0], stateManager.state); - break; + case _util.OPS.beginText: + parsingText = true; + break; + + case _util.OPS.endText: + parsingText = false; + break; + + case _util.OPS.endInlineImage: + var cacheKey = args[0].cacheKey; - case _util.OPS.showSpacedText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); + if (cacheKey) { + const localImage = localImageCache.getByName(cacheKey); + + if (localImage) { + operatorList.addOp(localImage.fn, localImage.args); + args = null; continue; } + } - var arr = args[0]; - var combinedGlyphs = []; - var arrLength = arr.length; - var state = stateManager.state; + next(self.buildPaintImageXObject({ + resources, + image: args[0], + isInline: true, + operatorList, + cacheKey, + localImageCache, + localColorSpaceCache + })); + return; - for (i = 0; i < arrLength; ++i) { - var arrItem = arr[i]; + case _util.OPS.showText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } - if ((0, _util.isString)(arrItem)) { - Array.prototype.push.apply(combinedGlyphs, self.handleText(arrItem, state)); - } else if ((0, _util.isNum)(arrItem)) { - combinedGlyphs.push(arrItem); - } - } + args[0] = self.handleText(args[0], stateManager.state); + break; - args[0] = combinedGlyphs; - fn = _util.OPS.showText; - break; + case _util.OPS.showSpacedText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } - case _util.OPS.nextLineShowText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; - } + var arr = args[0]; + var combinedGlyphs = []; + var arrLength = arr.length; + var state = stateManager.state; - operatorList.addOp(_util.OPS.nextLine); - args[0] = self.handleText(args[0], stateManager.state); - fn = _util.OPS.showText; - break; + for (i = 0; i < arrLength; ++i) { + var arrItem = arr[i]; - case _util.OPS.nextLineSetSpacingShowText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; + if ((0, _util.isString)(arrItem)) { + Array.prototype.push.apply(combinedGlyphs, self.handleText(arrItem, state)); + } else if ((0, _util.isNum)(arrItem)) { + combinedGlyphs.push(arrItem); } + } - operatorList.addOp(_util.OPS.nextLine); - operatorList.addOp(_util.OPS.setWordSpacing, [args.shift()]); - operatorList.addOp(_util.OPS.setCharSpacing, [args.shift()]); - args[0] = self.handleText(args[0], stateManager.state); - fn = _util.OPS.showText; - break; + args[0] = combinedGlyphs; + fn = _util.OPS.showText; + break; - case _util.OPS.setTextRenderingMode: - stateManager.state.textRenderingMode = args[0]; - break; + case _util.OPS.nextLineShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + + operatorList.addOp(_util.OPS.nextLine); + args[0] = self.handleText(args[0], stateManager.state); + fn = _util.OPS.showText; + break; + + case _util.OPS.nextLineSetSpacingShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + + operatorList.addOp(_util.OPS.nextLine); + operatorList.addOp(_util.OPS.setWordSpacing, [args.shift()]); + operatorList.addOp(_util.OPS.setCharSpacing, [args.shift()]); + args[0] = self.handleText(args[0], stateManager.state); + fn = _util.OPS.showText; + break; + + case _util.OPS.setTextRenderingMode: + stateManager.state.textRenderingMode = args[0]; + break; + + case _util.OPS.setFillColorSpace: + { + const cachedColorSpace = _colorspace.ColorSpace.getCached(args[0], xref, localColorSpaceCache); + + if (cachedColorSpace) { + stateManager.state.fillColorSpace = cachedColorSpace; + continue; + } - case _util.OPS.setFillColorSpace: next(self.parseColorSpace({ cs: args[0], - resources + resources, + localColorSpaceCache }).then(function (colorSpace) { if (colorSpace) { stateManager.state.fillColorSpace = colorSpace; } })); return; + } + + case _util.OPS.setStrokeColorSpace: + { + const cachedColorSpace = _colorspace.ColorSpace.getCached(args[0], xref, localColorSpaceCache); + + if (cachedColorSpace) { + stateManager.state.strokeColorSpace = cachedColorSpace; + continue; + } - case _util.OPS.setStrokeColorSpace: next(self.parseColorSpace({ cs: args[0], - resources + resources, + localColorSpaceCache }).then(function (colorSpace) { if (colorSpace) { stateManager.state.strokeColorSpace = colorSpace; } })); return; + } - case _util.OPS.setFillColor: - cs = stateManager.state.fillColorSpace; - args = cs.getRgb(args, 0); - fn = _util.OPS.setFillRGBColor; - break; + case _util.OPS.setFillColor: + cs = stateManager.state.fillColorSpace; + args = cs.getRgb(args, 0); + fn = _util.OPS.setFillRGBColor; + break; - case _util.OPS.setStrokeColor: - cs = stateManager.state.strokeColorSpace; - args = cs.getRgb(args, 0); - fn = _util.OPS.setStrokeRGBColor; - break; + case _util.OPS.setStrokeColor: + cs = stateManager.state.strokeColorSpace; + args = cs.getRgb(args, 0); + fn = _util.OPS.setStrokeRGBColor; + break; - case _util.OPS.setFillGray: - stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.gray; - args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); - fn = _util.OPS.setFillRGBColor; - break; + case _util.OPS.setFillGray: + stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.gray; + args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); + fn = _util.OPS.setFillRGBColor; + break; - case _util.OPS.setStrokeGray: - stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; - args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); - fn = _util.OPS.setStrokeRGBColor; - break; + case _util.OPS.setStrokeGray: + stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; + args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); + fn = _util.OPS.setStrokeRGBColor; + break; - case _util.OPS.setFillCMYKColor: - stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.cmyk; - args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = _util.OPS.setFillRGBColor; - break; + case _util.OPS.setFillCMYKColor: + stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.cmyk; + args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); + fn = _util.OPS.setFillRGBColor; + break; - case _util.OPS.setStrokeCMYKColor: - stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.cmyk; - args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = _util.OPS.setStrokeRGBColor; - break; + case _util.OPS.setStrokeCMYKColor: + stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.cmyk; + args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); + fn = _util.OPS.setStrokeRGBColor; + break; - case _util.OPS.setFillRGBColor: - stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.rgb; - args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); - break; + case _util.OPS.setFillRGBColor: + stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.rgb; + args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); + break; - case _util.OPS.setStrokeRGBColor: - stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.rgb; - args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); - break; + case _util.OPS.setStrokeRGBColor: + stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.rgb; + args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); + break; - case _util.OPS.setFillColorN: - cs = stateManager.state.fillColorSpace; + case _util.OPS.setFillColorN: + cs = stateManager.state.fillColorSpace; - if (cs.name === "Pattern") { - next(self.handleColorN(operatorList, _util.OPS.setFillColorN, args, cs, patterns, resources, task)); - return; - } + if (cs.name === "Pattern") { + next(self.handleColorN(operatorList, _util.OPS.setFillColorN, args, cs, patterns, resources, task, localColorSpaceCache)); + return; + } - args = cs.getRgb(args, 0); - fn = _util.OPS.setFillRGBColor; - break; + args = cs.getRgb(args, 0); + fn = _util.OPS.setFillRGBColor; + break; - case _util.OPS.setStrokeColorN: - cs = stateManager.state.strokeColorSpace; + case _util.OPS.setStrokeColorN: + cs = stateManager.state.strokeColorSpace; - if (cs.name === "Pattern") { - next(self.handleColorN(operatorList, _util.OPS.setStrokeColorN, args, cs, patterns, resources, task)); - return; - } + if (cs.name === "Pattern") { + next(self.handleColorN(operatorList, _util.OPS.setStrokeColorN, args, cs, patterns, resources, task, localColorSpaceCache)); + return; + } - args = cs.getRgb(args, 0); - fn = _util.OPS.setStrokeRGBColor; - break; + args = cs.getRgb(args, 0); + fn = _util.OPS.setStrokeRGBColor; + break; - case _util.OPS.shadingFill: - var shadingRes = resources.get("Shading"); + case _util.OPS.shadingFill: + var shadingRes = resources.get("Shading"); - if (!shadingRes) { - throw new _util.FormatError("No shading resource found"); - } + if (!shadingRes) { + throw new _util.FormatError("No shading resource found"); + } - var shading = shadingRes.get(args[0].name); + var shading = shadingRes.get(args[0].name); - if (!shading) { - throw new _util.FormatError("No shading object found"); - } + if (!shading) { + throw new _util.FormatError("No shading object found"); + } - var shadingFill = _pattern.Pattern.parseShading(shading, null, xref, resources, self.handler, self.pdfFunctionFactory); + var shadingFill = _pattern.Pattern.parseShading(shading, null, xref, resources, self.handler, self._pdfFunctionFactory, localColorSpaceCache); - var patternIR = shadingFill.getIR(); - args = [patternIR]; - fn = _util.OPS.shadingFill; - break; + var patternIR = shadingFill.getIR(); + args = [patternIR]; + fn = _util.OPS.shadingFill; + break; - case _util.OPS.setGState: - var dictName = args[0]; - var extGState = resources.get("ExtGState"); + case _util.OPS.setGState: + name = args[0].name; - if (!(0, _primitives.isDict)(extGState) || !extGState.has(dictName.name)) { - break; + if (name) { + const localGStateObj = localGStateCache.getByName(name); + + if (localGStateObj) { + if (localGStateObj.length > 0) { + operatorList.addOp(_util.OPS.setGState, [localGStateObj]); + } + + args = null; + continue; } + } - var gState = extGState.get(dictName.name); - next(self.setGState(resources, gState, operatorList, task, stateManager)); - return; + next(new Promise(function (resolveGState, rejectGState) { + if (!name) { + throw new _util.FormatError("GState must be referred to by name."); + } - case _util.OPS.moveTo: - case _util.OPS.lineTo: - case _util.OPS.curveTo: - case _util.OPS.curveTo2: - case _util.OPS.curveTo3: - case _util.OPS.closePath: - case _util.OPS.rectangle: - self.buildPath(operatorList, fn, args, parsingText); - continue; + const extGState = resources.get("ExtGState"); - case _util.OPS.markPoint: - case _util.OPS.markPointProps: - case _util.OPS.beginMarkedContent: - case _util.OPS.beginMarkedContentProps: - case _util.OPS.endMarkedContent: - case _util.OPS.beginCompat: - case _util.OPS.endCompat: - continue; + if (!(extGState instanceof _primitives.Dict)) { + throw new _util.FormatError("ExtGState should be a dictionary."); + } - default: - if (args !== null) { - for (i = 0, ii = args.length; i < ii; i++) { - if (args[i] instanceof _primitives.Dict) { - break; - } - } + const gState = extGState.get(name); - if (i < ii) { - (0, _util.warn)("getOperatorList - ignoring operator: " + fn); - continue; - } + if (!(gState instanceof _primitives.Dict)) { + throw new _util.FormatError("GState should be a dictionary."); } - } + self.setGState({ + resources, + gState, + operatorList, + cacheKey: name, + task, + stateManager, + localGStateCache, + localColorSpaceCache + }).then(resolveGState, rejectGState); + }).catch(function (reason) { + if (reason instanceof _util.AbortException) { + return; + } - operatorList.addOp(fn, args); - } + if (self.options.ignoreErrors) { + self.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorExtGState + }); + (0, _util.warn)(`getOperatorList - ignoring ExtGState: "${reason}".`); + return; + } - if (stop) { - next(deferred); - return; - } + throw reason; + })); + return; - closePendingRestoreOPS(); - resolve(); - }).catch(reason => { - if (reason instanceof _util.AbortException) { - return; - } + case _util.OPS.moveTo: + case _util.OPS.lineTo: + case _util.OPS.curveTo: + case _util.OPS.curveTo2: + case _util.OPS.curveTo3: + case _util.OPS.closePath: + case _util.OPS.rectangle: + self.buildPath(operatorList, fn, args, parsingText); + continue; - if (this.options.ignoreErrors) { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorOperatorList - }); - (0, _util.warn)(`getOperatorList - ignoring errors during "${task.name}" ` + `task: "${reason}".`); - closePendingRestoreOPS(); - return; - } + case _util.OPS.markPoint: + case _util.OPS.markPointProps: + case _util.OPS.beginCompat: + case _util.OPS.endCompat: + continue; - throw reason; - }); - }, + case _util.OPS.beginMarkedContentProps: + if (!(0, _primitives.isName)(args[0])) { + (0, _util.warn)(`Expected name for beginMarkedContentProps arg0=${args[0]}`); + continue; + } - getTextContent({ - stream, - task, - resources, - stateManager = null, - normalizeWhitespace = false, - combineTextItems = false, - sink, - seenStyles = Object.create(null) - }) { - resources = resources || _primitives.Dict.empty; - stateManager = stateManager || new StateManager(new TextState()); - var WhitespaceRegexp = /\s/g; - var textContent = { - items: [], - styles: Object.create(null) - }; - var textContentItem = { - initialized: false, - str: [], - width: 0, - height: 0, - vertical: false, - lastAdvanceWidth: 0, - lastAdvanceHeight: 0, - textAdvanceScale: 0, - spaceWidth: 0, - fakeSpaceMin: Infinity, - fakeMultiSpaceMin: Infinity, - fakeMultiSpaceMax: -0, - textRunBreakAllowed: false, - transform: null, - fontName: null - }; - var SPACE_FACTOR = 0.3; - var MULTI_SPACE_FACTOR = 1.5; - var MULTI_SPACE_FACTOR_MAX = 4; - var self = this; - var xref = this.xref; - var xobjs = null; - const emptyXObjectCache = new _image_utils.LocalImageCache(); - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - var textState; - - function ensureTextContentItem() { - if (textContentItem.initialized) { - return textContentItem; - } - - var font = textState.font; - - if (!(font.loadedName in seenStyles)) { - seenStyles[font.loadedName] = true; - textContent.styles[font.loadedName] = { - fontFamily: font.fallbackName, - ascent: font.ascent, - descent: font.descent, - vertical: font.vertical - }; - } + if (args[0].name === "OC") { + next(self.parseMarkedContentProps(args[1], resources).then(data => { + operatorList.addOp(_util.OPS.beginMarkedContentProps, ["OC", data]); + }).catch(reason => { + if (reason instanceof _util.AbortException) { + return; + } - textContentItem.fontName = font.loadedName; - var tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise]; + if (self.options.ignoreErrors) { + self.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorMarkedContent + }); + (0, _util.warn)(`getOperatorList - ignoring beginMarkedContentProps: "${reason}".`); + return; + } - if (font.isType3Font && textState.fontSize <= 1 && !(0, _util.isArrayEqual)(textState.fontMatrix, _util.FONT_IDENTITY_MATRIX)) { - const glyphHeight = font.bbox[3] - font.bbox[1]; + throw reason; + })); + return; + } - if (glyphHeight > 0) { - tsm[3] *= glyphHeight * textState.fontMatrix[3]; - } - } + args = [args[0].name]; + break; - var trm = _util.Util.transform(textState.ctm, _util.Util.transform(textState.textMatrix, tsm)); + case _util.OPS.beginMarkedContent: + case _util.OPS.endMarkedContent: + default: + if (args !== null) { + for (i = 0, ii = args.length; i < ii; i++) { + if (args[i] instanceof _primitives.Dict) { + break; + } + } - textContentItem.transform = trm; + if (i < ii) { + (0, _util.warn)("getOperatorList - ignoring operator: " + fn); + continue; + } + } - if (!font.vertical) { - textContentItem.width = 0; - textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); - textContentItem.vertical = false; - } else { - textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); - textContentItem.height = 0; - textContentItem.vertical = true; - } - - var a = textState.textLineMatrix[0]; - var b = textState.textLineMatrix[1]; - var scaleLineX = Math.sqrt(a * a + b * b); - a = textState.ctm[0]; - b = textState.ctm[1]; - var scaleCtmX = Math.sqrt(a * a + b * b); - textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; - textContentItem.lastAdvanceWidth = 0; - textContentItem.lastAdvanceHeight = 0; - var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; - - if (spaceWidth) { - textContentItem.spaceWidth = spaceWidth; - textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; - textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; - textContentItem.fakeMultiSpaceMax = spaceWidth * MULTI_SPACE_FACTOR_MAX; - textContentItem.textRunBreakAllowed = !font.isMonospace; - } else { - textContentItem.spaceWidth = 0; - textContentItem.fakeSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMax = 0; - textContentItem.textRunBreakAllowed = false; } - textContentItem.initialized = true; - return textContentItem; + operatorList.addOp(fn, args); } - function replaceWhitespace(str) { - var i = 0, - ii = str.length, - code; + if (stop) { + next(deferred); + return; + } - while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7f) { - i++; - } + closePendingRestoreOPS(); + resolve(); + }).catch(reason => { + if (reason instanceof _util.AbortException) { + return; + } - return i < ii ? str.replace(WhitespaceRegexp, " ") : str; + if (this.options.ignoreErrors) { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorOperatorList + }); + (0, _util.warn)(`getOperatorList - ignoring errors during "${task.name}" ` + `task: "${reason}".`); + closePendingRestoreOPS(); + return; } - function runBidiTransform(textChunk) { - var str = textChunk.str.join(""); - var bidiResult = (0, _bidi.bidi)(str, -1, textChunk.vertical); - return { - str: normalizeWhitespace ? replaceWhitespace(bidiResult.str) : bidiResult.str, - dir: bidiResult.dir, - width: textChunk.width, - height: textChunk.height, - transform: textChunk.transform, - fontName: textChunk.fontName + throw reason; + }); + } + + getTextContent({ + stream, + task, + resources, + stateManager = null, + normalizeWhitespace = false, + combineTextItems = false, + sink, + seenStyles = Object.create(null) + }) { + resources = resources || _primitives.Dict.empty; + stateManager = stateManager || new StateManager(new TextState()); + var WhitespaceRegexp = /\s/g; + var textContent = { + items: [], + styles: Object.create(null) + }; + var textContentItem = { + initialized: false, + str: [], + width: 0, + height: 0, + vertical: false, + lastAdvanceWidth: 0, + lastAdvanceHeight: 0, + textAdvanceScale: 0, + spaceWidth: 0, + fakeSpaceMin: Infinity, + fakeMultiSpaceMin: Infinity, + fakeMultiSpaceMax: -0, + textRunBreakAllowed: false, + transform: null, + fontName: null + }; + var SPACE_FACTOR = 0.3; + var MULTI_SPACE_FACTOR = 1.5; + var MULTI_SPACE_FACTOR_MAX = 4; + var self = this; + var xref = this.xref; + var xobjs = null; + const emptyXObjectCache = new _image_utils.LocalImageCache(); + const emptyGStateCache = new _image_utils.LocalGStateCache(); + var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); + var textState; + + function ensureTextContentItem() { + if (textContentItem.initialized) { + return textContentItem; + } + + var font = textState.font; + + if (!(font.loadedName in seenStyles)) { + seenStyles[font.loadedName] = true; + textContent.styles[font.loadedName] = { + fontFamily: font.fallbackName, + ascent: font.ascent, + descent: font.descent, + vertical: font.vertical }; } - function handleSetFont(fontName, fontRef) { - return self.loadFont(fontName, fontRef, resources).then(function (translated) { - textState.font = translated.font; - textState.fontMatrix = translated.font.fontMatrix || _util.FONT_IDENTITY_MATRIX; - }); + textContentItem.fontName = font.loadedName; + var tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise]; + + if (font.isType3Font && textState.fontSize <= 1 && !(0, _util.isArrayEqual)(textState.fontMatrix, _util.FONT_IDENTITY_MATRIX)) { + const glyphHeight = font.bbox[3] - font.bbox[1]; + + if (glyphHeight > 0) { + tsm[3] *= glyphHeight * textState.fontMatrix[3]; + } } - function buildTextContentItem(chars) { - var font = textState.font; - var textChunk = ensureTextContentItem(); - var width = 0; - var height = 0; - var glyphs = font.charsToGlyphs(chars); + var trm = _util.Util.transform(textState.ctm, _util.Util.transform(textState.textMatrix, tsm)); - for (var i = 0; i < glyphs.length; i++) { - var glyph = glyphs[i]; - var glyphWidth = null; + textContentItem.transform = trm; - if (font.vertical && glyph.vmetric) { - glyphWidth = glyph.vmetric[0]; - } else { - glyphWidth = glyph.width; - } + if (!font.vertical) { + textContentItem.width = 0; + textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); + textContentItem.vertical = false; + } else { + textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); + textContentItem.height = 0; + textContentItem.vertical = true; + } + + var a = textState.textLineMatrix[0]; + var b = textState.textLineMatrix[1]; + var scaleLineX = Math.sqrt(a * a + b * b); + a = textState.ctm[0]; + b = textState.ctm[1]; + var scaleCtmX = Math.sqrt(a * a + b * b); + textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; + textContentItem.lastAdvanceWidth = 0; + textContentItem.lastAdvanceHeight = 0; + var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; + + if (spaceWidth) { + textContentItem.spaceWidth = spaceWidth; + textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; + textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; + textContentItem.fakeMultiSpaceMax = spaceWidth * MULTI_SPACE_FACTOR_MAX; + textContentItem.textRunBreakAllowed = !font.isMonospace; + } else { + textContentItem.spaceWidth = 0; + textContentItem.fakeSpaceMin = Infinity; + textContentItem.fakeMultiSpaceMin = Infinity; + textContentItem.fakeMultiSpaceMax = 0; + textContentItem.textRunBreakAllowed = false; + } - var glyphUnicode = glyph.unicode; - var NormalizedUnicodes = (0, _unicode.getNormalizedUnicodes)(); + textContentItem.initialized = true; + return textContentItem; + } - if (NormalizedUnicodes[glyphUnicode] !== undefined) { - glyphUnicode = NormalizedUnicodes[glyphUnicode]; - } + function replaceWhitespace(str) { + var i = 0, + ii = str.length, + code; - glyphUnicode = (0, _unicode.reverseIfRtl)(glyphUnicode); - var charSpacing = textState.charSpacing; + while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7f) { + i++; + } - if (glyph.isSpace) { - var wordSpacing = textState.wordSpacing; - charSpacing += wordSpacing; + return i < ii ? str.replace(WhitespaceRegexp, " ") : str; + } - if (wordSpacing > 0) { - addFakeSpaces(wordSpacing, textChunk.str); - } - } + function runBidiTransform(textChunk) { + var str = textChunk.str.join(""); + var bidiResult = (0, _bidi.bidi)(str, -1, textChunk.vertical); + return { + str: normalizeWhitespace ? replaceWhitespace(bidiResult.str) : bidiResult.str, + dir: bidiResult.dir, + width: textChunk.width, + height: textChunk.height, + transform: textChunk.transform, + fontName: textChunk.fontName + }; + } - var tx = 0; - var ty = 0; + function handleSetFont(fontName, fontRef) { + return self.loadFont(fontName, fontRef, resources).then(function (translated) { + textState.font = translated.font; + textState.fontMatrix = translated.font.fontMatrix || _util.FONT_IDENTITY_MATRIX; + }); + } - if (!font.vertical) { - var w0 = glyphWidth * textState.fontMatrix[0]; - tx = (w0 * textState.fontSize + charSpacing) * textState.textHScale; - width += tx; - } else { - var w1 = glyphWidth * textState.fontMatrix[0]; - ty = w1 * textState.fontSize + charSpacing; - height += ty; - } + function buildTextContentItem(chars) { + var font = textState.font; + var textChunk = ensureTextContentItem(); + var width = 0; + var height = 0; + var glyphs = font.charsToGlyphs(chars); - textState.translateTextMatrix(tx, ty); - textChunk.str.push(glyphUnicode); - } + for (var i = 0; i < glyphs.length; i++) { + var glyph = glyphs[i]; + var glyphWidth = null; - if (!font.vertical) { - textChunk.lastAdvanceWidth = width; - textChunk.width += width; + if (font.vertical && glyph.vmetric) { + glyphWidth = glyph.vmetric[0]; } else { - textChunk.lastAdvanceHeight = height; - textChunk.height += Math.abs(height); + glyphWidth = glyph.width; } - return textChunk; - } + var glyphUnicode = glyph.unicode; + var NormalizedUnicodes = (0, _unicode.getNormalizedUnicodes)(); - function addFakeSpaces(width, strBuf) { - if (width < textContentItem.fakeSpaceMin) { - return; + if (NormalizedUnicodes[glyphUnicode] !== undefined) { + glyphUnicode = NormalizedUnicodes[glyphUnicode]; } - if (width < textContentItem.fakeMultiSpaceMin) { - strBuf.push(" "); - return; - } + glyphUnicode = (0, _unicode.reverseIfRtl)(glyphUnicode); + var charSpacing = textState.charSpacing; - var fakeSpaces = Math.round(width / textContentItem.spaceWidth); + if (glyph.isSpace) { + var wordSpacing = textState.wordSpacing; + charSpacing += wordSpacing; - while (fakeSpaces-- > 0) { - strBuf.push(" "); + if (wordSpacing > 0) { + addFakeSpaces(wordSpacing, textChunk.str); + } } - } - function flushTextContentItem() { - if (!textContentItem.initialized) { - return; - } + var tx = 0; + var ty = 0; - if (!textContentItem.vertical) { - textContentItem.width *= textContentItem.textAdvanceScale; + if (!font.vertical) { + var w0 = glyphWidth * textState.fontMatrix[0]; + tx = (w0 * textState.fontSize + charSpacing) * textState.textHScale; + width += tx; } else { - textContentItem.height *= textContentItem.textAdvanceScale; + var w1 = glyphWidth * textState.fontMatrix[0]; + ty = w1 * textState.fontSize + charSpacing; + height += ty; } - textContent.items.push(runBidiTransform(textContentItem)); - textContentItem.initialized = false; - textContentItem.str.length = 0; + textState.translateTextMatrix(tx, ty); + textChunk.str.push(glyphUnicode); + } + + if (!font.vertical) { + textChunk.lastAdvanceWidth = width; + textChunk.width += width; + } else { + textChunk.lastAdvanceHeight = height; + textChunk.height += Math.abs(height); } - function enqueueChunk() { - const length = textContent.items.length; + return textChunk; + } - if (length > 0) { - sink.enqueue(textContent, length); - textContent.items = []; - textContent.styles = Object.create(null); - } + function addFakeSpaces(width, strBuf) { + if (width < textContentItem.fakeSpaceMin) { + return; } - var timeSlotManager = new TimeSlotManager(); - return new Promise(function promiseBody(resolve, reject) { - const next = function (promise) { - enqueueChunk(); - Promise.all([promise, sink.ready]).then(function () { - try { - promiseBody(resolve, reject); - } catch (ex) { - reject(ex); - } - }, reject); - }; + if (width < textContentItem.fakeMultiSpaceMin) { + strBuf.push(" "); + return; + } + + var fakeSpaces = Math.round(width / textContentItem.spaceWidth); + + while (fakeSpaces-- > 0) { + strBuf.push(" "); + } + } - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, - operation = {}, - args = []; + function flushTextContentItem() { + if (!textContentItem.initialized) { + return; + } - while (!(stop = timeSlotManager.check())) { - args.length = 0; - operation.args = args; + if (!textContentItem.vertical) { + textContentItem.width *= textContentItem.textAdvanceScale; + } else { + textContentItem.height *= textContentItem.textAdvanceScale; + } - if (!preprocessor.read(operation)) { - break; + textContent.items.push(runBidiTransform(textContentItem)); + textContentItem.initialized = false; + textContentItem.str.length = 0; + } + + function enqueueChunk() { + const length = textContent.items.length; + + if (length > 0) { + sink.enqueue(textContent, length); + textContent.items = []; + textContent.styles = Object.create(null); + } + } + + var timeSlotManager = new TimeSlotManager(); + return new Promise(function promiseBody(resolve, reject) { + const next = function (promise) { + enqueueChunk(); + Promise.all([promise, sink.ready]).then(function () { + try { + promiseBody(resolve, reject); + } catch (ex) { + reject(ex); } + }, reject); + }; - textState = stateManager.state; - var fn = operation.fn; - args = operation.args; - var advance, diff; + task.ensureNotTerminated(); + timeSlotManager.reset(); + var stop, + operation = {}, + args = []; - switch (fn | 0) { - case _util.OPS.setFont: - var fontNameArg = args[0].name, - fontSizeArg = args[1]; + while (!(stop = timeSlotManager.check())) { + args.length = 0; + operation.args = args; - if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) { - break; - } + if (!preprocessor.read(operation)) { + break; + } - flushTextContentItem(); - textState.fontName = fontNameArg; - textState.fontSize = fontSizeArg; - next(handleSetFont(fontNameArg, null)); - return; + textState = stateManager.state; + var fn = operation.fn; + args = operation.args; + var advance, diff; - case _util.OPS.setTextRise: - flushTextContentItem(); - textState.textRise = args[0]; - break; + switch (fn | 0) { + case _util.OPS.setFont: + var fontNameArg = args[0].name, + fontSizeArg = args[1]; - case _util.OPS.setHScale: - flushTextContentItem(); - textState.textHScale = args[0] / 100; + if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) { break; + } - case _util.OPS.setLeading: - flushTextContentItem(); - textState.leading = args[0]; - break; + flushTextContentItem(); + textState.fontName = fontNameArg; + textState.fontSize = fontSizeArg; + next(handleSetFont(fontNameArg, null)); + return; - case _util.OPS.moveText: - var isSameTextLine = !textState.font ? false : (textState.font.vertical ? args[0] : args[1]) === 0; - advance = args[0] - args[1]; + case _util.OPS.setTextRise: + flushTextContentItem(); + textState.textRise = args[0]; + break; - if (combineTextItems && isSameTextLine && textContentItem.initialized && advance > 0 && advance <= textContentItem.fakeMultiSpaceMax) { - textState.translateTextLineMatrix(args[0], args[1]); - textContentItem.width += args[0] - textContentItem.lastAdvanceWidth; - textContentItem.height += args[1] - textContentItem.lastAdvanceHeight; - diff = args[0] - textContentItem.lastAdvanceWidth - (args[1] - textContentItem.lastAdvanceHeight); - addFakeSpaces(diff, textContentItem.str); - break; - } + case _util.OPS.setHScale: + flushTextContentItem(); + textState.textHScale = args[0] / 100; + break; - flushTextContentItem(); - textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); - break; + case _util.OPS.setLeading: + flushTextContentItem(); + textState.leading = args[0]; + break; - case _util.OPS.setLeadingMoveText: - flushTextContentItem(); - textState.leading = -args[1]; + case _util.OPS.moveText: + var isSameTextLine = !textState.font ? false : (textState.font.vertical ? args[0] : args[1]) === 0; + advance = args[0] - args[1]; + + if (combineTextItems && isSameTextLine && textContentItem.initialized && advance > 0 && advance <= textContentItem.fakeMultiSpaceMax) { textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); + textContentItem.width += args[0] - textContentItem.lastAdvanceWidth; + textContentItem.height += args[1] - textContentItem.lastAdvanceHeight; + diff = args[0] - textContentItem.lastAdvanceWidth - (args[1] - textContentItem.lastAdvanceHeight); + addFakeSpaces(diff, textContentItem.str); break; + } - case _util.OPS.nextLine: - flushTextContentItem(); - textState.carriageReturn(); - break; + flushTextContentItem(); + textState.translateTextLineMatrix(args[0], args[1]); + textState.textMatrix = textState.textLineMatrix.slice(); + break; - case _util.OPS.setTextMatrix: - advance = textState.calcTextLineMatrixAdvance(args[0], args[1], args[2], args[3], args[4], args[5]); + case _util.OPS.setLeadingMoveText: + flushTextContentItem(); + textState.leading = -args[1]; + textState.translateTextLineMatrix(args[0], args[1]); + textState.textMatrix = textState.textLineMatrix.slice(); + break; - if (combineTextItems && advance !== null && textContentItem.initialized && advance.value > 0 && advance.value <= textContentItem.fakeMultiSpaceMax) { - textState.translateTextLineMatrix(advance.width, advance.height); - textContentItem.width += advance.width - textContentItem.lastAdvanceWidth; - textContentItem.height += advance.height - textContentItem.lastAdvanceHeight; - diff = advance.width - textContentItem.lastAdvanceWidth - (advance.height - textContentItem.lastAdvanceHeight); - addFakeSpaces(diff, textContentItem.str); - break; - } + case _util.OPS.nextLine: + flushTextContentItem(); + textState.carriageReturn(); + break; - flushTextContentItem(); - textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); - textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); - break; + case _util.OPS.setTextMatrix: + advance = textState.calcTextLineMatrixAdvance(args[0], args[1], args[2], args[3], args[4], args[5]); - case _util.OPS.setCharSpacing: - textState.charSpacing = args[0]; + if (combineTextItems && advance !== null && textContentItem.initialized && advance.value > 0 && advance.value <= textContentItem.fakeMultiSpaceMax) { + textState.translateTextLineMatrix(advance.width, advance.height); + textContentItem.width += advance.width - textContentItem.lastAdvanceWidth; + textContentItem.height += advance.height - textContentItem.lastAdvanceHeight; + diff = advance.width - textContentItem.lastAdvanceWidth - (advance.height - textContentItem.lastAdvanceHeight); + addFakeSpaces(diff, textContentItem.str); break; + } - case _util.OPS.setWordSpacing: - textState.wordSpacing = args[0]; - break; + flushTextContentItem(); + textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); + textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); + break; - case _util.OPS.beginText: - flushTextContentItem(); - textState.textMatrix = _util.IDENTITY_MATRIX.slice(); - textState.textLineMatrix = _util.IDENTITY_MATRIX.slice(); - break; + case _util.OPS.setCharSpacing: + textState.charSpacing = args[0]; + break; - case _util.OPS.showSpacedText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; - } + case _util.OPS.setWordSpacing: + textState.wordSpacing = args[0]; + break; - var items = args[0]; - var offset; - - for (var j = 0, jj = items.length; j < jj; j++) { - if (typeof items[j] === "string") { - buildTextContentItem(items[j]); - } else if ((0, _util.isNum)(items[j])) { - ensureTextContentItem(); - advance = items[j] * textState.fontSize / 1000; - var breakTextRun = false; - - if (textState.font.vertical) { - offset = advance; - textState.translateTextMatrix(0, offset); - breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; - - if (!breakTextRun) { - textContentItem.height += offset; - } - } else { - advance = -advance; - offset = advance * textState.textHScale; - textState.translateTextMatrix(offset, 0); - breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; - - if (!breakTextRun) { - textContentItem.width += offset; - } + case _util.OPS.beginText: + flushTextContentItem(); + textState.textMatrix = _util.IDENTITY_MATRIX.slice(); + textState.textLineMatrix = _util.IDENTITY_MATRIX.slice(); + break; + + case _util.OPS.showSpacedText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + + var items = args[0]; + var offset; + + for (var j = 0, jj = items.length; j < jj; j++) { + if (typeof items[j] === "string") { + buildTextContentItem(items[j]); + } else if ((0, _util.isNum)(items[j])) { + ensureTextContentItem(); + advance = items[j] * textState.fontSize / 1000; + var breakTextRun = false; + + if (textState.font.vertical) { + offset = advance; + textState.translateTextMatrix(0, offset); + breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; + + if (!breakTextRun) { + textContentItem.height += offset; } + } else { + advance = -advance; + offset = advance * textState.textHScale; + textState.translateTextMatrix(offset, 0); + breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; - if (breakTextRun) { - flushTextContentItem(); - } else if (advance > 0) { - addFakeSpaces(advance, textContentItem.str); + if (!breakTextRun) { + textContentItem.width += offset; } } - } - - break; - case _util.OPS.showText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; + if (breakTextRun) { + flushTextContentItem(); + } else if (advance > 0) { + addFakeSpaces(advance, textContentItem.str); + } } + } - buildTextContentItem(args[0]); - break; + break; - case _util.OPS.nextLineShowText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; - } + case _util.OPS.showText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } - flushTextContentItem(); - textState.carriageReturn(); - buildTextContentItem(args[0]); - break; + buildTextContentItem(args[0]); + break; - case _util.OPS.nextLineSetSpacingShowText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; - } + case _util.OPS.nextLineShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } - flushTextContentItem(); - textState.wordSpacing = args[0]; - textState.charSpacing = args[1]; - textState.carriageReturn(); - buildTextContentItem(args[2]); - break; + flushTextContentItem(); + textState.carriageReturn(); + buildTextContentItem(args[0]); + break; - case _util.OPS.paintXObject: - flushTextContentItem(); + case _util.OPS.nextLineSetSpacingShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } - if (!xobjs) { - xobjs = resources.get("XObject") || _primitives.Dict.empty; - } + flushTextContentItem(); + textState.wordSpacing = args[0]; + textState.charSpacing = args[1]; + textState.carriageReturn(); + buildTextContentItem(args[2]); + break; - var name = args[0].name; + case _util.OPS.paintXObject: + flushTextContentItem(); - if (name && emptyXObjectCache.getByName(name)) { - break; - } + if (!xobjs) { + xobjs = resources.get("XObject") || _primitives.Dict.empty; + } - next(new Promise(function (resolveXObject, rejectXObject) { - if (!name) { - throw new _util.FormatError("XObject must be referred to by name."); - } + var name = args[0].name; - let xobj = xobjs.getRaw(name); + if (name && emptyXObjectCache.getByName(name)) { + break; + } - if (xobj instanceof _primitives.Ref) { - if (emptyXObjectCache.getByRef(xobj)) { - resolveXObject(); - return; - } + next(new Promise(function (resolveXObject, rejectXObject) { + if (!name) { + throw new _util.FormatError("XObject must be referred to by name."); + } - xobj = xref.fetch(xobj); - } + let xobj = xobjs.getRaw(name); - if (!xobj) { + if (xobj instanceof _primitives.Ref) { + if (emptyXObjectCache.getByRef(xobj)) { resolveXObject(); return; } - if (!(0, _primitives.isStream)(xobj)) { - throw new _util.FormatError("XObject should be a stream"); - } - - const type = xobj.dict.get("Subtype"); + xobj = xref.fetch(xobj); + } - if (!(0, _primitives.isName)(type)) { - throw new _util.FormatError("XObject should have a Name subtype"); - } + if (!(0, _primitives.isStream)(xobj)) { + throw new _util.FormatError("XObject should be a stream"); + } - if (type.name !== "Form") { - emptyXObjectCache.set(name, xobj.dict.objId, true); - resolveXObject(); - return; - } + const type = xobj.dict.get("Subtype"); - const currentState = stateManager.state.clone(); - const xObjStateManager = new StateManager(currentState); - const matrix = xobj.dict.getArray("Matrix"); + if (!(0, _primitives.isName)(type)) { + throw new _util.FormatError("XObject should have a Name subtype"); + } - if (Array.isArray(matrix) && matrix.length === 6) { - xObjStateManager.transform(matrix); - } + if (type.name !== "Form") { + emptyXObjectCache.set(name, xobj.dict.objId, true); + resolveXObject(); + return; + } - enqueueChunk(); - const sinkWrapper = { - enqueueInvoked: false, + const currentState = stateManager.state.clone(); + const xObjStateManager = new StateManager(currentState); + const matrix = xobj.dict.getArray("Matrix"); - enqueue(chunk, size) { - this.enqueueInvoked = true; - sink.enqueue(chunk, size); - }, + if (Array.isArray(matrix) && matrix.length === 6) { + xObjStateManager.transform(matrix); + } - get desiredSize() { - return sink.desiredSize; - }, + enqueueChunk(); + const sinkWrapper = { + enqueueInvoked: false, - get ready() { - return sink.ready; - } + enqueue(chunk, size) { + this.enqueueInvoked = true; + sink.enqueue(chunk, size); + }, - }; - self.getTextContent({ - stream: xobj, - task, - resources: xobj.dict.get("Resources") || resources, - stateManager: xObjStateManager, - normalizeWhitespace, - combineTextItems, - sink: sinkWrapper, - seenStyles - }).then(function () { - if (!sinkWrapper.enqueueInvoked) { - emptyXObjectCache.set(name, xobj.dict.objId, true); - } + get desiredSize() { + return sink.desiredSize; + }, - resolveXObject(); - }, rejectXObject); - }).catch(function (reason) { - if (reason instanceof _util.AbortException) { - return; + get ready() { + return sink.ready; } - if (self.options.ignoreErrors) { - (0, _util.warn)(`getTextContent - ignoring XObject: "${reason}".`); - return; + }; + self.getTextContent({ + stream: xobj, + task, + resources: xobj.dict.get("Resources") || resources, + stateManager: xObjStateManager, + normalizeWhitespace, + combineTextItems, + sink: sinkWrapper, + seenStyles + }).then(function () { + if (!sinkWrapper.enqueueInvoked) { + emptyXObjectCache.set(name, xobj.dict.objId, true); } - throw reason; - })); - return; + resolveXObject(); + }, rejectXObject); + }).catch(function (reason) { + if (reason instanceof _util.AbortException) { + return; + } - case _util.OPS.setGState: - flushTextContentItem(); - var dictName = args[0]; - var extGState = resources.get("ExtGState"); + if (self.options.ignoreErrors) { + (0, _util.warn)(`getTextContent - ignoring XObject: "${reason}".`); + return; + } - if (!(0, _primitives.isDict)(extGState) || !(0, _primitives.isName)(dictName)) { - break; + throw reason; + })); + return; + + case _util.OPS.setGState: + name = args[0].name; + + if (name && emptyGStateCache.getByName(name)) { + break; + } + + next(new Promise(function (resolveGState, rejectGState) { + if (!name) { + throw new _util.FormatError("GState must be referred to by name."); } - var gState = extGState.get(dictName.name); + const extGState = resources.get("ExtGState"); - if (!(0, _primitives.isDict)(gState)) { - break; + if (!(extGState instanceof _primitives.Dict)) { + throw new _util.FormatError("ExtGState should be a dictionary."); + } + + const gState = extGState.get(name); + + if (!(gState instanceof _primitives.Dict)) { + throw new _util.FormatError("GState should be a dictionary."); } - var gStateFont = gState.get("Font"); + const gStateFont = gState.get("Font"); - if (gStateFont) { - textState.fontName = null; - textState.fontSize = gStateFont[1]; - next(handleSetFont(null, gStateFont[0])); + if (!gStateFont) { + emptyGStateCache.set(name, gState.objId, true); + resolveGState(); return; } - break; - } + flushTextContentItem(); + textState.fontName = null; + textState.fontSize = gStateFont[1]; + handleSetFont(null, gStateFont[0]).then(resolveGState, rejectGState); + }).catch(function (reason) { + if (reason instanceof _util.AbortException) { + return; + } - if (textContent.items.length >= sink.desiredSize) { - stop = true; - break; - } - } + if (self.options.ignoreErrors) { + (0, _util.warn)(`getTextContent - ignoring ExtGState: "${reason}".`); + return; + } - if (stop) { - next(deferred); - return; + throw reason; + })); + return; } - flushTextContentItem(); - enqueueChunk(); - resolve(); - }).catch(reason => { - if (reason instanceof _util.AbortException) { - return; + if (textContent.items.length >= sink.desiredSize) { + stop = true; + break; } + } - if (this.options.ignoreErrors) { - (0, _util.warn)(`getTextContent - ignoring errors during "${task.name}" ` + `task: "${reason}".`); - flushTextContentItem(); - enqueueChunk(); - return; - } + if (stop) { + next(deferred); + return; + } - throw reason; - }); - }, + flushTextContentItem(); + enqueueChunk(); + resolve(); + }).catch(reason => { + if (reason instanceof _util.AbortException) { + return; + } - extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, properties) { - const xref = this.xref; - let cidToGidBytes; - var toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); - var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined); + if (this.options.ignoreErrors) { + (0, _util.warn)(`getTextContent - ignoring errors during "${task.name}" ` + `task: "${reason}".`); + flushTextContentItem(); + enqueueChunk(); + return; + } - if (properties.composite) { - var cidSystemInfo = dict.get("CIDSystemInfo"); + throw reason; + }); + } - if ((0, _primitives.isDict)(cidSystemInfo)) { - properties.cidSystemInfo = { - registry: (0, _util.stringToPDFString)(cidSystemInfo.get("Registry")), - ordering: (0, _util.stringToPDFString)(cidSystemInfo.get("Ordering")), - supplement: cidSystemInfo.get("Supplement") - }; - } + extractDataStructures(dict, baseDict, properties) { + const xref = this.xref; + let cidToGidBytes; + var toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); + var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined); + + if (properties.composite) { + var cidSystemInfo = dict.get("CIDSystemInfo"); + + if ((0, _primitives.isDict)(cidSystemInfo)) { + properties.cidSystemInfo = { + registry: (0, _util.stringToPDFString)(cidSystemInfo.get("Registry")), + ordering: (0, _util.stringToPDFString)(cidSystemInfo.get("Ordering")), + supplement: cidSystemInfo.get("Supplement") + }; + } - var cidToGidMap = dict.get("CIDToGIDMap"); + var cidToGidMap = dict.get("CIDToGIDMap"); - if ((0, _primitives.isStream)(cidToGidMap)) { - cidToGidBytes = cidToGidMap.getBytes(); - } + if ((0, _primitives.isStream)(cidToGidMap)) { + cidToGidBytes = cidToGidMap.getBytes(); } + } - var differences = []; - var baseEncodingName = null; - var encoding; + var differences = []; + var baseEncodingName = null; + var encoding; - if (dict.has("Encoding")) { - encoding = dict.get("Encoding"); + if (dict.has("Encoding")) { + encoding = dict.get("Encoding"); - if ((0, _primitives.isDict)(encoding)) { - baseEncodingName = encoding.get("BaseEncoding"); - baseEncodingName = (0, _primitives.isName)(baseEncodingName) ? baseEncodingName.name : null; + if ((0, _primitives.isDict)(encoding)) { + baseEncodingName = encoding.get("BaseEncoding"); + baseEncodingName = (0, _primitives.isName)(baseEncodingName) ? baseEncodingName.name : null; - if (encoding.has("Differences")) { - var diffEncoding = encoding.get("Differences"); - var index = 0; + if (encoding.has("Differences")) { + var diffEncoding = encoding.get("Differences"); + var index = 0; - for (var j = 0, jj = diffEncoding.length; j < jj; j++) { - var data = xref.fetchIfRef(diffEncoding[j]); + for (var j = 0, jj = diffEncoding.length; j < jj; j++) { + var data = xref.fetchIfRef(diffEncoding[j]); - if ((0, _util.isNum)(data)) { - index = data; - } else if ((0, _primitives.isName)(data)) { - differences[index++] = data.name; - } else { - throw new _util.FormatError(`Invalid entry in 'Differences' array: ${data}`); - } + if ((0, _util.isNum)(data)) { + index = data; + } else if ((0, _primitives.isName)(data)) { + differences[index++] = data.name; + } else { + throw new _util.FormatError(`Invalid entry in 'Differences' array: ${data}`); } } - } else if ((0, _primitives.isName)(encoding)) { - baseEncodingName = encoding.name; - } else { - throw new _util.FormatError("Encoding is not a Name nor a Dict"); } + } else if ((0, _primitives.isName)(encoding)) { + baseEncodingName = encoding.name; + } else { + throw new _util.FormatError("Encoding is not a Name nor a Dict"); + } - if (baseEncodingName !== "MacRomanEncoding" && baseEncodingName !== "MacExpertEncoding" && baseEncodingName !== "WinAnsiEncoding") { - baseEncodingName = null; - } + if (baseEncodingName !== "MacRomanEncoding" && baseEncodingName !== "MacExpertEncoding" && baseEncodingName !== "WinAnsiEncoding") { + baseEncodingName = null; } + } - if (baseEncodingName) { - properties.defaultEncoding = (0, _encodings.getEncoding)(baseEncodingName).slice(); - } else { - var isSymbolicFont = !!(properties.flags & _fonts.FontFlags.Symbolic); - var isNonsymbolicFont = !!(properties.flags & _fonts.FontFlags.Nonsymbolic); - encoding = _encodings.StandardEncoding; + if (baseEncodingName) { + properties.defaultEncoding = (0, _encodings.getEncoding)(baseEncodingName).slice(); + } else { + var isSymbolicFont = !!(properties.flags & _fonts.FontFlags.Symbolic); + var isNonsymbolicFont = !!(properties.flags & _fonts.FontFlags.Nonsymbolic); + encoding = _encodings.StandardEncoding; - if (properties.type === "TrueType" && !isNonsymbolicFont) { - encoding = _encodings.WinAnsiEncoding; - } + if (properties.type === "TrueType" && !isNonsymbolicFont) { + encoding = _encodings.WinAnsiEncoding; + } - if (isSymbolicFont) { - encoding = _encodings.MacRomanEncoding; + if (isSymbolicFont) { + encoding = _encodings.MacRomanEncoding; - if (!properties.file) { - if (/Symbol/i.test(properties.name)) { - encoding = _encodings.SymbolSetEncoding; - } else if (/Dingbats|Wingdings/i.test(properties.name)) { - encoding = _encodings.ZapfDingbatsEncoding; - } + if (!properties.file) { + if (/Symbol/i.test(properties.name)) { + encoding = _encodings.SymbolSetEncoding; + } else if (/Dingbats|Wingdings/i.test(properties.name)) { + encoding = _encodings.ZapfDingbatsEncoding; } } - - properties.defaultEncoding = encoding; } - properties.differences = differences; - properties.baseEncodingName = baseEncodingName; - properties.hasEncoding = !!baseEncodingName || differences.length > 0; - properties.dict = dict; - return toUnicodePromise.then(readToUnicode => { - properties.toUnicode = readToUnicode; - return this.buildToUnicode(properties); - }).then(builtToUnicode => { - properties.toUnicode = builtToUnicode; + properties.defaultEncoding = encoding; + } - if (cidToGidBytes) { - properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode); - } + properties.differences = differences; + properties.baseEncodingName = baseEncodingName; + properties.hasEncoding = !!baseEncodingName || differences.length > 0; + properties.dict = dict; + return toUnicodePromise.then(readToUnicode => { + properties.toUnicode = readToUnicode; + return this.buildToUnicode(properties); + }).then(builtToUnicode => { + properties.toUnicode = builtToUnicode; - return properties; - }); - }, + if (cidToGidBytes) { + properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode); + } - _buildSimpleFontToUnicode(properties, forceGlyphs = false) { - (0, _util.assert)(!properties.composite, "Must be a simple font."); - const toUnicode = []; - const encoding = properties.defaultEncoding.slice(); - const baseEncodingName = properties.baseEncodingName; - const differences = properties.differences; + return properties; + }); + } - for (const charcode in differences) { - const glyphName = differences[charcode]; + _buildSimpleFontToUnicode(properties, forceGlyphs = false) { + (0, _util.assert)(!properties.composite, "Must be a simple font."); + const toUnicode = []; + const encoding = properties.defaultEncoding.slice(); + const baseEncodingName = properties.baseEncodingName; + const differences = properties.differences; - if (glyphName === ".notdef") { - continue; - } + for (const charcode in differences) { + const glyphName = differences[charcode]; - encoding[charcode] = glyphName; + if (glyphName === ".notdef") { + continue; } - const glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); - - for (const charcode in encoding) { - let glyphName = encoding[charcode]; + encoding[charcode] = glyphName; + } - if (glyphName === "") { - continue; - } else if (glyphsUnicodeMap[glyphName] === undefined) { - let code = 0; + const glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); - switch (glyphName[0]) { - case "G": - if (glyphName.length === 3) { - code = parseInt(glyphName.substring(1), 16); - } + for (const charcode in encoding) { + let glyphName = encoding[charcode]; - break; + if (glyphName === "") { + continue; + } else if (glyphsUnicodeMap[glyphName] === undefined) { + let code = 0; - case "g": - if (glyphName.length === 5) { - code = parseInt(glyphName.substring(1), 16); - } + switch (glyphName[0]) { + case "G": + if (glyphName.length === 3) { + code = parseInt(glyphName.substring(1), 16); + } - break; + break; - case "C": - case "c": - if (glyphName.length >= 3 && glyphName.length <= 4) { - const codeStr = glyphName.substring(1); + case "g": + if (glyphName.length === 5) { + code = parseInt(glyphName.substring(1), 16); + } - if (forceGlyphs) { - code = parseInt(codeStr, 16); - break; - } + break; - code = +codeStr; + case "C": + case "c": + if (glyphName.length >= 3 && glyphName.length <= 4) { + const codeStr = glyphName.substring(1); - if (Number.isNaN(code) && Number.isInteger(parseInt(codeStr, 16))) { - return this._buildSimpleFontToUnicode(properties, true); - } + if (forceGlyphs) { + code = parseInt(codeStr, 16); + break; } - break; - - default: - const unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); + code = +codeStr; - if (unicode !== -1) { - code = unicode; + if (Number.isNaN(code) && Number.isInteger(parseInt(codeStr, 16))) { + return this._buildSimpleFontToUnicode(properties, true); } + } - } + break; - if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) { - if (baseEncodingName && code === +charcode) { - const baseEncoding = (0, _encodings.getEncoding)(baseEncodingName); + default: + const unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); - if (baseEncoding && (glyphName = baseEncoding[charcode])) { - toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); - continue; - } + if (unicode !== -1) { + code = unicode; } - toUnicode[charcode] = String.fromCodePoint(code); + } + + if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) { + if (baseEncodingName && code === +charcode) { + const baseEncoding = (0, _encodings.getEncoding)(baseEncodingName); + + if (baseEncoding && (glyphName = baseEncoding[charcode])) { + toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); + continue; + } } - continue; + toUnicode[charcode] = String.fromCodePoint(code); } - toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); + continue; } - return new _fonts.ToUnicodeMap(toUnicode); - }, + toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); + } - buildToUnicode(properties) { - properties.hasIncludedToUnicodeMap = !!properties.toUnicode && properties.toUnicode.length > 0; + return new _fonts.ToUnicodeMap(toUnicode); + } - if (properties.hasIncludedToUnicodeMap) { - if (!properties.composite && properties.hasEncoding) { - properties.fallbackToUnicode = this._buildSimpleFontToUnicode(properties); - } + buildToUnicode(properties) { + properties.hasIncludedToUnicodeMap = !!properties.toUnicode && properties.toUnicode.length > 0; - return Promise.resolve(properties.toUnicode); + if (properties.hasIncludedToUnicodeMap) { + if (!properties.composite && properties.hasEncoding) { + properties.fallbackToUnicode = this._buildSimpleFontToUnicode(properties); } - if (!properties.composite) { - return Promise.resolve(this._buildSimpleFontToUnicode(properties)); - } + return Promise.resolve(properties.toUnicode); + } - if (properties.composite && (properties.cMap.builtInCMap && !(properties.cMap instanceof _cmap.IdentityCMap) || properties.cidSystemInfo.registry === "Adobe" && (properties.cidSystemInfo.ordering === "GB1" || properties.cidSystemInfo.ordering === "CNS1" || properties.cidSystemInfo.ordering === "Japan1" || properties.cidSystemInfo.ordering === "Korea1"))) { - const registry = properties.cidSystemInfo.registry; - const ordering = properties.cidSystemInfo.ordering; + if (!properties.composite) { + return Promise.resolve(this._buildSimpleFontToUnicode(properties)); + } - const ucs2CMapName = _primitives.Name.get(registry + "-" + ordering + "-UCS2"); + if (properties.composite && (properties.cMap.builtInCMap && !(properties.cMap instanceof _cmap.IdentityCMap) || properties.cidSystemInfo.registry === "Adobe" && (properties.cidSystemInfo.ordering === "GB1" || properties.cidSystemInfo.ordering === "CNS1" || properties.cidSystemInfo.ordering === "Japan1" || properties.cidSystemInfo.ordering === "Korea1"))) { + const registry = properties.cidSystemInfo.registry; + const ordering = properties.cidSystemInfo.ordering; - return _cmap.CMapFactory.create({ - encoding: ucs2CMapName, - fetchBuiltInCMap: this.fetchBuiltInCMap, - useCMap: null - }).then(function (ucs2CMap) { - const cMap = properties.cMap; - const toUnicode = []; - cMap.forEach(function (charcode, cid) { - if (cid > 0xffff) { - throw new _util.FormatError("Max size of CID is 65,535"); - } + const ucs2CMapName = _primitives.Name.get(registry + "-" + ordering + "-UCS2"); - const ucs2 = ucs2CMap.lookup(cid); + return _cmap.CMapFactory.create({ + encoding: ucs2CMapName, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }).then(function (ucs2CMap) { + const cMap = properties.cMap; + const toUnicode = []; + cMap.forEach(function (charcode, cid) { + if (cid > 0xffff) { + throw new _util.FormatError("Max size of CID is 65,535"); + } - if (ucs2) { - toUnicode[charcode] = String.fromCharCode((ucs2.charCodeAt(0) << 8) + ucs2.charCodeAt(1)); - } - }); - return new _fonts.ToUnicodeMap(toUnicode); - }); - } + const ucs2 = ucs2CMap.lookup(cid); - return Promise.resolve(new _fonts.IdentityToUnicodeMap(properties.firstChar, properties.lastChar)); - }, + if (ucs2) { + toUnicode[charcode] = String.fromCharCode((ucs2.charCodeAt(0) << 8) + ucs2.charCodeAt(1)); + } + }); + return new _fonts.ToUnicodeMap(toUnicode); + }); + } - readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) { - var cmapObj = toUnicode; + return Promise.resolve(new _fonts.IdentityToUnicodeMap(properties.firstChar, properties.lastChar)); + } - if ((0, _primitives.isName)(cmapObj)) { - return _cmap.CMapFactory.create({ - encoding: cmapObj, - fetchBuiltInCMap: this.fetchBuiltInCMap, - useCMap: null - }).then(function (cmap) { - if (cmap instanceof _cmap.IdentityCMap) { - return new _fonts.IdentityToUnicodeMap(0, 0xffff); - } + readToUnicode(toUnicode) { + var cmapObj = toUnicode; - return new _fonts.ToUnicodeMap(cmap.getMap()); - }); - } else if ((0, _primitives.isStream)(cmapObj)) { - return _cmap.CMapFactory.create({ - encoding: cmapObj, - fetchBuiltInCMap: this.fetchBuiltInCMap, - useCMap: null - }).then(function (cmap) { - if (cmap instanceof _cmap.IdentityCMap) { - return new _fonts.IdentityToUnicodeMap(0, 0xffff); - } + if ((0, _primitives.isName)(cmapObj)) { + return _cmap.CMapFactory.create({ + encoding: cmapObj, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }).then(function (cmap) { + if (cmap instanceof _cmap.IdentityCMap) { + return new _fonts.IdentityToUnicodeMap(0, 0xffff); + } - var map = new Array(cmap.length); - cmap.forEach(function (charCode, token) { - var str = []; + return new _fonts.ToUnicodeMap(cmap.getMap()); + }); + } else if ((0, _primitives.isStream)(cmapObj)) { + return _cmap.CMapFactory.create({ + encoding: cmapObj, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }).then(function (cmap) { + if (cmap instanceof _cmap.IdentityCMap) { + return new _fonts.IdentityToUnicodeMap(0, 0xffff); + } - for (var k = 0; k < token.length; k += 2) { - var w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); + var map = new Array(cmap.length); + cmap.forEach(function (charCode, token) { + var str = []; - if ((w1 & 0xf800) !== 0xd800) { - str.push(w1); - continue; - } + for (var k = 0; k < token.length; k += 2) { + var w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); - k += 2; - var w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); - str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); + if ((w1 & 0xf800) !== 0xd800) { + str.push(w1); + continue; } - map[charCode] = String.fromCodePoint.apply(String, str); - }); - return new _fonts.ToUnicodeMap(map); - }, reason => { - if (reason instanceof _util.AbortException) { - return null; - } - - if (this.options.ignoreErrors) { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorFontToUnicode - }); - (0, _util.warn)(`readToUnicode - ignoring ToUnicode data: "${reason}".`); - return null; + k += 2; + var w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); + str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); } - throw reason; + map[charCode] = String.fromCodePoint.apply(String, str); }); - } + return new _fonts.ToUnicodeMap(map); + }, reason => { + if (reason instanceof _util.AbortException) { + return null; + } - return Promise.resolve(null); - }, + if (this.options.ignoreErrors) { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorFontToUnicode + }); + (0, _util.warn)(`readToUnicode - ignoring ToUnicode data: "${reason}".`); + return null; + } - readCidToGidMap(glyphsData, toUnicode) { - var result = []; + throw reason; + }); + } - for (var j = 0, jj = glyphsData.length; j < jj; j++) { - var glyphID = glyphsData[j++] << 8 | glyphsData[j]; - const code = j >> 1; + return Promise.resolve(null); + } - if (glyphID === 0 && !toUnicode.has(code)) { - continue; - } + readCidToGidMap(glyphsData, toUnicode) { + var result = []; + + for (var j = 0, jj = glyphsData.length; j < jj; j++) { + var glyphID = glyphsData[j++] << 8 | glyphsData[j]; + const code = j >> 1; - result[code] = glyphID; + if (glyphID === 0 && !toUnicode.has(code)) { + continue; } - return result; - }, + result[code] = glyphID; + } - extractWidths: function PartialEvaluator_extractWidths(dict, descriptor, properties) { - var xref = this.xref; - var glyphsWidths = []; - var defaultWidth = 0; - var glyphsVMetrics = []; - var defaultVMetrics; - var i, ii, j, jj, start, code, widths; + return result; + } - if (properties.composite) { - defaultWidth = dict.has("DW") ? dict.get("DW") : 1000; - widths = dict.get("W"); + extractWidths(dict, descriptor, properties) { + var xref = this.xref; + var glyphsWidths = []; + var defaultWidth = 0; + var glyphsVMetrics = []; + var defaultVMetrics; + var i, ii, j, jj, start, code, widths; - if (widths) { - for (i = 0, ii = widths.length; i < ii; i++) { - start = xref.fetchIfRef(widths[i++]); - code = xref.fetchIfRef(widths[i]); + if (properties.composite) { + defaultWidth = dict.has("DW") ? dict.get("DW") : 1000; + widths = dict.get("W"); - if (Array.isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsWidths[start++] = xref.fetchIfRef(code[j]); - } - } else { - var width = xref.fetchIfRef(widths[++i]); + if (widths) { + for (i = 0, ii = widths.length; i < ii; i++) { + start = xref.fetchIfRef(widths[i++]); + code = xref.fetchIfRef(widths[i]); - for (j = start; j <= code; j++) { - glyphsWidths[j] = width; - } + if (Array.isArray(code)) { + for (j = 0, jj = code.length; j < jj; j++) { + glyphsWidths[start++] = xref.fetchIfRef(code[j]); } - } - } - - if (properties.vertical) { - var vmetrics = dict.getArray("DW2") || [880, -1000]; - defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; - vmetrics = dict.get("W2"); - - if (vmetrics) { - for (i = 0, ii = vmetrics.length; i < ii; i++) { - start = xref.fetchIfRef(vmetrics[i++]); - code = xref.fetchIfRef(vmetrics[i]); - - if (Array.isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsVMetrics[start++] = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])]; - } - } else { - var vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])]; + } else { + var width = xref.fetchIfRef(widths[++i]); - for (j = start; j <= code; j++) { - glyphsVMetrics[j] = vmetric; - } - } + for (j = start; j <= code; j++) { + glyphsWidths[j] = width; } } } - } else { - var firstChar = properties.firstChar; - widths = dict.get("Widths"); + } - if (widths) { - j = firstChar; + if (properties.vertical) { + var vmetrics = dict.getArray("DW2") || [880, -1000]; + defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; + vmetrics = dict.get("W2"); - for (i = 0, ii = widths.length; i < ii; i++) { - glyphsWidths[j++] = xref.fetchIfRef(widths[i]); - } + if (vmetrics) { + for (i = 0, ii = vmetrics.length; i < ii; i++) { + start = xref.fetchIfRef(vmetrics[i++]); + code = xref.fetchIfRef(vmetrics[i]); - defaultWidth = parseFloat(descriptor.get("MissingWidth")) || 0; - } else { - var baseFontName = dict.get("BaseFont"); + if (Array.isArray(code)) { + for (j = 0, jj = code.length; j < jj; j++) { + glyphsVMetrics[start++] = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])]; + } + } else { + var vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])]; - if ((0, _primitives.isName)(baseFontName)) { - var metrics = this.getBaseFontMetrics(baseFontName.name); - glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); - defaultWidth = metrics.defaultWidth; + for (j = start; j <= code; j++) { + glyphsVMetrics[j] = vmetric; + } + } } } } + } else { + var firstChar = properties.firstChar; + widths = dict.get("Widths"); - var isMonospace = true; - var firstWidth = defaultWidth; - - for (var glyph in glyphsWidths) { - var glyphWidth = glyphsWidths[glyph]; + if (widths) { + j = firstChar; - if (!glyphWidth) { - continue; + for (i = 0, ii = widths.length; i < ii; i++) { + glyphsWidths[j++] = xref.fetchIfRef(widths[i]); } - if (!firstWidth) { - firstWidth = glyphWidth; - continue; - } + defaultWidth = parseFloat(descriptor.get("MissingWidth")) || 0; + } else { + var baseFontName = dict.get("BaseFont"); - if (firstWidth !== glyphWidth) { - isMonospace = false; - break; + if ((0, _primitives.isName)(baseFontName)) { + var metrics = this.getBaseFontMetrics(baseFontName.name); + glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); + defaultWidth = metrics.defaultWidth; } } + } - if (isMonospace) { - properties.flags |= _fonts.FontFlags.FixedPitch; - } - - properties.defaultWidth = defaultWidth; - properties.widths = glyphsWidths; - properties.defaultVMetrics = defaultVMetrics; - properties.vmetrics = glyphsVMetrics; - }, - isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) { - var fontNameWoStyle = baseFontName.split("-")[0]; - return fontNameWoStyle in (0, _standard_fonts.getSerifFonts)() || fontNameWoStyle.search(/serif/gi) !== -1; - }, - getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) { - var defaultWidth = 0; - var widths = []; - var monospace = false; - var stdFontMap = (0, _standard_fonts.getStdFontMap)(); - var lookupName = stdFontMap[name] || name; - var Metrics = (0, _metrics.getMetrics)(); - - if (!(lookupName in Metrics)) { - if (this.isSerifFont(name)) { - lookupName = "Times-Roman"; - } else { - lookupName = "Helvetica"; - } - } + var isMonospace = true; + var firstWidth = defaultWidth; - var glyphWidths = Metrics[lookupName]; + for (var glyph in glyphsWidths) { + var glyphWidth = glyphsWidths[glyph]; - if ((0, _util.isNum)(glyphWidths)) { - defaultWidth = glyphWidths; - monospace = true; - } else { - widths = glyphWidths(); + if (!glyphWidth) { + continue; } - return { - defaultWidth, - monospace, - widths - }; - }, - buildCharCodeToWidth: function PartialEvaluator_bulildCharCodeToWidth(widthsByGlyphName, properties) { - var widths = Object.create(null); - var differences = properties.differences; - var encoding = properties.defaultEncoding; - - for (var charCode = 0; charCode < 256; charCode++) { - if (charCode in differences && widthsByGlyphName[differences[charCode]]) { - widths[charCode] = widthsByGlyphName[differences[charCode]]; - continue; - } - - if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { - widths[charCode] = widthsByGlyphName[encoding[charCode]]; - continue; - } + if (!firstWidth) { + firstWidth = glyphWidth; + continue; } - return widths; - }, - preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict) { - var baseDict = dict; - var type = dict.get("Subtype"); - - if (!(0, _primitives.isName)(type)) { - throw new _util.FormatError("invalid font Subtype"); + if (firstWidth !== glyphWidth) { + isMonospace = false; + break; } + } - var composite = false; - var uint8array; - - if (type.name === "Type0") { - var df = dict.get("DescendantFonts"); + if (isMonospace) { + properties.flags |= _fonts.FontFlags.FixedPitch; + } - if (!df) { - throw new _util.FormatError("Descendant fonts are not specified"); - } + properties.defaultWidth = defaultWidth; + properties.widths = glyphsWidths; + properties.defaultVMetrics = defaultVMetrics; + properties.vmetrics = glyphsVMetrics; + } - dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df; - type = dict.get("Subtype"); + isSerifFont(baseFontName) { + var fontNameWoStyle = baseFontName.split("-")[0]; + return fontNameWoStyle in (0, _standard_fonts.getSerifFonts)() || fontNameWoStyle.search(/serif/gi) !== -1; + } - if (!(0, _primitives.isName)(type)) { - throw new _util.FormatError("invalid font Subtype"); - } + getBaseFontMetrics(name) { + var defaultWidth = 0; + var widths = []; + var monospace = false; + var stdFontMap = (0, _standard_fonts.getStdFontMap)(); + var lookupName = stdFontMap[name] || name; + var Metrics = (0, _metrics.getMetrics)(); - composite = true; + if (!(lookupName in Metrics)) { + if (this.isSerifFont(name)) { + lookupName = "Times-Roman"; + } else { + lookupName = "Helvetica"; } + } - var descriptor = dict.get("FontDescriptor"); + var glyphWidths = Metrics[lookupName]; - if (descriptor) { - var hash = new _murmurhash.MurmurHash3_64(); - var encoding = baseDict.getRaw("Encoding"); + if ((0, _util.isNum)(glyphWidths)) { + defaultWidth = glyphWidths; + monospace = true; + } else { + widths = glyphWidths(); + } - if ((0, _primitives.isName)(encoding)) { - hash.update(encoding.name); - } else if ((0, _primitives.isRef)(encoding)) { - hash.update(encoding.toString()); - } else if ((0, _primitives.isDict)(encoding)) { - var keys = encoding.getKeys(); + return { + defaultWidth, + monospace, + widths + }; + } - for (var i = 0, ii = keys.length; i < ii; i++) { - var entry = encoding.getRaw(keys[i]); + buildCharCodeToWidth(widthsByGlyphName, properties) { + var widths = Object.create(null); + var differences = properties.differences; + var encoding = properties.defaultEncoding; - if ((0, _primitives.isName)(entry)) { - hash.update(entry.name); - } else if ((0, _primitives.isRef)(entry)) { - hash.update(entry.toString()); - } else if (Array.isArray(entry)) { - var diffLength = entry.length, - diffBuf = new Array(diffLength); + for (var charCode = 0; charCode < 256; charCode++) { + if (charCode in differences && widthsByGlyphName[differences[charCode]]) { + widths[charCode] = widthsByGlyphName[differences[charCode]]; + continue; + } - for (var j = 0; j < diffLength; j++) { - var diffEntry = entry[j]; + if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { + widths[charCode] = widthsByGlyphName[encoding[charCode]]; + continue; + } + } - if ((0, _primitives.isName)(diffEntry)) { - diffBuf[j] = diffEntry.name; - } else if ((0, _util.isNum)(diffEntry) || (0, _primitives.isRef)(diffEntry)) { - diffBuf[j] = diffEntry.toString(); - } - } + return widths; + } - hash.update(diffBuf.join()); - } - } - } + preEvaluateFont(dict) { + var baseDict = dict; + var type = dict.get("Subtype"); - const firstChar = dict.get("FirstChar") || 0; - const lastChar = dict.get("LastChar") || (composite ? 0xffff : 0xff); - hash.update(`${firstChar}-${lastChar}`); - var toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); + if (!(0, _primitives.isName)(type)) { + throw new _util.FormatError("invalid font Subtype"); + } - if ((0, _primitives.isStream)(toUnicode)) { - var stream = toUnicode.str || toUnicode; - uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start); - hash.update(uint8array); - } else if ((0, _primitives.isName)(toUnicode)) { - hash.update(toUnicode.name); - } + var composite = false; + var uint8array; - var widths = dict.get("Widths") || baseDict.get("Widths"); + if (type.name === "Type0") { + var df = dict.get("DescendantFonts"); - if (widths) { - uint8array = new Uint8Array(new Uint32Array(widths).buffer); - hash.update(uint8array); - } + if (!df) { + throw new _util.FormatError("Descendant fonts are not specified"); } - return { - descriptor, - dict, - baseDict, - composite, - type: type.name, - hash: hash ? hash.hexdigest() : "" - }; - }, - translateFont: function PartialEvaluator_translateFont(preEvaluatedFont) { - var baseDict = preEvaluatedFont.baseDict; - var dict = preEvaluatedFont.dict; - var composite = preEvaluatedFont.composite; - var descriptor = preEvaluatedFont.descriptor; - var type = preEvaluatedFont.type; - var maxCharIndex = composite ? 0xffff : 0xff; - var properties; - const firstChar = dict.get("FirstChar") || 0; - const lastChar = dict.get("LastChar") || maxCharIndex; + dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df; + type = dict.get("Subtype"); - if (!descriptor) { - if (type === "Type3") { - descriptor = new _primitives.Dict(null); - descriptor.set("FontName", _primitives.Name.get(type)); - descriptor.set("FontBBox", dict.getArray("FontBBox") || [0, 0, 0, 0]); - } else { - var baseFontName = dict.get("BaseFont"); - - if (!(0, _primitives.isName)(baseFontName)) { - throw new _util.FormatError("Base font is not specified"); - } - - baseFontName = baseFontName.name.replace(/[,_]/g, "-"); - var metrics = this.getBaseFontMetrics(baseFontName); - var fontNameWoStyle = baseFontName.split("-")[0]; - var flags = (this.isSerifFont(fontNameWoStyle) ? _fonts.FontFlags.Serif : 0) | (metrics.monospace ? _fonts.FontFlags.FixedPitch : 0) | ((0, _standard_fonts.getSymbolsFonts)()[fontNameWoStyle] ? _fonts.FontFlags.Symbolic : _fonts.FontFlags.Nonsymbolic); - properties = { - type, - name: baseFontName, - widths: metrics.widths, - defaultWidth: metrics.defaultWidth, - flags, - firstChar, - lastChar - }; - const widths = dict.get("Widths"); - return this.extractDataStructures(dict, dict, properties).then(newProperties => { - if (widths) { - const glyphWidths = []; - let j = firstChar; - - for (let i = 0, ii = widths.length; i < ii; i++) { - glyphWidths[j++] = this.xref.fetchIfRef(widths[i]); - } + if (!(0, _primitives.isName)(type)) { + throw new _util.FormatError("invalid font Subtype"); + } - newProperties.widths = glyphWidths; - } else { - newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties); + composite = true; + } + + var descriptor = dict.get("FontDescriptor"); + + if (descriptor) { + var hash = new _murmurhash.MurmurHash3_64(); + var encoding = baseDict.getRaw("Encoding"); + + if ((0, _primitives.isName)(encoding)) { + hash.update(encoding.name); + } else if ((0, _primitives.isRef)(encoding)) { + hash.update(encoding.toString()); + } else if ((0, _primitives.isDict)(encoding)) { + for (const entry of encoding.getRawValues()) { + if ((0, _primitives.isName)(entry)) { + hash.update(entry.name); + } else if ((0, _primitives.isRef)(entry)) { + hash.update(entry.toString()); + } else if (Array.isArray(entry)) { + var diffLength = entry.length, + diffBuf = new Array(diffLength); + + for (var j = 0; j < diffLength; j++) { + var diffEntry = entry[j]; + + if ((0, _primitives.isName)(diffEntry)) { + diffBuf[j] = diffEntry.name; + } else if ((0, _util.isNum)(diffEntry) || (0, _primitives.isRef)(diffEntry)) { + diffBuf[j] = diffEntry.toString(); + } } - return new _fonts.Font(baseFontName, null, newProperties); - }); + hash.update(diffBuf.join()); + } } } - var fontName = descriptor.get("FontName"); - var baseFont = dict.get("BaseFont"); + const firstChar = dict.get("FirstChar") || 0; + const lastChar = dict.get("LastChar") || (composite ? 0xffff : 0xff); + hash.update(`${firstChar}-${lastChar}`); + var toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); - if ((0, _util.isString)(fontName)) { - fontName = _primitives.Name.get(fontName); + if ((0, _primitives.isStream)(toUnicode)) { + var stream = toUnicode.str || toUnicode; + uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start); + hash.update(uint8array); + } else if ((0, _primitives.isName)(toUnicode)) { + hash.update(toUnicode.name); } - if ((0, _util.isString)(baseFont)) { - baseFont = _primitives.Name.get(baseFont); + var widths = dict.get("Widths") || baseDict.get("Widths"); + + if (widths) { + uint8array = new Uint8Array(new Uint32Array(widths).buffer); + hash.update(uint8array); } + } - if (type !== "Type3") { - var fontNameStr = fontName && fontName.name; - var baseFontStr = baseFont && baseFont.name; + return { + descriptor, + dict, + baseDict, + composite, + type: type.name, + hash: hash ? hash.hexdigest() : "" + }; + } - if (fontNameStr !== baseFontStr) { - (0, _util.info)(`The FontDescriptor\'s FontName is "${fontNameStr}" but ` + `should be the same as the Font\'s BaseFont "${baseFontStr}".`); + translateFont(preEvaluatedFont) { + var baseDict = preEvaluatedFont.baseDict; + var dict = preEvaluatedFont.dict; + var composite = preEvaluatedFont.composite; + var descriptor = preEvaluatedFont.descriptor; + var type = preEvaluatedFont.type; + var maxCharIndex = composite ? 0xffff : 0xff; + var properties; + const firstChar = dict.get("FirstChar") || 0; + const lastChar = dict.get("LastChar") || maxCharIndex; + + if (!descriptor) { + if (type === "Type3") { + descriptor = new _primitives.Dict(null); + descriptor.set("FontName", _primitives.Name.get(type)); + descriptor.set("FontBBox", dict.getArray("FontBBox") || [0, 0, 0, 0]); + } else { + var baseFontName = dict.get("BaseFont"); + + if (!(0, _primitives.isName)(baseFontName)) { + throw new _util.FormatError("Base font is not specified"); + } + + baseFontName = baseFontName.name.replace(/[,_]/g, "-"); + var metrics = this.getBaseFontMetrics(baseFontName); + var fontNameWoStyle = baseFontName.split("-")[0]; + var flags = (this.isSerifFont(fontNameWoStyle) ? _fonts.FontFlags.Serif : 0) | (metrics.monospace ? _fonts.FontFlags.FixedPitch : 0) | ((0, _standard_fonts.getSymbolsFonts)()[fontNameWoStyle] ? _fonts.FontFlags.Symbolic : _fonts.FontFlags.Nonsymbolic); + properties = { + type, + name: baseFontName, + widths: metrics.widths, + defaultWidth: metrics.defaultWidth, + flags, + firstChar, + lastChar + }; + const widths = dict.get("Widths"); + return this.extractDataStructures(dict, dict, properties).then(newProperties => { + if (widths) { + const glyphWidths = []; + let j = firstChar; + + for (let i = 0, ii = widths.length; i < ii; i++) { + glyphWidths[j++] = this.xref.fetchIfRef(widths[i]); + } - if (fontNameStr && baseFontStr && baseFontStr.startsWith(fontNameStr)) { - fontName = baseFont; + newProperties.widths = glyphWidths; + } else { + newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties); } - } + + return new _fonts.Font(baseFontName, null, newProperties); + }); } + } - fontName = fontName || baseFont; + var fontName = descriptor.get("FontName"); + var baseFont = dict.get("BaseFont"); - if (!(0, _primitives.isName)(fontName)) { - throw new _util.FormatError("invalid font name"); - } + if ((0, _util.isString)(fontName)) { + fontName = _primitives.Name.get(fontName); + } - var fontFile = descriptor.get("FontFile", "FontFile2", "FontFile3"); + if ((0, _util.isString)(baseFont)) { + baseFont = _primitives.Name.get(baseFont); + } - if (fontFile) { - if (fontFile.dict) { - var subtype = fontFile.dict.get("Subtype"); + if (type !== "Type3") { + var fontNameStr = fontName && fontName.name; + var baseFontStr = baseFont && baseFont.name; - if (subtype) { - subtype = subtype.name; - } + if (fontNameStr !== baseFontStr) { + (0, _util.info)(`The FontDescriptor\'s FontName is "${fontNameStr}" but ` + `should be the same as the Font\'s BaseFont "${baseFontStr}".`); - var length1 = fontFile.dict.get("Length1"); - var length2 = fontFile.dict.get("Length2"); - var length3 = fontFile.dict.get("Length3"); + if (fontNameStr && baseFontStr && baseFontStr.startsWith(fontNameStr)) { + fontName = baseFont; } } + } - properties = { - type, - name: fontName.name, - subtype, - file: fontFile, - length1, - length2, - length3, - loadedName: baseDict.loadedName, - composite, - fixedPitch: false, - fontMatrix: dict.getArray("FontMatrix") || _util.FONT_IDENTITY_MATRIX, - firstChar: firstChar || 0, - lastChar: lastChar || maxCharIndex, - bbox: descriptor.getArray("FontBBox"), - ascent: descriptor.get("Ascent"), - descent: descriptor.get("Descent"), - xHeight: descriptor.get("XHeight"), - capHeight: descriptor.get("CapHeight"), - flags: descriptor.get("Flags"), - italicAngle: descriptor.get("ItalicAngle"), - isType3Font: false - }; - var cMapPromise; + fontName = fontName || baseFont; - if (composite) { - var cidEncoding = baseDict.get("Encoding"); + if (!(0, _primitives.isName)(fontName)) { + throw new _util.FormatError("invalid font name"); + } + + var fontFile = descriptor.get("FontFile", "FontFile2", "FontFile3"); - if ((0, _primitives.isName)(cidEncoding)) { - properties.cidEncoding = cidEncoding.name; + if (fontFile) { + if (fontFile.dict) { + var subtype = fontFile.dict.get("Subtype"); + + if (subtype) { + subtype = subtype.name; } - cMapPromise = _cmap.CMapFactory.create({ - encoding: cidEncoding, - fetchBuiltInCMap: this.fetchBuiltInCMap, - useCMap: null - }).then(function (cMap) { - properties.cMap = cMap; - properties.vertical = properties.cMap.vertical; - }); - } else { - cMapPromise = Promise.resolve(undefined); + var length1 = fontFile.dict.get("Length1"); + var length2 = fontFile.dict.get("Length2"); + var length3 = fontFile.dict.get("Length3"); } + } - return cMapPromise.then(() => { - return this.extractDataStructures(dict, baseDict, properties); - }).then(newProperties => { - this.extractWidths(dict, descriptor, newProperties); + properties = { + type, + name: fontName.name, + subtype, + file: fontFile, + length1, + length2, + length3, + loadedName: baseDict.loadedName, + composite, + fixedPitch: false, + fontMatrix: dict.getArray("FontMatrix") || _util.FONT_IDENTITY_MATRIX, + firstChar: firstChar || 0, + lastChar: lastChar || maxCharIndex, + bbox: descriptor.getArray("FontBBox"), + ascent: descriptor.get("Ascent"), + descent: descriptor.get("Descent"), + xHeight: descriptor.get("XHeight"), + capHeight: descriptor.get("CapHeight"), + flags: descriptor.get("Flags"), + italicAngle: descriptor.get("ItalicAngle"), + isType3Font: false + }; + var cMapPromise; - if (type === "Type3") { - newProperties.isType3Font = true; - } + if (composite) { + var cidEncoding = baseDict.get("Encoding"); - return new _fonts.Font(fontName.name, fontFile, newProperties); + if ((0, _primitives.isName)(cidEncoding)) { + properties.cidEncoding = cidEncoding.name; + } + + cMapPromise = _cmap.CMapFactory.create({ + encoding: cidEncoding, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }).then(function (cMap) { + properties.cMap = cMap; + properties.vertical = properties.cMap.vertical; }); + } else { + cMapPromise = Promise.resolve(undefined); } - }; - PartialEvaluator.buildFontPaths = function (font, glyphs, handler) { + return cMapPromise.then(() => { + return this.extractDataStructures(dict, baseDict, properties); + }).then(newProperties => { + this.extractWidths(dict, descriptor, newProperties); + + if (type === "Type3") { + newProperties.isType3Font = true; + } + + return new _fonts.Font(fontName.name, fontFile, newProperties); + }); + } + + static buildFontPaths(font, glyphs, handler) { function buildPath(fontChar) { if (font.renderer.hasBuiltPath(fontChar)) { return; @@ -23003,23 +24544,18 @@ var PartialEvaluator = function PartialEvaluatorClosure() { buildPath(accent.fontChar); } } - }; - - PartialEvaluator.getFallbackFontDict = function () { - if (this._fallbackFontDict) { - return this._fallbackFontDict; - } + } + static get fallbackFontDict() { const dict = new _primitives.Dict(); dict.set("BaseFont", _primitives.Name.get("PDFJS-FallbackFont")); dict.set("Type", _primitives.Name.get("FallbackType")); dict.set("Subtype", _primitives.Name.get("FallbackType")); dict.set("Encoding", _primitives.Name.get("WinAnsiEncoding")); - return this._fallbackFontDict = dict; - }; + return (0, _util.shadow)(this, "fallbackFontDict", dict); + } - return PartialEvaluator; -}(); +} exports.PartialEvaluator = PartialEvaluator; @@ -23035,6 +24571,7 @@ class TranslatedFont { this.dict = dict; this._extraProperties = extraProperties; this.type3Loaded = null; + this.type3Dependencies = font.isType3Font ? new Set() : null; this.sent = false; } @@ -23057,28 +24594,27 @@ class TranslatedFont { PartialEvaluator.buildFontPaths(this.font, glyphs, handler); } - loadType3Data(evaluator, resources, parentOperatorList, task) { - if (!this.font.isType3Font) { - throw new Error("Must be a Type3 font."); - } - + loadType3Data(evaluator, resources, task) { if (this.type3Loaded) { return this.type3Loaded; } + if (!this.font.isType3Font) { + throw new Error("Must be a Type3 font."); + } + var type3Options = Object.create(evaluator.options); type3Options.ignoreErrors = false; var type3Evaluator = evaluator.clone(type3Options); type3Evaluator.parsingType3Font = true; - var translatedFont = this.font; + const translatedFont = this.font, + type3Dependencies = this.type3Dependencies; var loadCharProcsPromise = Promise.resolve(); var charProcs = this.dict.get("CharProcs"); var fontResources = this.dict.get("Resources") || resources; - var charProcKeys = charProcs.getKeys(); var charProcOperatorList = Object.create(null); - for (var i = 0, n = charProcKeys.length; i < n; ++i) { - const key = charProcKeys[i]; + for (const key of charProcs.getKeys()) { loadCharProcsPromise = loadCharProcsPromise.then(function () { var glyphStream = charProcs.get(key); var operatorList = new _operator_list.OperatorList(); @@ -23089,7 +24625,10 @@ class TranslatedFont { operatorList }).then(function () { charProcOperatorList[key] = operatorList.getIR(); - parentOperatorList.addDependencies(operatorList.dependencies); + + for (const dependency of operatorList.dependencies) { + type3Dependencies.add(dependency); + } }).catch(function (reason) { (0, _util.warn)(`Type3 font resource "${key}" is not available.`); const dummyOperatorList = new _operator_list.OperatorList(); @@ -23106,37 +24645,34 @@ class TranslatedFont { } -var StateManager = function StateManagerClosure() { - function StateManager(initialState) { +class StateManager { + constructor(initialState) { this.state = initialState; this.stateStack = []; } - StateManager.prototype = { - save() { - var old = this.state; - this.stateStack.push(this.state); - this.state = old.clone(); - }, - - restore() { - var prev = this.stateStack.pop(); + save() { + var old = this.state; + this.stateStack.push(this.state); + this.state = old.clone(); + } - if (prev) { - this.state = prev; - } - }, + restore() { + var prev = this.stateStack.pop(); - transform(args) { - this.state.ctm = _util.Util.transform(this.state.ctm, args); + if (prev) { + this.state = prev; } + } - }; - return StateManager; -}(); + transform(args) { + this.state.ctm = _util.Util.transform(this.state.ctm, args); + } + +} -var TextState = function TextStateClosure() { - function TextState() { +class TextState { + constructor() { this.ctm = new Float32Array(_util.IDENTITY_MATRIX); this.fontName = null; this.fontSize = 0; @@ -23151,94 +24687,99 @@ var TextState = function TextStateClosure() { this.textRise = 0; } - TextState.prototype = { - setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textMatrix; - m[0] = a; - m[1] = b; - m[2] = c; - m[3] = d; - m[4] = e; - m[5] = f; - }, - setTextLineMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textLineMatrix; - m[0] = a; - m[1] = b; - m[2] = c; - m[3] = d; - m[4] = e; - m[5] = f; - }, - translateTextMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - translateTextLineMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textLineMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - calcTextLineMatrixAdvance: function TextState_calcTextLineMatrixAdvance(a, b, c, d, e, f) { - var font = this.font; + setTextMatrix(a, b, c, d, e, f) { + var m = this.textMatrix; + m[0] = a; + m[1] = b; + m[2] = c; + m[3] = d; + m[4] = e; + m[5] = f; + } - if (!font) { - return null; - } + setTextLineMatrix(a, b, c, d, e, f) { + var m = this.textLineMatrix; + m[0] = a; + m[1] = b; + m[2] = c; + m[3] = d; + m[4] = e; + m[5] = f; + } - var m = this.textLineMatrix; + translateTextMatrix(x, y) { + var m = this.textMatrix; + m[4] = m[0] * x + m[2] * y + m[4]; + m[5] = m[1] * x + m[3] * y + m[5]; + } - if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) { - return null; - } + translateTextLineMatrix(x, y) { + var m = this.textLineMatrix; + m[4] = m[0] * x + m[2] * y + m[4]; + m[5] = m[1] * x + m[3] * y + m[5]; + } - var txDiff = e - m[4], - tyDiff = f - m[5]; + calcTextLineMatrixAdvance(a, b, c, d, e, f) { + var font = this.font; - if (font.vertical && txDiff !== 0 || !font.vertical && tyDiff !== 0) { - return null; - } + if (!font) { + return null; + } - var tx, - ty, - denominator = a * d - b * c; + var m = this.textLineMatrix; - if (font.vertical) { - tx = -tyDiff * c / denominator; - ty = tyDiff * a / denominator; - } else { - tx = txDiff * d / denominator; - ty = -txDiff * b / denominator; - } + if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) { + return null; + } - return { - width: tx, - height: ty, - value: font.vertical ? ty : tx - }; - }, - calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { - var tsm = [this.fontSize * this.textHScale, 0, 0, this.fontSize, 0, this.textRise]; - return _util.Util.transform(ctm, _util.Util.transform(this.textMatrix, tsm)); - }, - carriageReturn: function TextState_carriageReturn() { - this.translateTextLineMatrix(0, -this.leading); - this.textMatrix = this.textLineMatrix.slice(); - }, - clone: function TextState_clone() { - var clone = Object.create(this); - clone.textMatrix = this.textMatrix.slice(); - clone.textLineMatrix = this.textLineMatrix.slice(); - clone.fontMatrix = this.fontMatrix.slice(); - return clone; + var txDiff = e - m[4], + tyDiff = f - m[5]; + + if (font.vertical && txDiff !== 0 || !font.vertical && tyDiff !== 0) { + return null; } - }; - return TextState; -}(); -var EvalState = function EvalStateClosure() { - function EvalState() { + var tx, + ty, + denominator = a * d - b * c; + + if (font.vertical) { + tx = -tyDiff * c / denominator; + ty = tyDiff * a / denominator; + } else { + tx = txDiff * d / denominator; + ty = -txDiff * b / denominator; + } + + return { + width: tx, + height: ty, + value: font.vertical ? ty : tx + }; + } + + calcRenderMatrix(ctm) { + var tsm = [this.fontSize * this.textHScale, 0, 0, this.fontSize, 0, this.textRise]; + return _util.Util.transform(ctm, _util.Util.transform(this.textMatrix, tsm)); + } + + carriageReturn() { + this.translateTextLineMatrix(0, -this.leading); + this.textMatrix = this.textLineMatrix.slice(); + } + + clone() { + var clone = Object.create(this); + clone.textMatrix = this.textMatrix.slice(); + clone.textLineMatrix = this.textLineMatrix.slice(); + clone.fontMatrix = this.fontMatrix.slice(); + return clone; + } + +} + +class EvalState { + constructor() { this.ctm = new Float32Array(_util.IDENTITY_MATRIX); this.font = null; this.textRenderingMode = _util.TextRenderingMode.FILL; @@ -23246,398 +24787,401 @@ var EvalState = function EvalStateClosure() { this.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; } - EvalState.prototype = { - clone: function CanvasExtraState_clone() { - return Object.create(this); - } - }; - return EvalState; -}(); + clone() { + return Object.create(this); + } -var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() { - var getOPMap = (0, _core_utils.getLookupTableFactory)(function (t) { - t.w = { - id: _util.OPS.setLineWidth, - numArgs: 1, - variableArgs: false - }; - t.J = { - id: _util.OPS.setLineCap, - numArgs: 1, - variableArgs: false - }; - t.j = { - id: _util.OPS.setLineJoin, - numArgs: 1, - variableArgs: false - }; - t.M = { - id: _util.OPS.setMiterLimit, - numArgs: 1, - variableArgs: false - }; - t.d = { - id: _util.OPS.setDash, - numArgs: 2, - variableArgs: false - }; - t.ri = { - id: _util.OPS.setRenderingIntent, - numArgs: 1, - variableArgs: false - }; - t.i = { - id: _util.OPS.setFlatness, - numArgs: 1, - variableArgs: false - }; - t.gs = { - id: _util.OPS.setGState, - numArgs: 1, - variableArgs: false - }; - t.q = { - id: _util.OPS.save, - numArgs: 0, - variableArgs: false - }; - t.Q = { - id: _util.OPS.restore, - numArgs: 0, - variableArgs: false - }; - t.cm = { - id: _util.OPS.transform, - numArgs: 6, - variableArgs: false - }; - t.m = { - id: _util.OPS.moveTo, - numArgs: 2, - variableArgs: false - }; - t.l = { - id: _util.OPS.lineTo, - numArgs: 2, - variableArgs: false - }; - t.c = { - id: _util.OPS.curveTo, - numArgs: 6, - variableArgs: false - }; - t.v = { - id: _util.OPS.curveTo2, - numArgs: 4, - variableArgs: false - }; - t.y = { - id: _util.OPS.curveTo3, - numArgs: 4, - variableArgs: false - }; - t.h = { - id: _util.OPS.closePath, - numArgs: 0, - variableArgs: false - }; - t.re = { - id: _util.OPS.rectangle, - numArgs: 4, - variableArgs: false - }; - t.S = { - id: _util.OPS.stroke, - numArgs: 0, - variableArgs: false - }; - t.s = { - id: _util.OPS.closeStroke, - numArgs: 0, - variableArgs: false - }; - t.f = { - id: _util.OPS.fill, - numArgs: 0, - variableArgs: false - }; - t.F = { - id: _util.OPS.fill, - numArgs: 0, - variableArgs: false - }; - t["f*"] = { - id: _util.OPS.eoFill, - numArgs: 0, - variableArgs: false - }; - t.B = { - id: _util.OPS.fillStroke, - numArgs: 0, - variableArgs: false - }; - t["B*"] = { - id: _util.OPS.eoFillStroke, - numArgs: 0, - variableArgs: false - }; - t.b = { - id: _util.OPS.closeFillStroke, - numArgs: 0, - variableArgs: false - }; - t["b*"] = { - id: _util.OPS.closeEOFillStroke, - numArgs: 0, - variableArgs: false - }; - t.n = { - id: _util.OPS.endPath, - numArgs: 0, - variableArgs: false - }; - t.W = { - id: _util.OPS.clip, - numArgs: 0, - variableArgs: false - }; - t["W*"] = { - id: _util.OPS.eoClip, - numArgs: 0, - variableArgs: false - }; - t.BT = { - id: _util.OPS.beginText, - numArgs: 0, - variableArgs: false - }; - t.ET = { - id: _util.OPS.endText, - numArgs: 0, - variableArgs: false - }; - t.Tc = { - id: _util.OPS.setCharSpacing, - numArgs: 1, - variableArgs: false - }; - t.Tw = { - id: _util.OPS.setWordSpacing, - numArgs: 1, - variableArgs: false - }; - t.Tz = { - id: _util.OPS.setHScale, - numArgs: 1, - variableArgs: false - }; - t.TL = { - id: _util.OPS.setLeading, - numArgs: 1, - variableArgs: false - }; - t.Tf = { - id: _util.OPS.setFont, - numArgs: 2, - variableArgs: false - }; - t.Tr = { - id: _util.OPS.setTextRenderingMode, - numArgs: 1, - variableArgs: false - }; - t.Ts = { - id: _util.OPS.setTextRise, - numArgs: 1, - variableArgs: false - }; - t.Td = { - id: _util.OPS.moveText, - numArgs: 2, - variableArgs: false - }; - t.TD = { - id: _util.OPS.setLeadingMoveText, - numArgs: 2, - variableArgs: false - }; - t.Tm = { - id: _util.OPS.setTextMatrix, - numArgs: 6, - variableArgs: false - }; - t["T*"] = { - id: _util.OPS.nextLine, - numArgs: 0, - variableArgs: false - }; - t.Tj = { - id: _util.OPS.showText, - numArgs: 1, - variableArgs: false - }; - t.TJ = { - id: _util.OPS.showSpacedText, - numArgs: 1, - variableArgs: false - }; - t["'"] = { - id: _util.OPS.nextLineShowText, - numArgs: 1, - variableArgs: false - }; - t['"'] = { - id: _util.OPS.nextLineSetSpacingShowText, - numArgs: 3, - variableArgs: false - }; - t.d0 = { - id: _util.OPS.setCharWidth, - numArgs: 2, - variableArgs: false - }; - t.d1 = { - id: _util.OPS.setCharWidthAndBounds, - numArgs: 6, - variableArgs: false - }; - t.CS = { - id: _util.OPS.setStrokeColorSpace, - numArgs: 1, - variableArgs: false - }; - t.cs = { - id: _util.OPS.setFillColorSpace, - numArgs: 1, - variableArgs: false - }; - t.SC = { - id: _util.OPS.setStrokeColor, - numArgs: 4, - variableArgs: true - }; - t.SCN = { - id: _util.OPS.setStrokeColorN, - numArgs: 33, - variableArgs: true - }; - t.sc = { - id: _util.OPS.setFillColor, - numArgs: 4, - variableArgs: true - }; - t.scn = { - id: _util.OPS.setFillColorN, - numArgs: 33, - variableArgs: true - }; - t.G = { - id: _util.OPS.setStrokeGray, - numArgs: 1, - variableArgs: false - }; - t.g = { - id: _util.OPS.setFillGray, - numArgs: 1, - variableArgs: false - }; - t.RG = { - id: _util.OPS.setStrokeRGBColor, - numArgs: 3, - variableArgs: false - }; - t.rg = { - id: _util.OPS.setFillRGBColor, - numArgs: 3, - variableArgs: false - }; - t.K = { - id: _util.OPS.setStrokeCMYKColor, - numArgs: 4, - variableArgs: false - }; - t.k = { - id: _util.OPS.setFillCMYKColor, - numArgs: 4, - variableArgs: false - }; - t.sh = { - id: _util.OPS.shadingFill, - numArgs: 1, - variableArgs: false - }; - t.BI = { - id: _util.OPS.beginInlineImage, - numArgs: 0, - variableArgs: false - }; - t.ID = { - id: _util.OPS.beginImageData, - numArgs: 0, - variableArgs: false - }; - t.EI = { - id: _util.OPS.endInlineImage, - numArgs: 1, - variableArgs: false - }; - t.Do = { - id: _util.OPS.paintXObject, - numArgs: 1, - variableArgs: false - }; - t.MP = { - id: _util.OPS.markPoint, - numArgs: 1, - variableArgs: false - }; - t.DP = { - id: _util.OPS.markPointProps, - numArgs: 2, - variableArgs: false - }; - t.BMC = { - id: _util.OPS.beginMarkedContent, - numArgs: 1, - variableArgs: false - }; - t.BDC = { - id: _util.OPS.beginMarkedContentProps, - numArgs: 2, - variableArgs: false - }; - t.EMC = { - id: _util.OPS.endMarkedContent, - numArgs: 0, - variableArgs: false - }; - t.BX = { - id: _util.OPS.beginCompat, - numArgs: 0, - variableArgs: false - }; - t.EX = { - id: _util.OPS.endCompat, - numArgs: 0, - variableArgs: false - }; - t.BM = null; - t.BD = null; - t.true = null; - t.fa = null; - t.fal = null; - t.fals = null; - t.false = null; - t.nu = null; - t.nul = null; - t.null = null; - }); - const MAX_INVALID_PATH_OPS = 20; +} - function EvaluatorPreprocessor(stream, xref, stateManager) { - this.opMap = getOPMap(); +class EvaluatorPreprocessor { + static get opMap() { + const getOPMap = (0, _core_utils.getLookupTableFactory)(function (t) { + t.w = { + id: _util.OPS.setLineWidth, + numArgs: 1, + variableArgs: false + }; + t.J = { + id: _util.OPS.setLineCap, + numArgs: 1, + variableArgs: false + }; + t.j = { + id: _util.OPS.setLineJoin, + numArgs: 1, + variableArgs: false + }; + t.M = { + id: _util.OPS.setMiterLimit, + numArgs: 1, + variableArgs: false + }; + t.d = { + id: _util.OPS.setDash, + numArgs: 2, + variableArgs: false + }; + t.ri = { + id: _util.OPS.setRenderingIntent, + numArgs: 1, + variableArgs: false + }; + t.i = { + id: _util.OPS.setFlatness, + numArgs: 1, + variableArgs: false + }; + t.gs = { + id: _util.OPS.setGState, + numArgs: 1, + variableArgs: false + }; + t.q = { + id: _util.OPS.save, + numArgs: 0, + variableArgs: false + }; + t.Q = { + id: _util.OPS.restore, + numArgs: 0, + variableArgs: false + }; + t.cm = { + id: _util.OPS.transform, + numArgs: 6, + variableArgs: false + }; + t.m = { + id: _util.OPS.moveTo, + numArgs: 2, + variableArgs: false + }; + t.l = { + id: _util.OPS.lineTo, + numArgs: 2, + variableArgs: false + }; + t.c = { + id: _util.OPS.curveTo, + numArgs: 6, + variableArgs: false + }; + t.v = { + id: _util.OPS.curveTo2, + numArgs: 4, + variableArgs: false + }; + t.y = { + id: _util.OPS.curveTo3, + numArgs: 4, + variableArgs: false + }; + t.h = { + id: _util.OPS.closePath, + numArgs: 0, + variableArgs: false + }; + t.re = { + id: _util.OPS.rectangle, + numArgs: 4, + variableArgs: false + }; + t.S = { + id: _util.OPS.stroke, + numArgs: 0, + variableArgs: false + }; + t.s = { + id: _util.OPS.closeStroke, + numArgs: 0, + variableArgs: false + }; + t.f = { + id: _util.OPS.fill, + numArgs: 0, + variableArgs: false + }; + t.F = { + id: _util.OPS.fill, + numArgs: 0, + variableArgs: false + }; + t["f*"] = { + id: _util.OPS.eoFill, + numArgs: 0, + variableArgs: false + }; + t.B = { + id: _util.OPS.fillStroke, + numArgs: 0, + variableArgs: false + }; + t["B*"] = { + id: _util.OPS.eoFillStroke, + numArgs: 0, + variableArgs: false + }; + t.b = { + id: _util.OPS.closeFillStroke, + numArgs: 0, + variableArgs: false + }; + t["b*"] = { + id: _util.OPS.closeEOFillStroke, + numArgs: 0, + variableArgs: false + }; + t.n = { + id: _util.OPS.endPath, + numArgs: 0, + variableArgs: false + }; + t.W = { + id: _util.OPS.clip, + numArgs: 0, + variableArgs: false + }; + t["W*"] = { + id: _util.OPS.eoClip, + numArgs: 0, + variableArgs: false + }; + t.BT = { + id: _util.OPS.beginText, + numArgs: 0, + variableArgs: false + }; + t.ET = { + id: _util.OPS.endText, + numArgs: 0, + variableArgs: false + }; + t.Tc = { + id: _util.OPS.setCharSpacing, + numArgs: 1, + variableArgs: false + }; + t.Tw = { + id: _util.OPS.setWordSpacing, + numArgs: 1, + variableArgs: false + }; + t.Tz = { + id: _util.OPS.setHScale, + numArgs: 1, + variableArgs: false + }; + t.TL = { + id: _util.OPS.setLeading, + numArgs: 1, + variableArgs: false + }; + t.Tf = { + id: _util.OPS.setFont, + numArgs: 2, + variableArgs: false + }; + t.Tr = { + id: _util.OPS.setTextRenderingMode, + numArgs: 1, + variableArgs: false + }; + t.Ts = { + id: _util.OPS.setTextRise, + numArgs: 1, + variableArgs: false + }; + t.Td = { + id: _util.OPS.moveText, + numArgs: 2, + variableArgs: false + }; + t.TD = { + id: _util.OPS.setLeadingMoveText, + numArgs: 2, + variableArgs: false + }; + t.Tm = { + id: _util.OPS.setTextMatrix, + numArgs: 6, + variableArgs: false + }; + t["T*"] = { + id: _util.OPS.nextLine, + numArgs: 0, + variableArgs: false + }; + t.Tj = { + id: _util.OPS.showText, + numArgs: 1, + variableArgs: false + }; + t.TJ = { + id: _util.OPS.showSpacedText, + numArgs: 1, + variableArgs: false + }; + t["'"] = { + id: _util.OPS.nextLineShowText, + numArgs: 1, + variableArgs: false + }; + t['"'] = { + id: _util.OPS.nextLineSetSpacingShowText, + numArgs: 3, + variableArgs: false + }; + t.d0 = { + id: _util.OPS.setCharWidth, + numArgs: 2, + variableArgs: false + }; + t.d1 = { + id: _util.OPS.setCharWidthAndBounds, + numArgs: 6, + variableArgs: false + }; + t.CS = { + id: _util.OPS.setStrokeColorSpace, + numArgs: 1, + variableArgs: false + }; + t.cs = { + id: _util.OPS.setFillColorSpace, + numArgs: 1, + variableArgs: false + }; + t.SC = { + id: _util.OPS.setStrokeColor, + numArgs: 4, + variableArgs: true + }; + t.SCN = { + id: _util.OPS.setStrokeColorN, + numArgs: 33, + variableArgs: true + }; + t.sc = { + id: _util.OPS.setFillColor, + numArgs: 4, + variableArgs: true + }; + t.scn = { + id: _util.OPS.setFillColorN, + numArgs: 33, + variableArgs: true + }; + t.G = { + id: _util.OPS.setStrokeGray, + numArgs: 1, + variableArgs: false + }; + t.g = { + id: _util.OPS.setFillGray, + numArgs: 1, + variableArgs: false + }; + t.RG = { + id: _util.OPS.setStrokeRGBColor, + numArgs: 3, + variableArgs: false + }; + t.rg = { + id: _util.OPS.setFillRGBColor, + numArgs: 3, + variableArgs: false + }; + t.K = { + id: _util.OPS.setStrokeCMYKColor, + numArgs: 4, + variableArgs: false + }; + t.k = { + id: _util.OPS.setFillCMYKColor, + numArgs: 4, + variableArgs: false + }; + t.sh = { + id: _util.OPS.shadingFill, + numArgs: 1, + variableArgs: false + }; + t.BI = { + id: _util.OPS.beginInlineImage, + numArgs: 0, + variableArgs: false + }; + t.ID = { + id: _util.OPS.beginImageData, + numArgs: 0, + variableArgs: false + }; + t.EI = { + id: _util.OPS.endInlineImage, + numArgs: 1, + variableArgs: false + }; + t.Do = { + id: _util.OPS.paintXObject, + numArgs: 1, + variableArgs: false + }; + t.MP = { + id: _util.OPS.markPoint, + numArgs: 1, + variableArgs: false + }; + t.DP = { + id: _util.OPS.markPointProps, + numArgs: 2, + variableArgs: false + }; + t.BMC = { + id: _util.OPS.beginMarkedContent, + numArgs: 1, + variableArgs: false + }; + t.BDC = { + id: _util.OPS.beginMarkedContentProps, + numArgs: 2, + variableArgs: false + }; + t.EMC = { + id: _util.OPS.endMarkedContent, + numArgs: 0, + variableArgs: false + }; + t.BX = { + id: _util.OPS.beginCompat, + numArgs: 0, + variableArgs: false + }; + t.EX = { + id: _util.OPS.endCompat, + numArgs: 0, + variableArgs: false + }; + t.BM = null; + t.BD = null; + t.true = null; + t.fa = null; + t.fal = null; + t.fals = null; + t.false = null; + t.nu = null; + t.nul = null; + t.null = null; + }); + return (0, _util.shadow)(this, "opMap", getOPMap()); + } + + static get MAX_INVALID_PATH_OPS() { + return (0, _util.shadow)(this, "MAX_INVALID_PATH_OPS", 20); + } + + constructor(stream, xref, stateManager) { this.parser = new _parser.Parser({ - lexer: new _parser.Lexer(stream, this.opMap), + lexer: new _parser.Lexer(stream, EvaluatorPreprocessor.opMap), xref }); this.stateManager = stateManager; @@ -23645,112 +25189,111 @@ var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() { this._numInvalidPathOPS = 0; } - EvaluatorPreprocessor.prototype = { - get savedStatesDepth() { - return this.stateManager.stateStack.length; - }, - - read: function EvaluatorPreprocessor_read(operation) { - var args = operation.args; + get savedStatesDepth() { + return this.stateManager.stateStack.length; + } - while (true) { - var obj = this.parser.getObj(); + read(operation) { + var args = operation.args; - if (obj instanceof _primitives.Cmd) { - var cmd = obj.cmd; - var opSpec = this.opMap[cmd]; + while (true) { + var obj = this.parser.getObj(); - if (!opSpec) { - (0, _util.warn)(`Unknown command "${cmd}".`); - continue; - } + if (obj instanceof _primitives.Cmd) { + var cmd = obj.cmd; + var opSpec = EvaluatorPreprocessor.opMap[cmd]; - var fn = opSpec.id; - var numArgs = opSpec.numArgs; - var argsLength = args !== null ? args.length : 0; + if (!opSpec) { + (0, _util.warn)(`Unknown command "${cmd}".`); + continue; + } - if (!opSpec.variableArgs) { - if (argsLength !== numArgs) { - var nonProcessedArgs = this.nonProcessedArgs; + var fn = opSpec.id; + var numArgs = opSpec.numArgs; + var argsLength = args !== null ? args.length : 0; - while (argsLength > numArgs) { - nonProcessedArgs.push(args.shift()); - argsLength--; - } + if (!opSpec.variableArgs) { + if (argsLength !== numArgs) { + var nonProcessedArgs = this.nonProcessedArgs; - while (argsLength < numArgs && nonProcessedArgs.length !== 0) { - if (args === null) { - args = []; - } + while (argsLength > numArgs) { + nonProcessedArgs.push(args.shift()); + argsLength--; + } - args.unshift(nonProcessedArgs.pop()); - argsLength++; + while (argsLength < numArgs && nonProcessedArgs.length !== 0) { + if (args === null) { + args = []; } - } - if (argsLength < numArgs) { - const partialMsg = `command ${cmd}: expected ${numArgs} args, ` + `but received ${argsLength} args.`; + args.unshift(nonProcessedArgs.pop()); + argsLength++; + } + } - if (fn >= _util.OPS.moveTo && fn <= _util.OPS.endPath && ++this._numInvalidPathOPS > MAX_INVALID_PATH_OPS) { - throw new _util.FormatError(`Invalid ${partialMsg}`); - } + if (argsLength < numArgs) { + const partialMsg = `command ${cmd}: expected ${numArgs} args, ` + `but received ${argsLength} args.`; - (0, _util.warn)(`Skipping ${partialMsg}`); + if (fn >= _util.OPS.moveTo && fn <= _util.OPS.endPath && ++this._numInvalidPathOPS > EvaluatorPreprocessor.MAX_INVALID_PATH_OPS) { + throw new _util.FormatError(`Invalid ${partialMsg}`); + } - if (args !== null) { - args.length = 0; - } + (0, _util.warn)(`Skipping ${partialMsg}`); - continue; + if (args !== null) { + args.length = 0; } - } else if (argsLength > numArgs) { - (0, _util.info)(`Command ${cmd}: expected [0, ${numArgs}] args, ` + `but received ${argsLength} args.`); - } - this.preprocessCommand(fn, args); - operation.fn = fn; - operation.args = args; - return true; + continue; + } + } else if (argsLength > numArgs) { + (0, _util.info)(`Command ${cmd}: expected [0, ${numArgs}] args, ` + `but received ${argsLength} args.`); } - if (obj === _primitives.EOF) { - return false; - } + this.preprocessCommand(fn, args); + operation.fn = fn; + operation.args = args; + return true; + } - if (obj !== null) { - if (args === null) { - args = []; - } + if (obj === _primitives.EOF) { + return false; + } - args.push(obj); + if (obj !== null) { + if (args === null) { + args = []; + } - if (args.length > 33) { - throw new _util.FormatError("Too many arguments"); - } + args.push(obj); + + if (args.length > 33) { + throw new _util.FormatError("Too many arguments"); } } - }, - preprocessCommand: function EvaluatorPreprocessor_preprocessCommand(fn, args) { - switch (fn | 0) { - case _util.OPS.save: - this.stateManager.save(); - break; + } + } - case _util.OPS.restore: - this.stateManager.restore(); - break; + preprocessCommand(fn, args) { + switch (fn | 0) { + case _util.OPS.save: + this.stateManager.save(); + break; - case _util.OPS.transform: - this.stateManager.transform(args); - break; - } + case _util.OPS.restore: + this.stateManager.restore(); + break; + + case _util.OPS.transform: + this.stateManager.transform(args); + break; } - }; - return EvaluatorPreprocessor; -}(); + } + +} /***/ }), -/* 28 */ +/* 29 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -24660,7 +26203,7 @@ var CMapFactory = function CMapFactoryClosure() { exports.CMapFactory = CMapFactory; /***/ }), -/* 29 */ +/* 30 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -24674,25 +26217,25 @@ exports.IdentityToUnicodeMap = exports.ToUnicodeMap = exports.FontFlags = export var _util = __w_pdfjs_require__(2); -var _cff_parser = __w_pdfjs_require__(30); +var _cff_parser = __w_pdfjs_require__(31); -var _glyphlist = __w_pdfjs_require__(33); +var _glyphlist = __w_pdfjs_require__(34); -var _encodings = __w_pdfjs_require__(32); +var _encodings = __w_pdfjs_require__(33); -var _standard_fonts = __w_pdfjs_require__(34); +var _standard_fonts = __w_pdfjs_require__(35); -var _unicode = __w_pdfjs_require__(35); +var _unicode = __w_pdfjs_require__(36); var _core_utils = __w_pdfjs_require__(8); -var _font_renderer = __w_pdfjs_require__(36); +var _font_renderer = __w_pdfjs_require__(37); -var _cmap = __w_pdfjs_require__(28); +var _cmap = __w_pdfjs_require__(29); var _stream = __w_pdfjs_require__(12); -var _type1_parser = __w_pdfjs_require__(37); +var _type1_parser = __w_pdfjs_require__(38); const PRIVATE_USE_AREAS = [[0xe000, 0xf8ff], [0x100000, 0x10fffd]]; var PDF_GLYPH_SPACE_UNITS = 1000; @@ -25167,13 +26710,6 @@ var Font = function FontClosure() { this.seacMap = properties.seacMap; } - Font.getFontID = function () { - var ID = 1; - return function Font_getFontID() { - return String(ID++); - }; - }(); - function int16(b0, b1) { return (b0 << 8) + b1; } @@ -25924,7 +27460,7 @@ var Font = function FontClosure() { continue; } - if (platformId === 0 && encodingId === 0) { + if (platformId === 0 && (encodingId === 0 || encodingId === 1 || encodingId === 3)) { useTable = true; } else if (platformId === 1 && encodingId === 0) { useTable = true; @@ -26314,28 +27850,40 @@ var Font = function FontClosure() { var oldGlyfData = glyf.data; var oldGlyfDataLength = oldGlyfData.length; var newGlyfData = new Uint8Array(oldGlyfDataLength); - var startOffset = itemDecode(locaData, 0); - var writeOffset = 0; - var missingGlyphs = Object.create(null); - itemEncode(locaData, 0, writeOffset); var i, j; + const locaEntries = []; - for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { - var endOffset = itemDecode(locaData, j); + for (i = 0, j = 0; i < numGlyphs + 1; i++, j += itemSize) { + let offset = itemDecode(locaData, j); - if (endOffset === 0) { - endOffset = startOffset; + if (offset > oldGlyfDataLength) { + offset = oldGlyfDataLength; } - if (endOffset > oldGlyfDataLength && (oldGlyfDataLength + 3 & ~3) === endOffset) { - endOffset = oldGlyfDataLength; - } + locaEntries.push({ + index: i, + offset, + endOffset: 0 + }); + } - if (endOffset > oldGlyfDataLength) { - startOffset = endOffset; - } + locaEntries.sort((a, b) => { + return a.offset - b.offset; + }); + + for (i = 0; i < numGlyphs; i++) { + locaEntries[i].endOffset = locaEntries[i + 1].offset; + } - var glyphProfile = sanitizeGlyph(oldGlyfData, startOffset, endOffset, newGlyfData, writeOffset, hintsValid); + locaEntries.sort((a, b) => { + return a.index - b.index; + }); + var missingGlyphs = Object.create(null); + var writeOffset = 0; + itemEncode(locaData, 0, writeOffset); + + for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { + var glyphProfile = sanitizeGlyph(oldGlyfData, locaEntries[i].offset, locaEntries[i].endOffset, newGlyfData, writeOffset, hintsValid); var newLength = glyphProfile.length; if (newLength === 0) { @@ -26348,7 +27896,6 @@ var Font = function FontClosure() { writeOffset += newLength; itemEncode(locaData, j, writeOffset); - startOffset = endOffset; } if (writeOffset === 0) { @@ -26993,14 +28540,13 @@ var Font = function FontClosure() { var cmapEncodingId = cmapTable.encodingId; var cmapMappings = cmapTable.mappings; var cmapMappingsLength = cmapMappings.length; + let baseEncoding = []; - if (properties.hasEncoding && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0) || cmapPlatformId === -1 && cmapEncodingId === -1 && !!(0, _encodings.getEncoding)(properties.baseEncodingName)) { - var baseEncoding = []; - - if (properties.baseEncodingName === "MacRomanEncoding" || properties.baseEncodingName === "WinAnsiEncoding") { - baseEncoding = (0, _encodings.getEncoding)(properties.baseEncodingName); - } + if (properties.hasEncoding && (properties.baseEncodingName === "MacRomanEncoding" || properties.baseEncodingName === "WinAnsiEncoding")) { + baseEncoding = (0, _encodings.getEncoding)(properties.baseEncodingName); + } + if (properties.hasEncoding && !this.isSymbolicFont && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0)) { var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); for (let charCode = 0; charCode < 256; charCode++) { @@ -27027,31 +28573,16 @@ var Font = function FontClosure() { unicodeOrCharCode = _encodings.MacRomanEncoding.indexOf(standardGlyphName); } - var found = false; - for (let i = 0; i < cmapMappingsLength; ++i) { if (cmapMappings[i].charCode !== unicodeOrCharCode) { continue; } charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; - found = true; break; } - - if (!found && properties.glyphNames) { - var glyphId = properties.glyphNames.indexOf(glyphName); - - if (glyphId === -1 && standardGlyphName !== glyphName) { - glyphId = properties.glyphNames.indexOf(standardGlyphName); - } - - if (glyphId > 0 && hasGlyph(glyphId)) { - charCodeToGlyphId[charCode] = glyphId; - } - } } - } else if (cmapPlatformId === 0 && cmapEncodingId === 0) { + } else if (cmapPlatformId === 0) { for (let i = 0; i < cmapMappingsLength; ++i) { charCodeToGlyphId[cmapMappings[i].charCode] = cmapMappings[i].glyphId; } @@ -27066,6 +28597,19 @@ var Font = function FontClosure() { charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; } } + + if (properties.glyphNames && baseEncoding.length) { + for (let i = 0; i < 256; ++i) { + if (charCodeToGlyphId[i] === undefined && baseEncoding[i]) { + glyphName = baseEncoding[i]; + const glyphId = properties.glyphNames.indexOf(glyphName); + + if (glyphId > 0 && hasGlyph(glyphId)) { + charCodeToGlyphId[i] = glyphId; + } + } + } + } } if (charCodeToGlyphId.length === 0) { @@ -27900,7 +29444,7 @@ var CFFFont = function CFFFontClosure() { }(); /***/ }), -/* 30 */ +/* 31 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -27913,9 +29457,9 @@ exports.CFFFDSelect = exports.CFFCompiler = exports.CFFPrivateDict = exports.CFF var _util = __w_pdfjs_require__(2); -var _charsets = __w_pdfjs_require__(31); +var _charsets = __w_pdfjs_require__(32); -var _encodings = __w_pdfjs_require__(32); +var _encodings = __w_pdfjs_require__(33); var MAX_SUBR_NESTING = 10; var CFFStandardStrings = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"]; @@ -28133,14 +29677,14 @@ var CFFParser = function CFFParserClosure() { resetStack: true }]; - function CFFParser(file, properties, seacAnalysisEnabled) { - this.bytes = file.getBytes(); - this.properties = properties; - this.seacAnalysisEnabled = !!seacAnalysisEnabled; - } + class CFFParser { + constructor(file, properties, seacAnalysisEnabled) { + this.bytes = file.getBytes(); + this.properties = properties; + this.seacAnalysisEnabled = !!seacAnalysisEnabled; + } - CFFParser.prototype = { - parse: function CFFParser_parse() { + parse() { var properties = this.properties; var cff = new CFF(); this.cff = cff; @@ -28208,8 +29752,9 @@ var CFFParser = function CFFParserClosure() { cff.seacs = charStringsAndSeacs.seacs; cff.widths = charStringsAndSeacs.widths; return cff; - }, - parseHeader: function CFFParser_parseHeader() { + } + + parseHeader() { var bytes = this.bytes; var bytesLength = bytes.length; var offset = 0; @@ -28237,8 +29782,9 @@ var CFFParser = function CFFParserClosure() { obj: header, endPos: hdrSize }; - }, - parseDict: function CFFParser_parseDict(dict) { + } + + parseDict(dict) { var pos = 0; function parseOperand() { @@ -28317,8 +29863,9 @@ var CFFParser = function CFFParserClosure() { } return entries; - }, - parseIndex: function CFFParser_parseIndex(pos) { + } + + parseIndex(pos) { var cffIndex = new CFFIndex(); var bytes = this.bytes; var count = bytes[pos++] << 8 | bytes[pos++]; @@ -28354,8 +29901,9 @@ var CFFParser = function CFFParserClosure() { obj: cffIndex, endPos: end }; - }, - parseNameIndex: function CFFParser_parseNameIndex(index) { + } + + parseNameIndex(index) { var names = []; for (var i = 0, ii = index.count; i < ii; ++i) { @@ -28364,8 +29912,9 @@ var CFFParser = function CFFParserClosure() { } return names; - }, - parseStringIndex: function CFFParser_parseStringIndex(index) { + } + + parseStringIndex(index) { var strings = new CFFStrings(); for (var i = 0, ii = index.count; i < ii; ++i) { @@ -28374,8 +29923,9 @@ var CFFParser = function CFFParserClosure() { } return strings; - }, - createDict: function CFFParser_createDict(Type, dict, strings) { + } + + createDict(Type, dict, strings) { var cffDict = new Type(strings); for (var i = 0, ii = dict.length; i < ii; ++i) { @@ -28386,8 +29936,9 @@ var CFFParser = function CFFParserClosure() { } return cffDict; - }, - parseCharString: function CFFParser_parseCharString(state, data, localSubrIndex, globalSubrIndex) { + } + + parseCharString(state, data, localSubrIndex, globalSubrIndex) { if (!data || state.callDepth > MAX_SUBR_NESTING) { return false; } @@ -28545,7 +30096,7 @@ var CFFParser = function CFFParserClosure() { state.stackSize = stackSize; return true; - }, + } parseCharStrings({ charStrings, @@ -28623,14 +30174,15 @@ var CFFParser = function CFFParserClosure() { seacs, widths }; - }, + } - emptyPrivateDictionary: function CFFParser_emptyPrivateDictionary(parentDict) { + emptyPrivateDictionary(parentDict) { var privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings); parentDict.setByKey(18, [0, 0]); parentDict.privateDict = privateDict; - }, - parsePrivateDict: function CFFParser_parsePrivateDict(parentDict) { + } + + parsePrivateDict(parentDict) { if (!parentDict.hasName("Private")) { this.emptyPrivateDictionary(parentDict); return; @@ -28671,8 +30223,9 @@ var CFFParser = function CFFParserClosure() { var subrsIndex = this.parseIndex(relativeOffset); privateDict.subrsIndex = subrsIndex.obj; - }, - parseCharsets: function CFFParser_parseCharsets(pos, length, strings, cid) { + } + + parseCharsets(pos, length, strings, cid) { if (pos === 0) { return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, _charsets.ISOAdobeCharset); } else if (pos === 1) { @@ -28728,8 +30281,9 @@ var CFFParser = function CFFParserClosure() { var end = pos; var raw = bytes.subarray(start, end); return new CFFCharset(false, format, charset, raw); - }, - parseEncoding: function CFFParser_parseEncoding(pos, properties, strings, charset) { + } + + parseEncoding(pos, properties, strings, charset) { var encoding = Object.create(null); var bytes = this.bytes; var predefined = false; @@ -28803,8 +30357,9 @@ var CFFParser = function CFFParserClosure() { format = format & 0x7f; return new CFFEncoding(predefined, format, encoding, raw); - }, - parseFDSelect: function CFFParser_parseFDSelect(pos, length) { + } + + parseFDSelect(pos, length) { var bytes = this.bytes; var format = bytes[pos++]; var fdSelect = []; @@ -28851,14 +30406,16 @@ var CFFParser = function CFFParserClosure() { return new CFFFDSelect(format, fdSelect); } - }; + + } + return CFFParser; }(); exports.CFFParser = CFFParser; -var CFF = function CFFClosure() { - function CFF() { +class CFF { + constructor() { this.header = null; this.names = []; this.topDict = null; @@ -28872,124 +30429,120 @@ var CFF = function CFFClosure() { this.isCIDFont = false; } - CFF.prototype = { - duplicateFirstGlyph: function CFF_duplicateFirstGlyph() { - if (this.charStrings.count >= 65535) { - (0, _util.warn)("Not enough space in charstrings to duplicate first glyph."); - return; - } + duplicateFirstGlyph() { + if (this.charStrings.count >= 65535) { + (0, _util.warn)("Not enough space in charstrings to duplicate first glyph."); + return; + } - var glyphZero = this.charStrings.get(0); - this.charStrings.add(glyphZero); + var glyphZero = this.charStrings.get(0); + this.charStrings.add(glyphZero); - if (this.isCIDFont) { - this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]); - } - }, - hasGlyphId: function CFF_hasGlyphID(id) { - if (id < 0 || id >= this.charStrings.count) { - return false; - } + if (this.isCIDFont) { + this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]); + } + } - var glyph = this.charStrings.get(id); - return glyph.length > 0; + hasGlyphId(id) { + if (id < 0 || id >= this.charStrings.count) { + return false; } - }; - return CFF; -}(); + + var glyph = this.charStrings.get(id); + return glyph.length > 0; + } + +} exports.CFF = CFF; -var CFFHeader = function CFFHeaderClosure() { - function CFFHeader(major, minor, hdrSize, offSize) { +class CFFHeader { + constructor(major, minor, hdrSize, offSize) { this.major = major; this.minor = minor; this.hdrSize = hdrSize; this.offSize = offSize; } - return CFFHeader; -}(); +} exports.CFFHeader = CFFHeader; -var CFFStrings = function CFFStringsClosure() { - function CFFStrings() { +class CFFStrings { + constructor() { this.strings = []; } - CFFStrings.prototype = { - get: function CFFStrings_get(index) { - if (index >= 0 && index <= NUM_STANDARD_CFF_STRINGS - 1) { - return CFFStandardStrings[index]; - } - - if (index - NUM_STANDARD_CFF_STRINGS <= this.strings.length) { - return this.strings[index - NUM_STANDARD_CFF_STRINGS]; - } + get(index) { + if (index >= 0 && index <= NUM_STANDARD_CFF_STRINGS - 1) { + return CFFStandardStrings[index]; + } - return CFFStandardStrings[0]; - }, - getSID: function CFFStrings_getSID(str) { - let index = CFFStandardStrings.indexOf(str); + if (index - NUM_STANDARD_CFF_STRINGS <= this.strings.length) { + return this.strings[index - NUM_STANDARD_CFF_STRINGS]; + } - if (index !== -1) { - return index; - } + return CFFStandardStrings[0]; + } - index = this.strings.indexOf(str); + getSID(str) { + let index = CFFStandardStrings.indexOf(str); - if (index !== -1) { - return index + NUM_STANDARD_CFF_STRINGS; - } + if (index !== -1) { + return index; + } - return -1; - }, - add: function CFFStrings_add(value) { - this.strings.push(value); - }, + index = this.strings.indexOf(str); - get count() { - return this.strings.length; + if (index !== -1) { + return index + NUM_STANDARD_CFF_STRINGS; } - }; - return CFFStrings; -}(); + return -1; + } + + add(value) { + this.strings.push(value); + } + + get count() { + return this.strings.length; + } + +} exports.CFFStrings = CFFStrings; -var CFFIndex = function CFFIndexClosure() { - function CFFIndex() { +class CFFIndex { + constructor() { this.objects = []; this.length = 0; } - CFFIndex.prototype = { - add: function CFFIndex_add(data) { - this.length += data.length; - this.objects.push(data); - }, - set: function CFFIndex_set(index, data) { - this.length += data.length - this.objects[index].length; - this.objects[index] = data; - }, - get: function CFFIndex_get(index) { - return this.objects[index]; - }, + add(data) { + this.length += data.length; + this.objects.push(data); + } - get count() { - return this.objects.length; - } + set(index, data) { + this.length += data.length - this.objects[index].length; + this.objects[index] = data; + } - }; - return CFFIndex; -}(); + get(index) { + return this.objects[index]; + } + + get count() { + return this.objects.length; + } + +} exports.CFFIndex = CFFIndex; -var CFFDict = function CFFDictClosure() { - function CFFDict(tables, strings) { +class CFFDict { + constructor(tables, strings) { this.keyToNameMap = tables.keyToNameMap; this.nameToKeyMap = tables.nameToKeyMap; this.defaults = tables.defaults; @@ -29000,63 +30553,65 @@ var CFFDict = function CFFDictClosure() { this.values = Object.create(null); } - CFFDict.prototype = { - setByKey: function CFFDict_setByKey(key, value) { - if (!(key in this.keyToNameMap)) { - return false; - } + setByKey(key, value) { + if (!(key in this.keyToNameMap)) { + return false; + } - var valueLength = value.length; + var valueLength = value.length; - if (valueLength === 0) { + if (valueLength === 0) { + return true; + } + + for (var i = 0; i < valueLength; i++) { + if (isNaN(value[i])) { + (0, _util.warn)('Invalid CFFDict value: "' + value + '" for key "' + key + '".'); return true; } + } - for (var i = 0; i < valueLength; i++) { - if (isNaN(value[i])) { - (0, _util.warn)('Invalid CFFDict value: "' + value + '" for key "' + key + '".'); - return true; - } - } + var type = this.types[key]; - var type = this.types[key]; + if (type === "num" || type === "sid" || type === "offset") { + value = value[0]; + } - if (type === "num" || type === "sid" || type === "offset") { - value = value[0]; - } + this.values[key] = value; + return true; + } - this.values[key] = value; - return true; - }, - setByName: function CFFDict_setByName(name, value) { - if (!(name in this.nameToKeyMap)) { - throw new _util.FormatError(`Invalid dictionary name "${name}"`); - } + setByName(name, value) { + if (!(name in this.nameToKeyMap)) { + throw new _util.FormatError(`Invalid dictionary name "${name}"`); + } - this.values[this.nameToKeyMap[name]] = value; - }, - hasName: function CFFDict_hasName(name) { - return this.nameToKeyMap[name] in this.values; - }, - getByName: function CFFDict_getByName(name) { - if (!(name in this.nameToKeyMap)) { - throw new _util.FormatError(`Invalid dictionary name ${name}"`); - } + this.values[this.nameToKeyMap[name]] = value; + } + + hasName(name) { + return this.nameToKeyMap[name] in this.values; + } - var key = this.nameToKeyMap[name]; + getByName(name) { + if (!(name in this.nameToKeyMap)) { + throw new _util.FormatError(`Invalid dictionary name ${name}"`); + } - if (!(key in this.values)) { - return this.defaults[key]; - } + var key = this.nameToKeyMap[name]; - return this.values[key]; - }, - removeByName: function CFFDict_removeByName(name) { - delete this.values[this.nameToKeyMap[name]]; + if (!(key in this.values)) { + return this.defaults[key]; } - }; - CFFDict.createTables = function CFFDict_createTables(layout) { + return this.values[key]; + } + + removeByName(name) { + delete this.values[this.nameToKeyMap[name]]; + } + + static createTables(layout) { var tables = { keyToNameMap: {}, nameToKeyMap: {}, @@ -29078,25 +30633,26 @@ var CFFDict = function CFFDictClosure() { } return tables; - }; + } - return CFFDict; -}(); +} var CFFTopDict = function CFFTopDictClosure() { var layout = [[[12, 30], "ROS", ["sid", "sid", "num"], null], [[12, 20], "SyntheticBase", "num", null], [0, "version", "sid", null], [1, "Notice", "sid", null], [[12, 0], "Copyright", "sid", null], [2, "FullName", "sid", null], [3, "FamilyName", "sid", null], [4, "Weight", "sid", null], [[12, 1], "isFixedPitch", "num", 0], [[12, 2], "ItalicAngle", "num", 0], [[12, 3], "UnderlinePosition", "num", -100], [[12, 4], "UnderlineThickness", "num", 50], [[12, 5], "PaintType", "num", 0], [[12, 6], "CharstringType", "num", 2], [[12, 7], "FontMatrix", ["num", "num", "num", "num", "num", "num"], [0.001, 0, 0, 0.001, 0, 0]], [13, "UniqueID", "num", null], [5, "FontBBox", ["num", "num", "num", "num"], [0, 0, 0, 0]], [[12, 8], "StrokeWidth", "num", 0], [14, "XUID", "array", null], [15, "charset", "offset", 0], [16, "Encoding", "offset", 0], [17, "CharStrings", "offset", 0], [18, "Private", ["offset", "offset"], null], [[12, 21], "PostScript", "sid", null], [[12, 22], "BaseFontName", "sid", null], [[12, 23], "BaseFontBlend", "delta", null], [[12, 31], "CIDFontVersion", "num", 0], [[12, 32], "CIDFontRevision", "num", 0], [[12, 33], "CIDFontType", "num", 0], [[12, 34], "CIDCount", "num", 8720], [[12, 35], "UIDBase", "num", null], [[12, 37], "FDSelect", "offset", null], [[12, 36], "FDArray", "offset", null], [[12, 38], "FontName", "sid", null]]; var tables = null; - function CFFTopDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); + class CFFTopDict extends CFFDict { + constructor(strings) { + if (tables === null) { + tables = CFFDict.createTables(layout); + } + + super(tables, strings); + this.privateDict = null; } - CFFDict.call(this, tables, strings); - this.privateDict = null; } - CFFTopDict.prototype = Object.create(CFFDict.prototype); return CFFTopDict; }(); @@ -29106,16 +30662,18 @@ var CFFPrivateDict = function CFFPrivateDictClosure() { var layout = [[6, "BlueValues", "delta", null], [7, "OtherBlues", "delta", null], [8, "FamilyBlues", "delta", null], [9, "FamilyOtherBlues", "delta", null], [[12, 9], "BlueScale", "num", 0.039625], [[12, 10], "BlueShift", "num", 7], [[12, 11], "BlueFuzz", "num", 1], [10, "StdHW", "num", null], [11, "StdVW", "num", null], [[12, 12], "StemSnapH", "delta", null], [[12, 13], "StemSnapV", "delta", null], [[12, 14], "ForceBold", "num", 0], [[12, 17], "LanguageGroup", "num", 0], [[12, 18], "ExpansionFactor", "num", 0.06], [[12, 19], "initialRandomSeed", "num", 0], [20, "defaultWidthX", "num", 0], [21, "nominalWidthX", "num", 0], [19, "Subrs", "offset", null]]; var tables = null; - function CFFPrivateDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); + class CFFPrivateDict extends CFFDict { + constructor(strings) { + if (tables === null) { + tables = CFFDict.createTables(layout); + } + + super(tables, strings); + this.subrsIndex = null; } - CFFDict.call(this, tables, strings); - this.subrsIndex = null; } - CFFPrivateDict.prototype = Object.create(CFFDict.prototype); return CFFPrivateDict; }(); @@ -29126,584 +30684,598 @@ var CFFCharsetPredefinedTypes = { EXPERT_SUBSET: 2 }; -var CFFCharset = function CFFCharsetClosure() { - function CFFCharset(predefined, format, charset, raw) { +class CFFCharset { + constructor(predefined, format, charset, raw) { this.predefined = predefined; this.format = format; this.charset = charset; this.raw = raw; } - return CFFCharset; -}(); +} exports.CFFCharset = CFFCharset; -var CFFEncoding = function CFFEncodingClosure() { - function CFFEncoding(predefined, format, encoding, raw) { +class CFFEncoding { + constructor(predefined, format, encoding, raw) { this.predefined = predefined; this.format = format; this.encoding = encoding; this.raw = raw; } - return CFFEncoding; -}(); +} -var CFFFDSelect = function CFFFDSelectClosure() { - function CFFFDSelect(format, fdSelect) { +class CFFFDSelect { + constructor(format, fdSelect) { this.format = format; this.fdSelect = fdSelect; } - CFFFDSelect.prototype = { - getFDIndex: function CFFFDSelect_get(glyphIndex) { - if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { - return -1; - } - - return this.fdSelect[glyphIndex]; + getFDIndex(glyphIndex) { + if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { + return -1; } - }; - return CFFFDSelect; -}(); + + return this.fdSelect[glyphIndex]; + } + +} exports.CFFFDSelect = CFFFDSelect; -var CFFOffsetTracker = function CFFOffsetTrackerClosure() { - function CFFOffsetTracker() { +class CFFOffsetTracker { + constructor() { this.offsets = Object.create(null); } - CFFOffsetTracker.prototype = { - isTracking: function CFFOffsetTracker_isTracking(key) { - return key in this.offsets; - }, - track: function CFFOffsetTracker_track(key, location) { - if (key in this.offsets) { - throw new _util.FormatError(`Already tracking location of ${key}`); - } + isTracking(key) { + return key in this.offsets; + } - this.offsets[key] = location; - }, - offset: function CFFOffsetTracker_offset(value) { - for (var key in this.offsets) { - this.offsets[key] += value; - } - }, - setEntryLocation: function CFFOffsetTracker_setEntryLocation(key, values, output) { - if (!(key in this.offsets)) { - throw new _util.FormatError(`Not tracking location of ${key}`); - } + track(key, location) { + if (key in this.offsets) { + throw new _util.FormatError(`Already tracking location of ${key}`); + } - var data = output.data; - var dataOffset = this.offsets[key]; - var size = 5; + this.offsets[key] = location; + } - for (var i = 0, ii = values.length; i < ii; ++i) { - var offset0 = i * size + dataOffset; - var offset1 = offset0 + 1; - var offset2 = offset0 + 2; - var offset3 = offset0 + 3; - var offset4 = offset0 + 4; + offset(value) { + for (var key in this.offsets) { + this.offsets[key] += value; + } + } - if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { - throw new _util.FormatError("writing to an offset that is not empty"); - } + setEntryLocation(key, values, output) { + if (!(key in this.offsets)) { + throw new _util.FormatError(`Not tracking location of ${key}`); + } + + var data = output.data; + var dataOffset = this.offsets[key]; + var size = 5; + + for (var i = 0, ii = values.length; i < ii; ++i) { + var offset0 = i * size + dataOffset; + var offset1 = offset0 + 1; + var offset2 = offset0 + 2; + var offset3 = offset0 + 3; + var offset4 = offset0 + 4; - var value = values[i]; - data[offset0] = 0x1d; - data[offset1] = value >> 24 & 0xff; - data[offset2] = value >> 16 & 0xff; - data[offset3] = value >> 8 & 0xff; - data[offset4] = value & 0xff; + if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { + throw new _util.FormatError("writing to an offset that is not empty"); } + + var value = values[i]; + data[offset0] = 0x1d; + data[offset1] = value >> 24 & 0xff; + data[offset2] = value >> 16 & 0xff; + data[offset3] = value >> 8 & 0xff; + data[offset4] = value & 0xff; } - }; - return CFFOffsetTracker; -}(); + } + +} -var CFFCompiler = function CFFCompilerClosure() { - function CFFCompiler(cff) { +class CFFCompiler { + constructor(cff) { this.cff = cff; } - CFFCompiler.prototype = { - compile: function CFFCompiler_compile() { - var cff = this.cff; - var output = { - data: [], - length: 0, - add: function CFFCompiler_add(data) { - this.data = this.data.concat(data); - this.length = this.data.length; - } - }; - var header = this.compileHeader(cff.header); - output.add(header); - var nameIndex = this.compileNameIndex(cff.names); - output.add(nameIndex); - - if (cff.isCIDFont) { - if (cff.topDict.hasName("FontMatrix")) { - var base = cff.topDict.getByName("FontMatrix"); - cff.topDict.removeByName("FontMatrix"); + compile() { + var cff = this.cff; + var output = { + data: [], + length: 0, + add: function CFFCompiler_add(data) { + this.data = this.data.concat(data); + this.length = this.data.length; + } + }; + var header = this.compileHeader(cff.header); + output.add(header); + var nameIndex = this.compileNameIndex(cff.names); + output.add(nameIndex); - for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { - var subDict = cff.fdArray[i]; - var matrix = base.slice(0); + if (cff.isCIDFont) { + if (cff.topDict.hasName("FontMatrix")) { + var base = cff.topDict.getByName("FontMatrix"); + cff.topDict.removeByName("FontMatrix"); - if (subDict.hasName("FontMatrix")) { - matrix = _util.Util.transform(matrix, subDict.getByName("FontMatrix")); - } + for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { + var subDict = cff.fdArray[i]; + var matrix = base.slice(0); - subDict.setByName("FontMatrix", matrix); + if (subDict.hasName("FontMatrix")) { + matrix = _util.Util.transform(matrix, subDict.getByName("FontMatrix")); } - } - } - cff.topDict.setByName("charset", 0); - var compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); - output.add(compiled.output); - var topDictTracker = compiled.trackers[0]; - var stringIndex = this.compileStringIndex(cff.strings.strings); - output.add(stringIndex); - var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); - output.add(globalSubrIndex); - - if (cff.encoding && cff.topDict.hasName("Encoding")) { - if (cff.encoding.predefined) { - topDictTracker.setEntryLocation("Encoding", [cff.encoding.format], output); - } else { - var encoding = this.compileEncoding(cff.encoding); - topDictTracker.setEntryLocation("Encoding", [output.length], output); - output.add(encoding); + subDict.setByName("FontMatrix", matrix); } } + } - var charset = this.compileCharset(cff.charset, cff.charStrings.count, cff.strings, cff.isCIDFont); - topDictTracker.setEntryLocation("charset", [output.length], output); - output.add(charset); - var charStrings = this.compileCharStrings(cff.charStrings); - topDictTracker.setEntryLocation("CharStrings", [output.length], output); - output.add(charStrings); + cff.topDict.setByName("charset", 0); + var compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); + output.add(compiled.output); + var topDictTracker = compiled.trackers[0]; + var stringIndex = this.compileStringIndex(cff.strings.strings); + output.add(stringIndex); + var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); + output.add(globalSubrIndex); - if (cff.isCIDFont) { - topDictTracker.setEntryLocation("FDSelect", [output.length], output); - var fdSelect = this.compileFDSelect(cff.fdSelect); - output.add(fdSelect); - compiled = this.compileTopDicts(cff.fdArray, output.length, true); - topDictTracker.setEntryLocation("FDArray", [output.length], output); - output.add(compiled.output); - var fontDictTrackers = compiled.trackers; - this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); - } - - this.compilePrivateDicts([cff.topDict], [topDictTracker], output); - output.add([0]); - return output.data; - }, - encodeNumber: function CFFCompiler_encodeNumber(value) { - if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { - return this.encodeInteger(value); + if (cff.encoding && cff.topDict.hasName("Encoding")) { + if (cff.encoding.predefined) { + topDictTracker.setEntryLocation("Encoding", [cff.encoding.format], output); + } else { + var encoding = this.compileEncoding(cff.encoding); + topDictTracker.setEntryLocation("Encoding", [output.length], output); + output.add(encoding); } + } - return this.encodeFloat(value); - }, - encodeFloat: function CFFCompiler_encodeFloat(num) { - var value = num.toString(); - var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); + var charset = this.compileCharset(cff.charset, cff.charStrings.count, cff.strings, cff.isCIDFont); + topDictTracker.setEntryLocation("charset", [output.length], output); + output.add(charset); + var charStrings = this.compileCharStrings(cff.charStrings); + topDictTracker.setEntryLocation("CharStrings", [output.length], output); + output.add(charStrings); - if (m) { - var epsilon = parseFloat("1e" + ((m[2] ? +m[2] : 0) + m[1].length)); - value = (Math.round(num * epsilon) / epsilon).toString(); - } + if (cff.isCIDFont) { + topDictTracker.setEntryLocation("FDSelect", [output.length], output); + var fdSelect = this.compileFDSelect(cff.fdSelect); + output.add(fdSelect); + compiled = this.compileTopDicts(cff.fdArray, output.length, true); + topDictTracker.setEntryLocation("FDArray", [output.length], output); + output.add(compiled.output); + var fontDictTrackers = compiled.trackers; + this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); + } - var nibbles = ""; - var i, ii; + this.compilePrivateDicts([cff.topDict], [topDictTracker], output); + output.add([0]); + return output.data; + } - for (i = 0, ii = value.length; i < ii; ++i) { - var a = value[i]; + encodeNumber(value) { + if (Number.isInteger(value)) { + return this.encodeInteger(value); + } - if (a === "e") { - nibbles += value[++i] === "-" ? "c" : "b"; - } else if (a === ".") { - nibbles += "a"; - } else if (a === "-") { - nibbles += "e"; - } else { - nibbles += a; - } - } + return this.encodeFloat(value); + } - nibbles += nibbles.length & 1 ? "f" : "ff"; - var out = [30]; + static get EncodeFloatRegExp() { + return (0, _util.shadow)(this, "EncodeFloatRegExp", /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/); + } - for (i = 0, ii = nibbles.length; i < ii; i += 2) { - out.push(parseInt(nibbles.substring(i, i + 2), 16)); - } + encodeFloat(num) { + var value = num.toString(); + var m = CFFCompiler.EncodeFloatRegExp.exec(value); - return out; - }, - encodeInteger: function CFFCompiler_encodeInteger(value) { - var code; + if (m) { + var epsilon = parseFloat("1e" + ((m[2] ? +m[2] : 0) + m[1].length)); + value = (Math.round(num * epsilon) / epsilon).toString(); + } + + var nibbles = ""; + var i, ii; + + for (i = 0, ii = value.length; i < ii; ++i) { + var a = value[i]; - if (value >= -107 && value <= 107) { - code = [value + 139]; - } else if (value >= 108 && value <= 1131) { - value = value - 108; - code = [(value >> 8) + 247, value & 0xff]; - } else if (value >= -1131 && value <= -108) { - value = -value - 108; - code = [(value >> 8) + 251, value & 0xff]; - } else if (value >= -32768 && value <= 32767) { - code = [0x1c, value >> 8 & 0xff, value & 0xff]; + if (a === "e") { + nibbles += value[++i] === "-" ? "c" : "b"; + } else if (a === ".") { + nibbles += "a"; + } else if (a === "-") { + nibbles += "e"; } else { - code = [0x1d, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff]; + nibbles += a; } + } - return code; - }, - compileHeader: function CFFCompiler_compileHeader(header) { - return [header.major, header.minor, header.hdrSize, header.offSize]; - }, - compileNameIndex: function CFFCompiler_compileNameIndex(names) { - var nameIndex = new CFFIndex(); + nibbles += nibbles.length & 1 ? "f" : "ff"; + var out = [30]; - for (var i = 0, ii = names.length; i < ii; ++i) { - var name = names[i]; - var length = Math.min(name.length, 127); - var sanitizedName = new Array(length); + for (i = 0, ii = nibbles.length; i < ii; i += 2) { + out.push(parseInt(nibbles.substring(i, i + 2), 16)); + } - for (var j = 0; j < length; j++) { - var char = name[j]; + return out; + } - if (char < "!" || char > "~" || char === "[" || char === "]" || char === "(" || char === ")" || char === "{" || char === "}" || char === "<" || char === ">" || char === "/" || char === "%") { - char = "_"; - } + encodeInteger(value) { + var code; - sanitizedName[j] = char; - } + if (value >= -107 && value <= 107) { + code = [value + 139]; + } else if (value >= 108 && value <= 1131) { + value = value - 108; + code = [(value >> 8) + 247, value & 0xff]; + } else if (value >= -1131 && value <= -108) { + value = -value - 108; + code = [(value >> 8) + 251, value & 0xff]; + } else if (value >= -32768 && value <= 32767) { + code = [0x1c, value >> 8 & 0xff, value & 0xff]; + } else { + code = [0x1d, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff]; + } + + return code; + } + + compileHeader(header) { + return [header.major, header.minor, header.hdrSize, header.offSize]; + } - sanitizedName = sanitizedName.join(""); + compileNameIndex(names) { + var nameIndex = new CFFIndex(); - if (sanitizedName === "") { - sanitizedName = "Bad_Font_Name"; + for (var i = 0, ii = names.length; i < ii; ++i) { + var name = names[i]; + var length = Math.min(name.length, 127); + var sanitizedName = new Array(length); + + for (var j = 0; j < length; j++) { + var char = name[j]; + + if (char < "!" || char > "~" || char === "[" || char === "]" || char === "(" || char === ")" || char === "{" || char === "}" || char === "<" || char === ">" || char === "/" || char === "%") { + char = "_"; } - nameIndex.add((0, _util.stringToBytes)(sanitizedName)); + sanitizedName[j] = char; } - return this.compileIndex(nameIndex); - }, - compileTopDicts: function CFFCompiler_compileTopDicts(dicts, length, removeCidKeys) { - var fontDictTrackers = []; - var fdArrayIndex = new CFFIndex(); + sanitizedName = sanitizedName.join(""); - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; + if (sanitizedName === "") { + sanitizedName = "Bad_Font_Name"; + } - if (removeCidKeys) { - fontDict.removeByName("CIDFontVersion"); - fontDict.removeByName("CIDFontRevision"); - fontDict.removeByName("CIDFontType"); - fontDict.removeByName("CIDCount"); - fontDict.removeByName("UIDBase"); - } + nameIndex.add((0, _util.stringToBytes)(sanitizedName)); + } - var fontDictTracker = new CFFOffsetTracker(); - var fontDictData = this.compileDict(fontDict, fontDictTracker); - fontDictTrackers.push(fontDictTracker); - fdArrayIndex.add(fontDictData); - fontDictTracker.offset(length); + return this.compileIndex(nameIndex); + } + + compileTopDicts(dicts, length, removeCidKeys) { + var fontDictTrackers = []; + var fdArrayIndex = new CFFIndex(); + + for (var i = 0, ii = dicts.length; i < ii; ++i) { + var fontDict = dicts[i]; + + if (removeCidKeys) { + fontDict.removeByName("CIDFontVersion"); + fontDict.removeByName("CIDFontRevision"); + fontDict.removeByName("CIDFontType"); + fontDict.removeByName("CIDCount"); + fontDict.removeByName("UIDBase"); } - fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); - return { - trackers: fontDictTrackers, - output: fdArrayIndex - }; - }, - compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts, trackers, output) { - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; - var privateDict = fontDict.privateDict; + var fontDictTracker = new CFFOffsetTracker(); + var fontDictData = this.compileDict(fontDict, fontDictTracker); + fontDictTrackers.push(fontDictTracker); + fdArrayIndex.add(fontDictData); + fontDictTracker.offset(length); + } - if (!privateDict || !fontDict.hasName("Private")) { - throw new _util.FormatError("There must be a private dictionary."); - } + fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); + return { + trackers: fontDictTrackers, + output: fdArrayIndex + }; + } - var privateDictTracker = new CFFOffsetTracker(); - var privateDictData = this.compileDict(privateDict, privateDictTracker); - var outputLength = output.length; - privateDictTracker.offset(outputLength); + compilePrivateDicts(dicts, trackers, output) { + for (var i = 0, ii = dicts.length; i < ii; ++i) { + var fontDict = dicts[i]; + var privateDict = fontDict.privateDict; - if (!privateDictData.length) { - outputLength = 0; - } + if (!privateDict || !fontDict.hasName("Private")) { + throw new _util.FormatError("There must be a private dictionary."); + } - trackers[i].setEntryLocation("Private", [privateDictData.length, outputLength], output); - output.add(privateDictData); + var privateDictTracker = new CFFOffsetTracker(); + var privateDictData = this.compileDict(privateDict, privateDictTracker); + var outputLength = output.length; + privateDictTracker.offset(outputLength); - if (privateDict.subrsIndex && privateDict.hasName("Subrs")) { - var subrs = this.compileIndex(privateDict.subrsIndex); - privateDictTracker.setEntryLocation("Subrs", [privateDictData.length], output); - output.add(subrs); - } + if (!privateDictData.length) { + outputLength = 0; } - }, - compileDict: function CFFCompiler_compileDict(dict, offsetTracker) { - var out = []; - var order = dict.order; - for (var i = 0; i < order.length; ++i) { - var key = order[i]; + trackers[i].setEntryLocation("Private", [privateDictData.length, outputLength], output); + output.add(privateDictData); - if (!(key in dict.values)) { - continue; - } + if (privateDict.subrsIndex && privateDict.hasName("Subrs")) { + var subrs = this.compileIndex(privateDict.subrsIndex); + privateDictTracker.setEntryLocation("Subrs", [privateDictData.length], output); + output.add(subrs); + } + } + } - var values = dict.values[key]; - var types = dict.types[key]; + compileDict(dict, offsetTracker) { + var out = []; + var order = dict.order; - if (!Array.isArray(types)) { - types = [types]; - } + for (var i = 0; i < order.length; ++i) { + var key = order[i]; - if (!Array.isArray(values)) { - values = [values]; - } + if (!(key in dict.values)) { + continue; + } - if (values.length === 0) { - continue; - } + var values = dict.values[key]; + var types = dict.types[key]; - for (var j = 0, jj = types.length; j < jj; ++j) { - var type = types[j]; - var value = values[j]; + if (!Array.isArray(types)) { + types = [types]; + } - switch (type) { - case "num": - case "sid": - out = out.concat(this.encodeNumber(value)); - break; + if (!Array.isArray(values)) { + values = [values]; + } + + if (values.length === 0) { + continue; + } - case "offset": - var name = dict.keyToNameMap[key]; + for (var j = 0, jj = types.length; j < jj; ++j) { + var type = types[j]; + var value = values[j]; - if (!offsetTracker.isTracking(name)) { - offsetTracker.track(name, out.length); - } + switch (type) { + case "num": + case "sid": + out = out.concat(this.encodeNumber(value)); + break; - out = out.concat([0x1d, 0, 0, 0, 0]); - break; + case "offset": + var name = dict.keyToNameMap[key]; - case "array": - case "delta": - out = out.concat(this.encodeNumber(value)); + if (!offsetTracker.isTracking(name)) { + offsetTracker.track(name, out.length); + } - for (var k = 1, kk = values.length; k < kk; ++k) { - out = out.concat(this.encodeNumber(values[k])); - } + out = out.concat([0x1d, 0, 0, 0, 0]); + break; - break; + case "array": + case "delta": + out = out.concat(this.encodeNumber(value)); - default: - throw new _util.FormatError(`Unknown data type of ${type}`); - } - } + for (var k = 1, kk = values.length; k < kk; ++k) { + out = out.concat(this.encodeNumber(values[k])); + } + + break; - out = out.concat(dict.opcodes[key]); + default: + throw new _util.FormatError(`Unknown data type of ${type}`); + } } - return out; - }, - compileStringIndex: function CFFCompiler_compileStringIndex(strings) { - var stringIndex = new CFFIndex(); + out = out.concat(dict.opcodes[key]); + } - for (var i = 0, ii = strings.length; i < ii; ++i) { - stringIndex.add((0, _util.stringToBytes)(strings[i])); - } + return out; + } - return this.compileIndex(stringIndex); - }, - compileGlobalSubrIndex: function CFFCompiler_compileGlobalSubrIndex() { - var globalSubrIndex = this.cff.globalSubrIndex; - this.out.writeByteArray(this.compileIndex(globalSubrIndex)); - }, - compileCharStrings: function CFFCompiler_compileCharStrings(charStrings) { - var charStringsIndex = new CFFIndex(); + compileStringIndex(strings) { + var stringIndex = new CFFIndex(); - for (var i = 0; i < charStrings.count; i++) { - var glyph = charStrings.get(i); + for (var i = 0, ii = strings.length; i < ii; ++i) { + stringIndex.add((0, _util.stringToBytes)(strings[i])); + } - if (glyph.length === 0) { - charStringsIndex.add(new Uint8Array([0x8b, 0x0e])); - continue; - } + return this.compileIndex(stringIndex); + } + + compileGlobalSubrIndex() { + var globalSubrIndex = this.cff.globalSubrIndex; + this.out.writeByteArray(this.compileIndex(globalSubrIndex)); + } - charStringsIndex.add(glyph); + compileCharStrings(charStrings) { + var charStringsIndex = new CFFIndex(); + + for (var i = 0; i < charStrings.count; i++) { + var glyph = charStrings.get(i); + + if (glyph.length === 0) { + charStringsIndex.add(new Uint8Array([0x8b, 0x0e])); + continue; } - return this.compileIndex(charStringsIndex); - }, - compileCharset: function CFFCompiler_compileCharset(charset, numGlyphs, strings, isCIDFont) { - let out; - const numGlyphsLessNotDef = numGlyphs - 1; + charStringsIndex.add(glyph); + } - if (isCIDFont) { - out = new Uint8Array([2, 0, 0, numGlyphsLessNotDef >> 8 & 0xff, numGlyphsLessNotDef & 0xff]); - } else { - const length = 1 + numGlyphsLessNotDef * 2; - out = new Uint8Array(length); - out[0] = 0; - let charsetIndex = 0; - const numCharsets = charset.charset.length; - let warned = false; - - for (let i = 1; i < out.length; i += 2) { - let sid = 0; - - if (charsetIndex < numCharsets) { - const name = charset.charset[charsetIndex++]; - sid = strings.getSID(name); - - if (sid === -1) { - sid = 0; - - if (!warned) { - warned = true; - (0, _util.warn)(`Couldn't find ${name} in CFF strings`); - } + return this.compileIndex(charStringsIndex); + } + + compileCharset(charset, numGlyphs, strings, isCIDFont) { + let out; + const numGlyphsLessNotDef = numGlyphs - 1; + + if (isCIDFont) { + out = new Uint8Array([2, 0, 0, numGlyphsLessNotDef >> 8 & 0xff, numGlyphsLessNotDef & 0xff]); + } else { + const length = 1 + numGlyphsLessNotDef * 2; + out = new Uint8Array(length); + out[0] = 0; + let charsetIndex = 0; + const numCharsets = charset.charset.length; + let warned = false; + + for (let i = 1; i < out.length; i += 2) { + let sid = 0; + + if (charsetIndex < numCharsets) { + const name = charset.charset[charsetIndex++]; + sid = strings.getSID(name); + + if (sid === -1) { + sid = 0; + + if (!warned) { + warned = true; + (0, _util.warn)(`Couldn't find ${name} in CFF strings`); } } - - out[i] = sid >> 8 & 0xff; - out[i + 1] = sid & 0xff; } + + out[i] = sid >> 8 & 0xff; + out[i + 1] = sid & 0xff; } + } - return this.compileTypedArray(out); - }, - compileEncoding: function CFFCompiler_compileEncoding(encoding) { - return this.compileTypedArray(encoding.raw); - }, - compileFDSelect: function CFFCompiler_compileFDSelect(fdSelect) { - const format = fdSelect.format; - let out, i; + return this.compileTypedArray(out); + } - switch (format) { - case 0: - out = new Uint8Array(1 + fdSelect.fdSelect.length); - out[0] = format; + compileEncoding(encoding) { + return this.compileTypedArray(encoding.raw); + } - for (i = 0; i < fdSelect.fdSelect.length; i++) { - out[i + 1] = fdSelect.fdSelect[i]; - } + compileFDSelect(fdSelect) { + const format = fdSelect.format; + let out, i; - break; + switch (format) { + case 0: + out = new Uint8Array(1 + fdSelect.fdSelect.length); + out[0] = format; - case 3: - const start = 0; - let lastFD = fdSelect.fdSelect[0]; - const ranges = [format, 0, 0, start >> 8 & 0xff, start & 0xff, lastFD]; + for (i = 0; i < fdSelect.fdSelect.length; i++) { + out[i + 1] = fdSelect.fdSelect[i]; + } - for (i = 1; i < fdSelect.fdSelect.length; i++) { - const currentFD = fdSelect.fdSelect[i]; + break; - if (currentFD !== lastFD) { - ranges.push(i >> 8 & 0xff, i & 0xff, currentFD); - lastFD = currentFD; - } + case 3: + const start = 0; + let lastFD = fdSelect.fdSelect[0]; + const ranges = [format, 0, 0, start >> 8 & 0xff, start & 0xff, lastFD]; + + for (i = 1; i < fdSelect.fdSelect.length; i++) { + const currentFD = fdSelect.fdSelect[i]; + + if (currentFD !== lastFD) { + ranges.push(i >> 8 & 0xff, i & 0xff, currentFD); + lastFD = currentFD; } + } - const numRanges = (ranges.length - 3) / 3; - ranges[1] = numRanges >> 8 & 0xff; - ranges[2] = numRanges & 0xff; - ranges.push(i >> 8 & 0xff, i & 0xff); - out = new Uint8Array(ranges); - break; - } + const numRanges = (ranges.length - 3) / 3; + ranges[1] = numRanges >> 8 & 0xff; + ranges[2] = numRanges & 0xff; + ranges.push(i >> 8 & 0xff, i & 0xff); + out = new Uint8Array(ranges); + break; + } - return this.compileTypedArray(out); - }, - compileTypedArray: function CFFCompiler_compileTypedArray(data) { - var out = []; + return this.compileTypedArray(out); + } - for (var i = 0, ii = data.length; i < ii; ++i) { - out[i] = data[i]; - } + compileTypedArray(data) { + var out = []; - return out; - }, - compileIndex: function CFFCompiler_compileIndex(index, trackers) { - trackers = trackers || []; - var objects = index.objects; - var count = objects.length; + for (var i = 0, ii = data.length; i < ii; ++i) { + out[i] = data[i]; + } - if (count === 0) { - return [0, 0, 0]; - } + return out; + } - var data = [count >> 8 & 0xff, count & 0xff]; - var lastOffset = 1, - i; + compileIndex(index, trackers = []) { + var objects = index.objects; + var count = objects.length; - for (i = 0; i < count; ++i) { - lastOffset += objects[i].length; - } + if (count === 0) { + return [0, 0, 0]; + } - var offsetSize; + var data = [count >> 8 & 0xff, count & 0xff]; + var lastOffset = 1, + i; - if (lastOffset < 0x100) { - offsetSize = 1; - } else if (lastOffset < 0x10000) { - offsetSize = 2; - } else if (lastOffset < 0x1000000) { - offsetSize = 3; - } else { - offsetSize = 4; - } + for (i = 0; i < count; ++i) { + lastOffset += objects[i].length; + } - data.push(offsetSize); - var relativeOffset = 1; + var offsetSize; - for (i = 0; i < count + 1; i++) { - if (offsetSize === 1) { - data.push(relativeOffset & 0xff); - } else if (offsetSize === 2) { - data.push(relativeOffset >> 8 & 0xff, relativeOffset & 0xff); - } else if (offsetSize === 3) { - data.push(relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); - } else { - data.push(relativeOffset >>> 24 & 0xff, relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); - } + if (lastOffset < 0x100) { + offsetSize = 1; + } else if (lastOffset < 0x10000) { + offsetSize = 2; + } else if (lastOffset < 0x1000000) { + offsetSize = 3; + } else { + offsetSize = 4; + } - if (objects[i]) { - relativeOffset += objects[i].length; - } + data.push(offsetSize); + var relativeOffset = 1; + + for (i = 0; i < count + 1; i++) { + if (offsetSize === 1) { + data.push(relativeOffset & 0xff); + } else if (offsetSize === 2) { + data.push(relativeOffset >> 8 & 0xff, relativeOffset & 0xff); + } else if (offsetSize === 3) { + data.push(relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); + } else { + data.push(relativeOffset >>> 24 & 0xff, relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); } - for (i = 0; i < count; i++) { - if (trackers[i]) { - trackers[i].offset(data.length); - } + if (objects[i]) { + relativeOffset += objects[i].length; + } + } - for (var j = 0, jj = objects[i].length; j < jj; j++) { - data.push(objects[i][j]); - } + for (i = 0; i < count; i++) { + if (trackers[i]) { + trackers[i].offset(data.length); } - return data; + for (var j = 0, jj = objects[i].length; j < jj; j++) { + data.push(objects[i][j]); + } } - }; - return CFFCompiler; -}(); + + return data; + } + +} exports.CFFCompiler = CFFCompiler; /***/ }), -/* 31 */ +/* 32 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -29721,7 +31293,7 @@ const ExpertSubsetCharset = [".notdef", "space", "dollaroldstyle", "dollarsuperi exports.ExpertSubsetCharset = ExpertSubsetCharset; /***/ }), -/* 32 */ +/* 33 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -29775,7 +31347,7 @@ function getEncoding(encodingName) { } /***/ }), -/* 33 */ +/* 34 */ /***/ (function(module, exports, __w_pdfjs_require__) { var getLookupTableFactory = __w_pdfjs_require__(8).getLookupTableFactory; @@ -34312,7 +35884,7 @@ exports.getGlyphsUnicode = getGlyphsUnicode; exports.getDingbatsGlyphsUnicode = getDingbatsGlyphsUnicode; /***/ }), -/* 34 */ +/* 35 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -35056,7 +36628,7 @@ const getSupplementalGlyphMapForCalibri = (0, _core_utils.getLookupTableFactory) exports.getSupplementalGlyphMapForCalibri = getSupplementalGlyphMapForCalibri; /***/ }), -/* 35 */ +/* 36 */ /***/ (function(module, exports, __w_pdfjs_require__) { var getLookupTableFactory = __w_pdfjs_require__(8).getLookupTableFactory; @@ -37033,7 +38605,7 @@ exports.getNormalizedUnicodes = getNormalizedUnicodes; exports.getUnicodeForGlyph = getUnicodeForGlyph; /***/ }), -/* 36 */ +/* 37 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -37046,11 +38618,11 @@ exports.FontRendererFactory = void 0; var _util = __w_pdfjs_require__(2); -var _cff_parser = __w_pdfjs_require__(30); +var _cff_parser = __w_pdfjs_require__(31); -var _glyphlist = __w_pdfjs_require__(33); +var _glyphlist = __w_pdfjs_require__(34); -var _encodings = __w_pdfjs_require__(32); +var _encodings = __w_pdfjs_require__(33); var _stream = __w_pdfjs_require__(12); @@ -37999,7 +39571,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() { exports.FontRendererFactory = FontRendererFactory; /***/ }), -/* 37 */ +/* 38 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -38010,7 +39582,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.Type1Parser = void 0; -var _encodings = __w_pdfjs_require__(32); +var _encodings = __w_pdfjs_require__(33); var _core_utils = __w_pdfjs_require__(8); @@ -38201,7 +39773,9 @@ var Type1CharString = function Type1CharStringClosure() { case (12 << 8) + 6: if (seacAnalysisEnabled) { + const asb = this.stack[this.stack.length - 5]; this.seac = this.stack.splice(-4, 4); + this.seac[0] += this.lsb - asb; error = this.executeCommand(0, COMMAND_MAP.endchar); } else { error = this.executeCommand(4, COMMAND_MAP.endchar); @@ -38710,7 +40284,7 @@ var Type1Parser = function Type1ParserClosure() { exports.Type1Parser = Type1Parser; /***/ }), -/* 38 */ +/* 39 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -38751,7 +40325,7 @@ var Pattern = function PatternClosure() { } }; - Pattern.parseShading = function (shading, matrix, xref, res, handler, pdfFunctionFactory) { + Pattern.parseShading = function (shading, matrix, xref, res, handler, pdfFunctionFactory, localColorSpaceCache) { var dict = (0, _primitives.isStream)(shading) ? shading.dict : shading; var type = dict.get("ShadingType"); @@ -38759,13 +40333,13 @@ var Pattern = function PatternClosure() { switch (type) { case ShadingType.AXIAL: case ShadingType.RADIAL: - return new Shadings.RadialAxial(dict, matrix, xref, res, pdfFunctionFactory); + return new Shadings.RadialAxial(dict, matrix, xref, res, pdfFunctionFactory, localColorSpaceCache); case ShadingType.FREE_FORM_MESH: case ShadingType.LATTICE_FORM_MESH: case ShadingType.COONS_PATCH_MESH: case ShadingType.TENSOR_PATCH_MESH: - return new Shadings.Mesh(shading, matrix, xref, res, pdfFunctionFactory); + return new Shadings.Mesh(shading, matrix, xref, res, pdfFunctionFactory, localColorSpaceCache); default: throw new _util.FormatError("Unsupported ShadingType: " + type); @@ -38791,13 +40365,20 @@ var Shadings = {}; Shadings.SMALL_NUMBER = 1e-6; Shadings.RadialAxial = function RadialAxialClosure() { - function RadialAxial(dict, matrix, xref, res, pdfFunctionFactory) { + function RadialAxial(dict, matrix, xref, resources, pdfFunctionFactory, localColorSpaceCache) { this.matrix = matrix; this.coordsArr = dict.getArray("Coords"); this.shadingType = dict.get("ShadingType"); this.type = "Pattern"; - var cs = dict.get("ColorSpace", "CS"); - cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); + + const cs = _colorspace.ColorSpace.parse({ + cs: dict.getRaw("ColorSpace") || dict.getRaw("CS"), + xref, + resources, + pdfFunctionFactory, + localColorSpaceCache + }); + this.cs = cs; const bbox = dict.getArray("BBox"); @@ -38841,7 +40422,7 @@ Shadings.RadialAxial = function RadialAxialClosure() { this.extendStart = extendStart; this.extendEnd = extendEnd; - var fnObj = dict.get("Function"); + var fnObj = dict.getRaw("Function"); var fn = pdfFunctionFactory.createFromArray(fnObj); const NUMBER_OF_SAMPLES = 10; const step = (t1 - t0) / NUMBER_OF_SAMPLES; @@ -39530,7 +41111,7 @@ Shadings.Mesh = function MeshClosure() { } } - function Mesh(stream, matrix, xref, res, pdfFunctionFactory) { + function Mesh(stream, matrix, xref, resources, pdfFunctionFactory, localColorSpaceCache) { if (!(0, _primitives.isStream)(stream)) { throw new _util.FormatError("Mesh data is not a stream"); } @@ -39547,11 +41128,17 @@ Shadings.Mesh = function MeshClosure() { this.bbox = null; } - var cs = dict.get("ColorSpace", "CS"); - cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); + const cs = _colorspace.ColorSpace.parse({ + cs: dict.getRaw("ColorSpace") || dict.getRaw("CS"), + xref, + resources, + pdfFunctionFactory, + localColorSpaceCache + }); + this.cs = cs; this.background = dict.has("Background") ? cs.getRgb(dict.get("Background"), 0) : null; - var fnObj = dict.get("Function"); + var fnObj = dict.getRaw("Function"); var fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null; this.coords = []; this.colors = []; @@ -39649,7 +41236,7 @@ function getTilingPatternIR(operatorList, dict, args) { } /***/ }), -/* 39 */ +/* 40 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -39658,3585 +41245,392 @@ function getTilingPatternIR(operatorList, dict, args) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.bidi = bidi; +exports.isPDFFunction = isPDFFunction; +exports.PostScriptCompiler = exports.PostScriptEvaluator = exports.PDFFunctionFactory = void 0; -var _util = __w_pdfjs_require__(2); +var _primitives = __w_pdfjs_require__(5); -var baseTypes = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "ON", "ON", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "ON", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "ON", "ET", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "L", "ON", "ON", "BN", "ON", "ON", "ET", "ET", "EN", "EN", "ON", "L", "ON", "ON", "ON", "EN", "L", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L"]; -var arabicTypes = ["AN", "AN", "AN", "AN", "AN", "AN", "ON", "ON", "AL", "ET", "ET", "AL", "CS", "AL", "ON", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "ON", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL"]; +var _util = __w_pdfjs_require__(2); -function isOdd(i) { - return (i & 1) !== 0; -} +var _ps_parser = __w_pdfjs_require__(41); -function isEven(i) { - return (i & 1) === 0; -} +var _image_utils = __w_pdfjs_require__(24); -function findUnequal(arr, start, value) { - for (var j = start, jj = arr.length; j < jj; ++j) { - if (arr[j] !== value) { - return j; - } +class PDFFunctionFactory { + constructor({ + xref, + isEvalSupported = true + }) { + this.xref = xref; + this.isEvalSupported = isEvalSupported !== false; + this._localFunctionCache = null; } - return j; -} + create(fn) { + const cachedFunction = this.getCached(fn); -function setValues(arr, start, end, value) { - for (var j = start; j < end; ++j) { - arr[j] = value; - } -} + if (cachedFunction) { + return cachedFunction; + } -function reverseValues(arr, start, end) { - for (var i = start, j = end - 1; i < j; ++i, --j) { - var temp = arr[i]; - arr[i] = arr[j]; - arr[j] = temp; - } -} + const parsedFunction = PDFFunction.parse({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + fn: fn instanceof _primitives.Ref ? this.xref.fetch(fn) : fn + }); -function createBidiText(str, isLTR, vertical = false) { - let dir = "ltr"; + this._cache(fn, parsedFunction); - if (vertical) { - dir = "ttb"; - } else if (!isLTR) { - dir = "rtl"; + return parsedFunction; } - return { - str, - dir - }; -} + createFromArray(fnObj) { + const cachedFunction = this.getCached(fnObj); -var chars = []; -var types = []; + if (cachedFunction) { + return cachedFunction; + } -function bidi(str, startLevel, vertical) { - var isLTR = true; - var strLength = str.length; + const parsedFunction = PDFFunction.parseArray({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + fnObj: fnObj instanceof _primitives.Ref ? this.xref.fetch(fnObj) : fnObj + }); - if (strLength === 0 || vertical) { - return createBidiText(str, isLTR, vertical); - } + this._cache(fnObj, parsedFunction); - chars.length = strLength; - types.length = strLength; - var numBidi = 0; - var i, ii; + return parsedFunction; + } - for (i = 0; i < strLength; ++i) { - chars[i] = str.charAt(i); - var charCode = str.charCodeAt(i); - var charType = "L"; + getCached(cacheKey) { + let fnRef; - if (charCode <= 0x00ff) { - charType = baseTypes[charCode]; - } else if (0x0590 <= charCode && charCode <= 0x05f4) { - charType = "R"; - } else if (0x0600 <= charCode && charCode <= 0x06ff) { - charType = arabicTypes[charCode & 0xff]; + if (cacheKey instanceof _primitives.Ref) { + fnRef = cacheKey; + } else if (cacheKey instanceof _primitives.Dict) { + fnRef = cacheKey.objId; + } else if ((0, _primitives.isStream)(cacheKey)) { + fnRef = cacheKey.dict && cacheKey.dict.objId; + } - if (!charType) { - (0, _util.warn)("Bidi: invalid Unicode character " + charCode.toString(16)); + if (fnRef) { + if (!this._localFunctionCache) { + this._localFunctionCache = new _image_utils.LocalFunctionCache(); } - } else if (0x0700 <= charCode && charCode <= 0x08ac) { - charType = "AL"; - } - if (charType === "R" || charType === "AL" || charType === "AN") { - numBidi++; - } + const localFunction = this._localFunctionCache.getByRef(fnRef); - types[i] = charType; - } + if (localFunction) { + return localFunction; + } + } - if (numBidi === 0) { - isLTR = true; - return createBidiText(str, isLTR); + return null; } - if (startLevel === -1) { - if (numBidi / strLength < 0.3) { - isLTR = true; - startLevel = 0; - } else { - isLTR = false; - startLevel = 1; + _cache(cacheKey, parsedFunction) { + if (!parsedFunction) { + throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.'); } - } - var levels = []; + let fnRef; - for (i = 0; i < strLength; ++i) { - levels[i] = startLevel; - } + if (cacheKey instanceof _primitives.Ref) { + fnRef = cacheKey; + } else if (cacheKey instanceof _primitives.Dict) { + fnRef = cacheKey.objId; + } else if ((0, _primitives.isStream)(cacheKey)) { + fnRef = cacheKey.dict && cacheKey.dict.objId; + } - var e = isOdd(startLevel) ? "R" : "L"; - var sor = e; - var eor = sor; - var lastType = sor; + if (fnRef) { + if (!this._localFunctionCache) { + this._localFunctionCache = new _image_utils.LocalFunctionCache(); + } - for (i = 0; i < strLength; ++i) { - if (types[i] === "NSM") { - types[i] = lastType; - } else { - lastType = types[i]; + this._localFunctionCache.set(null, fnRef, parsedFunction); } } - lastType = sor; - var t; +} - for (i = 0; i < strLength; ++i) { - t = types[i]; +exports.PDFFunctionFactory = PDFFunctionFactory; - if (t === "EN") { - types[i] = lastType === "AL" ? "AN" : "EN"; - } else if (t === "R" || t === "L" || t === "AL") { - lastType = t; - } +function toNumberArray(arr) { + if (!Array.isArray(arr)) { + return null; } - for (i = 0; i < strLength; ++i) { - t = types[i]; + const length = arr.length; - if (t === "AL") { - types[i] = "R"; - } - } + for (let i = 0; i < length; i++) { + if (typeof arr[i] !== "number") { + const result = new Array(length); - for (i = 1; i < strLength - 1; ++i) { - if (types[i] === "ES" && types[i - 1] === "EN" && types[i + 1] === "EN") { - types[i] = "EN"; - } + for (let j = 0; j < length; j++) { + result[j] = +arr[j]; + } - if (types[i] === "CS" && (types[i - 1] === "EN" || types[i - 1] === "AN") && types[i + 1] === types[i - 1]) { - types[i] = types[i - 1]; + return result; } } - for (i = 0; i < strLength; ++i) { - if (types[i] === "EN") { - var j; + return arr; +} - for (j = i - 1; j >= 0; --j) { - if (types[j] !== "ET") { - break; - } +var PDFFunction = function PDFFunctionClosure() { + const CONSTRUCT_SAMPLED = 0; + const CONSTRUCT_INTERPOLATED = 2; + const CONSTRUCT_STICHED = 3; + const CONSTRUCT_POSTSCRIPT = 4; + return { + getSampleArray(size, outputSize, bps, stream) { + var i, ii; + var length = 1; - types[j] = "EN"; + for (i = 0, ii = size.length; i < ii; i++) { + length *= size[i]; } - for (j = i + 1; j < strLength; ++j) { - if (types[j] !== "ET") { - break; + length *= outputSize; + var array = new Array(length); + var codeSize = 0; + var codeBuf = 0; + var sampleMul = 1.0 / (2.0 ** bps - 1); + var strBytes = stream.getBytes((length * bps + 7) / 8); + var strIdx = 0; + + for (i = 0; i < length; i++) { + while (codeSize < bps) { + codeBuf <<= 8; + codeBuf |= strBytes[strIdx++]; + codeSize += 8; } - types[j] = "EN"; + codeSize -= bps; + array[i] = (codeBuf >> codeSize) * sampleMul; + codeBuf &= (1 << codeSize) - 1; } - } - } - for (i = 0; i < strLength; ++i) { - t = types[i]; + return array; + }, - if (t === "WS" || t === "ES" || t === "ET" || t === "CS") { - types[i] = "ON"; - } - } + getIR({ + xref, + isEvalSupported, + fn + }) { + var dict = fn.dict; - lastType = sor; + if (!dict) { + dict = fn; + } - for (i = 0; i < strLength; ++i) { - t = types[i]; + var types = [this.constructSampled, null, this.constructInterpolated, this.constructStiched, this.constructPostScript]; + var typeNum = dict.get("FunctionType"); + var typeFn = types[typeNum]; - if (t === "EN") { - types[i] = lastType === "L" ? "L" : "EN"; - } else if (t === "R" || t === "L") { - lastType = t; - } - } + if (!typeFn) { + throw new _util.FormatError("Unknown type of function"); + } - for (i = 0; i < strLength; ++i) { - if (types[i] === "ON") { - var end = findUnequal(types, i + 1, "ON"); - var before = sor; + return typeFn.call(this, { + xref, + isEvalSupported, + fn, + dict + }); + }, - if (i > 0) { - before = types[i - 1]; - } + fromIR({ + xref, + isEvalSupported, + IR + }) { + var type = IR[0]; - var after = eor; + switch (type) { + case CONSTRUCT_SAMPLED: + return this.constructSampledFromIR({ + xref, + isEvalSupported, + IR + }); - if (end + 1 < strLength) { - after = types[end + 1]; - } + case CONSTRUCT_INTERPOLATED: + return this.constructInterpolatedFromIR({ + xref, + isEvalSupported, + IR + }); - if (before !== "L") { - before = "R"; + case CONSTRUCT_STICHED: + return this.constructStichedFromIR({ + xref, + isEvalSupported, + IR + }); + + default: + return this.constructPostScriptFromIR({ + xref, + isEvalSupported, + IR + }); } + }, - if (after !== "L") { - after = "R"; + parse({ + xref, + isEvalSupported, + fn + }) { + const IR = this.getIR({ + xref, + isEvalSupported, + fn + }); + return this.fromIR({ + xref, + isEvalSupported, + IR + }); + }, + + parseArray({ + xref, + isEvalSupported, + fnObj + }) { + if (!Array.isArray(fnObj)) { + return this.parse({ + xref, + isEvalSupported, + fn: fnObj + }); } - if (before === after) { - setValues(types, i, end, before); + var fnArray = []; + + for (var j = 0, jj = fnObj.length; j < jj; j++) { + fnArray.push(this.parse({ + xref, + isEvalSupported, + fn: xref.fetchIfRef(fnObj[j]) + })); } - i = end - 1; - } - } + return function (src, srcOffset, dest, destOffset) { + for (var i = 0, ii = fnArray.length; i < ii; i++) { + fnArray[i](src, srcOffset, dest, destOffset + i); + } + }; + }, - for (i = 0; i < strLength; ++i) { - if (types[i] === "ON") { - types[i] = e; - } - } + constructSampled({ + xref, + isEvalSupported, + fn, + dict + }) { + function toMultiArray(arr) { + var inputLength = arr.length; + var out = []; + var index = 0; - for (i = 0; i < strLength; ++i) { - t = types[i]; + for (var i = 0; i < inputLength; i += 2) { + out[index] = [arr[i], arr[i + 1]]; + ++index; + } - if (isEven(levels[i])) { - if (t === "R") { - levels[i] += 1; - } else if (t === "AN" || t === "EN") { - levels[i] += 2; - } - } else { - if (t === "L" || t === "AN" || t === "EN") { - levels[i] += 1; + return out; } - } - } - var highestLevel = -1; - var lowestOddLevel = 99; - var level; + var domain = toNumberArray(dict.getArray("Domain")); + var range = toNumberArray(dict.getArray("Range")); - for (i = 0, ii = levels.length; i < ii; ++i) { - level = levels[i]; + if (!domain || !range) { + throw new _util.FormatError("No domain or range"); + } - if (highestLevel < level) { - highestLevel = level; - } + var inputSize = domain.length / 2; + var outputSize = range.length / 2; + domain = toMultiArray(domain); + range = toMultiArray(range); + var size = toNumberArray(dict.getArray("Size")); + var bps = dict.get("BitsPerSample"); + var order = dict.get("Order") || 1; - if (lowestOddLevel > level && isOdd(level)) { - lowestOddLevel = level; - } - } + if (order !== 1) { + (0, _util.info)("No support for cubic spline interpolation: " + order); + } - for (level = highestLevel; level >= lowestOddLevel; --level) { - var start = -1; + var encode = toNumberArray(dict.getArray("Encode")); - for (i = 0, ii = levels.length; i < ii; ++i) { - if (levels[i] < level) { - if (start >= 0) { - reverseValues(chars, start, i); - start = -1; + if (!encode) { + encode = []; + + for (var i = 0; i < inputSize; ++i) { + encode.push([0, size[i] - 1]); } - } else if (start < 0) { - start = i; + } else { + encode = toMultiArray(encode); } - } - - if (start >= 0) { - reverseValues(chars, start, levels.length); - } - } - for (i = 0, ii = chars.length; i < ii; ++i) { - var ch = chars[i]; + var decode = toNumberArray(dict.getArray("Decode")); - if (ch === "<" || ch === ">") { - chars[i] = ""; - } - } + if (!decode) { + decode = range; + } else { + decode = toMultiArray(decode); + } - return createBidiText(chars.join(""), isLTR); -} + var samples = this.getSampleArray(size, outputSize, bps, fn); + return [CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, outputSize, 2 ** bps - 1, range]; + }, -/***/ }), -/* 40 */ -/***/ (function(module, exports, __w_pdfjs_require__) { + constructSampledFromIR({ + xref, + isEvalSupported, + IR + }) { + function interpolate(x, xmin, xmax, ymin, ymax) { + return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); + } -"use strict"; + return function constructSampledFromIRResult(src, srcOffset, dest, destOffset) { + var m = IR[1]; + var domain = IR[2]; + var encode = IR[3]; + var decode = IR[4]; + var samples = IR[5]; + var size = IR[6]; + var n = IR[7]; + var range = IR[9]; + var cubeVertices = 1 << m; + var cubeN = new Float64Array(cubeVertices); + var cubeVertex = new Uint32Array(cubeVertices); + var i, j; + for (j = 0; j < cubeVertices; j++) { + cubeN[j] = 1; + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getMetrics = void 0; + var k = n, + pos = 1; -var _core_utils = __w_pdfjs_require__(8); - -var getMetrics = (0, _core_utils.getLookupTableFactory)(function (t) { - t.Courier = 600; - t["Courier-Bold"] = 600; - t["Courier-BoldOblique"] = 600; - t["Courier-Oblique"] = 600; - t.Helvetica = (0, _core_utils.getLookupTableFactory)(function (t) { - t.space = 278; - t.exclam = 278; - t.quotedbl = 355; - t.numbersign = 556; - t.dollar = 556; - t.percent = 889; - t.ampersand = 667; - t.quoteright = 222; - t.parenleft = 333; - t.parenright = 333; - t.asterisk = 389; - t.plus = 584; - t.comma = 278; - t.hyphen = 333; - t.period = 278; - t.slash = 278; - t.zero = 556; - t.one = 556; - t.two = 556; - t.three = 556; - t.four = 556; - t.five = 556; - t.six = 556; - t.seven = 556; - t.eight = 556; - t.nine = 556; - t.colon = 278; - t.semicolon = 278; - t.less = 584; - t.equal = 584; - t.greater = 584; - t.question = 556; - t.at = 1015; - t.A = 667; - t.B = 667; - t.C = 722; - t.D = 722; - t.E = 667; - t.F = 611; - t.G = 778; - t.H = 722; - t.I = 278; - t.J = 500; - t.K = 667; - t.L = 556; - t.M = 833; - t.N = 722; - t.O = 778; - t.P = 667; - t.Q = 778; - t.R = 722; - t.S = 667; - t.T = 611; - t.U = 722; - t.V = 667; - t.W = 944; - t.X = 667; - t.Y = 667; - t.Z = 611; - t.bracketleft = 278; - t.backslash = 278; - t.bracketright = 278; - t.asciicircum = 469; - t.underscore = 556; - t.quoteleft = 222; - t.a = 556; - t.b = 556; - t.c = 500; - t.d = 556; - t.e = 556; - t.f = 278; - t.g = 556; - t.h = 556; - t.i = 222; - t.j = 222; - t.k = 500; - t.l = 222; - t.m = 833; - t.n = 556; - t.o = 556; - t.p = 556; - t.q = 556; - t.r = 333; - t.s = 500; - t.t = 278; - t.u = 556; - t.v = 500; - t.w = 722; - t.x = 500; - t.y = 500; - t.z = 500; - t.braceleft = 334; - t.bar = 260; - t.braceright = 334; - t.asciitilde = 584; - t.exclamdown = 333; - t.cent = 556; - t.sterling = 556; - t.fraction = 167; - t.yen = 556; - t.florin = 556; - t.section = 556; - t.currency = 556; - t.quotesingle = 191; - t.quotedblleft = 333; - t.guillemotleft = 556; - t.guilsinglleft = 333; - t.guilsinglright = 333; - t.fi = 500; - t.fl = 500; - t.endash = 556; - t.dagger = 556; - t.daggerdbl = 556; - t.periodcentered = 278; - t.paragraph = 537; - t.bullet = 350; - t.quotesinglbase = 222; - t.quotedblbase = 333; - t.quotedblright = 333; - t.guillemotright = 556; - t.ellipsis = 1000; - t.perthousand = 1000; - t.questiondown = 611; - t.grave = 333; - t.acute = 333; - t.circumflex = 333; - t.tilde = 333; - t.macron = 333; - t.breve = 333; - t.dotaccent = 333; - t.dieresis = 333; - t.ring = 333; - t.cedilla = 333; - t.hungarumlaut = 333; - t.ogonek = 333; - t.caron = 333; - t.emdash = 1000; - t.AE = 1000; - t.ordfeminine = 370; - t.Lslash = 556; - t.Oslash = 778; - t.OE = 1000; - t.ordmasculine = 365; - t.ae = 889; - t.dotlessi = 278; - t.lslash = 222; - t.oslash = 611; - t.oe = 944; - t.germandbls = 611; - t.Idieresis = 278; - t.eacute = 556; - t.abreve = 556; - t.uhungarumlaut = 556; - t.ecaron = 556; - t.Ydieresis = 667; - t.divide = 584; - t.Yacute = 667; - t.Acircumflex = 667; - t.aacute = 556; - t.Ucircumflex = 722; - t.yacute = 500; - t.scommaaccent = 500; - t.ecircumflex = 556; - t.Uring = 722; - t.Udieresis = 722; - t.aogonek = 556; - t.Uacute = 722; - t.uogonek = 556; - t.Edieresis = 667; - t.Dcroat = 722; - t.commaaccent = 250; - t.copyright = 737; - t.Emacron = 667; - t.ccaron = 500; - t.aring = 556; - t.Ncommaaccent = 722; - t.lacute = 222; - t.agrave = 556; - t.Tcommaaccent = 611; - t.Cacute = 722; - t.atilde = 556; - t.Edotaccent = 667; - t.scaron = 500; - t.scedilla = 500; - t.iacute = 278; - t.lozenge = 471; - t.Rcaron = 722; - t.Gcommaaccent = 778; - t.ucircumflex = 556; - t.acircumflex = 556; - t.Amacron = 667; - t.rcaron = 333; - t.ccedilla = 500; - t.Zdotaccent = 611; - t.Thorn = 667; - t.Omacron = 778; - t.Racute = 722; - t.Sacute = 667; - t.dcaron = 643; - t.Umacron = 722; - t.uring = 556; - t.threesuperior = 333; - t.Ograve = 778; - t.Agrave = 667; - t.Abreve = 667; - t.multiply = 584; - t.uacute = 556; - t.Tcaron = 611; - t.partialdiff = 476; - t.ydieresis = 500; - t.Nacute = 722; - t.icircumflex = 278; - t.Ecircumflex = 667; - t.adieresis = 556; - t.edieresis = 556; - t.cacute = 500; - t.nacute = 556; - t.umacron = 556; - t.Ncaron = 722; - t.Iacute = 278; - t.plusminus = 584; - t.brokenbar = 260; - t.registered = 737; - t.Gbreve = 778; - t.Idotaccent = 278; - t.summation = 600; - t.Egrave = 667; - t.racute = 333; - t.omacron = 556; - t.Zacute = 611; - t.Zcaron = 611; - t.greaterequal = 549; - t.Eth = 722; - t.Ccedilla = 722; - t.lcommaaccent = 222; - t.tcaron = 317; - t.eogonek = 556; - t.Uogonek = 722; - t.Aacute = 667; - t.Adieresis = 667; - t.egrave = 556; - t.zacute = 500; - t.iogonek = 222; - t.Oacute = 778; - t.oacute = 556; - t.amacron = 556; - t.sacute = 500; - t.idieresis = 278; - t.Ocircumflex = 778; - t.Ugrave = 722; - t.Delta = 612; - t.thorn = 556; - t.twosuperior = 333; - t.Odieresis = 778; - t.mu = 556; - t.igrave = 278; - t.ohungarumlaut = 556; - t.Eogonek = 667; - t.dcroat = 556; - t.threequarters = 834; - t.Scedilla = 667; - t.lcaron = 299; - t.Kcommaaccent = 667; - t.Lacute = 556; - t.trademark = 1000; - t.edotaccent = 556; - t.Igrave = 278; - t.Imacron = 278; - t.Lcaron = 556; - t.onehalf = 834; - t.lessequal = 549; - t.ocircumflex = 556; - t.ntilde = 556; - t.Uhungarumlaut = 722; - t.Eacute = 667; - t.emacron = 556; - t.gbreve = 556; - t.onequarter = 834; - t.Scaron = 667; - t.Scommaaccent = 667; - t.Ohungarumlaut = 778; - t.degree = 400; - t.ograve = 556; - t.Ccaron = 722; - t.ugrave = 556; - t.radical = 453; - t.Dcaron = 722; - t.rcommaaccent = 333; - t.Ntilde = 722; - t.otilde = 556; - t.Rcommaaccent = 722; - t.Lcommaaccent = 556; - t.Atilde = 667; - t.Aogonek = 667; - t.Aring = 667; - t.Otilde = 778; - t.zdotaccent = 500; - t.Ecaron = 667; - t.Iogonek = 278; - t.kcommaaccent = 500; - t.minus = 584; - t.Icircumflex = 278; - t.ncaron = 556; - t.tcommaaccent = 278; - t.logicalnot = 584; - t.odieresis = 556; - t.udieresis = 556; - t.notequal = 549; - t.gcommaaccent = 556; - t.eth = 556; - t.zcaron = 500; - t.ncommaaccent = 556; - t.onesuperior = 333; - t.imacron = 278; - t.Euro = 556; - }); - t["Helvetica-Bold"] = (0, _core_utils.getLookupTableFactory)(function (t) { - t.space = 278; - t.exclam = 333; - t.quotedbl = 474; - t.numbersign = 556; - t.dollar = 556; - t.percent = 889; - t.ampersand = 722; - t.quoteright = 278; - t.parenleft = 333; - t.parenright = 333; - t.asterisk = 389; - t.plus = 584; - t.comma = 278; - t.hyphen = 333; - t.period = 278; - t.slash = 278; - t.zero = 556; - t.one = 556; - t.two = 556; - t.three = 556; - t.four = 556; - t.five = 556; - t.six = 556; - t.seven = 556; - t.eight = 556; - t.nine = 556; - t.colon = 333; - t.semicolon = 333; - t.less = 584; - t.equal = 584; - t.greater = 584; - t.question = 611; - t.at = 975; - t.A = 722; - t.B = 722; - t.C = 722; - t.D = 722; - t.E = 667; - t.F = 611; - t.G = 778; - t.H = 722; - t.I = 278; - t.J = 556; - t.K = 722; - t.L = 611; - t.M = 833; - t.N = 722; - t.O = 778; - t.P = 667; - t.Q = 778; - t.R = 722; - t.S = 667; - t.T = 611; - t.U = 722; - t.V = 667; - t.W = 944; - t.X = 667; - t.Y = 667; - t.Z = 611; - t.bracketleft = 333; - t.backslash = 278; - t.bracketright = 333; - t.asciicircum = 584; - t.underscore = 556; - t.quoteleft = 278; - t.a = 556; - t.b = 611; - t.c = 556; - t.d = 611; - t.e = 556; - t.f = 333; - t.g = 611; - t.h = 611; - t.i = 278; - t.j = 278; - t.k = 556; - t.l = 278; - t.m = 889; - t.n = 611; - t.o = 611; - t.p = 611; - t.q = 611; - t.r = 389; - t.s = 556; - t.t = 333; - t.u = 611; - t.v = 556; - t.w = 778; - t.x = 556; - t.y = 556; - t.z = 500; - t.braceleft = 389; - t.bar = 280; - t.braceright = 389; - t.asciitilde = 584; - t.exclamdown = 333; - t.cent = 556; - t.sterling = 556; - t.fraction = 167; - t.yen = 556; - t.florin = 556; - t.section = 556; - t.currency = 556; - t.quotesingle = 238; - t.quotedblleft = 500; - t.guillemotleft = 556; - t.guilsinglleft = 333; - t.guilsinglright = 333; - t.fi = 611; - t.fl = 611; - t.endash = 556; - t.dagger = 556; - t.daggerdbl = 556; - t.periodcentered = 278; - t.paragraph = 556; - t.bullet = 350; - t.quotesinglbase = 278; - t.quotedblbase = 500; - t.quotedblright = 500; - t.guillemotright = 556; - t.ellipsis = 1000; - t.perthousand = 1000; - t.questiondown = 611; - t.grave = 333; - t.acute = 333; - t.circumflex = 333; - t.tilde = 333; - t.macron = 333; - t.breve = 333; - t.dotaccent = 333; - t.dieresis = 333; - t.ring = 333; - t.cedilla = 333; - t.hungarumlaut = 333; - t.ogonek = 333; - t.caron = 333; - t.emdash = 1000; - t.AE = 1000; - t.ordfeminine = 370; - t.Lslash = 611; - t.Oslash = 778; - t.OE = 1000; - t.ordmasculine = 365; - t.ae = 889; - t.dotlessi = 278; - t.lslash = 278; - t.oslash = 611; - t.oe = 944; - t.germandbls = 611; - t.Idieresis = 278; - t.eacute = 556; - t.abreve = 556; - t.uhungarumlaut = 611; - t.ecaron = 556; - t.Ydieresis = 667; - t.divide = 584; - t.Yacute = 667; - t.Acircumflex = 722; - t.aacute = 556; - t.Ucircumflex = 722; - t.yacute = 556; - t.scommaaccent = 556; - t.ecircumflex = 556; - t.Uring = 722; - t.Udieresis = 722; - t.aogonek = 556; - t.Uacute = 722; - t.uogonek = 611; - t.Edieresis = 667; - t.Dcroat = 722; - t.commaaccent = 250; - t.copyright = 737; - t.Emacron = 667; - t.ccaron = 556; - t.aring = 556; - t.Ncommaaccent = 722; - t.lacute = 278; - t.agrave = 556; - t.Tcommaaccent = 611; - t.Cacute = 722; - t.atilde = 556; - t.Edotaccent = 667; - t.scaron = 556; - t.scedilla = 556; - t.iacute = 278; - t.lozenge = 494; - t.Rcaron = 722; - t.Gcommaaccent = 778; - t.ucircumflex = 611; - t.acircumflex = 556; - t.Amacron = 722; - t.rcaron = 389; - t.ccedilla = 556; - t.Zdotaccent = 611; - t.Thorn = 667; - t.Omacron = 778; - t.Racute = 722; - t.Sacute = 667; - t.dcaron = 743; - t.Umacron = 722; - t.uring = 611; - t.threesuperior = 333; - t.Ograve = 778; - t.Agrave = 722; - t.Abreve = 722; - t.multiply = 584; - t.uacute = 611; - t.Tcaron = 611; - t.partialdiff = 494; - t.ydieresis = 556; - t.Nacute = 722; - t.icircumflex = 278; - t.Ecircumflex = 667; - t.adieresis = 556; - t.edieresis = 556; - t.cacute = 556; - t.nacute = 611; - t.umacron = 611; - t.Ncaron = 722; - t.Iacute = 278; - t.plusminus = 584; - t.brokenbar = 280; - t.registered = 737; - t.Gbreve = 778; - t.Idotaccent = 278; - t.summation = 600; - t.Egrave = 667; - t.racute = 389; - t.omacron = 611; - t.Zacute = 611; - t.Zcaron = 611; - t.greaterequal = 549; - t.Eth = 722; - t.Ccedilla = 722; - t.lcommaaccent = 278; - t.tcaron = 389; - t.eogonek = 556; - t.Uogonek = 722; - t.Aacute = 722; - t.Adieresis = 722; - t.egrave = 556; - t.zacute = 500; - t.iogonek = 278; - t.Oacute = 778; - t.oacute = 611; - t.amacron = 556; - t.sacute = 556; - t.idieresis = 278; - t.Ocircumflex = 778; - t.Ugrave = 722; - t.Delta = 612; - t.thorn = 611; - t.twosuperior = 333; - t.Odieresis = 778; - t.mu = 611; - t.igrave = 278; - t.ohungarumlaut = 611; - t.Eogonek = 667; - t.dcroat = 611; - t.threequarters = 834; - t.Scedilla = 667; - t.lcaron = 400; - t.Kcommaaccent = 722; - t.Lacute = 611; - t.trademark = 1000; - t.edotaccent = 556; - t.Igrave = 278; - t.Imacron = 278; - t.Lcaron = 611; - t.onehalf = 834; - t.lessequal = 549; - t.ocircumflex = 611; - t.ntilde = 611; - t.Uhungarumlaut = 722; - t.Eacute = 667; - t.emacron = 556; - t.gbreve = 611; - t.onequarter = 834; - t.Scaron = 667; - t.Scommaaccent = 667; - t.Ohungarumlaut = 778; - t.degree = 400; - t.ograve = 611; - t.Ccaron = 722; - t.ugrave = 611; - t.radical = 549; - t.Dcaron = 722; - t.rcommaaccent = 389; - t.Ntilde = 722; - t.otilde = 611; - t.Rcommaaccent = 722; - t.Lcommaaccent = 611; - t.Atilde = 722; - t.Aogonek = 722; - t.Aring = 722; - t.Otilde = 778; - t.zdotaccent = 500; - t.Ecaron = 667; - t.Iogonek = 278; - t.kcommaaccent = 556; - t.minus = 584; - t.Icircumflex = 278; - t.ncaron = 611; - t.tcommaaccent = 333; - t.logicalnot = 584; - t.odieresis = 611; - t.udieresis = 611; - t.notequal = 549; - t.gcommaaccent = 611; - t.eth = 611; - t.zcaron = 500; - t.ncommaaccent = 611; - t.onesuperior = 333; - t.imacron = 278; - t.Euro = 556; - }); - t["Helvetica-BoldOblique"] = (0, _core_utils.getLookupTableFactory)(function (t) { - t.space = 278; - t.exclam = 333; - t.quotedbl = 474; - t.numbersign = 556; - t.dollar = 556; - t.percent = 889; - t.ampersand = 722; - t.quoteright = 278; - t.parenleft = 333; - t.parenright = 333; - t.asterisk = 389; - t.plus = 584; - t.comma = 278; - t.hyphen = 333; - t.period = 278; - t.slash = 278; - t.zero = 556; - t.one = 556; - t.two = 556; - t.three = 556; - t.four = 556; - t.five = 556; - t.six = 556; - t.seven = 556; - t.eight = 556; - t.nine = 556; - t.colon = 333; - t.semicolon = 333; - t.less = 584; - t.equal = 584; - t.greater = 584; - t.question = 611; - t.at = 975; - t.A = 722; - t.B = 722; - t.C = 722; - t.D = 722; - t.E = 667; - t.F = 611; - t.G = 778; - t.H = 722; - t.I = 278; - t.J = 556; - t.K = 722; - t.L = 611; - t.M = 833; - t.N = 722; - t.O = 778; - t.P = 667; - t.Q = 778; - t.R = 722; - t.S = 667; - t.T = 611; - t.U = 722; - t.V = 667; - t.W = 944; - t.X = 667; - t.Y = 667; - t.Z = 611; - t.bracketleft = 333; - t.backslash = 278; - t.bracketright = 333; - t.asciicircum = 584; - t.underscore = 556; - t.quoteleft = 278; - t.a = 556; - t.b = 611; - t.c = 556; - t.d = 611; - t.e = 556; - t.f = 333; - t.g = 611; - t.h = 611; - t.i = 278; - t.j = 278; - t.k = 556; - t.l = 278; - t.m = 889; - t.n = 611; - t.o = 611; - t.p = 611; - t.q = 611; - t.r = 389; - t.s = 556; - t.t = 333; - t.u = 611; - t.v = 556; - t.w = 778; - t.x = 556; - t.y = 556; - t.z = 500; - t.braceleft = 389; - t.bar = 280; - t.braceright = 389; - t.asciitilde = 584; - t.exclamdown = 333; - t.cent = 556; - t.sterling = 556; - t.fraction = 167; - t.yen = 556; - t.florin = 556; - t.section = 556; - t.currency = 556; - t.quotesingle = 238; - t.quotedblleft = 500; - t.guillemotleft = 556; - t.guilsinglleft = 333; - t.guilsinglright = 333; - t.fi = 611; - t.fl = 611; - t.endash = 556; - t.dagger = 556; - t.daggerdbl = 556; - t.periodcentered = 278; - t.paragraph = 556; - t.bullet = 350; - t.quotesinglbase = 278; - t.quotedblbase = 500; - t.quotedblright = 500; - t.guillemotright = 556; - t.ellipsis = 1000; - t.perthousand = 1000; - t.questiondown = 611; - t.grave = 333; - t.acute = 333; - t.circumflex = 333; - t.tilde = 333; - t.macron = 333; - t.breve = 333; - t.dotaccent = 333; - t.dieresis = 333; - t.ring = 333; - t.cedilla = 333; - t.hungarumlaut = 333; - t.ogonek = 333; - t.caron = 333; - t.emdash = 1000; - t.AE = 1000; - t.ordfeminine = 370; - t.Lslash = 611; - t.Oslash = 778; - t.OE = 1000; - t.ordmasculine = 365; - t.ae = 889; - t.dotlessi = 278; - t.lslash = 278; - t.oslash = 611; - t.oe = 944; - t.germandbls = 611; - t.Idieresis = 278; - t.eacute = 556; - t.abreve = 556; - t.uhungarumlaut = 611; - t.ecaron = 556; - t.Ydieresis = 667; - t.divide = 584; - t.Yacute = 667; - t.Acircumflex = 722; - t.aacute = 556; - t.Ucircumflex = 722; - t.yacute = 556; - t.scommaaccent = 556; - t.ecircumflex = 556; - t.Uring = 722; - t.Udieresis = 722; - t.aogonek = 556; - t.Uacute = 722; - t.uogonek = 611; - t.Edieresis = 667; - t.Dcroat = 722; - t.commaaccent = 250; - t.copyright = 737; - t.Emacron = 667; - t.ccaron = 556; - t.aring = 556; - t.Ncommaaccent = 722; - t.lacute = 278; - t.agrave = 556; - t.Tcommaaccent = 611; - t.Cacute = 722; - t.atilde = 556; - t.Edotaccent = 667; - t.scaron = 556; - t.scedilla = 556; - t.iacute = 278; - t.lozenge = 494; - t.Rcaron = 722; - t.Gcommaaccent = 778; - t.ucircumflex = 611; - t.acircumflex = 556; - t.Amacron = 722; - t.rcaron = 389; - t.ccedilla = 556; - t.Zdotaccent = 611; - t.Thorn = 667; - t.Omacron = 778; - t.Racute = 722; - t.Sacute = 667; - t.dcaron = 743; - t.Umacron = 722; - t.uring = 611; - t.threesuperior = 333; - t.Ograve = 778; - t.Agrave = 722; - t.Abreve = 722; - t.multiply = 584; - t.uacute = 611; - t.Tcaron = 611; - t.partialdiff = 494; - t.ydieresis = 556; - t.Nacute = 722; - t.icircumflex = 278; - t.Ecircumflex = 667; - t.adieresis = 556; - t.edieresis = 556; - t.cacute = 556; - t.nacute = 611; - t.umacron = 611; - t.Ncaron = 722; - t.Iacute = 278; - t.plusminus = 584; - t.brokenbar = 280; - t.registered = 737; - t.Gbreve = 778; - t.Idotaccent = 278; - t.summation = 600; - t.Egrave = 667; - t.racute = 389; - t.omacron = 611; - t.Zacute = 611; - t.Zcaron = 611; - t.greaterequal = 549; - t.Eth = 722; - t.Ccedilla = 722; - t.lcommaaccent = 278; - t.tcaron = 389; - t.eogonek = 556; - t.Uogonek = 722; - t.Aacute = 722; - t.Adieresis = 722; - t.egrave = 556; - t.zacute = 500; - t.iogonek = 278; - t.Oacute = 778; - t.oacute = 611; - t.amacron = 556; - t.sacute = 556; - t.idieresis = 278; - t.Ocircumflex = 778; - t.Ugrave = 722; - t.Delta = 612; - t.thorn = 611; - t.twosuperior = 333; - t.Odieresis = 778; - t.mu = 611; - t.igrave = 278; - t.ohungarumlaut = 611; - t.Eogonek = 667; - t.dcroat = 611; - t.threequarters = 834; - t.Scedilla = 667; - t.lcaron = 400; - t.Kcommaaccent = 722; - t.Lacute = 611; - t.trademark = 1000; - t.edotaccent = 556; - t.Igrave = 278; - t.Imacron = 278; - t.Lcaron = 611; - t.onehalf = 834; - t.lessequal = 549; - t.ocircumflex = 611; - t.ntilde = 611; - t.Uhungarumlaut = 722; - t.Eacute = 667; - t.emacron = 556; - t.gbreve = 611; - t.onequarter = 834; - t.Scaron = 667; - t.Scommaaccent = 667; - t.Ohungarumlaut = 778; - t.degree = 400; - t.ograve = 611; - t.Ccaron = 722; - t.ugrave = 611; - t.radical = 549; - t.Dcaron = 722; - t.rcommaaccent = 389; - t.Ntilde = 722; - t.otilde = 611; - t.Rcommaaccent = 722; - t.Lcommaaccent = 611; - t.Atilde = 722; - t.Aogonek = 722; - t.Aring = 722; - t.Otilde = 778; - t.zdotaccent = 500; - t.Ecaron = 667; - t.Iogonek = 278; - t.kcommaaccent = 556; - t.minus = 584; - t.Icircumflex = 278; - t.ncaron = 611; - t.tcommaaccent = 333; - t.logicalnot = 584; - t.odieresis = 611; - t.udieresis = 611; - t.notequal = 549; - t.gcommaaccent = 611; - t.eth = 611; - t.zcaron = 500; - t.ncommaaccent = 611; - t.onesuperior = 333; - t.imacron = 278; - t.Euro = 556; - }); - t["Helvetica-Oblique"] = (0, _core_utils.getLookupTableFactory)(function (t) { - t.space = 278; - t.exclam = 278; - t.quotedbl = 355; - t.numbersign = 556; - t.dollar = 556; - t.percent = 889; - t.ampersand = 667; - t.quoteright = 222; - t.parenleft = 333; - t.parenright = 333; - t.asterisk = 389; - t.plus = 584; - t.comma = 278; - t.hyphen = 333; - t.period = 278; - t.slash = 278; - t.zero = 556; - t.one = 556; - t.two = 556; - t.three = 556; - t.four = 556; - t.five = 556; - t.six = 556; - t.seven = 556; - t.eight = 556; - t.nine = 556; - t.colon = 278; - t.semicolon = 278; - t.less = 584; - t.equal = 584; - t.greater = 584; - t.question = 556; - t.at = 1015; - t.A = 667; - t.B = 667; - t.C = 722; - t.D = 722; - t.E = 667; - t.F = 611; - t.G = 778; - t.H = 722; - t.I = 278; - t.J = 500; - t.K = 667; - t.L = 556; - t.M = 833; - t.N = 722; - t.O = 778; - t.P = 667; - t.Q = 778; - t.R = 722; - t.S = 667; - t.T = 611; - t.U = 722; - t.V = 667; - t.W = 944; - t.X = 667; - t.Y = 667; - t.Z = 611; - t.bracketleft = 278; - t.backslash = 278; - t.bracketright = 278; - t.asciicircum = 469; - t.underscore = 556; - t.quoteleft = 222; - t.a = 556; - t.b = 556; - t.c = 500; - t.d = 556; - t.e = 556; - t.f = 278; - t.g = 556; - t.h = 556; - t.i = 222; - t.j = 222; - t.k = 500; - t.l = 222; - t.m = 833; - t.n = 556; - t.o = 556; - t.p = 556; - t.q = 556; - t.r = 333; - t.s = 500; - t.t = 278; - t.u = 556; - t.v = 500; - t.w = 722; - t.x = 500; - t.y = 500; - t.z = 500; - t.braceleft = 334; - t.bar = 260; - t.braceright = 334; - t.asciitilde = 584; - t.exclamdown = 333; - t.cent = 556; - t.sterling = 556; - t.fraction = 167; - t.yen = 556; - t.florin = 556; - t.section = 556; - t.currency = 556; - t.quotesingle = 191; - t.quotedblleft = 333; - t.guillemotleft = 556; - t.guilsinglleft = 333; - t.guilsinglright = 333; - t.fi = 500; - t.fl = 500; - t.endash = 556; - t.dagger = 556; - t.daggerdbl = 556; - t.periodcentered = 278; - t.paragraph = 537; - t.bullet = 350; - t.quotesinglbase = 222; - t.quotedblbase = 333; - t.quotedblright = 333; - t.guillemotright = 556; - t.ellipsis = 1000; - t.perthousand = 1000; - t.questiondown = 611; - t.grave = 333; - t.acute = 333; - t.circumflex = 333; - t.tilde = 333; - t.macron = 333; - t.breve = 333; - t.dotaccent = 333; - t.dieresis = 333; - t.ring = 333; - t.cedilla = 333; - t.hungarumlaut = 333; - t.ogonek = 333; - t.caron = 333; - t.emdash = 1000; - t.AE = 1000; - t.ordfeminine = 370; - t.Lslash = 556; - t.Oslash = 778; - t.OE = 1000; - t.ordmasculine = 365; - t.ae = 889; - t.dotlessi = 278; - t.lslash = 222; - t.oslash = 611; - t.oe = 944; - t.germandbls = 611; - t.Idieresis = 278; - t.eacute = 556; - t.abreve = 556; - t.uhungarumlaut = 556; - t.ecaron = 556; - t.Ydieresis = 667; - t.divide = 584; - t.Yacute = 667; - t.Acircumflex = 667; - t.aacute = 556; - t.Ucircumflex = 722; - t.yacute = 500; - t.scommaaccent = 500; - t.ecircumflex = 556; - t.Uring = 722; - t.Udieresis = 722; - t.aogonek = 556; - t.Uacute = 722; - t.uogonek = 556; - t.Edieresis = 667; - t.Dcroat = 722; - t.commaaccent = 250; - t.copyright = 737; - t.Emacron = 667; - t.ccaron = 500; - t.aring = 556; - t.Ncommaaccent = 722; - t.lacute = 222; - t.agrave = 556; - t.Tcommaaccent = 611; - t.Cacute = 722; - t.atilde = 556; - t.Edotaccent = 667; - t.scaron = 500; - t.scedilla = 500; - t.iacute = 278; - t.lozenge = 471; - t.Rcaron = 722; - t.Gcommaaccent = 778; - t.ucircumflex = 556; - t.acircumflex = 556; - t.Amacron = 667; - t.rcaron = 333; - t.ccedilla = 500; - t.Zdotaccent = 611; - t.Thorn = 667; - t.Omacron = 778; - t.Racute = 722; - t.Sacute = 667; - t.dcaron = 643; - t.Umacron = 722; - t.uring = 556; - t.threesuperior = 333; - t.Ograve = 778; - t.Agrave = 667; - t.Abreve = 667; - t.multiply = 584; - t.uacute = 556; - t.Tcaron = 611; - t.partialdiff = 476; - t.ydieresis = 500; - t.Nacute = 722; - t.icircumflex = 278; - t.Ecircumflex = 667; - t.adieresis = 556; - t.edieresis = 556; - t.cacute = 500; - t.nacute = 556; - t.umacron = 556; - t.Ncaron = 722; - t.Iacute = 278; - t.plusminus = 584; - t.brokenbar = 260; - t.registered = 737; - t.Gbreve = 778; - t.Idotaccent = 278; - t.summation = 600; - t.Egrave = 667; - t.racute = 333; - t.omacron = 556; - t.Zacute = 611; - t.Zcaron = 611; - t.greaterequal = 549; - t.Eth = 722; - t.Ccedilla = 722; - t.lcommaaccent = 222; - t.tcaron = 317; - t.eogonek = 556; - t.Uogonek = 722; - t.Aacute = 667; - t.Adieresis = 667; - t.egrave = 556; - t.zacute = 500; - t.iogonek = 222; - t.Oacute = 778; - t.oacute = 556; - t.amacron = 556; - t.sacute = 500; - t.idieresis = 278; - t.Ocircumflex = 778; - t.Ugrave = 722; - t.Delta = 612; - t.thorn = 556; - t.twosuperior = 333; - t.Odieresis = 778; - t.mu = 556; - t.igrave = 278; - t.ohungarumlaut = 556; - t.Eogonek = 667; - t.dcroat = 556; - t.threequarters = 834; - t.Scedilla = 667; - t.lcaron = 299; - t.Kcommaaccent = 667; - t.Lacute = 556; - t.trademark = 1000; - t.edotaccent = 556; - t.Igrave = 278; - t.Imacron = 278; - t.Lcaron = 556; - t.onehalf = 834; - t.lessequal = 549; - t.ocircumflex = 556; - t.ntilde = 556; - t.Uhungarumlaut = 722; - t.Eacute = 667; - t.emacron = 556; - t.gbreve = 556; - t.onequarter = 834; - t.Scaron = 667; - t.Scommaaccent = 667; - t.Ohungarumlaut = 778; - t.degree = 400; - t.ograve = 556; - t.Ccaron = 722; - t.ugrave = 556; - t.radical = 453; - t.Dcaron = 722; - t.rcommaaccent = 333; - t.Ntilde = 722; - t.otilde = 556; - t.Rcommaaccent = 722; - t.Lcommaaccent = 556; - t.Atilde = 667; - t.Aogonek = 667; - t.Aring = 667; - t.Otilde = 778; - t.zdotaccent = 500; - t.Ecaron = 667; - t.Iogonek = 278; - t.kcommaaccent = 500; - t.minus = 584; - t.Icircumflex = 278; - t.ncaron = 556; - t.tcommaaccent = 278; - t.logicalnot = 584; - t.odieresis = 556; - t.udieresis = 556; - t.notequal = 549; - t.gcommaaccent = 556; - t.eth = 556; - t.zcaron = 500; - t.ncommaaccent = 556; - t.onesuperior = 333; - t.imacron = 278; - t.Euro = 556; - }); - t.Symbol = (0, _core_utils.getLookupTableFactory)(function (t) { - t.space = 250; - t.exclam = 333; - t.universal = 713; - t.numbersign = 500; - t.existential = 549; - t.percent = 833; - t.ampersand = 778; - t.suchthat = 439; - t.parenleft = 333; - t.parenright = 333; - t.asteriskmath = 500; - t.plus = 549; - t.comma = 250; - t.minus = 549; - t.period = 250; - t.slash = 278; - t.zero = 500; - t.one = 500; - t.two = 500; - t.three = 500; - t.four = 500; - t.five = 500; - t.six = 500; - t.seven = 500; - t.eight = 500; - t.nine = 500; - t.colon = 278; - t.semicolon = 278; - t.less = 549; - t.equal = 549; - t.greater = 549; - t.question = 444; - t.congruent = 549; - t.Alpha = 722; - t.Beta = 667; - t.Chi = 722; - t.Delta = 612; - t.Epsilon = 611; - t.Phi = 763; - t.Gamma = 603; - t.Eta = 722; - t.Iota = 333; - t.theta1 = 631; - t.Kappa = 722; - t.Lambda = 686; - t.Mu = 889; - t.Nu = 722; - t.Omicron = 722; - t.Pi = 768; - t.Theta = 741; - t.Rho = 556; - t.Sigma = 592; - t.Tau = 611; - t.Upsilon = 690; - t.sigma1 = 439; - t.Omega = 768; - t.Xi = 645; - t.Psi = 795; - t.Zeta = 611; - t.bracketleft = 333; - t.therefore = 863; - t.bracketright = 333; - t.perpendicular = 658; - t.underscore = 500; - t.radicalex = 500; - t.alpha = 631; - t.beta = 549; - t.chi = 549; - t.delta = 494; - t.epsilon = 439; - t.phi = 521; - t.gamma = 411; - t.eta = 603; - t.iota = 329; - t.phi1 = 603; - t.kappa = 549; - t.lambda = 549; - t.mu = 576; - t.nu = 521; - t.omicron = 549; - t.pi = 549; - t.theta = 521; - t.rho = 549; - t.sigma = 603; - t.tau = 439; - t.upsilon = 576; - t.omega1 = 713; - t.omega = 686; - t.xi = 493; - t.psi = 686; - t.zeta = 494; - t.braceleft = 480; - t.bar = 200; - t.braceright = 480; - t.similar = 549; - t.Euro = 750; - t.Upsilon1 = 620; - t.minute = 247; - t.lessequal = 549; - t.fraction = 167; - t.infinity = 713; - t.florin = 500; - t.club = 753; - t.diamond = 753; - t.heart = 753; - t.spade = 753; - t.arrowboth = 1042; - t.arrowleft = 987; - t.arrowup = 603; - t.arrowright = 987; - t.arrowdown = 603; - t.degree = 400; - t.plusminus = 549; - t.second = 411; - t.greaterequal = 549; - t.multiply = 549; - t.proportional = 713; - t.partialdiff = 494; - t.bullet = 460; - t.divide = 549; - t.notequal = 549; - t.equivalence = 549; - t.approxequal = 549; - t.ellipsis = 1000; - t.arrowvertex = 603; - t.arrowhorizex = 1000; - t.carriagereturn = 658; - t.aleph = 823; - t.Ifraktur = 686; - t.Rfraktur = 795; - t.weierstrass = 987; - t.circlemultiply = 768; - t.circleplus = 768; - t.emptyset = 823; - t.intersection = 768; - t.union = 768; - t.propersuperset = 713; - t.reflexsuperset = 713; - t.notsubset = 713; - t.propersubset = 713; - t.reflexsubset = 713; - t.element = 713; - t.notelement = 713; - t.angle = 768; - t.gradient = 713; - t.registerserif = 790; - t.copyrightserif = 790; - t.trademarkserif = 890; - t.product = 823; - t.radical = 549; - t.dotmath = 250; - t.logicalnot = 713; - t.logicaland = 603; - t.logicalor = 603; - t.arrowdblboth = 1042; - t.arrowdblleft = 987; - t.arrowdblup = 603; - t.arrowdblright = 987; - t.arrowdbldown = 603; - t.lozenge = 494; - t.angleleft = 329; - t.registersans = 790; - t.copyrightsans = 790; - t.trademarksans = 786; - t.summation = 713; - t.parenlefttp = 384; - t.parenleftex = 384; - t.parenleftbt = 384; - t.bracketlefttp = 384; - t.bracketleftex = 384; - t.bracketleftbt = 384; - t.bracelefttp = 494; - t.braceleftmid = 494; - t.braceleftbt = 494; - t.braceex = 494; - t.angleright = 329; - t.integral = 274; - t.integraltp = 686; - t.integralex = 686; - t.integralbt = 686; - t.parenrighttp = 384; - t.parenrightex = 384; - t.parenrightbt = 384; - t.bracketrighttp = 384; - t.bracketrightex = 384; - t.bracketrightbt = 384; - t.bracerighttp = 494; - t.bracerightmid = 494; - t.bracerightbt = 494; - t.apple = 790; - }); - t["Times-Roman"] = (0, _core_utils.getLookupTableFactory)(function (t) { - t.space = 250; - t.exclam = 333; - t.quotedbl = 408; - t.numbersign = 500; - t.dollar = 500; - t.percent = 833; - t.ampersand = 778; - t.quoteright = 333; - t.parenleft = 333; - t.parenright = 333; - t.asterisk = 500; - t.plus = 564; - t.comma = 250; - t.hyphen = 333; - t.period = 250; - t.slash = 278; - t.zero = 500; - t.one = 500; - t.two = 500; - t.three = 500; - t.four = 500; - t.five = 500; - t.six = 500; - t.seven = 500; - t.eight = 500; - t.nine = 500; - t.colon = 278; - t.semicolon = 278; - t.less = 564; - t.equal = 564; - t.greater = 564; - t.question = 444; - t.at = 921; - t.A = 722; - t.B = 667; - t.C = 667; - t.D = 722; - t.E = 611; - t.F = 556; - t.G = 722; - t.H = 722; - t.I = 333; - t.J = 389; - t.K = 722; - t.L = 611; - t.M = 889; - t.N = 722; - t.O = 722; - t.P = 556; - t.Q = 722; - t.R = 667; - t.S = 556; - t.T = 611; - t.U = 722; - t.V = 722; - t.W = 944; - t.X = 722; - t.Y = 722; - t.Z = 611; - t.bracketleft = 333; - t.backslash = 278; - t.bracketright = 333; - t.asciicircum = 469; - t.underscore = 500; - t.quoteleft = 333; - t.a = 444; - t.b = 500; - t.c = 444; - t.d = 500; - t.e = 444; - t.f = 333; - t.g = 500; - t.h = 500; - t.i = 278; - t.j = 278; - t.k = 500; - t.l = 278; - t.m = 778; - t.n = 500; - t.o = 500; - t.p = 500; - t.q = 500; - t.r = 333; - t.s = 389; - t.t = 278; - t.u = 500; - t.v = 500; - t.w = 722; - t.x = 500; - t.y = 500; - t.z = 444; - t.braceleft = 480; - t.bar = 200; - t.braceright = 480; - t.asciitilde = 541; - t.exclamdown = 333; - t.cent = 500; - t.sterling = 500; - t.fraction = 167; - t.yen = 500; - t.florin = 500; - t.section = 500; - t.currency = 500; - t.quotesingle = 180; - t.quotedblleft = 444; - t.guillemotleft = 500; - t.guilsinglleft = 333; - t.guilsinglright = 333; - t.fi = 556; - t.fl = 556; - t.endash = 500; - t.dagger = 500; - t.daggerdbl = 500; - t.periodcentered = 250; - t.paragraph = 453; - t.bullet = 350; - t.quotesinglbase = 333; - t.quotedblbase = 444; - t.quotedblright = 444; - t.guillemotright = 500; - t.ellipsis = 1000; - t.perthousand = 1000; - t.questiondown = 444; - t.grave = 333; - t.acute = 333; - t.circumflex = 333; - t.tilde = 333; - t.macron = 333; - t.breve = 333; - t.dotaccent = 333; - t.dieresis = 333; - t.ring = 333; - t.cedilla = 333; - t.hungarumlaut = 333; - t.ogonek = 333; - t.caron = 333; - t.emdash = 1000; - t.AE = 889; - t.ordfeminine = 276; - t.Lslash = 611; - t.Oslash = 722; - t.OE = 889; - t.ordmasculine = 310; - t.ae = 667; - t.dotlessi = 278; - t.lslash = 278; - t.oslash = 500; - t.oe = 722; - t.germandbls = 500; - t.Idieresis = 333; - t.eacute = 444; - t.abreve = 444; - t.uhungarumlaut = 500; - t.ecaron = 444; - t.Ydieresis = 722; - t.divide = 564; - t.Yacute = 722; - t.Acircumflex = 722; - t.aacute = 444; - t.Ucircumflex = 722; - t.yacute = 500; - t.scommaaccent = 389; - t.ecircumflex = 444; - t.Uring = 722; - t.Udieresis = 722; - t.aogonek = 444; - t.Uacute = 722; - t.uogonek = 500; - t.Edieresis = 611; - t.Dcroat = 722; - t.commaaccent = 250; - t.copyright = 760; - t.Emacron = 611; - t.ccaron = 444; - t.aring = 444; - t.Ncommaaccent = 722; - t.lacute = 278; - t.agrave = 444; - t.Tcommaaccent = 611; - t.Cacute = 667; - t.atilde = 444; - t.Edotaccent = 611; - t.scaron = 389; - t.scedilla = 389; - t.iacute = 278; - t.lozenge = 471; - t.Rcaron = 667; - t.Gcommaaccent = 722; - t.ucircumflex = 500; - t.acircumflex = 444; - t.Amacron = 722; - t.rcaron = 333; - t.ccedilla = 444; - t.Zdotaccent = 611; - t.Thorn = 556; - t.Omacron = 722; - t.Racute = 667; - t.Sacute = 556; - t.dcaron = 588; - t.Umacron = 722; - t.uring = 500; - t.threesuperior = 300; - t.Ograve = 722; - t.Agrave = 722; - t.Abreve = 722; - t.multiply = 564; - t.uacute = 500; - t.Tcaron = 611; - t.partialdiff = 476; - t.ydieresis = 500; - t.Nacute = 722; - t.icircumflex = 278; - t.Ecircumflex = 611; - t.adieresis = 444; - t.edieresis = 444; - t.cacute = 444; - t.nacute = 500; - t.umacron = 500; - t.Ncaron = 722; - t.Iacute = 333; - t.plusminus = 564; - t.brokenbar = 200; - t.registered = 760; - t.Gbreve = 722; - t.Idotaccent = 333; - t.summation = 600; - t.Egrave = 611; - t.racute = 333; - t.omacron = 500; - t.Zacute = 611; - t.Zcaron = 611; - t.greaterequal = 549; - t.Eth = 722; - t.Ccedilla = 667; - t.lcommaaccent = 278; - t.tcaron = 326; - t.eogonek = 444; - t.Uogonek = 722; - t.Aacute = 722; - t.Adieresis = 722; - t.egrave = 444; - t.zacute = 444; - t.iogonek = 278; - t.Oacute = 722; - t.oacute = 500; - t.amacron = 444; - t.sacute = 389; - t.idieresis = 278; - t.Ocircumflex = 722; - t.Ugrave = 722; - t.Delta = 612; - t.thorn = 500; - t.twosuperior = 300; - t.Odieresis = 722; - t.mu = 500; - t.igrave = 278; - t.ohungarumlaut = 500; - t.Eogonek = 611; - t.dcroat = 500; - t.threequarters = 750; - t.Scedilla = 556; - t.lcaron = 344; - t.Kcommaaccent = 722; - t.Lacute = 611; - t.trademark = 980; - t.edotaccent = 444; - t.Igrave = 333; - t.Imacron = 333; - t.Lcaron = 611; - t.onehalf = 750; - t.lessequal = 549; - t.ocircumflex = 500; - t.ntilde = 500; - t.Uhungarumlaut = 722; - t.Eacute = 611; - t.emacron = 444; - t.gbreve = 500; - t.onequarter = 750; - t.Scaron = 556; - t.Scommaaccent = 556; - t.Ohungarumlaut = 722; - t.degree = 400; - t.ograve = 500; - t.Ccaron = 667; - t.ugrave = 500; - t.radical = 453; - t.Dcaron = 722; - t.rcommaaccent = 333; - t.Ntilde = 722; - t.otilde = 500; - t.Rcommaaccent = 667; - t.Lcommaaccent = 611; - t.Atilde = 722; - t.Aogonek = 722; - t.Aring = 722; - t.Otilde = 722; - t.zdotaccent = 444; - t.Ecaron = 611; - t.Iogonek = 333; - t.kcommaaccent = 500; - t.minus = 564; - t.Icircumflex = 333; - t.ncaron = 500; - t.tcommaaccent = 278; - t.logicalnot = 564; - t.odieresis = 500; - t.udieresis = 500; - t.notequal = 549; - t.gcommaaccent = 500; - t.eth = 500; - t.zcaron = 444; - t.ncommaaccent = 500; - t.onesuperior = 300; - t.imacron = 278; - t.Euro = 500; - }); - t["Times-Bold"] = (0, _core_utils.getLookupTableFactory)(function (t) { - t.space = 250; - t.exclam = 333; - t.quotedbl = 555; - t.numbersign = 500; - t.dollar = 500; - t.percent = 1000; - t.ampersand = 833; - t.quoteright = 333; - t.parenleft = 333; - t.parenright = 333; - t.asterisk = 500; - t.plus = 570; - t.comma = 250; - t.hyphen = 333; - t.period = 250; - t.slash = 278; - t.zero = 500; - t.one = 500; - t.two = 500; - t.three = 500; - t.four = 500; - t.five = 500; - t.six = 500; - t.seven = 500; - t.eight = 500; - t.nine = 500; - t.colon = 333; - t.semicolon = 333; - t.less = 570; - t.equal = 570; - t.greater = 570; - t.question = 500; - t.at = 930; - t.A = 722; - t.B = 667; - t.C = 722; - t.D = 722; - t.E = 667; - t.F = 611; - t.G = 778; - t.H = 778; - t.I = 389; - t.J = 500; - t.K = 778; - t.L = 667; - t.M = 944; - t.N = 722; - t.O = 778; - t.P = 611; - t.Q = 778; - t.R = 722; - t.S = 556; - t.T = 667; - t.U = 722; - t.V = 722; - t.W = 1000; - t.X = 722; - t.Y = 722; - t.Z = 667; - t.bracketleft = 333; - t.backslash = 278; - t.bracketright = 333; - t.asciicircum = 581; - t.underscore = 500; - t.quoteleft = 333; - t.a = 500; - t.b = 556; - t.c = 444; - t.d = 556; - t.e = 444; - t.f = 333; - t.g = 500; - t.h = 556; - t.i = 278; - t.j = 333; - t.k = 556; - t.l = 278; - t.m = 833; - t.n = 556; - t.o = 500; - t.p = 556; - t.q = 556; - t.r = 444; - t.s = 389; - t.t = 333; - t.u = 556; - t.v = 500; - t.w = 722; - t.x = 500; - t.y = 500; - t.z = 444; - t.braceleft = 394; - t.bar = 220; - t.braceright = 394; - t.asciitilde = 520; - t.exclamdown = 333; - t.cent = 500; - t.sterling = 500; - t.fraction = 167; - t.yen = 500; - t.florin = 500; - t.section = 500; - t.currency = 500; - t.quotesingle = 278; - t.quotedblleft = 500; - t.guillemotleft = 500; - t.guilsinglleft = 333; - t.guilsinglright = 333; - t.fi = 556; - t.fl = 556; - t.endash = 500; - t.dagger = 500; - t.daggerdbl = 500; - t.periodcentered = 250; - t.paragraph = 540; - t.bullet = 350; - t.quotesinglbase = 333; - t.quotedblbase = 500; - t.quotedblright = 500; - t.guillemotright = 500; - t.ellipsis = 1000; - t.perthousand = 1000; - t.questiondown = 500; - t.grave = 333; - t.acute = 333; - t.circumflex = 333; - t.tilde = 333; - t.macron = 333; - t.breve = 333; - t.dotaccent = 333; - t.dieresis = 333; - t.ring = 333; - t.cedilla = 333; - t.hungarumlaut = 333; - t.ogonek = 333; - t.caron = 333; - t.emdash = 1000; - t.AE = 1000; - t.ordfeminine = 300; - t.Lslash = 667; - t.Oslash = 778; - t.OE = 1000; - t.ordmasculine = 330; - t.ae = 722; - t.dotlessi = 278; - t.lslash = 278; - t.oslash = 500; - t.oe = 722; - t.germandbls = 556; - t.Idieresis = 389; - t.eacute = 444; - t.abreve = 500; - t.uhungarumlaut = 556; - t.ecaron = 444; - t.Ydieresis = 722; - t.divide = 570; - t.Yacute = 722; - t.Acircumflex = 722; - t.aacute = 500; - t.Ucircumflex = 722; - t.yacute = 500; - t.scommaaccent = 389; - t.ecircumflex = 444; - t.Uring = 722; - t.Udieresis = 722; - t.aogonek = 500; - t.Uacute = 722; - t.uogonek = 556; - t.Edieresis = 667; - t.Dcroat = 722; - t.commaaccent = 250; - t.copyright = 747; - t.Emacron = 667; - t.ccaron = 444; - t.aring = 500; - t.Ncommaaccent = 722; - t.lacute = 278; - t.agrave = 500; - t.Tcommaaccent = 667; - t.Cacute = 722; - t.atilde = 500; - t.Edotaccent = 667; - t.scaron = 389; - t.scedilla = 389; - t.iacute = 278; - t.lozenge = 494; - t.Rcaron = 722; - t.Gcommaaccent = 778; - t.ucircumflex = 556; - t.acircumflex = 500; - t.Amacron = 722; - t.rcaron = 444; - t.ccedilla = 444; - t.Zdotaccent = 667; - t.Thorn = 611; - t.Omacron = 778; - t.Racute = 722; - t.Sacute = 556; - t.dcaron = 672; - t.Umacron = 722; - t.uring = 556; - t.threesuperior = 300; - t.Ograve = 778; - t.Agrave = 722; - t.Abreve = 722; - t.multiply = 570; - t.uacute = 556; - t.Tcaron = 667; - t.partialdiff = 494; - t.ydieresis = 500; - t.Nacute = 722; - t.icircumflex = 278; - t.Ecircumflex = 667; - t.adieresis = 500; - t.edieresis = 444; - t.cacute = 444; - t.nacute = 556; - t.umacron = 556; - t.Ncaron = 722; - t.Iacute = 389; - t.plusminus = 570; - t.brokenbar = 220; - t.registered = 747; - t.Gbreve = 778; - t.Idotaccent = 389; - t.summation = 600; - t.Egrave = 667; - t.racute = 444; - t.omacron = 500; - t.Zacute = 667; - t.Zcaron = 667; - t.greaterequal = 549; - t.Eth = 722; - t.Ccedilla = 722; - t.lcommaaccent = 278; - t.tcaron = 416; - t.eogonek = 444; - t.Uogonek = 722; - t.Aacute = 722; - t.Adieresis = 722; - t.egrave = 444; - t.zacute = 444; - t.iogonek = 278; - t.Oacute = 778; - t.oacute = 500; - t.amacron = 500; - t.sacute = 389; - t.idieresis = 278; - t.Ocircumflex = 778; - t.Ugrave = 722; - t.Delta = 612; - t.thorn = 556; - t.twosuperior = 300; - t.Odieresis = 778; - t.mu = 556; - t.igrave = 278; - t.ohungarumlaut = 500; - t.Eogonek = 667; - t.dcroat = 556; - t.threequarters = 750; - t.Scedilla = 556; - t.lcaron = 394; - t.Kcommaaccent = 778; - t.Lacute = 667; - t.trademark = 1000; - t.edotaccent = 444; - t.Igrave = 389; - t.Imacron = 389; - t.Lcaron = 667; - t.onehalf = 750; - t.lessequal = 549; - t.ocircumflex = 500; - t.ntilde = 556; - t.Uhungarumlaut = 722; - t.Eacute = 667; - t.emacron = 444; - t.gbreve = 500; - t.onequarter = 750; - t.Scaron = 556; - t.Scommaaccent = 556; - t.Ohungarumlaut = 778; - t.degree = 400; - t.ograve = 500; - t.Ccaron = 722; - t.ugrave = 556; - t.radical = 549; - t.Dcaron = 722; - t.rcommaaccent = 444; - t.Ntilde = 722; - t.otilde = 500; - t.Rcommaaccent = 722; - t.Lcommaaccent = 667; - t.Atilde = 722; - t.Aogonek = 722; - t.Aring = 722; - t.Otilde = 778; - t.zdotaccent = 444; - t.Ecaron = 667; - t.Iogonek = 389; - t.kcommaaccent = 556; - t.minus = 570; - t.Icircumflex = 389; - t.ncaron = 556; - t.tcommaaccent = 333; - t.logicalnot = 570; - t.odieresis = 500; - t.udieresis = 556; - t.notequal = 549; - t.gcommaaccent = 500; - t.eth = 500; - t.zcaron = 444; - t.ncommaaccent = 556; - t.onesuperior = 300; - t.imacron = 278; - t.Euro = 500; - }); - t["Times-BoldItalic"] = (0, _core_utils.getLookupTableFactory)(function (t) { - t.space = 250; - t.exclam = 389; - t.quotedbl = 555; - t.numbersign = 500; - t.dollar = 500; - t.percent = 833; - t.ampersand = 778; - t.quoteright = 333; - t.parenleft = 333; - t.parenright = 333; - t.asterisk = 500; - t.plus = 570; - t.comma = 250; - t.hyphen = 333; - t.period = 250; - t.slash = 278; - t.zero = 500; - t.one = 500; - t.two = 500; - t.three = 500; - t.four = 500; - t.five = 500; - t.six = 500; - t.seven = 500; - t.eight = 500; - t.nine = 500; - t.colon = 333; - t.semicolon = 333; - t.less = 570; - t.equal = 570; - t.greater = 570; - t.question = 500; - t.at = 832; - t.A = 667; - t.B = 667; - t.C = 667; - t.D = 722; - t.E = 667; - t.F = 667; - t.G = 722; - t.H = 778; - t.I = 389; - t.J = 500; - t.K = 667; - t.L = 611; - t.M = 889; - t.N = 722; - t.O = 722; - t.P = 611; - t.Q = 722; - t.R = 667; - t.S = 556; - t.T = 611; - t.U = 722; - t.V = 667; - t.W = 889; - t.X = 667; - t.Y = 611; - t.Z = 611; - t.bracketleft = 333; - t.backslash = 278; - t.bracketright = 333; - t.asciicircum = 570; - t.underscore = 500; - t.quoteleft = 333; - t.a = 500; - t.b = 500; - t.c = 444; - t.d = 500; - t.e = 444; - t.f = 333; - t.g = 500; - t.h = 556; - t.i = 278; - t.j = 278; - t.k = 500; - t.l = 278; - t.m = 778; - t.n = 556; - t.o = 500; - t.p = 500; - t.q = 500; - t.r = 389; - t.s = 389; - t.t = 278; - t.u = 556; - t.v = 444; - t.w = 667; - t.x = 500; - t.y = 444; - t.z = 389; - t.braceleft = 348; - t.bar = 220; - t.braceright = 348; - t.asciitilde = 570; - t.exclamdown = 389; - t.cent = 500; - t.sterling = 500; - t.fraction = 167; - t.yen = 500; - t.florin = 500; - t.section = 500; - t.currency = 500; - t.quotesingle = 278; - t.quotedblleft = 500; - t.guillemotleft = 500; - t.guilsinglleft = 333; - t.guilsinglright = 333; - t.fi = 556; - t.fl = 556; - t.endash = 500; - t.dagger = 500; - t.daggerdbl = 500; - t.periodcentered = 250; - t.paragraph = 500; - t.bullet = 350; - t.quotesinglbase = 333; - t.quotedblbase = 500; - t.quotedblright = 500; - t.guillemotright = 500; - t.ellipsis = 1000; - t.perthousand = 1000; - t.questiondown = 500; - t.grave = 333; - t.acute = 333; - t.circumflex = 333; - t.tilde = 333; - t.macron = 333; - t.breve = 333; - t.dotaccent = 333; - t.dieresis = 333; - t.ring = 333; - t.cedilla = 333; - t.hungarumlaut = 333; - t.ogonek = 333; - t.caron = 333; - t.emdash = 1000; - t.AE = 944; - t.ordfeminine = 266; - t.Lslash = 611; - t.Oslash = 722; - t.OE = 944; - t.ordmasculine = 300; - t.ae = 722; - t.dotlessi = 278; - t.lslash = 278; - t.oslash = 500; - t.oe = 722; - t.germandbls = 500; - t.Idieresis = 389; - t.eacute = 444; - t.abreve = 500; - t.uhungarumlaut = 556; - t.ecaron = 444; - t.Ydieresis = 611; - t.divide = 570; - t.Yacute = 611; - t.Acircumflex = 667; - t.aacute = 500; - t.Ucircumflex = 722; - t.yacute = 444; - t.scommaaccent = 389; - t.ecircumflex = 444; - t.Uring = 722; - t.Udieresis = 722; - t.aogonek = 500; - t.Uacute = 722; - t.uogonek = 556; - t.Edieresis = 667; - t.Dcroat = 722; - t.commaaccent = 250; - t.copyright = 747; - t.Emacron = 667; - t.ccaron = 444; - t.aring = 500; - t.Ncommaaccent = 722; - t.lacute = 278; - t.agrave = 500; - t.Tcommaaccent = 611; - t.Cacute = 667; - t.atilde = 500; - t.Edotaccent = 667; - t.scaron = 389; - t.scedilla = 389; - t.iacute = 278; - t.lozenge = 494; - t.Rcaron = 667; - t.Gcommaaccent = 722; - t.ucircumflex = 556; - t.acircumflex = 500; - t.Amacron = 667; - t.rcaron = 389; - t.ccedilla = 444; - t.Zdotaccent = 611; - t.Thorn = 611; - t.Omacron = 722; - t.Racute = 667; - t.Sacute = 556; - t.dcaron = 608; - t.Umacron = 722; - t.uring = 556; - t.threesuperior = 300; - t.Ograve = 722; - t.Agrave = 667; - t.Abreve = 667; - t.multiply = 570; - t.uacute = 556; - t.Tcaron = 611; - t.partialdiff = 494; - t.ydieresis = 444; - t.Nacute = 722; - t.icircumflex = 278; - t.Ecircumflex = 667; - t.adieresis = 500; - t.edieresis = 444; - t.cacute = 444; - t.nacute = 556; - t.umacron = 556; - t.Ncaron = 722; - t.Iacute = 389; - t.plusminus = 570; - t.brokenbar = 220; - t.registered = 747; - t.Gbreve = 722; - t.Idotaccent = 389; - t.summation = 600; - t.Egrave = 667; - t.racute = 389; - t.omacron = 500; - t.Zacute = 611; - t.Zcaron = 611; - t.greaterequal = 549; - t.Eth = 722; - t.Ccedilla = 667; - t.lcommaaccent = 278; - t.tcaron = 366; - t.eogonek = 444; - t.Uogonek = 722; - t.Aacute = 667; - t.Adieresis = 667; - t.egrave = 444; - t.zacute = 389; - t.iogonek = 278; - t.Oacute = 722; - t.oacute = 500; - t.amacron = 500; - t.sacute = 389; - t.idieresis = 278; - t.Ocircumflex = 722; - t.Ugrave = 722; - t.Delta = 612; - t.thorn = 500; - t.twosuperior = 300; - t.Odieresis = 722; - t.mu = 576; - t.igrave = 278; - t.ohungarumlaut = 500; - t.Eogonek = 667; - t.dcroat = 500; - t.threequarters = 750; - t.Scedilla = 556; - t.lcaron = 382; - t.Kcommaaccent = 667; - t.Lacute = 611; - t.trademark = 1000; - t.edotaccent = 444; - t.Igrave = 389; - t.Imacron = 389; - t.Lcaron = 611; - t.onehalf = 750; - t.lessequal = 549; - t.ocircumflex = 500; - t.ntilde = 556; - t.Uhungarumlaut = 722; - t.Eacute = 667; - t.emacron = 444; - t.gbreve = 500; - t.onequarter = 750; - t.Scaron = 556; - t.Scommaaccent = 556; - t.Ohungarumlaut = 722; - t.degree = 400; - t.ograve = 500; - t.Ccaron = 667; - t.ugrave = 556; - t.radical = 549; - t.Dcaron = 722; - t.rcommaaccent = 389; - t.Ntilde = 722; - t.otilde = 500; - t.Rcommaaccent = 667; - t.Lcommaaccent = 611; - t.Atilde = 667; - t.Aogonek = 667; - t.Aring = 667; - t.Otilde = 722; - t.zdotaccent = 389; - t.Ecaron = 667; - t.Iogonek = 389; - t.kcommaaccent = 500; - t.minus = 606; - t.Icircumflex = 389; - t.ncaron = 556; - t.tcommaaccent = 278; - t.logicalnot = 606; - t.odieresis = 500; - t.udieresis = 556; - t.notequal = 549; - t.gcommaaccent = 500; - t.eth = 500; - t.zcaron = 389; - t.ncommaaccent = 556; - t.onesuperior = 300; - t.imacron = 278; - t.Euro = 500; - }); - t["Times-Italic"] = (0, _core_utils.getLookupTableFactory)(function (t) { - t.space = 250; - t.exclam = 333; - t.quotedbl = 420; - t.numbersign = 500; - t.dollar = 500; - t.percent = 833; - t.ampersand = 778; - t.quoteright = 333; - t.parenleft = 333; - t.parenright = 333; - t.asterisk = 500; - t.plus = 675; - t.comma = 250; - t.hyphen = 333; - t.period = 250; - t.slash = 278; - t.zero = 500; - t.one = 500; - t.two = 500; - t.three = 500; - t.four = 500; - t.five = 500; - t.six = 500; - t.seven = 500; - t.eight = 500; - t.nine = 500; - t.colon = 333; - t.semicolon = 333; - t.less = 675; - t.equal = 675; - t.greater = 675; - t.question = 500; - t.at = 920; - t.A = 611; - t.B = 611; - t.C = 667; - t.D = 722; - t.E = 611; - t.F = 611; - t.G = 722; - t.H = 722; - t.I = 333; - t.J = 444; - t.K = 667; - t.L = 556; - t.M = 833; - t.N = 667; - t.O = 722; - t.P = 611; - t.Q = 722; - t.R = 611; - t.S = 500; - t.T = 556; - t.U = 722; - t.V = 611; - t.W = 833; - t.X = 611; - t.Y = 556; - t.Z = 556; - t.bracketleft = 389; - t.backslash = 278; - t.bracketright = 389; - t.asciicircum = 422; - t.underscore = 500; - t.quoteleft = 333; - t.a = 500; - t.b = 500; - t.c = 444; - t.d = 500; - t.e = 444; - t.f = 278; - t.g = 500; - t.h = 500; - t.i = 278; - t.j = 278; - t.k = 444; - t.l = 278; - t.m = 722; - t.n = 500; - t.o = 500; - t.p = 500; - t.q = 500; - t.r = 389; - t.s = 389; - t.t = 278; - t.u = 500; - t.v = 444; - t.w = 667; - t.x = 444; - t.y = 444; - t.z = 389; - t.braceleft = 400; - t.bar = 275; - t.braceright = 400; - t.asciitilde = 541; - t.exclamdown = 389; - t.cent = 500; - t.sterling = 500; - t.fraction = 167; - t.yen = 500; - t.florin = 500; - t.section = 500; - t.currency = 500; - t.quotesingle = 214; - t.quotedblleft = 556; - t.guillemotleft = 500; - t.guilsinglleft = 333; - t.guilsinglright = 333; - t.fi = 500; - t.fl = 500; - t.endash = 500; - t.dagger = 500; - t.daggerdbl = 500; - t.periodcentered = 250; - t.paragraph = 523; - t.bullet = 350; - t.quotesinglbase = 333; - t.quotedblbase = 556; - t.quotedblright = 556; - t.guillemotright = 500; - t.ellipsis = 889; - t.perthousand = 1000; - t.questiondown = 500; - t.grave = 333; - t.acute = 333; - t.circumflex = 333; - t.tilde = 333; - t.macron = 333; - t.breve = 333; - t.dotaccent = 333; - t.dieresis = 333; - t.ring = 333; - t.cedilla = 333; - t.hungarumlaut = 333; - t.ogonek = 333; - t.caron = 333; - t.emdash = 889; - t.AE = 889; - t.ordfeminine = 276; - t.Lslash = 556; - t.Oslash = 722; - t.OE = 944; - t.ordmasculine = 310; - t.ae = 667; - t.dotlessi = 278; - t.lslash = 278; - t.oslash = 500; - t.oe = 667; - t.germandbls = 500; - t.Idieresis = 333; - t.eacute = 444; - t.abreve = 500; - t.uhungarumlaut = 500; - t.ecaron = 444; - t.Ydieresis = 556; - t.divide = 675; - t.Yacute = 556; - t.Acircumflex = 611; - t.aacute = 500; - t.Ucircumflex = 722; - t.yacute = 444; - t.scommaaccent = 389; - t.ecircumflex = 444; - t.Uring = 722; - t.Udieresis = 722; - t.aogonek = 500; - t.Uacute = 722; - t.uogonek = 500; - t.Edieresis = 611; - t.Dcroat = 722; - t.commaaccent = 250; - t.copyright = 760; - t.Emacron = 611; - t.ccaron = 444; - t.aring = 500; - t.Ncommaaccent = 667; - t.lacute = 278; - t.agrave = 500; - t.Tcommaaccent = 556; - t.Cacute = 667; - t.atilde = 500; - t.Edotaccent = 611; - t.scaron = 389; - t.scedilla = 389; - t.iacute = 278; - t.lozenge = 471; - t.Rcaron = 611; - t.Gcommaaccent = 722; - t.ucircumflex = 500; - t.acircumflex = 500; - t.Amacron = 611; - t.rcaron = 389; - t.ccedilla = 444; - t.Zdotaccent = 556; - t.Thorn = 611; - t.Omacron = 722; - t.Racute = 611; - t.Sacute = 500; - t.dcaron = 544; - t.Umacron = 722; - t.uring = 500; - t.threesuperior = 300; - t.Ograve = 722; - t.Agrave = 611; - t.Abreve = 611; - t.multiply = 675; - t.uacute = 500; - t.Tcaron = 556; - t.partialdiff = 476; - t.ydieresis = 444; - t.Nacute = 667; - t.icircumflex = 278; - t.Ecircumflex = 611; - t.adieresis = 500; - t.edieresis = 444; - t.cacute = 444; - t.nacute = 500; - t.umacron = 500; - t.Ncaron = 667; - t.Iacute = 333; - t.plusminus = 675; - t.brokenbar = 275; - t.registered = 760; - t.Gbreve = 722; - t.Idotaccent = 333; - t.summation = 600; - t.Egrave = 611; - t.racute = 389; - t.omacron = 500; - t.Zacute = 556; - t.Zcaron = 556; - t.greaterequal = 549; - t.Eth = 722; - t.Ccedilla = 667; - t.lcommaaccent = 278; - t.tcaron = 300; - t.eogonek = 444; - t.Uogonek = 722; - t.Aacute = 611; - t.Adieresis = 611; - t.egrave = 444; - t.zacute = 389; - t.iogonek = 278; - t.Oacute = 722; - t.oacute = 500; - t.amacron = 500; - t.sacute = 389; - t.idieresis = 278; - t.Ocircumflex = 722; - t.Ugrave = 722; - t.Delta = 612; - t.thorn = 500; - t.twosuperior = 300; - t.Odieresis = 722; - t.mu = 500; - t.igrave = 278; - t.ohungarumlaut = 500; - t.Eogonek = 611; - t.dcroat = 500; - t.threequarters = 750; - t.Scedilla = 500; - t.lcaron = 300; - t.Kcommaaccent = 667; - t.Lacute = 556; - t.trademark = 980; - t.edotaccent = 444; - t.Igrave = 333; - t.Imacron = 333; - t.Lcaron = 611; - t.onehalf = 750; - t.lessequal = 549; - t.ocircumflex = 500; - t.ntilde = 500; - t.Uhungarumlaut = 722; - t.Eacute = 611; - t.emacron = 444; - t.gbreve = 500; - t.onequarter = 750; - t.Scaron = 500; - t.Scommaaccent = 500; - t.Ohungarumlaut = 722; - t.degree = 400; - t.ograve = 500; - t.Ccaron = 667; - t.ugrave = 500; - t.radical = 453; - t.Dcaron = 722; - t.rcommaaccent = 389; - t.Ntilde = 667; - t.otilde = 500; - t.Rcommaaccent = 611; - t.Lcommaaccent = 556; - t.Atilde = 611; - t.Aogonek = 611; - t.Aring = 611; - t.Otilde = 722; - t.zdotaccent = 389; - t.Ecaron = 611; - t.Iogonek = 333; - t.kcommaaccent = 444; - t.minus = 675; - t.Icircumflex = 333; - t.ncaron = 500; - t.tcommaaccent = 278; - t.logicalnot = 675; - t.odieresis = 500; - t.udieresis = 500; - t.notequal = 549; - t.gcommaaccent = 500; - t.eth = 500; - t.zcaron = 389; - t.ncommaaccent = 500; - t.onesuperior = 300; - t.imacron = 278; - t.Euro = 500; - }); - t.ZapfDingbats = (0, _core_utils.getLookupTableFactory)(function (t) { - t.space = 278; - t.a1 = 974; - t.a2 = 961; - t.a202 = 974; - t.a3 = 980; - t.a4 = 719; - t.a5 = 789; - t.a119 = 790; - t.a118 = 791; - t.a117 = 690; - t.a11 = 960; - t.a12 = 939; - t.a13 = 549; - t.a14 = 855; - t.a15 = 911; - t.a16 = 933; - t.a105 = 911; - t.a17 = 945; - t.a18 = 974; - t.a19 = 755; - t.a20 = 846; - t.a21 = 762; - t.a22 = 761; - t.a23 = 571; - t.a24 = 677; - t.a25 = 763; - t.a26 = 760; - t.a27 = 759; - t.a28 = 754; - t.a6 = 494; - t.a7 = 552; - t.a8 = 537; - t.a9 = 577; - t.a10 = 692; - t.a29 = 786; - t.a30 = 788; - t.a31 = 788; - t.a32 = 790; - t.a33 = 793; - t.a34 = 794; - t.a35 = 816; - t.a36 = 823; - t.a37 = 789; - t.a38 = 841; - t.a39 = 823; - t.a40 = 833; - t.a41 = 816; - t.a42 = 831; - t.a43 = 923; - t.a44 = 744; - t.a45 = 723; - t.a46 = 749; - t.a47 = 790; - t.a48 = 792; - t.a49 = 695; - t.a50 = 776; - t.a51 = 768; - t.a52 = 792; - t.a53 = 759; - t.a54 = 707; - t.a55 = 708; - t.a56 = 682; - t.a57 = 701; - t.a58 = 826; - t.a59 = 815; - t.a60 = 789; - t.a61 = 789; - t.a62 = 707; - t.a63 = 687; - t.a64 = 696; - t.a65 = 689; - t.a66 = 786; - t.a67 = 787; - t.a68 = 713; - t.a69 = 791; - t.a70 = 785; - t.a71 = 791; - t.a72 = 873; - t.a73 = 761; - t.a74 = 762; - t.a203 = 762; - t.a75 = 759; - t.a204 = 759; - t.a76 = 892; - t.a77 = 892; - t.a78 = 788; - t.a79 = 784; - t.a81 = 438; - t.a82 = 138; - t.a83 = 277; - t.a84 = 415; - t.a97 = 392; - t.a98 = 392; - t.a99 = 668; - t.a100 = 668; - t.a89 = 390; - t.a90 = 390; - t.a93 = 317; - t.a94 = 317; - t.a91 = 276; - t.a92 = 276; - t.a205 = 509; - t.a85 = 509; - t.a206 = 410; - t.a86 = 410; - t.a87 = 234; - t.a88 = 234; - t.a95 = 334; - t.a96 = 334; - t.a101 = 732; - t.a102 = 544; - t.a103 = 544; - t.a104 = 910; - t.a106 = 667; - t.a107 = 760; - t.a108 = 760; - t.a112 = 776; - t.a111 = 595; - t.a110 = 694; - t.a109 = 626; - t.a120 = 788; - t.a121 = 788; - t.a122 = 788; - t.a123 = 788; - t.a124 = 788; - t.a125 = 788; - t.a126 = 788; - t.a127 = 788; - t.a128 = 788; - t.a129 = 788; - t.a130 = 788; - t.a131 = 788; - t.a132 = 788; - t.a133 = 788; - t.a134 = 788; - t.a135 = 788; - t.a136 = 788; - t.a137 = 788; - t.a138 = 788; - t.a139 = 788; - t.a140 = 788; - t.a141 = 788; - t.a142 = 788; - t.a143 = 788; - t.a144 = 788; - t.a145 = 788; - t.a146 = 788; - t.a147 = 788; - t.a148 = 788; - t.a149 = 788; - t.a150 = 788; - t.a151 = 788; - t.a152 = 788; - t.a153 = 788; - t.a154 = 788; - t.a155 = 788; - t.a156 = 788; - t.a157 = 788; - t.a158 = 788; - t.a159 = 788; - t.a160 = 894; - t.a161 = 838; - t.a163 = 1016; - t.a164 = 458; - t.a196 = 748; - t.a165 = 924; - t.a192 = 748; - t.a166 = 918; - t.a167 = 927; - t.a168 = 928; - t.a169 = 928; - t.a170 = 834; - t.a171 = 873; - t.a172 = 828; - t.a173 = 924; - t.a162 = 924; - t.a174 = 917; - t.a175 = 930; - t.a176 = 931; - t.a177 = 463; - t.a178 = 883; - t.a179 = 836; - t.a193 = 836; - t.a180 = 867; - t.a199 = 867; - t.a181 = 696; - t.a200 = 696; - t.a182 = 874; - t.a201 = 874; - t.a183 = 760; - t.a184 = 946; - t.a197 = 771; - t.a185 = 865; - t.a194 = 771; - t.a198 = 888; - t.a186 = 967; - t.a195 = 888; - t.a187 = 831; - t.a188 = 873; - t.a189 = 927; - t.a190 = 970; - t.a191 = 918; - }); -}); -exports.getMetrics = getMetrics; - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __w_pdfjs_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isPDFFunction = isPDFFunction; -exports.PostScriptCompiler = exports.PostScriptEvaluator = exports.PDFFunctionFactory = void 0; - -var _util = __w_pdfjs_require__(2); - -var _primitives = __w_pdfjs_require__(5); - -var _ps_parser = __w_pdfjs_require__(42); - -class PDFFunctionFactory { - constructor({ - xref, - isEvalSupported = true - }) { - this.xref = xref; - this.isEvalSupported = isEvalSupported !== false; - } - - create(fn) { - return PDFFunction.parse({ - xref: this.xref, - isEvalSupported: this.isEvalSupported, - fn - }); - } - - createFromArray(fnObj) { - return PDFFunction.parseArray({ - xref: this.xref, - isEvalSupported: this.isEvalSupported, - fnObj - }); - } - -} - -exports.PDFFunctionFactory = PDFFunctionFactory; - -function toNumberArray(arr) { - if (!Array.isArray(arr)) { - return null; - } - - const length = arr.length; - - for (let i = 0; i < length; i++) { - if (typeof arr[i] !== "number") { - const result = new Array(length); - - for (let j = 0; j < length; j++) { - result[j] = +arr[j]; - } - - return result; - } - } - - return arr; -} - -var PDFFunction = function PDFFunctionClosure() { - const CONSTRUCT_SAMPLED = 0; - const CONSTRUCT_INTERPOLATED = 2; - const CONSTRUCT_STICHED = 3; - const CONSTRUCT_POSTSCRIPT = 4; - return { - getSampleArray(size, outputSize, bps, stream) { - var i, ii; - var length = 1; - - for (i = 0, ii = size.length; i < ii; i++) { - length *= size[i]; - } - - length *= outputSize; - var array = new Array(length); - var codeSize = 0; - var codeBuf = 0; - var sampleMul = 1.0 / (2.0 ** bps - 1); - var strBytes = stream.getBytes((length * bps + 7) / 8); - var strIdx = 0; - - for (i = 0; i < length; i++) { - while (codeSize < bps) { - codeBuf <<= 8; - codeBuf |= strBytes[strIdx++]; - codeSize += 8; - } - - codeSize -= bps; - array[i] = (codeBuf >> codeSize) * sampleMul; - codeBuf &= (1 << codeSize) - 1; - } - - return array; - }, - - getIR({ - xref, - isEvalSupported, - fn - }) { - var dict = fn.dict; - - if (!dict) { - dict = fn; - } - - var types = [this.constructSampled, null, this.constructInterpolated, this.constructStiched, this.constructPostScript]; - var typeNum = dict.get("FunctionType"); - var typeFn = types[typeNum]; - - if (!typeFn) { - throw new _util.FormatError("Unknown type of function"); - } - - return typeFn.call(this, { - xref, - isEvalSupported, - fn, - dict - }); - }, - - fromIR({ - xref, - isEvalSupported, - IR - }) { - var type = IR[0]; - - switch (type) { - case CONSTRUCT_SAMPLED: - return this.constructSampledFromIR({ - xref, - isEvalSupported, - IR - }); - - case CONSTRUCT_INTERPOLATED: - return this.constructInterpolatedFromIR({ - xref, - isEvalSupported, - IR - }); - - case CONSTRUCT_STICHED: - return this.constructStichedFromIR({ - xref, - isEvalSupported, - IR - }); - - default: - return this.constructPostScriptFromIR({ - xref, - isEvalSupported, - IR - }); - } - }, - - parse({ - xref, - isEvalSupported, - fn - }) { - const IR = this.getIR({ - xref, - isEvalSupported, - fn - }); - return this.fromIR({ - xref, - isEvalSupported, - IR - }); - }, - - parseArray({ - xref, - isEvalSupported, - fnObj - }) { - if (!Array.isArray(fnObj)) { - return this.parse({ - xref, - isEvalSupported, - fn: fnObj - }); - } - - var fnArray = []; - - for (var j = 0, jj = fnObj.length; j < jj; j++) { - fnArray.push(this.parse({ - xref, - isEvalSupported, - fn: xref.fetchIfRef(fnObj[j]) - })); - } - - return function (src, srcOffset, dest, destOffset) { - for (var i = 0, ii = fnArray.length; i < ii; i++) { - fnArray[i](src, srcOffset, dest, destOffset + i); - } - }; - }, - - constructSampled({ - xref, - isEvalSupported, - fn, - dict - }) { - function toMultiArray(arr) { - var inputLength = arr.length; - var out = []; - var index = 0; - - for (var i = 0; i < inputLength; i += 2) { - out[index] = [arr[i], arr[i + 1]]; - ++index; - } - - return out; - } - - var domain = toNumberArray(dict.getArray("Domain")); - var range = toNumberArray(dict.getArray("Range")); - - if (!domain || !range) { - throw new _util.FormatError("No domain or range"); - } - - var inputSize = domain.length / 2; - var outputSize = range.length / 2; - domain = toMultiArray(domain); - range = toMultiArray(range); - var size = toNumberArray(dict.getArray("Size")); - var bps = dict.get("BitsPerSample"); - var order = dict.get("Order") || 1; - - if (order !== 1) { - (0, _util.info)("No support for cubic spline interpolation: " + order); - } - - var encode = toNumberArray(dict.getArray("Encode")); - - if (!encode) { - encode = []; - - for (var i = 0; i < inputSize; ++i) { - encode.push([0, size[i] - 1]); - } - } else { - encode = toMultiArray(encode); - } - - var decode = toNumberArray(dict.getArray("Decode")); - - if (!decode) { - decode = range; - } else { - decode = toMultiArray(decode); - } - - var samples = this.getSampleArray(size, outputSize, bps, fn); - return [CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, outputSize, 2 ** bps - 1, range]; - }, - - constructSampledFromIR({ - xref, - isEvalSupported, - IR - }) { - function interpolate(x, xmin, xmax, ymin, ymax) { - return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); - } - - return function constructSampledFromIRResult(src, srcOffset, dest, destOffset) { - var m = IR[1]; - var domain = IR[2]; - var encode = IR[3]; - var decode = IR[4]; - var samples = IR[5]; - var size = IR[6]; - var n = IR[7]; - var range = IR[9]; - var cubeVertices = 1 << m; - var cubeN = new Float64Array(cubeVertices); - var cubeVertex = new Uint32Array(cubeVertices); - var i, j; - - for (j = 0; j < cubeVertices; j++) { - cubeN[j] = 1; - } - - var k = n, - pos = 1; - - for (i = 0; i < m; ++i) { - var domain_2i = domain[i][0]; - var domain_2i_1 = domain[i][1]; - var xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); - var e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); - var size_i = size[i]; - e = Math.min(Math.max(e, 0), size_i - 1); - var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; - var n0 = e0 + 1 - e; - var n1 = e - e0; - var offset0 = e0 * k; - var offset1 = offset0 + k; + for (i = 0; i < m; ++i) { + var domain_2i = domain[i][0]; + var domain_2i_1 = domain[i][1]; + var xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); + var e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); + var size_i = size[i]; + e = Math.min(Math.max(e, 0), size_i - 1); + var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; + var n0 = e0 + 1 - e; + var n1 = e - e0; + var offset0 = e0 * k; + var offset1 = offset0 + k; for (j = 0; j < cubeVertices; j++) { if (j & pos) { @@ -43496,776 +41890,1342 @@ function isPDFFunction(v) { return false; } - return fnDict.has("FunctionType"); -} + return fnDict.has("FunctionType"); +} + +var PostScriptStack = function PostScriptStackClosure() { + var MAX_STACK_SIZE = 100; + + function PostScriptStack(initialStack) { + this.stack = !initialStack ? [] : Array.prototype.slice.call(initialStack, 0); + } + + PostScriptStack.prototype = { + push: function PostScriptStack_push(value) { + if (this.stack.length >= MAX_STACK_SIZE) { + throw new Error("PostScript function stack overflow."); + } + + this.stack.push(value); + }, + pop: function PostScriptStack_pop() { + if (this.stack.length <= 0) { + throw new Error("PostScript function stack underflow."); + } + + return this.stack.pop(); + }, + copy: function PostScriptStack_copy(n) { + if (this.stack.length + n >= MAX_STACK_SIZE) { + throw new Error("PostScript function stack overflow."); + } + + var stack = this.stack; + + for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { + stack.push(stack[i]); + } + }, + index: function PostScriptStack_index(n) { + this.push(this.stack[this.stack.length - n - 1]); + }, + roll: function PostScriptStack_roll(n, p) { + var stack = this.stack; + var l = stack.length - n; + var r = stack.length - 1, + c = l + (p - Math.floor(p / n) * n), + i, + j, + t; + + for (i = l, j = r; i < j; i++, j--) { + t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + + for (i = l, j = c - 1; i < j; i++, j--) { + t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + + for (i = c, j = r; i < j; i++, j--) { + t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + } + }; + return PostScriptStack; +}(); + +var PostScriptEvaluator = function PostScriptEvaluatorClosure() { + function PostScriptEvaluator(operators) { + this.operators = operators; + } + + PostScriptEvaluator.prototype = { + execute: function PostScriptEvaluator_execute(initialStack) { + var stack = new PostScriptStack(initialStack); + var counter = 0; + var operators = this.operators; + var length = operators.length; + var operator, a, b; + + while (counter < length) { + operator = operators[counter++]; + + if (typeof operator === "number") { + stack.push(operator); + continue; + } + + switch (operator) { + case "jz": + b = stack.pop(); + a = stack.pop(); + + if (!a) { + counter = b; + } + + break; + + case "j": + a = stack.pop(); + counter = a; + break; + + case "abs": + a = stack.pop(); + stack.push(Math.abs(a)); + break; + + case "add": + b = stack.pop(); + a = stack.pop(); + stack.push(a + b); + break; + + case "and": + b = stack.pop(); + a = stack.pop(); + + if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { + stack.push(a && b); + } else { + stack.push(a & b); + } + + break; + + case "atan": + a = stack.pop(); + stack.push(Math.atan(a)); + break; + + case "bitshift": + b = stack.pop(); + a = stack.pop(); + + if (a > 0) { + stack.push(a << b); + } else { + stack.push(a >> b); + } + + break; + + case "ceiling": + a = stack.pop(); + stack.push(Math.ceil(a)); + break; + + case "copy": + a = stack.pop(); + stack.copy(a); + break; + + case "cos": + a = stack.pop(); + stack.push(Math.cos(a)); + break; + + case "cvi": + a = stack.pop() | 0; + stack.push(a); + break; + + case "cvr": + break; + + case "div": + b = stack.pop(); + a = stack.pop(); + stack.push(a / b); + break; + + case "dup": + stack.copy(1); + break; + + case "eq": + b = stack.pop(); + a = stack.pop(); + stack.push(a === b); + break; + + case "exch": + stack.roll(2, 1); + break; + + case "exp": + b = stack.pop(); + a = stack.pop(); + stack.push(a ** b); + break; + + case "false": + stack.push(false); + break; + + case "floor": + a = stack.pop(); + stack.push(Math.floor(a)); + break; + + case "ge": + b = stack.pop(); + a = stack.pop(); + stack.push(a >= b); + break; + + case "gt": + b = stack.pop(); + a = stack.pop(); + stack.push(a > b); + break; + + case "idiv": + b = stack.pop(); + a = stack.pop(); + stack.push(a / b | 0); + break; + + case "index": + a = stack.pop(); + stack.index(a); + break; + + case "le": + b = stack.pop(); + a = stack.pop(); + stack.push(a <= b); + break; + + case "ln": + a = stack.pop(); + stack.push(Math.log(a)); + break; + + case "log": + a = stack.pop(); + stack.push(Math.log(a) / Math.LN10); + break; + + case "lt": + b = stack.pop(); + a = stack.pop(); + stack.push(a < b); + break; + + case "mod": + b = stack.pop(); + a = stack.pop(); + stack.push(a % b); + break; + + case "mul": + b = stack.pop(); + a = stack.pop(); + stack.push(a * b); + break; + + case "ne": + b = stack.pop(); + a = stack.pop(); + stack.push(a !== b); + break; + + case "neg": + a = stack.pop(); + stack.push(-a); + break; + + case "not": + a = stack.pop(); + + if ((0, _util.isBool)(a)) { + stack.push(!a); + } else { + stack.push(~a); + } + + break; + + case "or": + b = stack.pop(); + a = stack.pop(); + + if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { + stack.push(a || b); + } else { + stack.push(a | b); + } + + break; + + case "pop": + stack.pop(); + break; + + case "roll": + b = stack.pop(); + a = stack.pop(); + stack.roll(a, b); + break; + + case "round": + a = stack.pop(); + stack.push(Math.round(a)); + break; + + case "sin": + a = stack.pop(); + stack.push(Math.sin(a)); + break; + + case "sqrt": + a = stack.pop(); + stack.push(Math.sqrt(a)); + break; + + case "sub": + b = stack.pop(); + a = stack.pop(); + stack.push(a - b); + break; + + case "true": + stack.push(true); + break; + + case "truncate": + a = stack.pop(); + a = a < 0 ? Math.ceil(a) : Math.floor(a); + stack.push(a); + break; + + case "xor": + b = stack.pop(); + a = stack.pop(); + + if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { + stack.push(a !== b); + } else { + stack.push(a ^ b); + } + + break; + + default: + throw new _util.FormatError(`Unknown operator ${operator}`); + } + } + + return stack.stack; + } + }; + return PostScriptEvaluator; +}(); + +exports.PostScriptEvaluator = PostScriptEvaluator; + +var PostScriptCompiler = function PostScriptCompilerClosure() { + function AstNode(type) { + this.type = type; + } + + AstNode.prototype.visit = function (visitor) { + (0, _util.unreachable)("abstract method"); + }; + + function AstArgument(index, min, max) { + AstNode.call(this, "args"); + this.index = index; + this.min = min; + this.max = max; + } + + AstArgument.prototype = Object.create(AstNode.prototype); + + AstArgument.prototype.visit = function (visitor) { + visitor.visitArgument(this); + }; + + function AstLiteral(number) { + AstNode.call(this, "literal"); + this.number = number; + this.min = number; + this.max = number; + } + + AstLiteral.prototype = Object.create(AstNode.prototype); + + AstLiteral.prototype.visit = function (visitor) { + visitor.visitLiteral(this); + }; + + function AstBinaryOperation(op, arg1, arg2, min, max) { + AstNode.call(this, "binary"); + this.op = op; + this.arg1 = arg1; + this.arg2 = arg2; + this.min = min; + this.max = max; + } + + AstBinaryOperation.prototype = Object.create(AstNode.prototype); + + AstBinaryOperation.prototype.visit = function (visitor) { + visitor.visitBinaryOperation(this); + }; + + function AstMin(arg, max) { + AstNode.call(this, "max"); + this.arg = arg; + this.min = arg.min; + this.max = max; + } + + AstMin.prototype = Object.create(AstNode.prototype); + + AstMin.prototype.visit = function (visitor) { + visitor.visitMin(this); + }; + + function AstVariable(index, min, max) { + AstNode.call(this, "var"); + this.index = index; + this.min = min; + this.max = max; + } + + AstVariable.prototype = Object.create(AstNode.prototype); + + AstVariable.prototype.visit = function (visitor) { + visitor.visitVariable(this); + }; + + function AstVariableDefinition(variable, arg) { + AstNode.call(this, "definition"); + this.variable = variable; + this.arg = arg; + } + + AstVariableDefinition.prototype = Object.create(AstNode.prototype); + + AstVariableDefinition.prototype.visit = function (visitor) { + visitor.visitVariableDefinition(this); + }; + + function ExpressionBuilderVisitor() { + this.parts = []; + } + + ExpressionBuilderVisitor.prototype = { + visitArgument(arg) { + this.parts.push("Math.max(", arg.min, ", Math.min(", arg.max, ", src[srcOffset + ", arg.index, "]))"); + }, + + visitVariable(variable) { + this.parts.push("v", variable.index); + }, + + visitLiteral(literal) { + this.parts.push(literal.number); + }, + + visitBinaryOperation(operation) { + this.parts.push("("); + operation.arg1.visit(this); + this.parts.push(" ", operation.op, " "); + operation.arg2.visit(this); + this.parts.push(")"); + }, + + visitVariableDefinition(definition) { + this.parts.push("var "); + definition.variable.visit(this); + this.parts.push(" = "); + definition.arg.visit(this); + this.parts.push(";"); + }, + + visitMin(max) { + this.parts.push("Math.min("); + max.arg.visit(this); + this.parts.push(", ", max.max, ")"); + }, + + toString() { + return this.parts.join(""); + } + + }; -var PostScriptStack = function PostScriptStackClosure() { - var MAX_STACK_SIZE = 100; + function buildAddOperation(num1, num2) { + if (num2.type === "literal" && num2.number === 0) { + return num1; + } - function PostScriptStack(initialStack) { - this.stack = !initialStack ? [] : Array.prototype.slice.call(initialStack, 0); - } + if (num1.type === "literal" && num1.number === 0) { + return num2; + } - PostScriptStack.prototype = { - push: function PostScriptStack_push(value) { - if (this.stack.length >= MAX_STACK_SIZE) { - throw new Error("PostScript function stack overflow."); - } + if (num2.type === "literal" && num1.type === "literal") { + return new AstLiteral(num1.number + num2.number); + } - this.stack.push(value); - }, - pop: function PostScriptStack_pop() { - if (this.stack.length <= 0) { - throw new Error("PostScript function stack underflow."); + return new AstBinaryOperation("+", num1, num2, num1.min + num2.min, num1.max + num2.max); + } + + function buildMulOperation(num1, num2) { + if (num2.type === "literal") { + if (num2.number === 0) { + return new AstLiteral(0); + } else if (num2.number === 1) { + return num1; + } else if (num1.type === "literal") { + return new AstLiteral(num1.number * num2.number); } + } - return this.stack.pop(); - }, - copy: function PostScriptStack_copy(n) { - if (this.stack.length + n >= MAX_STACK_SIZE) { - throw new Error("PostScript function stack overflow."); + if (num1.type === "literal") { + if (num1.number === 0) { + return new AstLiteral(0); + } else if (num1.number === 1) { + return num2; } + } - var stack = this.stack; + var min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); + var max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); + return new AstBinaryOperation("*", num1, num2, min, max); + } - for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { - stack.push(stack[i]); + function buildSubOperation(num1, num2) { + if (num2.type === "literal") { + if (num2.number === 0) { + return num1; + } else if (num1.type === "literal") { + return new AstLiteral(num1.number - num2.number); } - }, - index: function PostScriptStack_index(n) { - this.push(this.stack[this.stack.length - n - 1]); - }, - roll: function PostScriptStack_roll(n, p) { - var stack = this.stack; - var l = stack.length - n; - var r = stack.length - 1, - c = l + (p - Math.floor(p / n) * n), - i, - j, - t; + } - for (i = l, j = r; i < j; i++, j--) { - t = stack[i]; - stack[i] = stack[j]; - stack[j] = t; - } + if (num2.type === "binary" && num2.op === "-" && num1.type === "literal" && num1.number === 1 && num2.arg1.type === "literal" && num2.arg1.number === 1) { + return num2.arg2; + } - for (i = l, j = c - 1; i < j; i++, j--) { - t = stack[i]; - stack[i] = stack[j]; - stack[j] = t; - } + return new AstBinaryOperation("-", num1, num2, num1.min - num2.max, num1.max - num2.min); + } - for (i = c, j = r; i < j; i++, j--) { - t = stack[i]; - stack[i] = stack[j]; - stack[j] = t; - } + function buildMinOperation(num1, max) { + if (num1.min >= max) { + return new AstLiteral(max); + } else if (num1.max <= max) { + return num1; } - }; - return PostScriptStack; -}(); -var PostScriptEvaluator = function PostScriptEvaluatorClosure() { - function PostScriptEvaluator(operators) { - this.operators = operators; + return new AstMin(num1, max); } - PostScriptEvaluator.prototype = { - execute: function PostScriptEvaluator_execute(initialStack) { - var stack = new PostScriptStack(initialStack); - var counter = 0; - var operators = this.operators; - var length = operators.length; - var operator, a, b; + function PostScriptCompiler() {} - while (counter < length) { - operator = operators[counter++]; + PostScriptCompiler.prototype = { + compile: function PostScriptCompiler_compile(code, domain, range) { + var stack = []; + var instructions = []; + var inputSize = domain.length >> 1, + outputSize = range.length >> 1; + var lastRegister = 0; + var n, j; + var num1, num2, ast1, ast2, tmpVar, item; - if (typeof operator === "number") { - stack.push(operator); + for (let i = 0; i < inputSize; i++) { + stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); + } + + for (let i = 0, ii = code.length; i < ii; i++) { + item = code[i]; + + if (typeof item === "number") { + stack.push(new AstLiteral(item)); continue; } - switch (operator) { - case "jz": - b = stack.pop(); - a = stack.pop(); - - if (!a) { - counter = b; + switch (item) { + case "add": + if (stack.length < 2) { + return null; } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildAddOperation(num1, num2)); break; - case "j": - a = stack.pop(); - counter = a; - break; + case "cvr": + if (stack.length < 1) { + return null; + } - case "abs": - a = stack.pop(); - stack.push(Math.abs(a)); break; - case "add": - b = stack.pop(); - a = stack.pop(); - stack.push(a + b); - break; + case "mul": + if (stack.length < 2) { + return null; + } - case "and": - b = stack.pop(); - a = stack.pop(); + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildMulOperation(num1, num2)); + break; - if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { - stack.push(a && b); - } else { - stack.push(a & b); + case "sub": + if (stack.length < 2) { + return null; } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildSubOperation(num1, num2)); break; - case "atan": - a = stack.pop(); - stack.push(Math.atan(a)); - break; + case "exch": + if (stack.length < 2) { + return null; + } - case "bitshift": - b = stack.pop(); - a = stack.pop(); + ast1 = stack.pop(); + ast2 = stack.pop(); + stack.push(ast1, ast2); + break; - if (a > 0) { - stack.push(a << b); - } else { - stack.push(a >> b); + case "pop": + if (stack.length < 1) { + return null; } + stack.pop(); break; - case "ceiling": - a = stack.pop(); - stack.push(Math.ceil(a)); - break; + case "index": + if (stack.length < 1) { + return null; + } - case "copy": - a = stack.pop(); - stack.copy(a); - break; + num1 = stack.pop(); - case "cos": - a = stack.pop(); - stack.push(Math.cos(a)); - break; + if (num1.type !== "literal") { + return null; + } - case "cvi": - a = stack.pop() | 0; - stack.push(a); - break; + n = num1.number; - case "cvr": - break; + if (n < 0 || !Number.isInteger(n) || stack.length < n) { + return null; + } - case "div": - b = stack.pop(); - a = stack.pop(); - stack.push(a / b); + ast1 = stack[stack.length - n - 1]; + + if (ast1.type === "literal" || ast1.type === "var") { + stack.push(ast1); + break; + } + + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - n - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); break; case "dup": - stack.copy(1); - break; + if (stack.length < 1) { + return null; + } - case "eq": - b = stack.pop(); - a = stack.pop(); - stack.push(a === b); - break; + if (typeof code[i + 1] === "number" && code[i + 2] === "gt" && code[i + 3] === i + 7 && code[i + 4] === "jz" && code[i + 5] === "pop" && code[i + 6] === code[i + 1]) { + num1 = stack.pop(); + stack.push(buildMinOperation(num1, code[i + 1])); + i += 6; + break; + } - case "exch": - stack.roll(2, 1); - break; + ast1 = stack[stack.length - 1]; - case "exp": - b = stack.pop(); - a = stack.pop(); - stack.push(a ** b); - break; + if (ast1.type === "literal" || ast1.type === "var") { + stack.push(ast1); + break; + } - case "false": - stack.push(false); + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); break; - case "floor": - a = stack.pop(); - stack.push(Math.floor(a)); - break; + case "roll": + if (stack.length < 2) { + return null; + } - case "ge": - b = stack.pop(); - a = stack.pop(); - stack.push(a >= b); - break; + num2 = stack.pop(); + num1 = stack.pop(); - case "gt": - b = stack.pop(); - a = stack.pop(); - stack.push(a > b); - break; + if (num2.type !== "literal" || num1.type !== "literal") { + return null; + } - case "idiv": - b = stack.pop(); - a = stack.pop(); - stack.push(a / b | 0); - break; + j = num2.number; + n = num1.number; - case "index": - a = stack.pop(); - stack.index(a); - break; + if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { + return null; + } - case "le": - b = stack.pop(); - a = stack.pop(); - stack.push(a <= b); - break; + j = (j % n + n) % n; - case "ln": - a = stack.pop(); - stack.push(Math.log(a)); - break; + if (j === 0) { + break; + } - case "log": - a = stack.pop(); - stack.push(Math.log(a) / Math.LN10); + Array.prototype.push.apply(stack, stack.splice(stack.length - n, n - j)); break; - case "lt": - b = stack.pop(); - a = stack.pop(); - stack.push(a < b); - break; + default: + return null; + } + } - case "mod": - b = stack.pop(); - a = stack.pop(); - stack.push(a % b); - break; + if (stack.length !== outputSize) { + return null; + } - case "mul": - b = stack.pop(); - a = stack.pop(); - stack.push(a * b); - break; + var result = []; + instructions.forEach(function (instruction) { + var statementBuilder = new ExpressionBuilderVisitor(); + instruction.visit(statementBuilder); + result.push(statementBuilder.toString()); + }); + stack.forEach(function (expr, i) { + var statementBuilder = new ExpressionBuilderVisitor(); + expr.visit(statementBuilder); + var min = range[i * 2], + max = range[i * 2 + 1]; + var out = [statementBuilder.toString()]; - case "ne": - b = stack.pop(); - a = stack.pop(); - stack.push(a !== b); - break; + if (min > expr.min) { + out.unshift("Math.max(", min, ", "); + out.push(")"); + } - case "neg": - a = stack.pop(); - stack.push(-a); - break; + if (max < expr.max) { + out.unshift("Math.min(", max, ", "); + out.push(")"); + } - case "not": - a = stack.pop(); + out.unshift("dest[destOffset + ", i, "] = "); + out.push(";"); + result.push(out.join("")); + }); + return result.join("\n"); + } + }; + return PostScriptCompiler; +}(); - if ((0, _util.isBool)(a)) { - stack.push(!a); - } else { - stack.push(~a); - } +exports.PostScriptCompiler = PostScriptCompiler; + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __w_pdfjs_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PostScriptParser = exports.PostScriptLexer = void 0; + +var _util = __w_pdfjs_require__(2); + +var _primitives = __w_pdfjs_require__(5); + +var _core_utils = __w_pdfjs_require__(8); + +class PostScriptParser { + constructor(lexer) { + this.lexer = lexer; + this.operators = []; + this.token = null; + this.prev = null; + } + + nextToken() { + this.prev = this.token; + this.token = this.lexer.getToken(); + } + + accept(type) { + if (this.token.type === type) { + this.nextToken(); + return true; + } + + return false; + } + + expect(type) { + if (this.accept(type)) { + return true; + } + + throw new _util.FormatError(`Unexpected symbol: found ${this.token.type} expected ${type}.`); + } + + parse() { + this.nextToken(); + this.expect(PostScriptTokenTypes.LBRACE); + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + return this.operators; + } + + parseBlock() { + while (true) { + if (this.accept(PostScriptTokenTypes.NUMBER)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { + this.parseCondition(); + } else { + return; + } + } + } + + parseCondition() { + const conditionLocation = this.operators.length; + this.operators.push(null, null); + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + + if (this.accept(PostScriptTokenTypes.IF)) { + this.operators[conditionLocation] = this.operators.length; + this.operators[conditionLocation + 1] = "jz"; + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { + const jumpLocation = this.operators.length; + this.operators.push(null, null); + const endOfTrue = this.operators.length; + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + this.expect(PostScriptTokenTypes.IFELSE); + this.operators[jumpLocation] = this.operators.length; + this.operators[jumpLocation + 1] = "j"; + this.operators[conditionLocation] = endOfTrue; + this.operators[conditionLocation + 1] = "jz"; + } else { + throw new _util.FormatError("PS Function: error parsing conditional."); + } + } - break; +} - case "or": - b = stack.pop(); - a = stack.pop(); +exports.PostScriptParser = PostScriptParser; +const PostScriptTokenTypes = { + LBRACE: 0, + RBRACE: 1, + NUMBER: 2, + OPERATOR: 3, + IF: 4, + IFELSE: 5 +}; - if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { - stack.push(a || b); - } else { - stack.push(a | b); - } +const PostScriptToken = function PostScriptTokenClosure() { + const opCache = Object.create(null); - break; + class PostScriptToken { + constructor(type, value) { + this.type = type; + this.value = value; + } - case "pop": - stack.pop(); - break; + static getOperator(op) { + const opValue = opCache[op]; - case "roll": - b = stack.pop(); - a = stack.pop(); - stack.roll(a, b); - break; + if (opValue) { + return opValue; + } - case "round": - a = stack.pop(); - stack.push(Math.round(a)); - break; + return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); + } - case "sin": - a = stack.pop(); - stack.push(Math.sin(a)); - break; + static get LBRACE() { + return (0, _util.shadow)(this, "LBRACE", new PostScriptToken(PostScriptTokenTypes.LBRACE, "{")); + } - case "sqrt": - a = stack.pop(); - stack.push(Math.sqrt(a)); - break; + static get RBRACE() { + return (0, _util.shadow)(this, "RBRACE", new PostScriptToken(PostScriptTokenTypes.RBRACE, "}")); + } - case "sub": - b = stack.pop(); - a = stack.pop(); - stack.push(a - b); - break; + static get IF() { + return (0, _util.shadow)(this, "IF", new PostScriptToken(PostScriptTokenTypes.IF, "IF")); + } - case "true": - stack.push(true); - break; + static get IFELSE() { + return (0, _util.shadow)(this, "IFELSE", new PostScriptToken(PostScriptTokenTypes.IFELSE, "IFELSE")); + } - case "truncate": - a = stack.pop(); - a = a < 0 ? Math.ceil(a) : Math.floor(a); - stack.push(a); - break; + } - case "xor": - b = stack.pop(); - a = stack.pop(); + return PostScriptToken; +}(); - if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { - stack.push(a !== b); - } else { - stack.push(a ^ b); - } +class PostScriptLexer { + constructor(stream) { + this.stream = stream; + this.nextChar(); + this.strBuf = []; + } - break; + nextChar() { + return this.currentChar = this.stream.getByte(); + } - default: - throw new _util.FormatError(`Unknown operator ${operator}`); + getToken() { + let comment = false; + let ch = this.currentChar; + + while (true) { + if (ch < 0) { + return _primitives.EOF; + } + + if (comment) { + if (ch === 0x0a || ch === 0x0d) { + comment = false; } + } else if (ch === 0x25) { + comment = true; + } else if (!(0, _core_utils.isWhiteSpace)(ch)) { + break; } - return stack.stack; + ch = this.nextChar(); } - }; - return PostScriptEvaluator; -}(); - -exports.PostScriptEvaluator = PostScriptEvaluator; -var PostScriptCompiler = function PostScriptCompilerClosure() { - function AstNode(type) { - this.type = type; - } + switch (ch | 0) { + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x2b: + case 0x2d: + case 0x2e: + return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); - AstNode.prototype.visit = function (visitor) { - (0, _util.unreachable)("abstract method"); - }; + case 0x7b: + this.nextChar(); + return PostScriptToken.LBRACE; - function AstArgument(index, min, max) { - AstNode.call(this, "args"); - this.index = index; - this.min = min; - this.max = max; - } + case 0x7d: + this.nextChar(); + return PostScriptToken.RBRACE; + } - AstArgument.prototype = Object.create(AstNode.prototype); + const strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); - AstArgument.prototype.visit = function (visitor) { - visitor.visitArgument(this); - }; + while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5a || ch >= 0x61 && ch <= 0x7a)) { + strBuf.push(String.fromCharCode(ch)); + } - function AstLiteral(number) { - AstNode.call(this, "literal"); - this.number = number; - this.min = number; - this.max = number; - } + const str = strBuf.join(""); - AstLiteral.prototype = Object.create(AstNode.prototype); + switch (str.toLowerCase()) { + case "if": + return PostScriptToken.IF; - AstLiteral.prototype.visit = function (visitor) { - visitor.visitLiteral(this); - }; + case "ifelse": + return PostScriptToken.IFELSE; - function AstBinaryOperation(op, arg1, arg2, min, max) { - AstNode.call(this, "binary"); - this.op = op; - this.arg1 = arg1; - this.arg2 = arg2; - this.min = min; - this.max = max; + default: + return PostScriptToken.getOperator(str); + } } - AstBinaryOperation.prototype = Object.create(AstNode.prototype); + getNumber() { + let ch = this.currentChar; + const strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); - AstBinaryOperation.prototype.visit = function (visitor) { - visitor.visitBinaryOperation(this); - }; + while ((ch = this.nextChar()) >= 0) { + if (ch >= 0x30 && ch <= 0x39 || ch === 0x2d || ch === 0x2e) { + strBuf.push(String.fromCharCode(ch)); + } else { + break; + } + } - function AstMin(arg, max) { - AstNode.call(this, "max"); - this.arg = arg; - this.min = arg.min; - this.max = max; + const value = parseFloat(strBuf.join("")); + + if (isNaN(value)) { + throw new _util.FormatError(`Invalid floating point number: ${value}`); + } + + return value; } - AstMin.prototype = Object.create(AstNode.prototype); +} - AstMin.prototype.visit = function (visitor) { - visitor.visitMin(this); - }; +exports.PostScriptLexer = PostScriptLexer; - function AstVariable(index, min, max) { - AstNode.call(this, "var"); - this.index = index; - this.min = min; - this.max = max; - } +/***/ }), +/* 42 */ +/***/ (function(module, exports, __w_pdfjs_require__) { - AstVariable.prototype = Object.create(AstNode.prototype); +"use strict"; - AstVariable.prototype.visit = function (visitor) { - visitor.visitVariable(this); - }; - function AstVariableDefinition(variable, arg) { - AstNode.call(this, "definition"); - this.variable = variable; - this.arg = arg; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bidi = bidi; - AstVariableDefinition.prototype = Object.create(AstNode.prototype); +var _util = __w_pdfjs_require__(2); - AstVariableDefinition.prototype.visit = function (visitor) { - visitor.visitVariableDefinition(this); - }; +var baseTypes = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "ON", "ON", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "ON", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "ON", "ET", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "L", "ON", "ON", "BN", "ON", "ON", "ET", "ET", "EN", "EN", "ON", "L", "ON", "ON", "ON", "EN", "L", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L"]; +var arabicTypes = ["AN", "AN", "AN", "AN", "AN", "AN", "ON", "ON", "AL", "ET", "ET", "AL", "CS", "AL", "ON", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "ON", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL"]; - function ExpressionBuilderVisitor() { - this.parts = []; - } +function isOdd(i) { + return (i & 1) !== 0; +} - ExpressionBuilderVisitor.prototype = { - visitArgument(arg) { - this.parts.push("Math.max(", arg.min, ", Math.min(", arg.max, ", src[srcOffset + ", arg.index, "]))"); - }, +function isEven(i) { + return (i & 1) === 0; +} - visitVariable(variable) { - this.parts.push("v", variable.index); - }, +function findUnequal(arr, start, value) { + for (var j = start, jj = arr.length; j < jj; ++j) { + if (arr[j] !== value) { + return j; + } + } - visitLiteral(literal) { - this.parts.push(literal.number); - }, + return j; +} - visitBinaryOperation(operation) { - this.parts.push("("); - operation.arg1.visit(this); - this.parts.push(" ", operation.op, " "); - operation.arg2.visit(this); - this.parts.push(")"); - }, +function setValues(arr, start, end, value) { + for (var j = start; j < end; ++j) { + arr[j] = value; + } +} - visitVariableDefinition(definition) { - this.parts.push("var "); - definition.variable.visit(this); - this.parts.push(" = "); - definition.arg.visit(this); - this.parts.push(";"); - }, +function reverseValues(arr, start, end) { + for (var i = start, j = end - 1; i < j; ++i, --j) { + var temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + } +} - visitMin(max) { - this.parts.push("Math.min("); - max.arg.visit(this); - this.parts.push(", ", max.max, ")"); - }, +function createBidiText(str, isLTR, vertical = false) { + let dir = "ltr"; - toString() { - return this.parts.join(""); - } + if (vertical) { + dir = "ttb"; + } else if (!isLTR) { + dir = "rtl"; + } + return { + str, + dir }; +} - function buildAddOperation(num1, num2) { - if (num2.type === "literal" && num2.number === 0) { - return num1; - } - - if (num1.type === "literal" && num1.number === 0) { - return num2; - } +var chars = []; +var types = []; - if (num2.type === "literal" && num1.type === "literal") { - return new AstLiteral(num1.number + num2.number); - } +function bidi(str, startLevel, vertical) { + var isLTR = true; + var strLength = str.length; - return new AstBinaryOperation("+", num1, num2, num1.min + num2.min, num1.max + num2.max); + if (strLength === 0 || vertical) { + return createBidiText(str, isLTR, vertical); } - function buildMulOperation(num1, num2) { - if (num2.type === "literal") { - if (num2.number === 0) { - return new AstLiteral(0); - } else if (num2.number === 1) { - return num1; - } else if (num1.type === "literal") { - return new AstLiteral(num1.number * num2.number); - } - } + chars.length = strLength; + types.length = strLength; + var numBidi = 0; + var i, ii; - if (num1.type === "literal") { - if (num1.number === 0) { - return new AstLiteral(0); - } else if (num1.number === 1) { - return num2; - } - } + for (i = 0; i < strLength; ++i) { + chars[i] = str.charAt(i); + var charCode = str.charCodeAt(i); + var charType = "L"; - var min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); - var max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); - return new AstBinaryOperation("*", num1, num2, min, max); - } + if (charCode <= 0x00ff) { + charType = baseTypes[charCode]; + } else if (0x0590 <= charCode && charCode <= 0x05f4) { + charType = "R"; + } else if (0x0600 <= charCode && charCode <= 0x06ff) { + charType = arabicTypes[charCode & 0xff]; - function buildSubOperation(num1, num2) { - if (num2.type === "literal") { - if (num2.number === 0) { - return num1; - } else if (num1.type === "literal") { - return new AstLiteral(num1.number - num2.number); + if (!charType) { + (0, _util.warn)("Bidi: invalid Unicode character " + charCode.toString(16)); } + } else if (0x0700 <= charCode && charCode <= 0x08ac) { + charType = "AL"; } - if (num2.type === "binary" && num2.op === "-" && num1.type === "literal" && num1.number === 1 && num2.arg1.type === "literal" && num2.arg1.number === 1) { - return num2.arg2; + if (charType === "R" || charType === "AL" || charType === "AN") { + numBidi++; } - return new AstBinaryOperation("-", num1, num2, num1.min - num2.max, num1.max - num2.min); + types[i] = charType; } - function buildMinOperation(num1, max) { - if (num1.min >= max) { - return new AstLiteral(max); - } else if (num1.max <= max) { - return num1; - } - - return new AstMin(num1, max); + if (numBidi === 0) { + isLTR = true; + return createBidiText(str, isLTR); } - function PostScriptCompiler() {} + if (startLevel === -1) { + if (numBidi / strLength < 0.3) { + isLTR = true; + startLevel = 0; + } else { + isLTR = false; + startLevel = 1; + } + } - PostScriptCompiler.prototype = { - compile: function PostScriptCompiler_compile(code, domain, range) { - var stack = []; - var instructions = []; - var inputSize = domain.length >> 1, - outputSize = range.length >> 1; - var lastRegister = 0; - var n, j; - var num1, num2, ast1, ast2, tmpVar, item; + var levels = []; - for (let i = 0; i < inputSize; i++) { - stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); - } + for (i = 0; i < strLength; ++i) { + levels[i] = startLevel; + } - for (let i = 0, ii = code.length; i < ii; i++) { - item = code[i]; + var e = isOdd(startLevel) ? "R" : "L"; + var sor = e; + var eor = sor; + var lastType = sor; - if (typeof item === "number") { - stack.push(new AstLiteral(item)); - continue; - } + for (i = 0; i < strLength; ++i) { + if (types[i] === "NSM") { + types[i] = lastType; + } else { + lastType = types[i]; + } + } - switch (item) { - case "add": - if (stack.length < 2) { - return null; - } + lastType = sor; + var t; - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildAddOperation(num1, num2)); - break; + for (i = 0; i < strLength; ++i) { + t = types[i]; - case "cvr": - if (stack.length < 1) { - return null; - } + if (t === "EN") { + types[i] = lastType === "AL" ? "AN" : "EN"; + } else if (t === "R" || t === "L" || t === "AL") { + lastType = t; + } + } - break; + for (i = 0; i < strLength; ++i) { + t = types[i]; - case "mul": - if (stack.length < 2) { - return null; - } + if (t === "AL") { + types[i] = "R"; + } + } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildMulOperation(num1, num2)); - break; + for (i = 1; i < strLength - 1; ++i) { + if (types[i] === "ES" && types[i - 1] === "EN" && types[i + 1] === "EN") { + types[i] = "EN"; + } - case "sub": - if (stack.length < 2) { - return null; - } + if (types[i] === "CS" && (types[i - 1] === "EN" || types[i - 1] === "AN") && types[i + 1] === types[i - 1]) { + types[i] = types[i - 1]; + } + } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildSubOperation(num1, num2)); - break; + for (i = 0; i < strLength; ++i) { + if (types[i] === "EN") { + var j; - case "exch": - if (stack.length < 2) { - return null; - } + for (j = i - 1; j >= 0; --j) { + if (types[j] !== "ET") { + break; + } - ast1 = stack.pop(); - ast2 = stack.pop(); - stack.push(ast1, ast2); - break; + types[j] = "EN"; + } - case "pop": - if (stack.length < 1) { - return null; - } + for (j = i + 1; j < strLength; ++j) { + if (types[j] !== "ET") { + break; + } - stack.pop(); - break; + types[j] = "EN"; + } + } + } - case "index": - if (stack.length < 1) { - return null; - } + for (i = 0; i < strLength; ++i) { + t = types[i]; - num1 = stack.pop(); + if (t === "WS" || t === "ES" || t === "ET" || t === "CS") { + types[i] = "ON"; + } + } - if (num1.type !== "literal") { - return null; - } + lastType = sor; - n = num1.number; + for (i = 0; i < strLength; ++i) { + t = types[i]; - if (n < 0 || !Number.isInteger(n) || stack.length < n) { - return null; - } + if (t === "EN") { + types[i] = lastType === "L" ? "L" : "EN"; + } else if (t === "R" || t === "L") { + lastType = t; + } + } - ast1 = stack[stack.length - n - 1]; + for (i = 0; i < strLength; ++i) { + if (types[i] === "ON") { + var end = findUnequal(types, i + 1, "ON"); + var before = sor; - if (ast1.type === "literal" || ast1.type === "var") { - stack.push(ast1); - break; - } + if (i > 0) { + before = types[i - 1]; + } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - n - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; + var after = eor; - case "dup": - if (stack.length < 1) { - return null; - } + if (end + 1 < strLength) { + after = types[end + 1]; + } - if (typeof code[i + 1] === "number" && code[i + 2] === "gt" && code[i + 3] === i + 7 && code[i + 4] === "jz" && code[i + 5] === "pop" && code[i + 6] === code[i + 1]) { - num1 = stack.pop(); - stack.push(buildMinOperation(num1, code[i + 1])); - i += 6; - break; - } + if (before !== "L") { + before = "R"; + } - ast1 = stack[stack.length - 1]; + if (after !== "L") { + after = "R"; + } - if (ast1.type === "literal" || ast1.type === "var") { - stack.push(ast1); - break; - } + if (before === after) { + setValues(types, i, end, before); + } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; + i = end - 1; + } + } - case "roll": - if (stack.length < 2) { - return null; - } + for (i = 0; i < strLength; ++i) { + if (types[i] === "ON") { + types[i] = e; + } + } - num2 = stack.pop(); - num1 = stack.pop(); + for (i = 0; i < strLength; ++i) { + t = types[i]; - if (num2.type !== "literal" || num1.type !== "literal") { - return null; - } + if (isEven(levels[i])) { + if (t === "R") { + levels[i] += 1; + } else if (t === "AN" || t === "EN") { + levels[i] += 2; + } + } else { + if (t === "L" || t === "AN" || t === "EN") { + levels[i] += 1; + } + } + } - j = num2.number; - n = num1.number; + var highestLevel = -1; + var lowestOddLevel = 99; + var level; - if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { - return null; - } + for (i = 0, ii = levels.length; i < ii; ++i) { + level = levels[i]; - j = (j % n + n) % n; + if (highestLevel < level) { + highestLevel = level; + } - if (j === 0) { - break; - } + if (lowestOddLevel > level && isOdd(level)) { + lowestOddLevel = level; + } + } - Array.prototype.push.apply(stack, stack.splice(stack.length - n, n - j)); - break; + for (level = highestLevel; level >= lowestOddLevel; --level) { + var start = -1; - default: - return null; + for (i = 0, ii = levels.length; i < ii; ++i) { + if (levels[i] < level) { + if (start >= 0) { + reverseValues(chars, start, i); + start = -1; } + } else if (start < 0) { + start = i; } + } - if (stack.length !== outputSize) { - return null; - } - - var result = []; - instructions.forEach(function (instruction) { - var statementBuilder = new ExpressionBuilderVisitor(); - instruction.visit(statementBuilder); - result.push(statementBuilder.toString()); - }); - stack.forEach(function (expr, i) { - var statementBuilder = new ExpressionBuilderVisitor(); - expr.visit(statementBuilder); - var min = range[i * 2], - max = range[i * 2 + 1]; - var out = [statementBuilder.toString()]; - - if (min > expr.min) { - out.unshift("Math.max(", min, ", "); - out.push(")"); - } + if (start >= 0) { + reverseValues(chars, start, levels.length); + } + } - if (max < expr.max) { - out.unshift("Math.min(", max, ", "); - out.push(")"); - } + for (i = 0, ii = chars.length; i < ii; ++i) { + var ch = chars[i]; - out.unshift("dest[destOffset + ", i, "] = "); - out.push(";"); - result.push(out.join("")); - }); - return result.join("\n"); + if (ch === "<" || ch === ">") { + chars[i] = ""; } - }; - return PostScriptCompiler; -}(); + } -exports.PostScriptCompiler = PostScriptCompiler; + return createBidiText(chars.join(""), isLTR); +} /***/ }), -/* 42 */ +/* 43 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -44274,252 +43234,2952 @@ exports.PostScriptCompiler = PostScriptCompiler; Object.defineProperty(exports, "__esModule", { value: true }); -exports.PostScriptParser = exports.PostScriptLexer = void 0; - -var _util = __w_pdfjs_require__(2); - -var _primitives = __w_pdfjs_require__(5); - -var _core_utils = __w_pdfjs_require__(8); - -class PostScriptParser { - constructor(lexer) { - this.lexer = lexer; - this.operators = []; - this.token = null; - this.prev = null; - } - - nextToken() { - this.prev = this.token; - this.token = this.lexer.getToken(); - } - - accept(type) { - if (this.token.type === type) { - this.nextToken(); - return true; - } - - return false; - } - - expect(type) { - if (this.accept(type)) { - return true; - } - - throw new _util.FormatError(`Unexpected symbol: found ${this.token.type} expected ${type}.`); - } - - parse() { - this.nextToken(); - this.expect(PostScriptTokenTypes.LBRACE); - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - return this.operators; - } - - parseBlock() { - while (true) { - if (this.accept(PostScriptTokenTypes.NUMBER)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - this.parseCondition(); - } else { - return; - } - } - } - - parseCondition() { - const conditionLocation = this.operators.length; - this.operators.push(null, null); - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - - if (this.accept(PostScriptTokenTypes.IF)) { - this.operators[conditionLocation] = this.operators.length; - this.operators[conditionLocation + 1] = "jz"; - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - const jumpLocation = this.operators.length; - this.operators.push(null, null); - const endOfTrue = this.operators.length; - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - this.expect(PostScriptTokenTypes.IFELSE); - this.operators[jumpLocation] = this.operators.length; - this.operators[jumpLocation + 1] = "j"; - this.operators[conditionLocation] = endOfTrue; - this.operators[conditionLocation + 1] = "jz"; - } else { - throw new _util.FormatError("PS Function: error parsing conditional."); - } - } - -} - -exports.PostScriptParser = PostScriptParser; -const PostScriptTokenTypes = { - LBRACE: 0, - RBRACE: 1, - NUMBER: 2, - OPERATOR: 3, - IF: 4, - IFELSE: 5 -}; - -const PostScriptToken = function PostScriptTokenClosure() { - const opCache = Object.create(null); - - class PostScriptToken { - constructor(type, value) { - this.type = type; - this.value = value; - } - - static getOperator(op) { - const opValue = opCache[op]; - - if (opValue) { - return opValue; - } - - return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); - } - - static get LBRACE() { - return (0, _util.shadow)(this, "LBRACE", new PostScriptToken(PostScriptTokenTypes.LBRACE, "{")); - } - - static get RBRACE() { - return (0, _util.shadow)(this, "RBRACE", new PostScriptToken(PostScriptTokenTypes.RBRACE, "}")); - } - - static get IF() { - return (0, _util.shadow)(this, "IF", new PostScriptToken(PostScriptTokenTypes.IF, "IF")); - } - - static get IFELSE() { - return (0, _util.shadow)(this, "IFELSE", new PostScriptToken(PostScriptTokenTypes.IFELSE, "IFELSE")); - } - - } - - return PostScriptToken; -}(); - -class PostScriptLexer { - constructor(stream) { - this.stream = stream; - this.nextChar(); - this.strBuf = []; - } - - nextChar() { - return this.currentChar = this.stream.getByte(); - } - - getToken() { - let comment = false; - let ch = this.currentChar; - - while (true) { - if (ch < 0) { - return _primitives.EOF; - } - - if (comment) { - if (ch === 0x0a || ch === 0x0d) { - comment = false; - } - } else if (ch === 0x25) { - comment = true; - } else if (!(0, _core_utils.isWhiteSpace)(ch)) { - break; - } - - ch = this.nextChar(); - } - - switch (ch | 0) { - case 0x30: - case 0x31: - case 0x32: - case 0x33: - case 0x34: - case 0x35: - case 0x36: - case 0x37: - case 0x38: - case 0x39: - case 0x2b: - case 0x2d: - case 0x2e: - return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); - - case 0x7b: - this.nextChar(); - return PostScriptToken.LBRACE; - - case 0x7d: - this.nextChar(); - return PostScriptToken.RBRACE; - } - - const strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5a || ch >= 0x61 && ch <= 0x7a)) { - strBuf.push(String.fromCharCode(ch)); - } - - const str = strBuf.join(""); - - switch (str.toLowerCase()) { - case "if": - return PostScriptToken.IF; - - case "ifelse": - return PostScriptToken.IFELSE; - - default: - return PostScriptToken.getOperator(str); - } - } - - getNumber() { - let ch = this.currentChar; - const strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0) { - if (ch >= 0x30 && ch <= 0x39 || ch === 0x2d || ch === 0x2e) { - strBuf.push(String.fromCharCode(ch)); - } else { - break; - } - } - - const value = parseFloat(strBuf.join("")); - - if (isNaN(value)) { - throw new _util.FormatError(`Invalid floating point number: ${value}`); - } - - return value; - } - -} - -exports.PostScriptLexer = PostScriptLexer; +exports.getMetrics = void 0; + +var _core_utils = __w_pdfjs_require__(8); + +var getMetrics = (0, _core_utils.getLookupTableFactory)(function (t) { + t.Courier = 600; + t["Courier-Bold"] = 600; + t["Courier-BoldOblique"] = 600; + t["Courier-Oblique"] = 600; + t.Helvetica = (0, _core_utils.getLookupTableFactory)(function (t) { + t.space = 278; + t.exclam = 278; + t.quotedbl = 355; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 667; + t.quoteright = 222; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 278; + t.semicolon = 278; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 556; + t.at = 1015; + t.A = 667; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 500; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 278; + t.backslash = 278; + t.bracketright = 278; + t.asciicircum = 469; + t.underscore = 556; + t.quoteleft = 222; + t.a = 556; + t.b = 556; + t.c = 500; + t.d = 556; + t.e = 556; + t.f = 278; + t.g = 556; + t.h = 556; + t.i = 222; + t.j = 222; + t.k = 500; + t.l = 222; + t.m = 833; + t.n = 556; + t.o = 556; + t.p = 556; + t.q = 556; + t.r = 333; + t.s = 500; + t.t = 278; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 500; + t.braceleft = 334; + t.bar = 260; + t.braceright = 334; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 191; + t.quotedblleft = 333; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 537; + t.bullet = 350; + t.quotesinglbase = 222; + t.quotedblbase = 333; + t.quotedblright = 333; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 556; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 222; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 556; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 667; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 500; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 500; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 222; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 500; + t.scedilla = 500; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 556; + t.Amacron = 667; + t.rcaron = 333; + t.ccedilla = 500; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 643; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 584; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 500; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 260; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 333; + t.omacron = 556; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 222; + t.tcaron = 317; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 222; + t.Oacute = 778; + t.oacute = 556; + t.amacron = 556; + t.sacute = 500; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 556; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 299; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 556; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 556; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 556; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 556; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 556; + t.Rcommaaccent = 722; + t.Lcommaaccent = 556; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 500; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 584; + t.odieresis = 556; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 556; + t.eth = 556; + t.zcaron = 500; + t.ncommaaccent = 556; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t["Helvetica-Bold"] = (0, _core_utils.getLookupTableFactory)(function (t) { + t.space = 278; + t.exclam = 333; + t.quotedbl = 474; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 722; + t.quoteright = 278; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 333; + t.semicolon = 333; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 611; + t.at = 975; + t.A = 722; + t.B = 722; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 556; + t.K = 722; + t.L = 611; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 584; + t.underscore = 556; + t.quoteleft = 278; + t.a = 556; + t.b = 611; + t.c = 556; + t.d = 611; + t.e = 556; + t.f = 333; + t.g = 611; + t.h = 611; + t.i = 278; + t.j = 278; + t.k = 556; + t.l = 278; + t.m = 889; + t.n = 611; + t.o = 611; + t.p = 611; + t.q = 611; + t.r = 389; + t.s = 556; + t.t = 333; + t.u = 611; + t.v = 556; + t.w = 778; + t.x = 556; + t.y = 556; + t.z = 500; + t.braceleft = 389; + t.bar = 280; + t.braceright = 389; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 238; + t.quotedblleft = 500; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 611; + t.fl = 611; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 556; + t.bullet = 350; + t.quotesinglbase = 278; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 611; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 611; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 722; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 556; + t.scommaaccent = 556; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 611; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 556; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 556; + t.scedilla = 556; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 611; + t.acircumflex = 556; + t.Amacron = 722; + t.rcaron = 389; + t.ccedilla = 556; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 743; + t.Umacron = 722; + t.uring = 611; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 584; + t.uacute = 611; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 556; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 556; + t.nacute = 611; + t.umacron = 611; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 280; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 611; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 389; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 611; + t.amacron = 556; + t.sacute = 556; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 611; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 611; + t.igrave = 278; + t.ohungarumlaut = 611; + t.Eogonek = 667; + t.dcroat = 611; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 400; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 611; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 611; + t.ntilde = 611; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 611; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 611; + t.Ccaron = 722; + t.ugrave = 611; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 611; + t.Rcommaaccent = 722; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 556; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 611; + t.tcommaaccent = 333; + t.logicalnot = 584; + t.odieresis = 611; + t.udieresis = 611; + t.notequal = 549; + t.gcommaaccent = 611; + t.eth = 611; + t.zcaron = 500; + t.ncommaaccent = 611; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t["Helvetica-BoldOblique"] = (0, _core_utils.getLookupTableFactory)(function (t) { + t.space = 278; + t.exclam = 333; + t.quotedbl = 474; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 722; + t.quoteright = 278; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 333; + t.semicolon = 333; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 611; + t.at = 975; + t.A = 722; + t.B = 722; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 556; + t.K = 722; + t.L = 611; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 584; + t.underscore = 556; + t.quoteleft = 278; + t.a = 556; + t.b = 611; + t.c = 556; + t.d = 611; + t.e = 556; + t.f = 333; + t.g = 611; + t.h = 611; + t.i = 278; + t.j = 278; + t.k = 556; + t.l = 278; + t.m = 889; + t.n = 611; + t.o = 611; + t.p = 611; + t.q = 611; + t.r = 389; + t.s = 556; + t.t = 333; + t.u = 611; + t.v = 556; + t.w = 778; + t.x = 556; + t.y = 556; + t.z = 500; + t.braceleft = 389; + t.bar = 280; + t.braceright = 389; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 238; + t.quotedblleft = 500; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 611; + t.fl = 611; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 556; + t.bullet = 350; + t.quotesinglbase = 278; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 611; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 611; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 722; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 556; + t.scommaaccent = 556; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 611; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 556; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 556; + t.scedilla = 556; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 611; + t.acircumflex = 556; + t.Amacron = 722; + t.rcaron = 389; + t.ccedilla = 556; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 743; + t.Umacron = 722; + t.uring = 611; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 584; + t.uacute = 611; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 556; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 556; + t.nacute = 611; + t.umacron = 611; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 280; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 611; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 389; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 611; + t.amacron = 556; + t.sacute = 556; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 611; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 611; + t.igrave = 278; + t.ohungarumlaut = 611; + t.Eogonek = 667; + t.dcroat = 611; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 400; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 611; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 611; + t.ntilde = 611; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 611; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 611; + t.Ccaron = 722; + t.ugrave = 611; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 611; + t.Rcommaaccent = 722; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 556; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 611; + t.tcommaaccent = 333; + t.logicalnot = 584; + t.odieresis = 611; + t.udieresis = 611; + t.notequal = 549; + t.gcommaaccent = 611; + t.eth = 611; + t.zcaron = 500; + t.ncommaaccent = 611; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t["Helvetica-Oblique"] = (0, _core_utils.getLookupTableFactory)(function (t) { + t.space = 278; + t.exclam = 278; + t.quotedbl = 355; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 667; + t.quoteright = 222; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 278; + t.semicolon = 278; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 556; + t.at = 1015; + t.A = 667; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 500; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 278; + t.backslash = 278; + t.bracketright = 278; + t.asciicircum = 469; + t.underscore = 556; + t.quoteleft = 222; + t.a = 556; + t.b = 556; + t.c = 500; + t.d = 556; + t.e = 556; + t.f = 278; + t.g = 556; + t.h = 556; + t.i = 222; + t.j = 222; + t.k = 500; + t.l = 222; + t.m = 833; + t.n = 556; + t.o = 556; + t.p = 556; + t.q = 556; + t.r = 333; + t.s = 500; + t.t = 278; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 500; + t.braceleft = 334; + t.bar = 260; + t.braceright = 334; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 191; + t.quotedblleft = 333; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 537; + t.bullet = 350; + t.quotesinglbase = 222; + t.quotedblbase = 333; + t.quotedblright = 333; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 556; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 222; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 556; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 667; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 500; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 500; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 222; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 500; + t.scedilla = 500; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 556; + t.Amacron = 667; + t.rcaron = 333; + t.ccedilla = 500; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 643; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 584; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 500; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 260; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 333; + t.omacron = 556; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 222; + t.tcaron = 317; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 222; + t.Oacute = 778; + t.oacute = 556; + t.amacron = 556; + t.sacute = 500; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 556; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 299; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 556; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 556; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 556; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 556; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 556; + t.Rcommaaccent = 722; + t.Lcommaaccent = 556; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 500; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 584; + t.odieresis = 556; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 556; + t.eth = 556; + t.zcaron = 500; + t.ncommaaccent = 556; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t.Symbol = (0, _core_utils.getLookupTableFactory)(function (t) { + t.space = 250; + t.exclam = 333; + t.universal = 713; + t.numbersign = 500; + t.existential = 549; + t.percent = 833; + t.ampersand = 778; + t.suchthat = 439; + t.parenleft = 333; + t.parenright = 333; + t.asteriskmath = 500; + t.plus = 549; + t.comma = 250; + t.minus = 549; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 278; + t.semicolon = 278; + t.less = 549; + t.equal = 549; + t.greater = 549; + t.question = 444; + t.congruent = 549; + t.Alpha = 722; + t.Beta = 667; + t.Chi = 722; + t.Delta = 612; + t.Epsilon = 611; + t.Phi = 763; + t.Gamma = 603; + t.Eta = 722; + t.Iota = 333; + t.theta1 = 631; + t.Kappa = 722; + t.Lambda = 686; + t.Mu = 889; + t.Nu = 722; + t.Omicron = 722; + t.Pi = 768; + t.Theta = 741; + t.Rho = 556; + t.Sigma = 592; + t.Tau = 611; + t.Upsilon = 690; + t.sigma1 = 439; + t.Omega = 768; + t.Xi = 645; + t.Psi = 795; + t.Zeta = 611; + t.bracketleft = 333; + t.therefore = 863; + t.bracketright = 333; + t.perpendicular = 658; + t.underscore = 500; + t.radicalex = 500; + t.alpha = 631; + t.beta = 549; + t.chi = 549; + t.delta = 494; + t.epsilon = 439; + t.phi = 521; + t.gamma = 411; + t.eta = 603; + t.iota = 329; + t.phi1 = 603; + t.kappa = 549; + t.lambda = 549; + t.mu = 576; + t.nu = 521; + t.omicron = 549; + t.pi = 549; + t.theta = 521; + t.rho = 549; + t.sigma = 603; + t.tau = 439; + t.upsilon = 576; + t.omega1 = 713; + t.omega = 686; + t.xi = 493; + t.psi = 686; + t.zeta = 494; + t.braceleft = 480; + t.bar = 200; + t.braceright = 480; + t.similar = 549; + t.Euro = 750; + t.Upsilon1 = 620; + t.minute = 247; + t.lessequal = 549; + t.fraction = 167; + t.infinity = 713; + t.florin = 500; + t.club = 753; + t.diamond = 753; + t.heart = 753; + t.spade = 753; + t.arrowboth = 1042; + t.arrowleft = 987; + t.arrowup = 603; + t.arrowright = 987; + t.arrowdown = 603; + t.degree = 400; + t.plusminus = 549; + t.second = 411; + t.greaterequal = 549; + t.multiply = 549; + t.proportional = 713; + t.partialdiff = 494; + t.bullet = 460; + t.divide = 549; + t.notequal = 549; + t.equivalence = 549; + t.approxequal = 549; + t.ellipsis = 1000; + t.arrowvertex = 603; + t.arrowhorizex = 1000; + t.carriagereturn = 658; + t.aleph = 823; + t.Ifraktur = 686; + t.Rfraktur = 795; + t.weierstrass = 987; + t.circlemultiply = 768; + t.circleplus = 768; + t.emptyset = 823; + t.intersection = 768; + t.union = 768; + t.propersuperset = 713; + t.reflexsuperset = 713; + t.notsubset = 713; + t.propersubset = 713; + t.reflexsubset = 713; + t.element = 713; + t.notelement = 713; + t.angle = 768; + t.gradient = 713; + t.registerserif = 790; + t.copyrightserif = 790; + t.trademarkserif = 890; + t.product = 823; + t.radical = 549; + t.dotmath = 250; + t.logicalnot = 713; + t.logicaland = 603; + t.logicalor = 603; + t.arrowdblboth = 1042; + t.arrowdblleft = 987; + t.arrowdblup = 603; + t.arrowdblright = 987; + t.arrowdbldown = 603; + t.lozenge = 494; + t.angleleft = 329; + t.registersans = 790; + t.copyrightsans = 790; + t.trademarksans = 786; + t.summation = 713; + t.parenlefttp = 384; + t.parenleftex = 384; + t.parenleftbt = 384; + t.bracketlefttp = 384; + t.bracketleftex = 384; + t.bracketleftbt = 384; + t.bracelefttp = 494; + t.braceleftmid = 494; + t.braceleftbt = 494; + t.braceex = 494; + t.angleright = 329; + t.integral = 274; + t.integraltp = 686; + t.integralex = 686; + t.integralbt = 686; + t.parenrighttp = 384; + t.parenrightex = 384; + t.parenrightbt = 384; + t.bracketrighttp = 384; + t.bracketrightex = 384; + t.bracketrightbt = 384; + t.bracerighttp = 494; + t.bracerightmid = 494; + t.bracerightbt = 494; + t.apple = 790; + }); + t["Times-Roman"] = (0, _core_utils.getLookupTableFactory)(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 408; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 564; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 278; + t.semicolon = 278; + t.less = 564; + t.equal = 564; + t.greater = 564; + t.question = 444; + t.at = 921; + t.A = 722; + t.B = 667; + t.C = 667; + t.D = 722; + t.E = 611; + t.F = 556; + t.G = 722; + t.H = 722; + t.I = 333; + t.J = 389; + t.K = 722; + t.L = 611; + t.M = 889; + t.N = 722; + t.O = 722; + t.P = 556; + t.Q = 722; + t.R = 667; + t.S = 556; + t.T = 611; + t.U = 722; + t.V = 722; + t.W = 944; + t.X = 722; + t.Y = 722; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 469; + t.underscore = 500; + t.quoteleft = 333; + t.a = 444; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 500; + t.i = 278; + t.j = 278; + t.k = 500; + t.l = 278; + t.m = 778; + t.n = 500; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 333; + t.s = 389; + t.t = 278; + t.u = 500; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 444; + t.braceleft = 480; + t.bar = 200; + t.braceright = 480; + t.asciitilde = 541; + t.exclamdown = 333; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 180; + t.quotedblleft = 444; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 453; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 444; + t.quotedblright = 444; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 444; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 889; + t.ordfeminine = 276; + t.Lslash = 611; + t.Oslash = 722; + t.OE = 889; + t.ordmasculine = 310; + t.ae = 667; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 500; + t.Idieresis = 333; + t.eacute = 444; + t.abreve = 444; + t.uhungarumlaut = 500; + t.ecaron = 444; + t.Ydieresis = 722; + t.divide = 564; + t.Yacute = 722; + t.Acircumflex = 722; + t.aacute = 444; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 444; + t.Uacute = 722; + t.uogonek = 500; + t.Edieresis = 611; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 760; + t.Emacron = 611; + t.ccaron = 444; + t.aring = 444; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 444; + t.Tcommaaccent = 611; + t.Cacute = 667; + t.atilde = 444; + t.Edotaccent = 611; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 667; + t.Gcommaaccent = 722; + t.ucircumflex = 500; + t.acircumflex = 444; + t.Amacron = 722; + t.rcaron = 333; + t.ccedilla = 444; + t.Zdotaccent = 611; + t.Thorn = 556; + t.Omacron = 722; + t.Racute = 667; + t.Sacute = 556; + t.dcaron = 588; + t.Umacron = 722; + t.uring = 500; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 564; + t.uacute = 500; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 611; + t.adieresis = 444; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 500; + t.umacron = 500; + t.Ncaron = 722; + t.Iacute = 333; + t.plusminus = 564; + t.brokenbar = 200; + t.registered = 760; + t.Gbreve = 722; + t.Idotaccent = 333; + t.summation = 600; + t.Egrave = 611; + t.racute = 333; + t.omacron = 500; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 326; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 444; + t.zacute = 444; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 444; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 500; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 611; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 344; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 980; + t.edotaccent = 444; + t.Igrave = 333; + t.Imacron = 333; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 500; + t.Uhungarumlaut = 722; + t.Eacute = 611; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 500; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 667; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 722; + t.zdotaccent = 444; + t.Ecaron = 611; + t.Iogonek = 333; + t.kcommaaccent = 500; + t.minus = 564; + t.Icircumflex = 333; + t.ncaron = 500; + t.tcommaaccent = 278; + t.logicalnot = 564; + t.odieresis = 500; + t.udieresis = 500; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 444; + t.ncommaaccent = 500; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-Bold"] = (0, _core_utils.getLookupTableFactory)(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 555; + t.numbersign = 500; + t.dollar = 500; + t.percent = 1000; + t.ampersand = 833; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 570; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 570; + t.equal = 570; + t.greater = 570; + t.question = 500; + t.at = 930; + t.A = 722; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 778; + t.I = 389; + t.J = 500; + t.K = 778; + t.L = 667; + t.M = 944; + t.N = 722; + t.O = 778; + t.P = 611; + t.Q = 778; + t.R = 722; + t.S = 556; + t.T = 667; + t.U = 722; + t.V = 722; + t.W = 1000; + t.X = 722; + t.Y = 722; + t.Z = 667; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 581; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 556; + t.c = 444; + t.d = 556; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 556; + t.i = 278; + t.j = 333; + t.k = 556; + t.l = 278; + t.m = 833; + t.n = 556; + t.o = 500; + t.p = 556; + t.q = 556; + t.r = 444; + t.s = 389; + t.t = 333; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 444; + t.braceleft = 394; + t.bar = 220; + t.braceright = 394; + t.asciitilde = 520; + t.exclamdown = 333; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 278; + t.quotedblleft = 500; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 540; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 300; + t.Lslash = 667; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 330; + t.ae = 722; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 556; + t.Idieresis = 389; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 556; + t.ecaron = 444; + t.Ydieresis = 722; + t.divide = 570; + t.Yacute = 722; + t.Acircumflex = 722; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 747; + t.Emacron = 667; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 667; + t.Cacute = 722; + t.atilde = 500; + t.Edotaccent = 667; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 500; + t.Amacron = 722; + t.rcaron = 444; + t.ccedilla = 444; + t.Zdotaccent = 667; + t.Thorn = 611; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 556; + t.dcaron = 672; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 300; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 570; + t.uacute = 556; + t.Tcaron = 667; + t.partialdiff = 494; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 389; + t.plusminus = 570; + t.brokenbar = 220; + t.registered = 747; + t.Gbreve = 778; + t.Idotaccent = 389; + t.summation = 600; + t.Egrave = 667; + t.racute = 444; + t.omacron = 500; + t.Zacute = 667; + t.Zcaron = 667; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 416; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 444; + t.zacute = 444; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 300; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 394; + t.Kcommaaccent = 778; + t.Lacute = 667; + t.trademark = 1000; + t.edotaccent = 444; + t.Igrave = 389; + t.Imacron = 389; + t.Lcaron = 667; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 444; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 722; + t.Lcommaaccent = 667; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 444; + t.Ecaron = 667; + t.Iogonek = 389; + t.kcommaaccent = 556; + t.minus = 570; + t.Icircumflex = 389; + t.ncaron = 556; + t.tcommaaccent = 333; + t.logicalnot = 570; + t.odieresis = 500; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 444; + t.ncommaaccent = 556; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-BoldItalic"] = (0, _core_utils.getLookupTableFactory)(function (t) { + t.space = 250; + t.exclam = 389; + t.quotedbl = 555; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 570; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 570; + t.equal = 570; + t.greater = 570; + t.question = 500; + t.at = 832; + t.A = 667; + t.B = 667; + t.C = 667; + t.D = 722; + t.E = 667; + t.F = 667; + t.G = 722; + t.H = 778; + t.I = 389; + t.J = 500; + t.K = 667; + t.L = 611; + t.M = 889; + t.N = 722; + t.O = 722; + t.P = 611; + t.Q = 722; + t.R = 667; + t.S = 556; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 889; + t.X = 667; + t.Y = 611; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 570; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 556; + t.i = 278; + t.j = 278; + t.k = 500; + t.l = 278; + t.m = 778; + t.n = 556; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 389; + t.s = 389; + t.t = 278; + t.u = 556; + t.v = 444; + t.w = 667; + t.x = 500; + t.y = 444; + t.z = 389; + t.braceleft = 348; + t.bar = 220; + t.braceright = 348; + t.asciitilde = 570; + t.exclamdown = 389; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 278; + t.quotedblleft = 500; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 500; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 944; + t.ordfeminine = 266; + t.Lslash = 611; + t.Oslash = 722; + t.OE = 944; + t.ordmasculine = 300; + t.ae = 722; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 500; + t.Idieresis = 389; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 556; + t.ecaron = 444; + t.Ydieresis = 611; + t.divide = 570; + t.Yacute = 611; + t.Acircumflex = 667; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 444; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 747; + t.Emacron = 667; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 611; + t.Cacute = 667; + t.atilde = 500; + t.Edotaccent = 667; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 667; + t.Gcommaaccent = 722; + t.ucircumflex = 556; + t.acircumflex = 500; + t.Amacron = 667; + t.rcaron = 389; + t.ccedilla = 444; + t.Zdotaccent = 611; + t.Thorn = 611; + t.Omacron = 722; + t.Racute = 667; + t.Sacute = 556; + t.dcaron = 608; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 570; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 444; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 389; + t.plusminus = 570; + t.brokenbar = 220; + t.registered = 747; + t.Gbreve = 722; + t.Idotaccent = 389; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 500; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 366; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 444; + t.zacute = 389; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 576; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 667; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 382; + t.Kcommaaccent = 667; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 444; + t.Igrave = 389; + t.Imacron = 389; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 556; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 667; + t.Lcommaaccent = 611; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 722; + t.zdotaccent = 389; + t.Ecaron = 667; + t.Iogonek = 389; + t.kcommaaccent = 500; + t.minus = 606; + t.Icircumflex = 389; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 606; + t.odieresis = 500; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 389; + t.ncommaaccent = 556; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-Italic"] = (0, _core_utils.getLookupTableFactory)(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 420; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 675; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 675; + t.equal = 675; + t.greater = 675; + t.question = 500; + t.at = 920; + t.A = 611; + t.B = 611; + t.C = 667; + t.D = 722; + t.E = 611; + t.F = 611; + t.G = 722; + t.H = 722; + t.I = 333; + t.J = 444; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 667; + t.O = 722; + t.P = 611; + t.Q = 722; + t.R = 611; + t.S = 500; + t.T = 556; + t.U = 722; + t.V = 611; + t.W = 833; + t.X = 611; + t.Y = 556; + t.Z = 556; + t.bracketleft = 389; + t.backslash = 278; + t.bracketright = 389; + t.asciicircum = 422; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 278; + t.g = 500; + t.h = 500; + t.i = 278; + t.j = 278; + t.k = 444; + t.l = 278; + t.m = 722; + t.n = 500; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 389; + t.s = 389; + t.t = 278; + t.u = 500; + t.v = 444; + t.w = 667; + t.x = 444; + t.y = 444; + t.z = 389; + t.braceleft = 400; + t.bar = 275; + t.braceright = 400; + t.asciitilde = 541; + t.exclamdown = 389; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 214; + t.quotedblleft = 556; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 523; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 556; + t.quotedblright = 556; + t.guillemotright = 500; + t.ellipsis = 889; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 889; + t.AE = 889; + t.ordfeminine = 276; + t.Lslash = 556; + t.Oslash = 722; + t.OE = 944; + t.ordmasculine = 310; + t.ae = 667; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 667; + t.germandbls = 500; + t.Idieresis = 333; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 500; + t.ecaron = 444; + t.Ydieresis = 556; + t.divide = 675; + t.Yacute = 556; + t.Acircumflex = 611; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 444; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 500; + t.Edieresis = 611; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 760; + t.Emacron = 611; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 667; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 556; + t.Cacute = 667; + t.atilde = 500; + t.Edotaccent = 611; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 611; + t.Gcommaaccent = 722; + t.ucircumflex = 500; + t.acircumflex = 500; + t.Amacron = 611; + t.rcaron = 389; + t.ccedilla = 444; + t.Zdotaccent = 556; + t.Thorn = 611; + t.Omacron = 722; + t.Racute = 611; + t.Sacute = 500; + t.dcaron = 544; + t.Umacron = 722; + t.uring = 500; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 611; + t.Abreve = 611; + t.multiply = 675; + t.uacute = 500; + t.Tcaron = 556; + t.partialdiff = 476; + t.ydieresis = 444; + t.Nacute = 667; + t.icircumflex = 278; + t.Ecircumflex = 611; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 500; + t.umacron = 500; + t.Ncaron = 667; + t.Iacute = 333; + t.plusminus = 675; + t.brokenbar = 275; + t.registered = 760; + t.Gbreve = 722; + t.Idotaccent = 333; + t.summation = 600; + t.Egrave = 611; + t.racute = 389; + t.omacron = 500; + t.Zacute = 556; + t.Zcaron = 556; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 300; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 611; + t.Adieresis = 611; + t.egrave = 444; + t.zacute = 389; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 500; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 611; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 500; + t.lcaron = 300; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 980; + t.edotaccent = 444; + t.Igrave = 333; + t.Imacron = 333; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 500; + t.Uhungarumlaut = 722; + t.Eacute = 611; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 500; + t.Scommaaccent = 500; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 500; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 667; + t.otilde = 500; + t.Rcommaaccent = 611; + t.Lcommaaccent = 556; + t.Atilde = 611; + t.Aogonek = 611; + t.Aring = 611; + t.Otilde = 722; + t.zdotaccent = 389; + t.Ecaron = 611; + t.Iogonek = 333; + t.kcommaaccent = 444; + t.minus = 675; + t.Icircumflex = 333; + t.ncaron = 500; + t.tcommaaccent = 278; + t.logicalnot = 675; + t.odieresis = 500; + t.udieresis = 500; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 389; + t.ncommaaccent = 500; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t.ZapfDingbats = (0, _core_utils.getLookupTableFactory)(function (t) { + t.space = 278; + t.a1 = 974; + t.a2 = 961; + t.a202 = 974; + t.a3 = 980; + t.a4 = 719; + t.a5 = 789; + t.a119 = 790; + t.a118 = 791; + t.a117 = 690; + t.a11 = 960; + t.a12 = 939; + t.a13 = 549; + t.a14 = 855; + t.a15 = 911; + t.a16 = 933; + t.a105 = 911; + t.a17 = 945; + t.a18 = 974; + t.a19 = 755; + t.a20 = 846; + t.a21 = 762; + t.a22 = 761; + t.a23 = 571; + t.a24 = 677; + t.a25 = 763; + t.a26 = 760; + t.a27 = 759; + t.a28 = 754; + t.a6 = 494; + t.a7 = 552; + t.a8 = 537; + t.a9 = 577; + t.a10 = 692; + t.a29 = 786; + t.a30 = 788; + t.a31 = 788; + t.a32 = 790; + t.a33 = 793; + t.a34 = 794; + t.a35 = 816; + t.a36 = 823; + t.a37 = 789; + t.a38 = 841; + t.a39 = 823; + t.a40 = 833; + t.a41 = 816; + t.a42 = 831; + t.a43 = 923; + t.a44 = 744; + t.a45 = 723; + t.a46 = 749; + t.a47 = 790; + t.a48 = 792; + t.a49 = 695; + t.a50 = 776; + t.a51 = 768; + t.a52 = 792; + t.a53 = 759; + t.a54 = 707; + t.a55 = 708; + t.a56 = 682; + t.a57 = 701; + t.a58 = 826; + t.a59 = 815; + t.a60 = 789; + t.a61 = 789; + t.a62 = 707; + t.a63 = 687; + t.a64 = 696; + t.a65 = 689; + t.a66 = 786; + t.a67 = 787; + t.a68 = 713; + t.a69 = 791; + t.a70 = 785; + t.a71 = 791; + t.a72 = 873; + t.a73 = 761; + t.a74 = 762; + t.a203 = 762; + t.a75 = 759; + t.a204 = 759; + t.a76 = 892; + t.a77 = 892; + t.a78 = 788; + t.a79 = 784; + t.a81 = 438; + t.a82 = 138; + t.a83 = 277; + t.a84 = 415; + t.a97 = 392; + t.a98 = 392; + t.a99 = 668; + t.a100 = 668; + t.a89 = 390; + t.a90 = 390; + t.a93 = 317; + t.a94 = 317; + t.a91 = 276; + t.a92 = 276; + t.a205 = 509; + t.a85 = 509; + t.a206 = 410; + t.a86 = 410; + t.a87 = 234; + t.a88 = 234; + t.a95 = 334; + t.a96 = 334; + t.a101 = 732; + t.a102 = 544; + t.a103 = 544; + t.a104 = 910; + t.a106 = 667; + t.a107 = 760; + t.a108 = 760; + t.a112 = 776; + t.a111 = 595; + t.a110 = 694; + t.a109 = 626; + t.a120 = 788; + t.a121 = 788; + t.a122 = 788; + t.a123 = 788; + t.a124 = 788; + t.a125 = 788; + t.a126 = 788; + t.a127 = 788; + t.a128 = 788; + t.a129 = 788; + t.a130 = 788; + t.a131 = 788; + t.a132 = 788; + t.a133 = 788; + t.a134 = 788; + t.a135 = 788; + t.a136 = 788; + t.a137 = 788; + t.a138 = 788; + t.a139 = 788; + t.a140 = 788; + t.a141 = 788; + t.a142 = 788; + t.a143 = 788; + t.a144 = 788; + t.a145 = 788; + t.a146 = 788; + t.a147 = 788; + t.a148 = 788; + t.a149 = 788; + t.a150 = 788; + t.a151 = 788; + t.a152 = 788; + t.a153 = 788; + t.a154 = 788; + t.a155 = 788; + t.a156 = 788; + t.a157 = 788; + t.a158 = 788; + t.a159 = 788; + t.a160 = 894; + t.a161 = 838; + t.a163 = 1016; + t.a164 = 458; + t.a196 = 748; + t.a165 = 924; + t.a192 = 748; + t.a166 = 918; + t.a167 = 927; + t.a168 = 928; + t.a169 = 928; + t.a170 = 834; + t.a171 = 873; + t.a172 = 828; + t.a173 = 924; + t.a162 = 924; + t.a174 = 917; + t.a175 = 930; + t.a176 = 931; + t.a177 = 463; + t.a178 = 883; + t.a179 = 836; + t.a193 = 836; + t.a180 = 867; + t.a199 = 867; + t.a181 = 696; + t.a200 = 696; + t.a182 = 874; + t.a201 = 874; + t.a183 = 760; + t.a184 = 946; + t.a197 = 771; + t.a185 = 865; + t.a194 = 771; + t.a198 = 888; + t.a186 = 967; + t.a195 = 888; + t.a187 = 831; + t.a188 = 873; + t.a189 = 927; + t.a190 = 970; + t.a191 = 918; + }); +}); +exports.getMetrics = getMetrics; /***/ }), -/* 43 */ +/* 44 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -44645,7 +46305,7 @@ class MurmurHash3_64 { exports.MurmurHash3_64 = MurmurHash3_64; /***/ }), -/* 44 */ +/* 45 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -44668,58 +46328,58 @@ var _jpeg_stream = __w_pdfjs_require__(18); var _jpx = __w_pdfjs_require__(21); -var PDFImage = function PDFImageClosure() { - function decodeAndClamp(value, addend, coefficient, max) { - value = addend + value * coefficient; - - if (value < 0) { - value = 0; - } else if (value > max) { - value = max; - } +function decodeAndClamp(value, addend, coefficient, max) { + value = addend + value * coefficient; - return value; + if (value < 0) { + value = 0; + } else if (value > max) { + value = max; } - function resizeImageMask(src, bpc, w1, h1, w2, h2) { - var length = w2 * h2; - let dest; + return value; +} - if (bpc <= 8) { - dest = new Uint8Array(length); - } else if (bpc <= 16) { - dest = new Uint16Array(length); - } else { - dest = new Uint32Array(length); - } +function resizeImageMask(src, bpc, w1, h1, w2, h2) { + var length = w2 * h2; + let dest; - var xRatio = w1 / w2; - var yRatio = h1 / h2; - var i, - j, - py, - newIndex = 0, - oldIndex; - var xScaled = new Uint16Array(w2); - var w1Scanline = w1; + if (bpc <= 8) { + dest = new Uint8Array(length); + } else if (bpc <= 16) { + dest = new Uint16Array(length); + } else { + dest = new Uint32Array(length); + } - for (i = 0; i < w2; i++) { - xScaled[i] = Math.floor(i * xRatio); - } + var xRatio = w1 / w2; + var yRatio = h1 / h2; + var i, + j, + py, + newIndex = 0, + oldIndex; + var xScaled = new Uint16Array(w2); + var w1Scanline = w1; - for (i = 0; i < h2; i++) { - py = Math.floor(i * yRatio) * w1Scanline; + for (i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio); + } - for (j = 0; j < w2; j++) { - oldIndex = py + xScaled[j]; - dest[newIndex++] = src[oldIndex]; - } - } + for (i = 0; i < h2; i++) { + py = Math.floor(i * yRatio) * w1Scanline; - return dest; + for (j = 0; j < w2; j++) { + oldIndex = py + xScaled[j]; + dest[newIndex++] = src[oldIndex]; + } } - function PDFImage({ + return dest; +} + +class PDFImage { + constructor({ xref, res, image, @@ -44727,7 +46387,8 @@ var PDFImage = function PDFImageClosure() { smask = null, mask = null, isMask = false, - pdfFunctionFactory + pdfFunctionFactory, + localColorSpaceCache }) { this.image = image; var dict = image.dict; @@ -44787,7 +46448,7 @@ var PDFImage = function PDFImageClosure() { this.bpc = bitsPerComponent; if (!this.imageMask) { - var colorSpace = dict.get("ColorSpace", "CS"); + let colorSpace = dict.getRaw("ColorSpace") || dict.getRaw("CS"); if (!colorSpace) { (0, _util.info)("JPX images (which do not require color spaces)"); @@ -44810,8 +46471,13 @@ var PDFImage = function PDFImageClosure() { } } - const resources = isInline ? res : null; - this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, resources, pdfFunctionFactory); + this.colorSpace = _colorspace.ColorSpace.parse({ + cs: colorSpace, + xref, + resources: isInline ? res : null, + pdfFunctionFactory, + localColorSpaceCache + }); this.numComps = this.colorSpace.numComps; } @@ -44839,7 +46505,8 @@ var PDFImage = function PDFImageClosure() { res, image: smask, isInline, - pdfFunctionFactory + pdfFunctionFactory, + localColorSpaceCache }); } else if (mask) { if ((0, _primitives.isStream)(mask)) { @@ -44855,7 +46522,8 @@ var PDFImage = function PDFImageClosure() { image: mask, isInline, isMask: true, - pdfFunctionFactory + pdfFunctionFactory, + localColorSpaceCache }); } } else { @@ -44864,12 +46532,13 @@ var PDFImage = function PDFImageClosure() { } } - PDFImage.buildImage = function ({ + static async buildImage({ xref, res, image, isInline = false, - pdfFunctionFactory + pdfFunctionFactory, + localColorSpaceCache }) { const imageData = image; let smaskData = null; @@ -44887,18 +46556,19 @@ var PDFImage = function PDFImageClosure() { } } - return Promise.resolve(new PDFImage({ + return new PDFImage({ xref, res, image: imageData, isInline, smask: smaskData, mask: maskData, - pdfFunctionFactory - })); - }; + pdfFunctionFactory, + localColorSpaceCache + }); + } - PDFImage.createMask = function ({ + static createMask({ imgArray, width, height, @@ -44935,384 +46605,381 @@ var PDFImage = function PDFImageClosure() { width, height }; - }; - - PDFImage.prototype = { - get drawWidth() { - return Math.max(this.width, this.smask && this.smask.width || 0, this.mask && this.mask.width || 0); - }, + } - get drawHeight() { - return Math.max(this.height, this.smask && this.smask.height || 0, this.mask && this.mask.height || 0); - }, + get drawWidth() { + return Math.max(this.width, this.smask && this.smask.width || 0, this.mask && this.mask.width || 0); + } - decodeBuffer(buffer) { - var bpc = this.bpc; - var numComps = this.numComps; - var decodeAddends = this.decodeAddends; - var decodeCoefficients = this.decodeCoefficients; - var max = (1 << bpc) - 1; - var i, ii; + get drawHeight() { + return Math.max(this.height, this.smask && this.smask.height || 0, this.mask && this.mask.height || 0); + } - if (bpc === 1) { - for (i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] = +!buffer[i]; - } + decodeBuffer(buffer) { + var bpc = this.bpc; + var numComps = this.numComps; + var decodeAddends = this.decodeAddends; + var decodeCoefficients = this.decodeCoefficients; + var max = (1 << bpc) - 1; + var i, ii; - return; + if (bpc === 1) { + for (i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] = +!buffer[i]; } - var index = 0; - - for (i = 0, ii = this.width * this.height; i < ii; i++) { - for (var j = 0; j < numComps; j++) { - buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max); - index++; - } - } - }, + return; + } - getComponents(buffer) { - var bpc = this.bpc; + var index = 0; - if (bpc === 8) { - return buffer; + for (i = 0, ii = this.width * this.height; i < ii; i++) { + for (var j = 0; j < numComps; j++) { + buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max); + index++; } + } + } - var width = this.width; - var height = this.height; - var numComps = this.numComps; - var length = width * height * numComps; - var bufferPos = 0; - let output; + getComponents(buffer) { + var bpc = this.bpc; - if (bpc <= 8) { - output = new Uint8Array(length); - } else if (bpc <= 16) { - output = new Uint16Array(length); - } else { - output = new Uint32Array(length); - } + if (bpc === 8) { + return buffer; + } - var rowComps = width * numComps; - var max = (1 << bpc) - 1; - var i = 0, - ii, - buf; - - if (bpc === 1) { - var mask, loop1End, loop2End; - - for (var j = 0; j < height; j++) { - loop1End = i + (rowComps & ~7); - loop2End = i + rowComps; - - while (i < loop1End) { - buf = buffer[bufferPos++]; - output[i] = buf >> 7 & 1; - output[i + 1] = buf >> 6 & 1; - output[i + 2] = buf >> 5 & 1; - output[i + 3] = buf >> 4 & 1; - output[i + 4] = buf >> 3 & 1; - output[i + 5] = buf >> 2 & 1; - output[i + 6] = buf >> 1 & 1; - output[i + 7] = buf & 1; - i += 8; - } - - if (i < loop2End) { - buf = buffer[bufferPos++]; - mask = 128; - - while (i < loop2End) { - output[i++] = +!!(buf & mask); - mask >>= 1; - } - } + var width = this.width; + var height = this.height; + var numComps = this.numComps; + var length = width * height * numComps; + var bufferPos = 0; + let output; + + if (bpc <= 8) { + output = new Uint8Array(length); + } else if (bpc <= 16) { + output = new Uint16Array(length); + } else { + output = new Uint32Array(length); + } + + var rowComps = width * numComps; + var max = (1 << bpc) - 1; + var i = 0, + ii, + buf; + + if (bpc === 1) { + var mask, loop1End, loop2End; + + for (var j = 0; j < height; j++) { + loop1End = i + (rowComps & ~7); + loop2End = i + rowComps; + + while (i < loop1End) { + buf = buffer[bufferPos++]; + output[i] = buf >> 7 & 1; + output[i + 1] = buf >> 6 & 1; + output[i + 2] = buf >> 5 & 1; + output[i + 3] = buf >> 4 & 1; + output[i + 4] = buf >> 3 & 1; + output[i + 5] = buf >> 2 & 1; + output[i + 6] = buf >> 1 & 1; + output[i + 7] = buf & 1; + i += 8; } - } else { - var bits = 0; - buf = 0; - for (i = 0, ii = length; i < ii; ++i) { - if (i % rowComps === 0) { - buf = 0; - bits = 0; - } + if (i < loop2End) { + buf = buffer[bufferPos++]; + mask = 128; - while (bits < bpc) { - buf = buf << 8 | buffer[bufferPos++]; - bits += 8; + while (i < loop2End) { + output[i++] = +!!(buf & mask); + mask >>= 1; } + } + } + } else { + var bits = 0; + buf = 0; - var remainingBits = bits - bpc; - let value = buf >> remainingBits; + for (i = 0, ii = length; i < ii; ++i) { + if (i % rowComps === 0) { + buf = 0; + bits = 0; + } - if (value < 0) { - value = 0; - } else if (value > max) { - value = max; - } + while (bits < bpc) { + buf = buf << 8 | buffer[bufferPos++]; + bits += 8; + } - output[i] = value; - buf = buf & (1 << remainingBits) - 1; - bits = remainingBits; + var remainingBits = bits - bpc; + let value = buf >> remainingBits; + + if (value < 0) { + value = 0; + } else if (value > max) { + value = max; } + + output[i] = value; + buf = buf & (1 << remainingBits) - 1; + bits = remainingBits; } + } - return output; - }, + return output; + } + + fillOpacity(rgbaBuf, width, height, actualHeight, image) { + var smask = this.smask; + var mask = this.mask; + var alphaBuf, sw, sh, i, ii, j; - fillOpacity(rgbaBuf, width, height, actualHeight, image) { - var smask = this.smask; - var mask = this.mask; - var alphaBuf, sw, sh, i, ii, j; + if (smask) { + sw = smask.width; + sh = smask.height; + alphaBuf = new Uint8ClampedArray(sw * sh); + smask.fillGrayBuffer(alphaBuf); - if (smask) { - sw = smask.width; - sh = smask.height; + if (sw !== width || sh !== height) { + alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); + } + } else if (mask) { + if (mask instanceof PDFImage) { + sw = mask.width; + sh = mask.height; alphaBuf = new Uint8ClampedArray(sw * sh); - smask.fillGrayBuffer(alphaBuf); + mask.numComps = 1; + mask.fillGrayBuffer(alphaBuf); - if (sw !== width || sh !== height) { - alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); + for (i = 0, ii = sw * sh; i < ii; ++i) { + alphaBuf[i] = 255 - alphaBuf[i]; } - } else if (mask) { - if (mask instanceof PDFImage) { - sw = mask.width; - sh = mask.height; - alphaBuf = new Uint8ClampedArray(sw * sh); - mask.numComps = 1; - mask.fillGrayBuffer(alphaBuf); - - for (i = 0, ii = sw * sh; i < ii; ++i) { - alphaBuf[i] = 255 - alphaBuf[i]; - } - if (sw !== width || sh !== height) { - alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); - } - } else if (Array.isArray(mask)) { - alphaBuf = new Uint8ClampedArray(width * height); - var numComps = this.numComps; + if (sw !== width || sh !== height) { + alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); + } + } else if (Array.isArray(mask)) { + alphaBuf = new Uint8ClampedArray(width * height); + var numComps = this.numComps; - for (i = 0, ii = width * height; i < ii; ++i) { - var opacity = 0; - var imageOffset = i * numComps; + for (i = 0, ii = width * height; i < ii; ++i) { + var opacity = 0; + var imageOffset = i * numComps; - for (j = 0; j < numComps; ++j) { - var color = image[imageOffset + j]; - var maskOffset = j * 2; + for (j = 0; j < numComps; ++j) { + var color = image[imageOffset + j]; + var maskOffset = j * 2; - if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { - opacity = 255; - break; - } + if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { + opacity = 255; + break; } - - alphaBuf[i] = opacity; } - } else { - throw new _util.FormatError("Unknown mask format."); - } - } - if (alphaBuf) { - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = alphaBuf[i]; + alphaBuf[i] = opacity; } } else { - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = 255; - } + throw new _util.FormatError("Unknown mask format."); } - }, - - undoPreblend(buffer, width, height) { - var matte = this.smask && this.smask.matte; + } - if (!matte) { - return; + if (alphaBuf) { + for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { + rgbaBuf[j] = alphaBuf[i]; } + } else { + for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { + rgbaBuf[j] = 255; + } + } + } - var matteRgb = this.colorSpace.getRgb(matte, 0); - var matteR = matteRgb[0]; - var matteG = matteRgb[1]; - var matteB = matteRgb[2]; - var length = width * height * 4; - - for (var i = 0; i < length; i += 4) { - var alpha = buffer[i + 3]; + undoPreblend(buffer, width, height) { + var matte = this.smask && this.smask.matte; - if (alpha === 0) { - buffer[i] = 255; - buffer[i + 1] = 255; - buffer[i + 2] = 255; - continue; - } + if (!matte) { + return; + } - var k = 255 / alpha; - buffer[i] = (buffer[i] - matteR) * k + matteR; - buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG; - buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB; - } - }, + var matteRgb = this.colorSpace.getRgb(matte, 0); + var matteR = matteRgb[0]; + var matteG = matteRgb[1]; + var matteB = matteRgb[2]; + var length = width * height * 4; - createImageData(forceRGBA = false) { - var drawWidth = this.drawWidth; - var drawHeight = this.drawHeight; - var imgData = { - width: drawWidth, - height: drawHeight, - kind: 0, - data: null - }; - var numComps = this.numComps; - var originalWidth = this.width; - var originalHeight = this.height; - var bpc = this.bpc; - var rowBytes = originalWidth * numComps * bpc + 7 >> 3; - var imgArray; + for (var i = 0; i < length; i += 4) { + var alpha = buffer[i + 3]; - if (!forceRGBA) { - var kind; + if (alpha === 0) { + buffer[i] = 255; + buffer[i + 1] = 255; + buffer[i + 2] = 255; + continue; + } - if (this.colorSpace.name === "DeviceGray" && bpc === 1) { - kind = _util.ImageKind.GRAYSCALE_1BPP; - } else if (this.colorSpace.name === "DeviceRGB" && bpc === 8 && !this.needsDecode) { - kind = _util.ImageKind.RGB_24BPP; - } + var k = 255 / alpha; + buffer[i] = (buffer[i] - matteR) * k + matteR; + buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG; + buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB; + } + } - if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { - imgData.kind = kind; - imgArray = this.getImageBytes(originalHeight * rowBytes); + createImageData(forceRGBA = false) { + var drawWidth = this.drawWidth; + var drawHeight = this.drawHeight; + var imgData = { + width: drawWidth, + height: drawHeight, + kind: 0, + data: null + }; + var numComps = this.numComps; + var originalWidth = this.width; + var originalHeight = this.height; + var bpc = this.bpc; + var rowBytes = originalWidth * numComps * bpc + 7 >> 3; + var imgArray; - if (this.image instanceof _stream.DecodeStream) { - imgData.data = imgArray; - } else { - var newArray = new Uint8ClampedArray(imgArray.length); - newArray.set(imgArray); - imgData.data = newArray; - } + if (!forceRGBA) { + var kind; - if (this.needsDecode) { - (0, _util.assert)(kind === _util.ImageKind.GRAYSCALE_1BPP, "PDFImage.createImageData: The image must be grayscale."); - var buffer = imgData.data; + if (this.colorSpace.name === "DeviceGray" && bpc === 1) { + kind = _util.ImageKind.GRAYSCALE_1BPP; + } else if (this.colorSpace.name === "DeviceRGB" && bpc === 8 && !this.needsDecode) { + kind = _util.ImageKind.RGB_24BPP; + } - for (var i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] ^= 0xff; - } - } + if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { + imgData.kind = kind; + imgArray = this.getImageBytes(originalHeight * rowBytes); - return imgData; + if (this.image instanceof _stream.DecodeStream) { + imgData.data = imgArray; + } else { + var newArray = new Uint8ClampedArray(imgArray.length); + newArray.set(imgArray); + imgData.data = newArray; } - if (this.image instanceof _jpeg_stream.JpegStream && !this.smask && !this.mask) { - let imageLength = originalHeight * rowBytes; - - switch (this.colorSpace.name) { - case "DeviceGray": - imageLength *= 3; + if (this.needsDecode) { + (0, _util.assert)(kind === _util.ImageKind.GRAYSCALE_1BPP, "PDFImage.createImageData: The image must be grayscale."); + var buffer = imgData.data; - case "DeviceRGB": - case "DeviceCMYK": - imgData.kind = _util.ImageKind.RGB_24BPP; - imgData.data = this.getImageBytes(imageLength, drawWidth, drawHeight, true); - return imgData; + for (var i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] ^= 0xff; } } + + return imgData; } - imgArray = this.getImageBytes(originalHeight * rowBytes); - var actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight; - var comps = this.getComponents(imgArray); - var alpha01, maybeUndoPreblend; + if (this.image instanceof _jpeg_stream.JpegStream && !this.smask && !this.mask) { + let imageLength = originalHeight * rowBytes; - if (!forceRGBA && !this.smask && !this.mask) { - imgData.kind = _util.ImageKind.RGB_24BPP; - imgData.data = new Uint8ClampedArray(drawWidth * drawHeight * 3); - alpha01 = 0; - maybeUndoPreblend = false; - } else { - imgData.kind = _util.ImageKind.RGBA_32BPP; - imgData.data = new Uint8ClampedArray(drawWidth * drawHeight * 4); - alpha01 = 1; - maybeUndoPreblend = true; - this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, comps); - } + switch (this.colorSpace.name) { + case "DeviceGray": + imageLength *= 3; - if (this.needsDecode) { - this.decodeBuffer(comps); + case "DeviceRGB": + case "DeviceCMYK": + imgData.kind = _util.ImageKind.RGB_24BPP; + imgData.data = this.getImageBytes(imageLength, drawWidth, drawHeight, true); + return imgData; + } } + } - this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01); + imgArray = this.getImageBytes(originalHeight * rowBytes); + var actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight; + var comps = this.getComponents(imgArray); + var alpha01, maybeUndoPreblend; - if (maybeUndoPreblend) { - this.undoPreblend(imgData.data, drawWidth, actualHeight); - } + if (!forceRGBA && !this.smask && !this.mask) { + imgData.kind = _util.ImageKind.RGB_24BPP; + imgData.data = new Uint8ClampedArray(drawWidth * drawHeight * 3); + alpha01 = 0; + maybeUndoPreblend = false; + } else { + imgData.kind = _util.ImageKind.RGBA_32BPP; + imgData.data = new Uint8ClampedArray(drawWidth * drawHeight * 4); + alpha01 = 1; + maybeUndoPreblend = true; + this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, comps); + } - return imgData; - }, + if (this.needsDecode) { + this.decodeBuffer(comps); + } - fillGrayBuffer(buffer) { - var numComps = this.numComps; + this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01); - if (numComps !== 1) { - throw new _util.FormatError(`Reading gray scale from a color image: ${numComps}`); - } + if (maybeUndoPreblend) { + this.undoPreblend(imgData.data, drawWidth, actualHeight); + } + + return imgData; + } - var width = this.width; - var height = this.height; - var bpc = this.bpc; - var rowBytes = width * numComps * bpc + 7 >> 3; - var imgArray = this.getImageBytes(height * rowBytes); - var comps = this.getComponents(imgArray); - var i, length; + fillGrayBuffer(buffer) { + var numComps = this.numComps; - if (bpc === 1) { - length = width * height; + if (numComps !== 1) { + throw new _util.FormatError(`Reading gray scale from a color image: ${numComps}`); + } - if (this.needsDecode) { - for (i = 0; i < length; ++i) { - buffer[i] = comps[i] - 1 & 255; - } - } else { - for (i = 0; i < length; ++i) { - buffer[i] = -comps[i] & 255; - } - } + var width = this.width; + var height = this.height; + var bpc = this.bpc; + var rowBytes = width * numComps * bpc + 7 >> 3; + var imgArray = this.getImageBytes(height * rowBytes); + var comps = this.getComponents(imgArray); + var i, length; - return; - } + if (bpc === 1) { + length = width * height; if (this.needsDecode) { - this.decodeBuffer(comps); + for (i = 0; i < length; ++i) { + buffer[i] = comps[i] - 1 & 255; + } + } else { + for (i = 0; i < length; ++i) { + buffer[i] = -comps[i] & 255; + } } - length = width * height; - var scale = 255 / ((1 << bpc) - 1); + return; + } - for (i = 0; i < length; ++i) { - buffer[i] = scale * comps[i]; - } - }, + if (this.needsDecode) { + this.decodeBuffer(comps); + } + + length = width * height; + var scale = 255 / ((1 << bpc) - 1); - getImageBytes(length, drawWidth, drawHeight, forceRGB = false) { - this.image.reset(); - this.image.drawWidth = drawWidth || this.width; - this.image.drawHeight = drawHeight || this.height; - this.image.forceRGB = !!forceRGB; - return this.image.getBytes(length, true); + for (i = 0; i < length; ++i) { + buffer[i] = scale * comps[i]; } + } - }; - return PDFImage; -}(); + getImageBytes(length, drawWidth, drawHeight, forceRGB = false) { + this.image.reset(); + this.image.drawWidth = drawWidth || this.width; + this.image.drawHeight = drawHeight || this.height; + this.image.forceRGB = !!forceRGB; + return this.image.getBytes(length, true); + } + +} exports.PDFImage = PDFImage; /***/ }), -/* 45 */ +/* 46 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -45813,7 +47480,7 @@ class MessageHandler { exports.MessageHandler = MessageHandler; /***/ }), -/* 46 */ +/* 47 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; diff --git a/third-party/pdfjs/pdfjs.gresource.xml b/third-party/pdfjs/pdfjs.gresource.xml index 7788e8752..36708560c 100644 --- a/third-party/pdfjs/pdfjs.gresource.xml +++ b/third-party/pdfjs/pdfjs.gresource.xml @@ -1,13 +1,11 @@ - build/pdf.js - build/pdf.worker.js - web/viewer.html - web/viewer.css - web/viewer.js web/compressed.tracemonkey-pldi-09.pdf web/debugger.js + web/viewer.js + web/viewer.css + web/viewer.html web/cmaps/78-EUC-H.bcmap web/cmaps/78-EUC-V.bcmap web/cmaps/78-H.bcmap @@ -186,79 +184,80 @@ web/images/annotation-noicon.svg web/images/annotation-note.svg web/images/annotation-paragraph.svg - web/images/findbarButton-next.png - web/images/findbarButton-next@2x.png - web/images/findbarButton-previous.png - web/images/findbarButton-previous@2x.png + web/images/findbarButton-next-dark.svg + web/images/findbarButton-next.svg + web/images/findbarButton-previous-dark.svg + web/images/findbarButton-previous.svg web/images/grab.cur web/images/grabbing.cur + web/images/loading-dark.svg web/images/loading-icon.gif - web/images/loading-small.png - web/images/loading-small@2x.png - web/images/secondaryToolbarButton-documentProperties.png - web/images/secondaryToolbarButton-documentProperties@2x.png - web/images/secondaryToolbarButton-firstPage.png - web/images/secondaryToolbarButton-firstPage@2x.png - web/images/secondaryToolbarButton-handTool.png - web/images/secondaryToolbarButton-handTool@2x.png - web/images/secondaryToolbarButton-lastPage.png - web/images/secondaryToolbarButton-lastPage@2x.png - web/images/secondaryToolbarButton-rotateCcw.png - web/images/secondaryToolbarButton-rotateCcw@2x.png - web/images/secondaryToolbarButton-rotateCw.png - web/images/secondaryToolbarButton-rotateCw@2x.png - web/images/secondaryToolbarButton-scrollHorizontal.png - web/images/secondaryToolbarButton-scrollHorizontal@2x.png - web/images/secondaryToolbarButton-scrollVertical.png - web/images/secondaryToolbarButton-scrollVertical@2x.png - web/images/secondaryToolbarButton-scrollWrapped.png - web/images/secondaryToolbarButton-scrollWrapped@2x.png - web/images/secondaryToolbarButton-selectTool.png - web/images/secondaryToolbarButton-selectTool@2x.png - web/images/secondaryToolbarButton-spreadEven.png - web/images/secondaryToolbarButton-spreadEven@2x.png - web/images/secondaryToolbarButton-spreadNone.png - web/images/secondaryToolbarButton-spreadNone@2x.png - web/images/secondaryToolbarButton-spreadOdd.png - web/images/secondaryToolbarButton-spreadOdd@2x.png + web/images/loading.svg + web/images/secondaryToolbarButton-documentProperties-dark.svg + web/images/secondaryToolbarButton-documentProperties.svg + web/images/secondaryToolbarButton-firstPage-dark.svg + web/images/secondaryToolbarButton-firstPage.svg + web/images/secondaryToolbarButton-handTool-dark.svg + web/images/secondaryToolbarButton-handTool.svg + web/images/secondaryToolbarButton-lastPage-dark.svg + web/images/secondaryToolbarButton-lastPage.svg + web/images/secondaryToolbarButton-rotateCcw-dark.svg + web/images/secondaryToolbarButton-rotateCcw.svg + web/images/secondaryToolbarButton-rotateCw-dark.svg + web/images/secondaryToolbarButton-rotateCw.svg + web/images/secondaryToolbarButton-scrollHorizontal-dark.svg + web/images/secondaryToolbarButton-scrollHorizontal.svg + web/images/secondaryToolbarButton-scrollVertical-dark.svg + web/images/secondaryToolbarButton-scrollVertical.svg + web/images/secondaryToolbarButton-scrollWrapped-dark.svg + web/images/secondaryToolbarButton-scrollWrapped.svg + web/images/secondaryToolbarButton-selectTool-dark.svg + web/images/secondaryToolbarButton-selectTool.svg + web/images/secondaryToolbarButton-spreadEven-dark.svg + web/images/secondaryToolbarButton-spreadEven.svg + web/images/secondaryToolbarButton-spreadNone-dark.svg + web/images/secondaryToolbarButton-spreadNone.svg + web/images/secondaryToolbarButton-spreadOdd-dark.svg + web/images/secondaryToolbarButton-spreadOdd.svg web/images/shadow.png - web/images/texture.png - web/images/toolbarButton-bookmark.png - web/images/toolbarButton-bookmark@2x.png - web/images/toolbarButton-download.png - web/images/toolbarButton-download@2x.png - web/images/toolbarButton-menuArrows.png - web/images/toolbarButton-menuArrows@2x.png - web/images/toolbarButton-openFile.png - web/images/toolbarButton-openFile@2x.png - web/images/toolbarButton-pageDown.png - web/images/toolbarButton-pageDown@2x.png - web/images/toolbarButton-pageUp.png - web/images/toolbarButton-pageUp@2x.png - web/images/toolbarButton-presentationMode.png - web/images/toolbarButton-presentationMode@2x.png - web/images/toolbarButton-print.png - web/images/toolbarButton-print@2x.png - web/images/toolbarButton-search.png - web/images/toolbarButton-search@2x.png - web/images/toolbarButton-secondaryToolbarToggle.png - web/images/toolbarButton-secondaryToolbarToggle@2x.png - web/images/toolbarButton-sidebarToggle.png - web/images/toolbarButton-sidebarToggle@2x.png - web/images/toolbarButton-viewAttachments.png - web/images/toolbarButton-viewAttachments@2x.png - web/images/toolbarButton-viewOutline.png - web/images/toolbarButton-viewOutline@2x.png - web/images/toolbarButton-viewThumbnail.png - web/images/toolbarButton-viewThumbnail@2x.png - web/images/toolbarButton-zoomIn.png - web/images/toolbarButton-zoomIn@2x.png - web/images/toolbarButton-zoomOut.png - web/images/toolbarButton-zoomOut@2x.png - web/images/treeitem-collapsed.png - web/images/treeitem-collapsed@2x.png - web/images/treeitem-expanded.png - web/images/treeitem-expanded@2x.png + web/images/toolbarButton-bookmark-dark.svg + web/images/toolbarButton-bookmark.svg + web/images/toolbarButton-download-dark.svg + web/images/toolbarButton-download.svg + web/images/toolbarButton-menuArrow-dark.svg + web/images/toolbarButton-menuArrow.svg + web/images/toolbarButton-openFile-dark.svg + web/images/toolbarButton-openFile.svg + web/images/toolbarButton-pageDown-dark.svg + web/images/toolbarButton-pageDown.svg + web/images/toolbarButton-pageUp-dark.svg + web/images/toolbarButton-pageUp.svg + web/images/toolbarButton-presentationMode-dark.svg + web/images/toolbarButton-presentationMode.svg + web/images/toolbarButton-print-dark.svg + web/images/toolbarButton-print.svg + web/images/toolbarButton-search-dark.svg + web/images/toolbarButton-search.svg + web/images/toolbarButton-secondaryToolbarToggle-dark.svg + web/images/toolbarButton-secondaryToolbarToggle.svg + web/images/toolbarButton-sidebarToggle-dark.svg + web/images/toolbarButton-sidebarToggle.svg + web/images/toolbarButton-viewAttachments-dark.svg + web/images/toolbarButton-viewAttachments.svg + web/images/toolbarButton-viewLayers-dark.svg + web/images/toolbarButton-viewLayers.svg + web/images/toolbarButton-viewOutline-dark.svg + web/images/toolbarButton-viewOutline.svg + web/images/toolbarButton-viewThumbnail-dark.svg + web/images/toolbarButton-viewThumbnail.svg + web/images/toolbarButton-zoomIn-dark.svg + web/images/toolbarButton-zoomIn.svg + web/images/toolbarButton-zoomOut-dark.svg + web/images/toolbarButton-zoomOut.svg + web/images/treeitem-collapsed-dark.svg + web/images/treeitem-collapsed.svg + web/images/treeitem-expanded-dark.svg + web/images/treeitem-expanded.svg web/locale/locale.properties web/locale/ach/viewer.properties web/locale/af/viewer.properties @@ -275,6 +274,7 @@ web/locale/bs/viewer.properties web/locale/ca/viewer.properties web/locale/cak/viewer.properties + web/locale/ckb/viewer.properties web/locale/cs/viewer.properties web/locale/cy/viewer.properties web/locale/da/viewer.properties @@ -349,6 +349,7 @@ web/locale/sq/viewer.properties web/locale/sr/viewer.properties web/locale/sv-SE/viewer.properties + web/locale/szl/viewer.properties web/locale/ta/viewer.properties web/locale/te/viewer.properties web/locale/th/viewer.properties @@ -363,5 +364,9 @@ web/locale/xh/viewer.properties web/locale/zh-CN/viewer.properties web/locale/zh-TW/viewer.properties + build/pdf.js + build/pdf.js.map + build/pdf.worker.js + build/pdf.worker.js.map diff --git a/third-party/pdfjs/pdfjs_generate_resource.py b/third-party/pdfjs/pdfjs_generate_resource.py index 5387530b3..f20641f80 100755 --- a/third-party/pdfjs/pdfjs_generate_resource.py +++ b/third-party/pdfjs/pdfjs_generate_resource.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """ Pack pdf.js into a gresource file for Epiphany """ diff --git a/third-party/pdfjs/web/images/findbarButton-next-dark.svg b/third-party/pdfjs/web/images/findbarButton-next-dark.svg new file mode 100644 index 000000000..80df70bc1 --- /dev/null +++ b/third-party/pdfjs/web/images/findbarButton-next-dark.svg @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/findbarButton-next.png b/third-party/pdfjs/web/images/findbarButton-next.png deleted file mode 100644 index de1d0fc90..000000000 Binary files a/third-party/pdfjs/web/images/findbarButton-next.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/findbarButton-next.svg b/third-party/pdfjs/web/images/findbarButton-next.svg new file mode 100644 index 000000000..a81eb0296 --- /dev/null +++ b/third-party/pdfjs/web/images/findbarButton-next.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/findbarButton-next@2x.png b/third-party/pdfjs/web/images/findbarButton-next@2x.png deleted file mode 100644 index 0250307c0..000000000 Binary files a/third-party/pdfjs/web/images/findbarButton-next@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/findbarButton-previous-dark.svg b/third-party/pdfjs/web/images/findbarButton-previous-dark.svg new file mode 100644 index 000000000..d304a9b8c --- /dev/null +++ b/third-party/pdfjs/web/images/findbarButton-previous-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/findbarButton-previous.png b/third-party/pdfjs/web/images/findbarButton-previous.png deleted file mode 100644 index bef02743f..000000000 Binary files a/third-party/pdfjs/web/images/findbarButton-previous.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/findbarButton-previous.svg b/third-party/pdfjs/web/images/findbarButton-previous.svg new file mode 100644 index 000000000..5fd703225 --- /dev/null +++ b/third-party/pdfjs/web/images/findbarButton-previous.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/findbarButton-previous@2x.png b/third-party/pdfjs/web/images/findbarButton-previous@2x.png deleted file mode 100644 index 1da6dc949..000000000 Binary files a/third-party/pdfjs/web/images/findbarButton-previous@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/loading-dark.svg b/third-party/pdfjs/web/images/loading-dark.svg new file mode 100644 index 000000000..fa5269b1a --- /dev/null +++ b/third-party/pdfjs/web/images/loading-dark.svg @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/loading-small.png b/third-party/pdfjs/web/images/loading-small.png deleted file mode 100644 index 8831a8058..000000000 Binary files a/third-party/pdfjs/web/images/loading-small.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/loading-small@2x.png b/third-party/pdfjs/web/images/loading-small@2x.png deleted file mode 100644 index b25b4452a..000000000 Binary files a/third-party/pdfjs/web/images/loading-small@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/loading.svg b/third-party/pdfjs/web/images/loading.svg new file mode 100644 index 000000000..0a15ff688 --- /dev/null +++ b/third-party/pdfjs/web/images/loading.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties-dark.svg new file mode 100644 index 000000000..306e628d7 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties-dark.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.png b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.png deleted file mode 100644 index 40925e25a..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg new file mode 100644 index 000000000..6bd55cda7 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties@2x.png deleted file mode 100644 index adb240eaa..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage-dark.svg new file mode 100644 index 000000000..c13ff8671 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.png b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.png deleted file mode 100644 index e68846aa5..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.svg new file mode 100644 index 000000000..2fa0fa6da --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage@2x.png deleted file mode 100644 index 3ad8af517..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool-dark.svg new file mode 100644 index 000000000..834d8b0da --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.png b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.png deleted file mode 100644 index cb85a841b..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.svg new file mode 100644 index 000000000..3d038fabb --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool@2x.png deleted file mode 100644 index 5c13f77ff..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage-dark.svg new file mode 100644 index 000000000..8633e420a --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.png b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.png deleted file mode 100644 index be763e0c4..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.svg new file mode 100644 index 000000000..53fa9a6d0 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage@2x.png deleted file mode 100644 index 8570984f2..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw-dark.svg new file mode 100644 index 000000000..1a92f802c --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.png b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.png deleted file mode 100644 index 675d6da2c..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg new file mode 100644 index 000000000..c71ea8e8d --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw@2x.png deleted file mode 100644 index b9e743122..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw-dark.svg new file mode 100644 index 000000000..2a4ef7385 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.png b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.png deleted file mode 100644 index e1c759888..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg new file mode 100644 index 000000000..e1e19e73d --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw@2x.png deleted file mode 100644 index cb257b41c..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal-dark.svg new file mode 100644 index 000000000..337f85ef4 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.png deleted file mode 100644 index cb702fc4d..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg new file mode 100644 index 000000000..8693eec39 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal@2x.png deleted file mode 100644 index 7f05289bb..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical-dark.svg new file mode 100644 index 000000000..41bdd8f14 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.png deleted file mode 100644 index 0b8427a16..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg new file mode 100644 index 000000000..ee1cf22f9 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical@2x.png deleted file mode 100644 index 72ab55ebf..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped-dark.svg new file mode 100644 index 000000000..cd50526ff --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.png deleted file mode 100644 index 165fc8bc0..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg new file mode 100644 index 000000000..804e7469b --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped@2x.png deleted file mode 100644 index 424614119..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool-dark.svg new file mode 100644 index 000000000..7a95098af --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.png b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.png deleted file mode 100644 index 25520a6fe..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.svg new file mode 100644 index 000000000..43e978944 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png deleted file mode 100644 index a58aaef4f..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven-dark.svg new file mode 100644 index 000000000..0c9586ed8 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.png deleted file mode 100644 index 3fa07e703..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg new file mode 100644 index 000000000..ddec5e68d --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven@2x.png deleted file mode 100644 index 32e5033d7..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone-dark.svg new file mode 100644 index 000000000..75e1b985d --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.png deleted file mode 100644 index 161147354..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg new file mode 100644 index 000000000..63318c56b --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone@2x.png deleted file mode 100644 index 8e51cf3b7..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd-dark.svg new file mode 100644 index 000000000..8dff9598e --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.png deleted file mode 100644 index 5126313a1..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg new file mode 100644 index 000000000..29909e9fa --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd@2x.png deleted file mode 100644 index 5996b74db..000000000 Binary files a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/shadow.png b/third-party/pdfjs/web/images/shadow.png index 31d3bdb14..a00061ac7 100644 Binary files a/third-party/pdfjs/web/images/shadow.png and b/third-party/pdfjs/web/images/shadow.png differ diff --git a/third-party/pdfjs/web/images/texture.png b/third-party/pdfjs/web/images/texture.png deleted file mode 100644 index 12bae83a9..000000000 Binary files a/third-party/pdfjs/web/images/texture.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-bookmark-dark.svg b/third-party/pdfjs/web/images/toolbarButton-bookmark-dark.svg new file mode 100644 index 000000000..7bf332972 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-bookmark-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-bookmark.png b/third-party/pdfjs/web/images/toolbarButton-bookmark.png deleted file mode 100644 index a187be6c9..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-bookmark.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-bookmark.svg b/third-party/pdfjs/web/images/toolbarButton-bookmark.svg new file mode 100644 index 000000000..79d39b090 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-bookmark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-bookmark@2x.png b/third-party/pdfjs/web/images/toolbarButton-bookmark@2x.png deleted file mode 100644 index 4efbaa675..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-bookmark@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-download-dark.svg b/third-party/pdfjs/web/images/toolbarButton-download-dark.svg new file mode 100644 index 000000000..d2a92e5d4 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-download-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-download.png b/third-party/pdfjs/web/images/toolbarButton-download.png deleted file mode 100644 index eaab35f09..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-download.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-download.svg b/third-party/pdfjs/web/images/toolbarButton-download.svg new file mode 100644 index 000000000..2cdb5db3c --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-download.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-download@2x.png b/third-party/pdfjs/web/images/toolbarButton-download@2x.png deleted file mode 100644 index 896face45..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-download@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-menuArrow-dark.svg b/third-party/pdfjs/web/images/toolbarButton-menuArrow-dark.svg new file mode 100644 index 000000000..eb7f50e6d --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-menuArrow-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-menuArrow.svg b/third-party/pdfjs/web/images/toolbarButton-menuArrow.svg new file mode 100644 index 000000000..46e41e18c --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-menuArrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-menuArrows.png b/third-party/pdfjs/web/images/toolbarButton-menuArrows.png deleted file mode 100644 index e50ca4eee..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-menuArrows.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-menuArrows@2x.png b/third-party/pdfjs/web/images/toolbarButton-menuArrows@2x.png deleted file mode 100644 index f7570bc0d..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-menuArrows@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-openFile-dark.svg b/third-party/pdfjs/web/images/toolbarButton-openFile-dark.svg new file mode 100644 index 000000000..0bd612f0e --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-openFile-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-openFile.png b/third-party/pdfjs/web/images/toolbarButton-openFile.png deleted file mode 100644 index b5cf1bd06..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-openFile.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-openFile.svg b/third-party/pdfjs/web/images/toolbarButton-openFile.svg new file mode 100644 index 000000000..cb35980f0 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-openFile.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-openFile@2x.png b/third-party/pdfjs/web/images/toolbarButton-openFile@2x.png deleted file mode 100644 index 91ab76593..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-openFile@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-pageDown-dark.svg b/third-party/pdfjs/web/images/toolbarButton-pageDown-dark.svg new file mode 100644 index 000000000..c2ca60c8f --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-pageDown-dark.svg @@ -0,0 +1,8 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-pageDown.png b/third-party/pdfjs/web/images/toolbarButton-pageDown.png deleted file mode 100644 index 8219ecf83..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-pageDown.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-pageDown.svg b/third-party/pdfjs/web/images/toolbarButton-pageDown.svg new file mode 100644 index 000000000..c5d8b0f3f --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-pageDown.svg @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-pageDown@2x.png b/third-party/pdfjs/web/images/toolbarButton-pageDown@2x.png deleted file mode 100644 index 758c01d83..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-pageDown@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-pageUp-dark.svg b/third-party/pdfjs/web/images/toolbarButton-pageUp-dark.svg new file mode 100644 index 000000000..dddc4ab26 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-pageUp-dark.svg @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-pageUp.png b/third-party/pdfjs/web/images/toolbarButton-pageUp.png deleted file mode 100644 index fb9daa337..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-pageUp.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-pageUp.svg b/third-party/pdfjs/web/images/toolbarButton-pageUp.svg new file mode 100644 index 000000000..aa0160ab9 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-pageUp.svg @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-pageUp@2x.png b/third-party/pdfjs/web/images/toolbarButton-pageUp@2x.png deleted file mode 100644 index a5cfd755b..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-pageUp@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-presentationMode-dark.svg b/third-party/pdfjs/web/images/toolbarButton-presentationMode-dark.svg new file mode 100644 index 000000000..13fa9dc7c --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-presentationMode-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-presentationMode.png b/third-party/pdfjs/web/images/toolbarButton-presentationMode.png deleted file mode 100644 index 3ac21244d..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-presentationMode.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-presentationMode.svg b/third-party/pdfjs/web/images/toolbarButton-presentationMode.svg new file mode 100644 index 000000000..3f1f832e5 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-presentationMode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-presentationMode@2x.png b/third-party/pdfjs/web/images/toolbarButton-presentationMode@2x.png deleted file mode 100644 index cada9e791..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-presentationMode@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-print-dark.svg b/third-party/pdfjs/web/images/toolbarButton-print-dark.svg new file mode 100644 index 000000000..ad37022f0 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-print-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-print.png b/third-party/pdfjs/web/images/toolbarButton-print.png deleted file mode 100644 index 51275e54b..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-print.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-print.svg b/third-party/pdfjs/web/images/toolbarButton-print.svg new file mode 100644 index 000000000..d521c9ad2 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-print.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-print@2x.png b/third-party/pdfjs/web/images/toolbarButton-print@2x.png deleted file mode 100644 index 53d18daf7..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-print@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-search-dark.svg b/third-party/pdfjs/web/images/toolbarButton-search-dark.svg new file mode 100644 index 000000000..cec8a4206 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-search-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-search.png b/third-party/pdfjs/web/images/toolbarButton-search.png deleted file mode 100644 index f9b75579b..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-search.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-search.svg b/third-party/pdfjs/web/images/toolbarButton-search.svg new file mode 100644 index 000000000..28b7774eb --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-search.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-search@2x.png b/third-party/pdfjs/web/images/toolbarButton-search@2x.png deleted file mode 100644 index 456b13324..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-search@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-dark.svg b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-dark.svg new file mode 100644 index 000000000..0160c07cd --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png deleted file mode 100644 index 1f90f83da..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg new file mode 100644 index 000000000..dbef23804 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle@2x.png b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle@2x.png deleted file mode 100644 index b066fe5cb..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle-dark.svg b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle-dark.svg new file mode 100644 index 000000000..0118e41a8 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.png b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.png deleted file mode 100644 index 025dc9040..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.svg b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.svg new file mode 100644 index 000000000..691c41cb1 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle@2x.png b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle@2x.png deleted file mode 100644 index 7f834df94..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-viewAttachments-dark.svg b/third-party/pdfjs/web/images/toolbarButton-viewAttachments-dark.svg new file mode 100644 index 000000000..c9714fdea --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewAttachments-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewAttachments.png b/third-party/pdfjs/web/images/toolbarButton-viewAttachments.png deleted file mode 100644 index fcd0b268a..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-viewAttachments.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-viewAttachments.svg b/third-party/pdfjs/web/images/toolbarButton-viewAttachments.svg new file mode 100644 index 000000000..e914ec083 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewAttachments.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewAttachments@2x.png b/third-party/pdfjs/web/images/toolbarButton-viewAttachments@2x.png deleted file mode 100644 index 4a5e2b8a3..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-viewAttachments@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-viewLayers-dark.svg b/third-party/pdfjs/web/images/toolbarButton-viewLayers-dark.svg new file mode 100644 index 000000000..76b042a95 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewLayers-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewLayers.svg b/third-party/pdfjs/web/images/toolbarButton-viewLayers.svg new file mode 100644 index 000000000..e8687b770 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewLayers.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewOutline-dark.svg b/third-party/pdfjs/web/images/toolbarButton-viewOutline-dark.svg new file mode 100644 index 000000000..1704d961a --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewOutline-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewOutline.png b/third-party/pdfjs/web/images/toolbarButton-viewOutline.png deleted file mode 100644 index 976365a50..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-viewOutline.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-viewOutline.svg b/third-party/pdfjs/web/images/toolbarButton-viewOutline.svg new file mode 100644 index 000000000..030c28dfe --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewOutline.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewOutline@2x.png b/third-party/pdfjs/web/images/toolbarButton-viewOutline@2x.png deleted file mode 100644 index b6a197fdf..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-viewOutline@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail-dark.svg b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail-dark.svg new file mode 100644 index 000000000..17c55f7b8 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.png b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.png deleted file mode 100644 index 584ba5588..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.svg b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.svg new file mode 100644 index 000000000..b997ec49a --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png deleted file mode 100644 index a0208b413..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomIn-dark.svg b/third-party/pdfjs/web/images/toolbarButton-zoomIn-dark.svg new file mode 100644 index 000000000..9b615541e --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-zoomIn-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomIn.png b/third-party/pdfjs/web/images/toolbarButton-zoomIn.png deleted file mode 100644 index 513d081bc..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-zoomIn.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomIn.svg b/third-party/pdfjs/web/images/toolbarButton-zoomIn.svg new file mode 100644 index 000000000..480d2cef0 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-zoomIn.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomIn@2x.png b/third-party/pdfjs/web/images/toolbarButton-zoomIn@2x.png deleted file mode 100644 index d5d49d5ff..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-zoomIn@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomOut-dark.svg b/third-party/pdfjs/web/images/toolbarButton-zoomOut-dark.svg new file mode 100644 index 000000000..0fb3594d1 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-zoomOut-dark.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomOut.png b/third-party/pdfjs/web/images/toolbarButton-zoomOut.png deleted file mode 100644 index 156c26b94..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-zoomOut.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomOut.svg b/third-party/pdfjs/web/images/toolbarButton-zoomOut.svg new file mode 100644 index 000000000..527f52106 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-zoomOut.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomOut@2x.png b/third-party/pdfjs/web/images/toolbarButton-zoomOut@2x.png deleted file mode 100644 index 959e1919d..000000000 Binary files a/third-party/pdfjs/web/images/toolbarButton-zoomOut@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/treeitem-collapsed-dark.svg b/third-party/pdfjs/web/images/treeitem-collapsed-dark.svg new file mode 100644 index 000000000..1fb655162 --- /dev/null +++ b/third-party/pdfjs/web/images/treeitem-collapsed-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/treeitem-collapsed.png b/third-party/pdfjs/web/images/treeitem-collapsed.png deleted file mode 100644 index 06d4d3769..000000000 Binary files a/third-party/pdfjs/web/images/treeitem-collapsed.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/treeitem-collapsed.svg b/third-party/pdfjs/web/images/treeitem-collapsed.svg new file mode 100644 index 000000000..831cddfc8 --- /dev/null +++ b/third-party/pdfjs/web/images/treeitem-collapsed.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/treeitem-collapsed@2x.png b/third-party/pdfjs/web/images/treeitem-collapsed@2x.png deleted file mode 100644 index eec1e58c1..000000000 Binary files a/third-party/pdfjs/web/images/treeitem-collapsed@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/treeitem-expanded-dark.svg b/third-party/pdfjs/web/images/treeitem-expanded-dark.svg new file mode 100644 index 000000000..695b0aa61 --- /dev/null +++ b/third-party/pdfjs/web/images/treeitem-expanded-dark.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/treeitem-expanded.png b/third-party/pdfjs/web/images/treeitem-expanded.png deleted file mode 100644 index c8d557351..000000000 Binary files a/third-party/pdfjs/web/images/treeitem-expanded.png and /dev/null differ diff --git a/third-party/pdfjs/web/images/treeitem-expanded.svg b/third-party/pdfjs/web/images/treeitem-expanded.svg new file mode 100644 index 000000000..2d45f0c8d --- /dev/null +++ b/third-party/pdfjs/web/images/treeitem-expanded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/third-party/pdfjs/web/images/treeitem-expanded@2x.png b/third-party/pdfjs/web/images/treeitem-expanded@2x.png deleted file mode 100644 index 3b3b6103b..000000000 Binary files a/third-party/pdfjs/web/images/treeitem-expanded@2x.png and /dev/null differ diff --git a/third-party/pdfjs/web/locale/ach/viewer.properties b/third-party/pdfjs/web/locale/ach/viewer.properties index 57c6a9121..46e36fb7e 100644 --- a/third-party/pdfjs/web/locale/ach/viewer.properties +++ b/third-party/pdfjs/web/locale/ach/viewer.properties @@ -204,4 +204,3 @@ password_cancel=Juki printing_not_supported=Ciko: Layeny ma pe teno goyo liweng. printing_not_ready=Ciko: PDF pe ocane weng me agoya. web_fonts_disabled=Kijuko dit pa coc me kakube woko: pe romo tic ki dit pa coc me PDF ma kiketo i kine. -document_colors_not_allowed=Pe ki yee ki gin acoya me PDF me tic ki rangi gi kengi: Kijuko woko “Yee pot buk me yero rangi mamegi kengi” ki i layeny. diff --git a/third-party/pdfjs/web/locale/af/viewer.properties b/third-party/pdfjs/web/locale/af/viewer.properties index 8cf088087..c7d6c42b4 100644 --- a/third-party/pdfjs/web/locale/af/viewer.properties +++ b/third-party/pdfjs/web/locale/af/viewer.properties @@ -181,4 +181,3 @@ password_cancel=Kanselleer printing_not_supported=Waarskuwing: Dié blaaier ondersteun nie drukwerk ten volle nie. printing_not_ready=Waarskuwing: Die PDF is nog nie volledig gelaai vir drukwerk nie. web_fonts_disabled=Webfonte is gedeaktiveer: kan nie PDF-fonte wat ingebed is, gebruik nie. -document_colors_not_allowed=PDF-dokumente word nie toegelaat om hul eie kleure te gebruik nie: “Laat bladsye toe om hul eie kleure te kies” is gedeaktiveer in die blaaier. diff --git a/third-party/pdfjs/web/locale/an/viewer.properties b/third-party/pdfjs/web/locale/an/viewer.properties index 35761347a..7e3504c77 100644 --- a/third-party/pdfjs/web/locale/an/viewer.properties +++ b/third-party/pdfjs/web/locale/an/viewer.properties @@ -181,4 +181,3 @@ password_cancel=Cancelar printing_not_supported=Pare cuenta: Iste navegador no maneya totalment as impresions. printing_not_ready=Aviso: Encara no se ha cargau completament o PDF ta imprentar-lo. web_fonts_disabled=As fuents web son desactivadas: no se puet incrustar fichers PDF. -document_colors_not_allowed=Los documentos PDF no pueden fer servir las suyas propias colors: 'Permitir que as pachinas triguen as suyas propias colors' ye desactivau en o navegador. diff --git a/third-party/pdfjs/web/locale/ar/viewer.properties b/third-party/pdfjs/web/locale/ar/viewer.properties index b42ba74c2..cffa8bec5 100644 --- a/third-party/pdfjs/web/locale/ar/viewer.properties +++ b/third-party/pdfjs/web/locale/ar/viewer.properties @@ -243,4 +243,3 @@ password_cancel=ألغِ printing_not_supported=تحذير: لا يدعم هذا المتصفح الطباعة بشكل كامل. printing_not_ready=تحذير: ملف PDF لم يُحمّل كاملًا للطباعة. web_fonts_disabled=خطوط الوب مُعطّلة: تعذّر استخدام خطوط PDF المُضمّنة. -document_colors_not_allowed=ليس مسموحًا لملفات PDF باستخدام ألوانها الخاصة: خيار ”اسمح للصفحات باختيار ألوانها الخاصة“ ليس مُفعّلًا في المتصفح. diff --git a/third-party/pdfjs/web/locale/ast/viewer.properties b/third-party/pdfjs/web/locale/ast/viewer.properties index db66a5675..5f6d5e7c0 100644 --- a/third-party/pdfjs/web/locale/ast/viewer.properties +++ b/third-party/pdfjs/web/locale/ast/viewer.properties @@ -204,4 +204,3 @@ password_cancel=Encaboxar printing_not_supported=Alvertencia: La imprentación entá nun ta sofitada dafechu nesti restolador. printing_not_ready=Avisu: Esti PDF nun se cargó completamente pa poder imprentase. web_fonts_disabled=Les fontes web tán desactivaes: ye imposible usar les fontes PDF embebíes. -document_colors_not_allowed=Los documentos PDF nun tienen permisu pa usar les sos colores: «Permitir que les páxines escueyan les sos colores» ta desactivao nel restolador. diff --git a/third-party/pdfjs/web/locale/az/viewer.properties b/third-party/pdfjs/web/locale/az/viewer.properties index 2c27d1246..8f61d9641 100644 --- a/third-party/pdfjs/web/locale/az/viewer.properties +++ b/third-party/pdfjs/web/locale/az/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Ləğv et printing_not_supported=Xəbərdarlıq: Çap bu səyyah tərəfindən tam olaraq dəstəklənmir. printing_not_ready=Xəbərdarlıq: PDF çap üçün tam yüklənməyib. web_fonts_disabled=Web Şriftlər söndürülüb: yerləşdirilmiş PDF şriftlərini istifadə etmək mümkün deyil. -document_colors_not_allowed=PDF sənədlərə öz rənglərini işlətməyə icazə verilmir: “Səhifələrə öz rənglərini istifadə etməyə icazə ver”mə səyyahda söndürülüb. diff --git a/third-party/pdfjs/web/locale/be/viewer.properties b/third-party/pdfjs/web/locale/be/viewer.properties index 67cd0126e..6ac719288 100644 --- a/third-party/pdfjs/web/locale/be/viewer.properties +++ b/third-party/pdfjs/web/locale/be/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Скасаваць printing_not_supported=Папярэджанне: друк не падтрымліваецца цалкам гэтым браўзерам. printing_not_ready=Увага: PDF не сцягнуты цалкам для друкавання. web_fonts_disabled=Шрыфты Сеціва забаронены: немагчыма ўжываць укладзеныя шрыфты PDF. -document_colors_not_allowed=PDF-дакументам не дазволена выкарыстоўваць свае колеры: у браўзеры адключаны параметр "Дазволіць вэб-сайтам выкарыстоўваць свае колеры". diff --git a/third-party/pdfjs/web/locale/bg/viewer.properties b/third-party/pdfjs/web/locale/bg/viewer.properties index 713b1138d..b93e3d1e4 100644 --- a/third-party/pdfjs/web/locale/bg/viewer.properties +++ b/third-party/pdfjs/web/locale/bg/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Отказ printing_not_supported=Внимание: Този четец няма пълна поддръжка на отпечатване. printing_not_ready=Внимание: Този PDF файл не е напълно зареден за печат. web_fonts_disabled=Уеб-шрифтовете са забранени: разрешаване на използването на вградените PDF шрифтове. -document_colors_not_allowed=На документите от вид PDF не е разрешено да използват собствени цветове: „Разрешаване на страниците да избират собствени цветове“ е изключено в четеца. diff --git a/third-party/pdfjs/web/locale/bn/viewer.properties b/third-party/pdfjs/web/locale/bn/viewer.properties index 52fec2c35..c106df10c 100644 --- a/third-party/pdfjs/web/locale/bn/viewer.properties +++ b/third-party/pdfjs/web/locale/bn/viewer.properties @@ -243,4 +243,3 @@ password_cancel=বাতিল printing_not_supported=সতর্কতা: এই ব্রাউজারে মুদ্রণ সম্পূর্ণভাবে সমর্থিত নয়। printing_not_ready=সতর্কীকরণ: পিডিএফটি মুদ্রণের জন্য সম্পূর্ণ লোড হয়নি। web_fonts_disabled=ওয়েব ফন্ট নিষ্ক্রিয়: সংযুক্ত পিডিএফ ফন্ট ব্যবহার করা যাচ্ছে না। -document_colors_not_allowed=পিডিএফ ডকুমেন্টকে তাদের নিজস্ব রঙ ব্যবহারে অনুমতি নেই: 'পাতা তাদের নিজেস্ব রঙ নির্বাচন করতে অনুমতি দিন' এই ব্রাউজারে নিষ্ক্রিয় রয়েছে। diff --git a/third-party/pdfjs/web/locale/bo/viewer.properties b/third-party/pdfjs/web/locale/bo/viewer.properties index d35c453dd..3ffa84819 100644 --- a/third-party/pdfjs/web/locale/bo/viewer.properties +++ b/third-party/pdfjs/web/locale/bo/viewer.properties @@ -242,4 +242,3 @@ password_cancel=Cancel printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_ready=Warning: The PDF is not fully loaded for printing. web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. -document_colors_not_allowed=PDF documents are not allowed to use their own colors: “Allow pages to choose their own colors” is deactivated in the browser. diff --git a/third-party/pdfjs/web/locale/br/viewer.properties b/third-party/pdfjs/web/locale/br/viewer.properties index 14c2a5e4f..9add9a432 100644 --- a/third-party/pdfjs/web/locale/br/viewer.properties +++ b/third-party/pdfjs/web/locale/br/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Nullañ printing_not_supported=Kemenn : N'eo ket skoret penn-da-benn ar moullañ gant ar merdeer-mañ. printing_not_ready=Kemenn : N'hall ket bezañ moullet ar restr PDF rak n'eo ket karget penn-da-benn. web_fonts_disabled=Diweredekaet eo an nodrezhoù web : n'haller ket arverañ an nodrezhoù PDF enframmet. -document_colors_not_allowed=N'eo ket aotreet an teuliadoù PDF da arverañ o livioù dezho : diweredekaet eo “Aotren ar pajennoù da zibab o livioù dezho” e-barzh ar merdeer. diff --git a/third-party/pdfjs/web/locale/brx/viewer.properties b/third-party/pdfjs/web/locale/brx/viewer.properties index 234bca1fe..cd3656380 100644 --- a/third-party/pdfjs/web/locale/brx/viewer.properties +++ b/third-party/pdfjs/web/locale/brx/viewer.properties @@ -208,4 +208,3 @@ password_cancel=नेवसि printing_not_supported=सांग्रांथि: साफायनाया बे ब्राउजारजों आबुङै हेफाजाब होजाया। printing_not_ready=सांग्रांथि: PDF खौ साफायनायनि थाखाय फुरायै ल'ड खालामाखै। web_fonts_disabled=वेब फन्टखौ लोरबां खालामबाय: अरजाबहोनाय PDF फन्टखौ बाहायनो हायाखै। -document_colors_not_allowed=PDF फोरमान बिलाइखौ बिसोरनि निजि गाब बाहायनो गनायथि होनाय जाया: 'बिसोरनि निजि गाब बासिखनो बिलाइखौ गनायथि हो'-खौ ब्राउजारआव लोरबां खालामनाय जायो। diff --git a/third-party/pdfjs/web/locale/bs/viewer.properties b/third-party/pdfjs/web/locale/bs/viewer.properties index 6c2122b82..e5346cb0c 100644 --- a/third-party/pdfjs/web/locale/bs/viewer.properties +++ b/third-party/pdfjs/web/locale/bs/viewer.properties @@ -198,4 +198,3 @@ password_cancel=Otkaži printing_not_supported=Upozorenje: Štampanje nije u potpunosti podržano u ovom browseru. printing_not_ready=Upozorenje: PDF nije u potpunosti učitan za štampanje. web_fonts_disabled=Web fontovi su onemogućeni: nemoguće koristiti ubačene PDF fontove. -document_colors_not_allowed=PDF dokumentima nije dozvoljeno da koriste vlastite boje: 'Dozvoli stranicama da izaberu vlastite boje' je deaktivirano u browseru. diff --git a/third-party/pdfjs/web/locale/ca/viewer.properties b/third-party/pdfjs/web/locale/ca/viewer.properties index 924637aaf..ac6fb779f 100644 --- a/third-party/pdfjs/web/locale/ca/viewer.properties +++ b/third-party/pdfjs/web/locale/ca/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancel·la printing_not_supported=Avís: la impressió no és plenament funcional en aquest navegador. printing_not_ready=Atenció: el PDF no s'ha acabat de carregar per imprimir-lo. web_fonts_disabled=Els tipus de lletra web estan desactivats: no es poden utilitzar els tipus de lletra incrustats al PDF. -document_colors_not_allowed=Els documents PDF no poden usar els seus colors propis: «Permet a les pàgines triar els colors propis» es troba desactivat al navegador. diff --git a/third-party/pdfjs/web/locale/cak/viewer.properties b/third-party/pdfjs/web/locale/cak/viewer.properties index c105d8252..d4eae51a8 100644 --- a/third-party/pdfjs/web/locale/cak/viewer.properties +++ b/third-party/pdfjs/web/locale/cak/viewer.properties @@ -14,7 +14,7 @@ # Main toolbar buttons (tooltips and alt text for images) previous.title=Jun kan ruxaq -previous_label=Chuwäch +previous_label=Jun kan next.title=Jun chik ruxaq next_label=Jun chik @@ -35,7 +35,7 @@ zoom_in_label=Tinimirisäx zoom.title=Sum presentation_mode.title=Tijal ri rub'anikil niwachin presentation_mode_label=Pa rub'eyal niwachin -open_file.title=Tijaq yakb'äl +open_file.title=Tijaq Yakb'äl open_file_label=Tijaq print.title=Titz'ajb'äx print_label=Titz'ajb'äx @@ -111,7 +111,7 @@ document_properties_page_size_orientation_landscape=rukotz'olem document_properties_page_size_name_a3=A3 document_properties_page_size_name_a4=A4 document_properties_page_size_name_letter=Loman wuj -document_properties_page_size_name_legal=Nïm wuj +document_properties_page_size_name_legal=Taqanel tzijol # LOCALIZATION NOTE (document_properties_page_size_dimension_string): # "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by # the size, respectively their unit of measurement and orientation, of the (current) page. @@ -216,7 +216,7 @@ rendering_error=Xk'ulwachitäj jun sachoj toq ninuk'wachij ri ruxaq. page_scale_width=Ruwa ruxaq page_scale_fit=Tinuk' ruxaq page_scale_auto=Yonil chi nimilem -page_scale_actual=Runimilem +page_scale_actual=Runimilem Wakami # LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a # numerical scale value. page_scale_percent={{scale}}% @@ -245,4 +245,3 @@ password_cancel=Tiq'at printing_not_supported=Rutzijol k'ayewal: Ri rutz'ajb'axik man koch'el ta ronojel pa re okik'amaya'l re'. printing_not_ready=Rutzijol k'ayewal: Ri PDF man xusamajij ta ronojel richin nitz'ajb'äx. web_fonts_disabled=E chupül ri taq ajk'amaya'l tz'ib': man tikirel ta nokisäx ri taq tz'ib' PDF pa ch'ikenïk -document_colors_not_allowed=Ri taq wuj pa PDF man ya'on ta q'ij chi ke richin nikokisaj ri taq kib'onil: “Tiya' q'ij chi ke ri taq ruxaq chi kekicha' ri taq kib'onil” chupun pa ri awokik'amaya'l. diff --git a/third-party/pdfjs/web/locale/ckb/viewer.properties b/third-party/pdfjs/web/locale/ckb/viewer.properties new file mode 100644 index 000000000..d1bed431b --- /dev/null +++ b/third-party/pdfjs/web/locale/ckb/viewer.properties @@ -0,0 +1,111 @@ +# 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. + +# Main toolbar buttons (tooltips and alt text for images) +next.title=پەڕەی دوواتر +next_label=دوواتر + +# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input. +page.title=پەرە +# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number +# representing the total number of pages in the document. +# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}" +# will be replaced by a number representing the currently visible page, +# respectively a number representing the total number of pages in the document. + +open_file.title=پەڕگە بکەرەوە +open_file_label=کردنەوە +print.title=چاپکردن +download.title=داگرتن + +# Secondary toolbar and context menu +tools.title=ئامرازەکان +first_page.title=برۆ بۆ یەکەم پەڕە + + + + +# Document properties dialog box +document_properties_file_name=ناوی پەڕگە: +document_properties_file_size=قەبارەی پەڕگە: +# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}" +# will be replaced by the PDF file size in kilobytes, respectively in bytes. +# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}" +# will be replaced by the PDF file size in megabytes, respectively in bytes. +document_properties_title=سەردێڕ: +document_properties_author=نووسەر +document_properties_keywords=کلیلەوشە: +# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}" +# will be replaced by the creation/modification date, and time, of the PDF file. +# LOCALIZATION NOTE (document_properties_page_size_dimension_string): +# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by +# the size, respectively their unit of measurement and orientation, of the (current) page. +# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string): +# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by +# the size, respectively their unit of measurement, name, and orientation, of the (current) page. +# LOCALIZATION NOTE (document_properties_linearized): The linearization status of +# the document; usually called "Fast Web View" in English locales of Adobe software. +document_properties_close=داخستن + +# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by +# a numerical per cent value. +print_progress_close=پاشگەزبوونەوە + +# Tooltips and alt text for side panel toolbar buttons +# (the _label strings are alt text for the buttons, the .title strings are +# tooltips) +findbar_label=دۆزینەوە + +# LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number. +# Thumbnails panel item (tooltip and alt text for images) +# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page +# number. +# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page +# number. + +# Find panel button title and messages +find_input.title=دۆزینەوە +# LOCALIZATION NOTE (find_match_count): The supported plural forms are +# [one|two|few|many|other], with [other] as the default value. +# "{{current}}" and "{{total}}" will be replaced by a number representing the +# index of the currently active find result, respectively a number representing +# the total number of matches in the document. +# LOCALIZATION NOTE (find_match_count_limit): The supported plural forms are +# [zero|one|two|few|many|other], with [other] as the default value. +# "{{limit}}" will be replaced by a numerical value. + +# Error panel labels +# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be +# replaced by the PDF.JS version and build ID. +# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an +# english string describing the error. +# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack +# trace. +# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename +# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number + +# Predefined zoom values +# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a +# numerical scale value. + +# Loading indicator messages + +# LOCALIZATION NOTE (annotation_date_string): "{{date}}" and "{{time}}" will be +# replaced by the modification date, and time, of the annotation. + +# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip. +# "{{type}}" will be replaced with an annotation type from a list defined in +# the PDF spec (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" + diff --git a/third-party/pdfjs/web/locale/cs/viewer.properties b/third-party/pdfjs/web/locale/cs/viewer.properties index 6310f637c..646f410bb 100644 --- a/third-party/pdfjs/web/locale/cs/viewer.properties +++ b/third-party/pdfjs/web/locale/cs/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Zrušit printing_not_supported=Upozornění: Tisk není v tomto prohlížeči plně podporován. printing_not_ready=Upozornění: Dokument PDF není kompletně načten. web_fonts_disabled=Webová písma jsou zakázána, proto není možné použít vložená písma PDF. -document_colors_not_allowed=PDF dokumenty nemají povoleno používat vlastní barvy: volba 'Povolit stránkám používat vlastní barvy' je v prohlížeči deaktivována. diff --git a/third-party/pdfjs/web/locale/cy/viewer.properties b/third-party/pdfjs/web/locale/cy/viewer.properties index dc4fb2ea4..16cda5fd7 100644 --- a/third-party/pdfjs/web/locale/cy/viewer.properties +++ b/third-party/pdfjs/web/locale/cy/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Diddymu printing_not_supported=Rhybudd: Nid yw argraffu yn cael ei gynnal yn llawn gan y porwr. printing_not_ready=Rhybudd: Nid yw'r PDF wedi ei lwytho'n llawn ar gyfer argraffu. web_fonts_disabled=Ffontiau gwe wedi eu hanalluogi: methu defnyddio ffontiau PDF mewnblanedig. -document_colors_not_allowed=Nid oes caniatâd i ddogfennau PDF i ddefnyddio eu lliwiau eu hunain: Mae “Caniatáu i dudalennau ddefnyddio eu lliwiau eu hunain” wedi ei atal yn y porwr. diff --git a/third-party/pdfjs/web/locale/da/viewer.properties b/third-party/pdfjs/web/locale/da/viewer.properties index 4f05fd980..38ed99d0b 100644 --- a/third-party/pdfjs/web/locale/da/viewer.properties +++ b/third-party/pdfjs/web/locale/da/viewer.properties @@ -33,12 +33,12 @@ zoom_out_label=Zoom ud zoom_in.title=Zoom ind zoom_in_label=Zoom ind zoom.title=Zoom -print.title=Udskriv -print_label=Udskriv presentation_mode.title=Skift til fuldskærmsvisning presentation_mode_label=Fuldskærmsvisning open_file.title=Åbn fil open_file_label=Åbn +print.title=Udskriv +print_label=Udskriv download.title=Hent download_label=Hent bookmark.title=Aktuel visning (kopier eller åbn i et nyt vindue) @@ -245,4 +245,3 @@ password_cancel=Fortryd printing_not_supported=Advarsel: Udskrivning er ikke fuldt understøttet af browseren. printing_not_ready=Advarsel: PDF-filen er ikke fuldt indlæst til udskrivning. web_fonts_disabled=Webskrifttyper er deaktiverede. De indlejrede skrifttyper i PDF-filen kan ikke anvendes. -document_colors_not_allowed=PDF-dokumenter må ikke bruge deres egne farver: 'Tillad sider at vælge deres egne farver' er deaktiveret i browseren. diff --git a/third-party/pdfjs/web/locale/de/viewer.properties b/third-party/pdfjs/web/locale/de/viewer.properties index 84240bb20..26b682ebe 100644 --- a/third-party/pdfjs/web/locale/de/viewer.properties +++ b/third-party/pdfjs/web/locale/de/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Abbrechen printing_not_supported=Warnung: Die Drucken-Funktion wird durch diesen Browser nicht vollständig unterstützt. printing_not_ready=Warnung: Die PDF-Datei ist nicht vollständig geladen, dies ist für das Drucken aber empfohlen. web_fonts_disabled=Web-Schriftarten sind deaktiviert: Eingebettete PDF-Schriftarten konnten nicht geladen werden. -document_colors_not_allowed=PDF-Dokumenten ist es nicht erlaubt, ihre eigenen Farben zu verwenden: 'Seiten das Verwenden von eigenen Farben erlauben' ist im Browser deaktiviert. diff --git a/third-party/pdfjs/web/locale/dsb/viewer.properties b/third-party/pdfjs/web/locale/dsb/viewer.properties index eb567ecb6..468ccd745 100644 --- a/third-party/pdfjs/web/locale/dsb/viewer.properties +++ b/third-party/pdfjs/web/locale/dsb/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Pśetergnuś printing_not_supported=Warnowanje: Śišćanje njepódpěra se połnje pśez toś ten wobglědowak. printing_not_ready=Warnowanje: PDF njejo se za śišćanje dopołnje zacytał. web_fonts_disabled=Webpisma su znjemóžnjone: njejo móžno, zasajźone PDF-pisma wužywaś. -document_colors_not_allowed=PDF-dokumenty njesměju swóje barwy wužywaś: 'Bokam dowóliś, swóje barwy wužywaś' jo we wobglědowaku znjemóžnjone. diff --git a/third-party/pdfjs/web/locale/el/viewer.properties b/third-party/pdfjs/web/locale/el/viewer.properties index d7a6abc10..896bbeefc 100644 --- a/third-party/pdfjs/web/locale/el/viewer.properties +++ b/third-party/pdfjs/web/locale/el/viewer.properties @@ -148,6 +148,8 @@ thumbs_label=Μικρογραφίες findbar.title=Εύρεση στο έγγραφο findbar_label=Εύρεση +# LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number. +page_canvas=Σελίδα {{page}} # Thumbnails panel item (tooltip and alt text for images) # LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page # number. @@ -243,4 +245,3 @@ password_cancel=Ακύρωση printing_not_supported=Προειδοποίηση: Η εκτύπωση δεν υποστηρίζεται πλήρως από αυτόν τον περιηγητή. printing_not_ready=Προειδοποίηση: Το PDF δεν φορτώθηκε πλήρως για εκτύπωση. web_fonts_disabled=Οι γραμματοσειρές Web απενεργοποιημένες: αδυναμία χρήσης των ενσωματωμένων γραμματοσειρών PDF. -document_colors_not_allowed=Στα PDF έγγραφα δεν επιτρέπεται να χρησιμοποιούν τα δικά τους χρώματα: Το “Να επιτρέπεται στις σελίδες να επιλέγουν τα δικά τους χρώματα” είναι απενεργοποιημένο στον περιηγητή. diff --git a/third-party/pdfjs/web/locale/en-CA/viewer.properties b/third-party/pdfjs/web/locale/en-CA/viewer.properties index df7a68774..554a0e176 100644 --- a/third-party/pdfjs/web/locale/en-CA/viewer.properties +++ b/third-party/pdfjs/web/locale/en-CA/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancel printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_ready=Warning: The PDF is not fully loaded for printing. web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. -document_colors_not_allowed=PDF documents are not allowed to use their own colours: “Allow pages to choose their own colours” is deactivated in the browser. diff --git a/third-party/pdfjs/web/locale/en-GB/viewer.properties b/third-party/pdfjs/web/locale/en-GB/viewer.properties index df7a68774..554a0e176 100644 --- a/third-party/pdfjs/web/locale/en-GB/viewer.properties +++ b/third-party/pdfjs/web/locale/en-GB/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancel printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_ready=Warning: The PDF is not fully loaded for printing. web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. -document_colors_not_allowed=PDF documents are not allowed to use their own colours: “Allow pages to choose their own colours” is deactivated in the browser. diff --git a/third-party/pdfjs/web/locale/en-US/viewer.properties b/third-party/pdfjs/web/locale/en-US/viewer.properties index 6f7598e3d..d31103c00 100644 --- a/third-party/pdfjs/web/locale/en-US/viewer.properties +++ b/third-party/pdfjs/web/locale/en-US/viewer.properties @@ -137,17 +137,20 @@ print_progress_close=Cancel # (the _label strings are alt text for the buttons, the .title strings are # tooltips) toggle_sidebar.title=Toggle Sidebar -toggle_sidebar_notification.title=Toggle Sidebar (document contains outline/attachments) +toggle_sidebar_notification2.title=Toggle Sidebar (document contains outline/attachments/layers) toggle_sidebar_label=Toggle Sidebar document_outline.title=Show Document Outline (double-click to expand/collapse all items) document_outline_label=Document Outline attachments.title=Show Attachments attachments_label=Attachments +layers.title=Show Layers (double-click to reset all layers to the default state) +layers_label=Layers thumbs.title=Show Thumbnails thumbs_label=Thumbnails findbar.title=Find in Document findbar_label=Find +additional_layers=Additional Layers # LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number. page_canvas=Page {{page}} # Thumbnails panel item (tooltip and alt text for images) diff --git a/third-party/pdfjs/web/locale/eo/viewer.properties b/third-party/pdfjs/web/locale/eo/viewer.properties index bca7c4568..804bd9842 100644 --- a/third-party/pdfjs/web/locale/eo/viewer.properties +++ b/third-party/pdfjs/web/locale/eo/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Nuligi printing_not_supported=Averto: tiu ĉi retumilo ne plene subtenas presadon. printing_not_ready=Averto: la PDF dosiero ne estas plene ŝargita por presado. web_fonts_disabled=Neaktivaj teksaĵaj tiparoj: ne elbas uzi enmetitajn tiparojn de PDF. -document_colors_not_allowed=PDF dokumentoj ne rajtas uzi siajn proprajn kolorojn: 'Permesi al paĝoj uzi siajn proprajn kolorojn' ne estas aktiva en la retumilo. diff --git a/third-party/pdfjs/web/locale/es-AR/viewer.properties b/third-party/pdfjs/web/locale/es-AR/viewer.properties index 1d22fbad6..ca2c87ba6 100644 --- a/third-party/pdfjs/web/locale/es-AR/viewer.properties +++ b/third-party/pdfjs/web/locale/es-AR/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Advertencia: La impresión no está totalmente soportada por este navegador. printing_not_ready=Advertencia: El PDF no está completamente cargado para impresión. web_fonts_disabled=Tipografía web deshabilitada: no se pueden usar tipos incrustados en PDF. -document_colors_not_allowed=Los documentos PDF no tienen permitido usar sus propios colores: 'Permitir a las páginas elegir sus propios colores' está desactivado en el navegador. diff --git a/third-party/pdfjs/web/locale/es-CL/viewer.properties b/third-party/pdfjs/web/locale/es-CL/viewer.properties index f7f621f59..b6ac40939 100644 --- a/third-party/pdfjs/web/locale/es-CL/viewer.properties +++ b/third-party/pdfjs/web/locale/es-CL/viewer.properties @@ -210,7 +210,7 @@ error_stack=Pila: {{stack}} error_file=Archivo: {{file}} # LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number error_line=Línea: {{line}} -rendering_error=Ha ocurrido un error al renderizar la página. +rendering_error=Ocurrió un error al renderizar la página. # Predefined zoom values page_scale_width=Ancho de página @@ -223,7 +223,7 @@ page_scale_percent={{scale}}% # Loading indicator messages loading_error_indicator=Error -loading_error=Ha ocurrido un error al cargar el PDF. +loading_error=Ocurrió un error al cargar el PDF. invalid_file_error=Archivo PDF inválido o corrupto. missing_file_error=Falta el archivo PDF. unexpected_response_error=Respuesta del servidor inesperada. @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Advertencia: Imprimir no está soportado completamente por este navegador. printing_not_ready=Advertencia: El PDF no está completamente cargado para ser impreso. web_fonts_disabled=Las tipografías web están desactivadas: imposible usar las fuentes PDF embebidas. -document_colors_not_allowed=Los documentos PDF no tienen permitido usar sus propios colores: 'Permitir a las páginas elegir sus propios colores' está desactivado en el navegador. diff --git a/third-party/pdfjs/web/locale/es-ES/viewer.properties b/third-party/pdfjs/web/locale/es-ES/viewer.properties index cef373a1f..75e5f0ad4 100644 --- a/third-party/pdfjs/web/locale/es-ES/viewer.properties +++ b/third-party/pdfjs/web/locale/es-ES/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Advertencia: Imprimir no está totalmente soportado por este navegador. printing_not_ready=Advertencia: Este PDF no se ha cargado completamente para poder imprimirse. web_fonts_disabled=Las tipografías web están desactivadas: es imposible usar las tipografías PDF embebidas. -document_colors_not_allowed=Los documentos PDF no tienen permitido usar sus propios colores: 'Permitir a las páginas elegir sus propios colores' está desactivado en el navegador. diff --git a/third-party/pdfjs/web/locale/es-MX/viewer.properties b/third-party/pdfjs/web/locale/es-MX/viewer.properties index 88a82826e..5098ad195 100644 --- a/third-party/pdfjs/web/locale/es-MX/viewer.properties +++ b/third-party/pdfjs/web/locale/es-MX/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Advertencia: La impresión no esta completamente soportada por este navegador. printing_not_ready=Advertencia: El PDF no cargo completamente para impresión. web_fonts_disabled=Las fuentes web están desactivadas: es imposible usar las fuentes PDF embebidas. -document_colors_not_allowed=Los documentos PDF no tienen permiso de usar sus propios colores: 'Permitir que las páginas elijan sus propios colores' esta desactivada en el navegador. diff --git a/third-party/pdfjs/web/locale/et/viewer.properties b/third-party/pdfjs/web/locale/et/viewer.properties index 11f47c1c2..97f2c9bd7 100644 --- a/third-party/pdfjs/web/locale/et/viewer.properties +++ b/third-party/pdfjs/web/locale/et/viewer.properties @@ -243,4 +243,3 @@ password_cancel=Loobu printing_not_supported=Hoiatus: printimine pole selle brauseri poolt täielikult toetatud. printing_not_ready=Hoiatus: PDF pole printimiseks täielikult laaditud. web_fonts_disabled=Veebifondid on keelatud: PDFiga kaasatud fonte pole võimalik kasutada. -document_colors_not_allowed=PDF-dokumentidel pole oma värvide kasutamine lubatud: “Veebilehtedel on lubatud kasutada oma värve” on brauseris deaktiveeritud. diff --git a/third-party/pdfjs/web/locale/eu/viewer.properties b/third-party/pdfjs/web/locale/eu/viewer.properties index e14f5cd38..5700d6019 100644 --- a/third-party/pdfjs/web/locale/eu/viewer.properties +++ b/third-party/pdfjs/web/locale/eu/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Utzi printing_not_supported=Abisua: inprimatzeko euskarria ez da erabatekoa nabigatzaile honetan. printing_not_ready=Abisua: PDFa ez dago erabat kargatuta inprimatzeko. web_fonts_disabled=Webeko letra-tipoak desgaituta daude: ezin dira kapsulatutako PDF letra-tipoak erabili. -document_colors_not_allowed=PDF dokumentuek ez dute beraien koloreak erabiltzeko baimenik: 'Baimendu orriak beraien letra-tipoak aukeratzea' desaktibatuta dago nabigatzailean. diff --git a/third-party/pdfjs/web/locale/fa/viewer.properties b/third-party/pdfjs/web/locale/fa/viewer.properties index e95738c6e..9886b39d2 100644 --- a/third-party/pdfjs/web/locale/fa/viewer.properties +++ b/third-party/pdfjs/web/locale/fa/viewer.properties @@ -220,4 +220,3 @@ password_cancel=لغو printing_not_supported=هشدار: قابلیت چاپ به‌طور کامل در این مرورگر پشتیبانی نمی‌شود. printing_not_ready=اخطار: پرونده PDF بطور کامل بارگیری نشده و امکان چاپ وجود ندارد. web_fonts_disabled=فونت های تحت وب غیر فعال شده اند: امکان استفاده از نمایش دهنده داخلی PDF وجود ندارد. -document_colors_not_allowed=فایلهای PDF اجازه ندارند تا از رنگ‌های خود استفاده کنند: گزینه «به صفحات اجازه بده تا از رنگ‌های خود استفاده کنند» در مرورگر غیر فعال است. diff --git a/third-party/pdfjs/web/locale/ff/viewer.properties b/third-party/pdfjs/web/locale/ff/viewer.properties index 2e94346aa..0a081021b 100644 --- a/third-party/pdfjs/web/locale/ff/viewer.properties +++ b/third-party/pdfjs/web/locale/ff/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Haaytu printing_not_supported=Reentino: Winnditagol tammbitaaka no feewi e ndee wanngorde. printing_not_ready=Reentino: PDF oo loowaaki haa timmi ngam winnditagol. web_fonts_disabled=Ponte geese ko daaƴaaɗe: horiima huutoraade ponte PDF coomtoraaɗe. -document_colors_not_allowed=Piilanɗe PDF njamiraaka yoo kuutoro goobuuji mum'en keeriiɗi: 'Yamir kello yoo kuutoro goobuuki keeriiɗi' koko daaƴaa e wanngorde ndee. diff --git a/third-party/pdfjs/web/locale/fi/viewer.properties b/third-party/pdfjs/web/locale/fi/viewer.properties index 76bfa13a2..38c40a395 100644 --- a/third-party/pdfjs/web/locale/fi/viewer.properties +++ b/third-party/pdfjs/web/locale/fi/viewer.properties @@ -169,7 +169,7 @@ find_highlight=Korosta kaikki find_match_case_label=Huomioi kirjainkoko find_entire_word_label=Kokonaiset sanat find_reached_top=Päästiin dokumentin alkuun, jatketaan lopusta -find_reached_bottom=Päästiin sivun loppuun, jatketaan alusta +find_reached_bottom=Päästiin dokumentin loppuun, jatketaan alusta # LOCALIZATION NOTE (find_match_count): The supported plural forms are # [one|two|few|many|other], with [other] as the default value. # "{{current}}" and "{{total}}" will be replaced by a number representing the @@ -245,4 +245,3 @@ password_cancel=Peruuta printing_not_supported=Varoitus: Selain ei tue kaikkia tulostustapoja. printing_not_ready=Varoitus: PDF-tiedosto ei ole vielä latautunut kokonaan, eikä sitä voi vielä tulostaa. web_fonts_disabled=Verkkosivujen omat kirjasinlajit on estetty: ei voida käyttää upotettuja PDF-kirjasinlajeja. -document_colors_not_allowed=PDF-dokumenttien ei ole sallittua käyttää omia värejään: Asetusta ”Sivut saavat käyttää omia värejään oletusten sijaan” ei ole valittu selaimen asetuksissa. diff --git a/third-party/pdfjs/web/locale/fr/viewer.properties b/third-party/pdfjs/web/locale/fr/viewer.properties index 7df1d3d51..589a4185c 100644 --- a/third-party/pdfjs/web/locale/fr/viewer.properties +++ b/third-party/pdfjs/web/locale/fr/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Annuler printing_not_supported=Attention : l’impression n’est pas totalement prise en charge par ce navigateur. printing_not_ready=Attention : le PDF n’est pas entièrement chargé pour pouvoir l’imprimer. web_fonts_disabled=Les polices web sont désactivées : impossible d’utiliser les polices intégrées au PDF. -document_colors_not_allowed=Les documents PDF ne peuvent pas utiliser leurs propres couleurs : « Autoriser les pages web à utiliser leurs propres couleurs » est désactivé dans le navigateur. diff --git a/third-party/pdfjs/web/locale/fy-NL/viewer.properties b/third-party/pdfjs/web/locale/fy-NL/viewer.properties index 4d6b18c69..5a506540b 100644 --- a/third-party/pdfjs/web/locale/fy-NL/viewer.properties +++ b/third-party/pdfjs/web/locale/fy-NL/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Annulearje printing_not_supported=Warning: Printen is net folslein stipe troch dizze browser. printing_not_ready=Warning: PDF is net folslein laden om ôf te drukken. web_fonts_disabled=Weblettertypen binne útskeakele: gebrûk fan ynsluten PDF-lettertypen is net mooglik. -document_colors_not_allowed=PDF-dokuminten meie harren eigen kleuren net brûke: ‘Siden tastean om harren eigen kleuren te kiezen’ is útskeakele yn de browser. diff --git a/third-party/pdfjs/web/locale/ga-IE/viewer.properties b/third-party/pdfjs/web/locale/ga-IE/viewer.properties index 62f1a551b..f606e81b0 100644 --- a/third-party/pdfjs/web/locale/ga-IE/viewer.properties +++ b/third-party/pdfjs/web/locale/ga-IE/viewer.properties @@ -181,4 +181,3 @@ password_cancel=Cealaigh printing_not_supported=Rabhadh: Ní thacaíonn an brabhsálaí le priontáil go hiomlán. printing_not_ready=Rabhadh: Ní féidir an PDF a phriontáil go dtí go mbeidh an cháipéis iomlán lódáilte. web_fonts_disabled=Tá clófhoirne Gréasáin díchumasaithe: ní féidir clófhoirne leabaithe PDF a úsáid. -document_colors_not_allowed=Níl cead ag cáipéisí PDF a ndathanna féin a roghnú: tá “Tabhair cead do leathanaigh a ndathanna féin a roghnú” díchumasaithe sa mbrabhsálaí. diff --git a/third-party/pdfjs/web/locale/gd/viewer.properties b/third-party/pdfjs/web/locale/gd/viewer.properties index 2712568e8..af4433e3f 100644 --- a/third-party/pdfjs/web/locale/gd/viewer.properties +++ b/third-party/pdfjs/web/locale/gd/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Sguir dheth printing_not_supported=Rabhadh: Chan eil am brabhsair seo a' cur làn-taic ri clò-bhualadh. printing_not_ready=Rabhadh: Cha deach am PDF a luchdadh gu tur airson clò-bhualadh. web_fonts_disabled=Tha cruthan-clò lìn à comas: Chan urrainn dhuinn cruthan-clò PDF leabaichte a chleachdadh. -document_colors_not_allowed=Chan fhaod sgrìobhainnean PDF na dathan aca fhèin a chleachdadh: Tha “Leig le duilleagan na dathan aca fhèin a chleachdadh” à comas sa bhrabhsair. diff --git a/third-party/pdfjs/web/locale/gl/viewer.properties b/third-party/pdfjs/web/locale/gl/viewer.properties index 187dbf155..c3a30fecd 100644 --- a/third-party/pdfjs/web/locale/gl/viewer.properties +++ b/third-party/pdfjs/web/locale/gl/viewer.properties @@ -148,6 +148,8 @@ thumbs_label=Miniaturas findbar.title=Atopar no documento findbar_label=Atopar +# LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number. +page_canvas=Páxina {{page}} # Thumbnails panel item (tooltip and alt text for images) # LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page # number. @@ -226,6 +228,10 @@ invalid_file_error=Ficheiro PDF danado ou non válido. missing_file_error=Falta o ficheiro PDF. unexpected_response_error=Resposta inesperada do servidor. +# LOCALIZATION NOTE (annotation_date_string): "{{date}}" and "{{time}}" will be +# replaced by the modification date, and time, of the annotation. +annotation_date_string={{date}}, {{time}} + # LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip. # "{{type}}" will be replaced with an annotation type from a list defined in # the PDF spec (32000-1:2008 Table 169 – Annotation types). @@ -239,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Aviso: A impresión non é compatíbel de todo con este navegador. printing_not_ready=Aviso: O PDF non se cargou completamente para imprimirse. web_fonts_disabled=Desactiváronse as fontes web: foi imposíbel usar as fontes incrustadas no PDF. -document_colors_not_allowed=Os documentos PDF non poden usar as súas propias cores: «Permitir que as páxinas escollan as súas propias cores» está desactivado no navegador. diff --git a/third-party/pdfjs/web/locale/gn/viewer.properties b/third-party/pdfjs/web/locale/gn/viewer.properties index e5652d71f..4b893971d 100644 --- a/third-party/pdfjs/web/locale/gn/viewer.properties +++ b/third-party/pdfjs/web/locale/gn/viewer.properties @@ -60,8 +60,8 @@ page_rotate_ccw.title=Aravo rapykue gotyo mbojere page_rotate_ccw.label=Aravo rapykue gotyo mbojere page_rotate_ccw_label=Aravo rapykue gotyo mbojere -cursor_text_select_tool.title=Emyandy moñe'ẽrã jeporavo rembipuru -cursor_text_select_tool_label=Moñe'ẽrã jeporavo rembipuru +cursor_text_select_tool.title=Emyandy moñe’ẽrã jeporavo rembipuru +cursor_text_select_tool_label=Moñe’ẽrã jeporavo rembipuru cursor_hand_tool.title=Tembipuru po pegua myandy cursor_hand_tool_label=Tembipuru po pegua @@ -80,8 +80,8 @@ spread_even.title=Embojuaju kuatiarogue jepysokue eñepyrũvo kuatiarogue par-va spread_even_label=Ipukuve uvei # Document properties dialog box -document_properties.title=Kuatia mba'etee… -document_properties_label=Kuatia mba'etee… +document_properties.title=Kuatia mba’etee… +document_properties_label=Kuatia mba’etee… document_properties_file_name=Marandurenda réra: document_properties_file_size=Marandurenda tuichakue: # LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}" @@ -92,15 +92,15 @@ document_properties_kb={{size_kb}} KB ({{size_b}} bytes) document_properties_mb={{size_mb}} MB ({{size_b}} bytes) document_properties_title=Teratee: document_properties_author=Apohára: -document_properties_subject=Mba'egua: +document_properties_subject=Mba’egua: document_properties_keywords=Jehero: document_properties_creation_date=Teñoihague arange: document_properties_modification_date=Iñambue hague arange: # LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}" # will be replaced by the creation/modification date, and time, of the PDF file. document_properties_date_string={{date}}, {{time}} -document_properties_creator=Apo'ypyha: -document_properties_producer=PDF mbosako'iha: +document_properties_creator=Apo’ypyha: +document_properties_producer=PDF mbosako’iha: document_properties_version=PDF mbojuehegua: document_properties_page_count=Kuatiarogue papapy: document_properties_page_size=Kuatiarogue tuichakue: @@ -110,7 +110,7 @@ document_properties_page_size_orientation_portrait=Oĩháicha document_properties_page_size_orientation_landscape=apaisado document_properties_page_size_name_a3=A3 document_properties_page_size_name_a4=A4 -document_properties_page_size_name_letter=Kuatiañe'ẽ +document_properties_page_size_name_letter=Kuatiañe’ẽ document_properties_page_size_name_legal=Tee # LOCALIZATION NOTE (document_properties_page_size_dimension_string): # "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by @@ -127,7 +127,7 @@ document_properties_linearized_yes=Añete document_properties_linearized_no=Ahániri document_properties_close=Mboty -print_progress_message=Embosako'i kuatia emonguatia hag̃ua… +print_progress_message=Embosako’i kuatia emonguatia hag̃ua… # LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by # a numerical per cent value. print_progress_percent={{progress}}% @@ -139,12 +139,12 @@ print_progress_close=Heja toggle_sidebar.title=Tenda yke moambue toggle_sidebar_notification.title=Embojopyru tenda ykegua (kuatia oguereko kora/marandurenda moirũha) toggle_sidebar_label=Tenda yke moambue -document_outline.title=Ehechauka kuatia rape (eikutu mokõi jey embotuicha/emomichĩ hag̃ua opavavete mba'epuru) +document_outline.title=Ehechauka kuatia rape (eikutu mokõi jey embotuicha/emomichĩ hag̃ua opavavete mba’epuru) document_outline_label=Kuatia apopyre attachments.title=Moirũha jehechauka attachments_label=Moirũha -thumbs.title=Mba'emirĩ jehechauka -thumbs_label=Mba'emirĩ +thumbs.title=Mba’emirĩ jehechauka +thumbs_label=Mba’emirĩ findbar.title=Kuatiápe jeheka findbar_label=Juhu @@ -156,20 +156,20 @@ page_canvas=Kuatiarogue {{page}} thumb_page_title=Kuatiarogue {{page}} # LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page # number. -thumb_page_canvas=Kuatiarogue mba'emirĩ {{page}} +thumb_page_canvas=Kuatiarogue mba’emirĩ {{page}} # Find panel button title and messages find_input.title=Juhu find_input.placeholder=Kuatiápe jejuhu… -find_previous.title=Ejuhu ñe'ẽrysýi osẽ'ypy hague +find_previous.title=Ejuhu ñe’ẽrysýi osẽ’ypy hague find_previous_label=Mboyvegua -find_next.title=Eho ñe'ẽ juhupyre upeiguávape +find_next.title=Eho ñe’ẽ juhupyre upeiguávape find_next_label=Upeigua find_highlight=Embojekuaavepa find_match_case_label=Ejesareko taiguasu/taimichĩre find_entire_word_label=Ñe’ẽ oĩmbáva -find_reached_top=Ojehupyty kuatia ñepyrũ, oku'ejeýta kuatia paha guive -find_reached_bottom=Ojehupyty kuatia paha, oku'ejeýta kuatia ñepyrũ guive +find_reached_top=Ojehupyty kuatia ñepyrũ, oku’ejeýta kuatia paha guive +find_reached_bottom=Ojehupyty kuatia paha, oku’ejeýta kuatia ñepyrũ guive # LOCALIZATION NOTE (find_match_count): The supported plural forms are # [one|two|few|many|other], with [other] as the default value. # "{{current}}" and "{{total}}" will be replaced by a number representing the @@ -191,21 +191,21 @@ find_match_count_limit[two]=Hetave {{limit}} ojojoguáva find_match_count_limit[few]=Hetave {{limit}} ojojoguáva find_match_count_limit[many]=Hetave {{limit}} ojojoguáva find_match_count_limit[other]=Hetave {{limit}} ojojoguáva -find_not_found=Ñe'ẽrysýi ojejuhu'ỹva +find_not_found=Ñe’ẽrysýi ojejuhu’ỹva # Error panel labels error_more_info=Maranduve -error_less_info=Sa'ive marandu +error_less_info=Sa’ive marandu error_close=Mboty # LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be # replaced by the PDF.JS version and build ID. error_version_info=PDF.js v{{version}} (build: {{build}}) # LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an # english string describing the error. -error_message=Ñe'ẽmondo: {{message}} +error_message=Ñe’ẽmondo: {{message}} # LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack # trace. -error_stack=Mbojo'apy: {{stack}} +error_stack=Mbojo’apy: {{stack}} # LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename error_file=Marandurenda: {{file}} # LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number @@ -226,7 +226,7 @@ loading_error_indicator=Oĩvaíva loading_error=Oiko jejavy PDF oñemyeñyhẽnguévo. invalid_file_error=PDF marandurenda ndoikóiva térã ivaipyréva. missing_file_error=Ndaipóri PDF marandurenda -unexpected_response_error=Mohendahavusu mbohovái ñeha'arõ'ỹva. +unexpected_response_error=Mohendahavusu mbohovái ñeha’arõ’ỹva. # LOCALIZATION NOTE (annotation_date_string): "{{date}}" and "{{time}}" will be # replaced by the modification date, and time, of the annotation. @@ -237,12 +237,11 @@ annotation_date_string={{date}}, {{time}} # the PDF spec (32000-1:2008 Table 169 – Annotation types). # Some common types are e.g.: "Check", "Text", "Comment", "Note" text_annotation_type.alt=[Jehaipy {{type}}] -password_label=Emoinge ñe'ẽñemi eipe'a hag̃ua ko marandurenda PDF. -password_invalid=Ñe'ẽñemi ndoikóiva. Eha'ã jey. +password_label=Emoinge ñe’ẽñemi eipe’a hag̃ua ko marandurenda PDF. +password_invalid=Ñe’ẽñemi ndoikóiva. Eha’ã jey. password_ok=MONEĨ password_cancel=Heja printing_not_supported=Kyhyjerã: Ñembokuatia ndojokupytypái ko kundahára ndive. printing_not_ready=Kyhyjerã: Ko PDF nahenyhẽmbái oñembokuatia hag̃uáicha. -web_fonts_disabled=Ñanduti taity oñemongéma: ndaikatumo'ãi eipuru PDF jehai'íva taity. -document_colors_not_allowed=Kuatiakuéra PDF ndaikatúi oipuru isa'ykuéra tee: “Emoneĩ kuatiaroguépe toiporavo isa'ykuéra tee” oñemongehína kundahárape. +web_fonts_disabled=Ñanduti taity oñemongéma: ndaikatumo’ãi eipuru PDF jehai’íva taity. diff --git a/third-party/pdfjs/web/locale/gu-IN/viewer.properties b/third-party/pdfjs/web/locale/gu-IN/viewer.properties index cce4bec11..579c068d9 100644 --- a/third-party/pdfjs/web/locale/gu-IN/viewer.properties +++ b/third-party/pdfjs/web/locale/gu-IN/viewer.properties @@ -239,4 +239,3 @@ password_cancel=રદ કરો printing_not_supported=ચેતવણી: છાપવાનું આ બ્રાઉઝર દ્દારા સંપૂર્ણપણે આધારભૂત નથી. printing_not_ready=Warning: PDF એ છાપવા માટે સંપૂર્ણપણે લાવેલ છે. web_fonts_disabled=વેબ ફોન્ટ નિષ્ક્રિય થયેલ છે: ઍમ્બેડ થયેલ PDF ફોન્ટને વાપરવાનું અસમર્થ. -document_colors_not_allowed=PDF દસ્તાવેજો તેનાં પોતાના રંગોને વાપરવા પરવાનગી આપતા નથી: 'તેનાં પોતાનાં રંગોને પસંદ કરવા માટે પાનાંને પરવાનગી આપો' બ્રાઉઝરમાં નિષ્ક્રિય થયેલ છે. diff --git a/third-party/pdfjs/web/locale/he/viewer.properties b/third-party/pdfjs/web/locale/he/viewer.properties index e3d197efb..066478921 100644 --- a/third-party/pdfjs/web/locale/he/viewer.properties +++ b/third-party/pdfjs/web/locale/he/viewer.properties @@ -245,4 +245,3 @@ password_cancel=ביטול printing_not_supported=אזהרה: הדפסה אינה נתמכת במלואה בדפדפן זה. printing_not_ready=אזהרה: ה־PDF לא ניתן לחלוטין עד מצב שמאפשר הדפסה. web_fonts_disabled=גופני רשת מנוטרלים: לא ניתן להשתמש בגופני PDF מוטבעים. -document_colors_not_allowed=מסמכי PDF אינם מורשים להשתמש בצבעים משלהם: האפשרות „אפשר לעמודים לבחור צבעים משלהם” אינה פעילה בדפדפן. diff --git a/third-party/pdfjs/web/locale/hi-IN/viewer.properties b/third-party/pdfjs/web/locale/hi-IN/viewer.properties index 3005180f5..6a49a9a98 100644 --- a/third-party/pdfjs/web/locale/hi-IN/viewer.properties +++ b/third-party/pdfjs/web/locale/hi-IN/viewer.properties @@ -241,4 +241,3 @@ password_cancel=रद्द करें printing_not_supported=चेतावनी: इस ब्राउज़र पर छपाई पूरी तरह से समर्थित नहीं है. printing_not_ready=चेतावनी: PDF छपाई के लिए पूरी तरह से लोड नहीं है. web_fonts_disabled=वेब फॉन्ट्स निष्क्रिय हैं: अंतःस्थापित PDF फॉन्टस के उपयोग में असमर्थ. -document_colors_not_allowed=PDF दस्तावेज़ उनके अपने रंग को उपयोग करने के लिए अनुमति प्राप्त नहीं है: "पृष्ठों को उनके अपने रंग को चुनने के लिए स्वीकृति दें" कि वह उस ब्राउज़र में निष्क्रिय है. diff --git a/third-party/pdfjs/web/locale/hr/viewer.properties b/third-party/pdfjs/web/locale/hr/viewer.properties index 67cc8983d..bfe10f808 100644 --- a/third-party/pdfjs/web/locale/hr/viewer.properties +++ b/third-party/pdfjs/web/locale/hr/viewer.properties @@ -244,5 +244,4 @@ password_cancel=Odustani printing_not_supported=Upozorenje: Ovaj preglednik ne podržava u potpunosti ispisivanje. printing_not_ready=Upozorenje: PDF nije u potpunosti učitan za ispis. -web_fonts_disabled=Web fontovi su onemogućeni: nije moguće koristiti umetnute PDF fontove. -document_colors_not_allowed=PDF dokumentima nije dozvoljeno koristiti vlastite boje: opcija „Dozvoli stranicama koristiti vlastite boje” je deaktivirana u pregledniku. +web_fonts_disabled=Web fontovi su deaktivirani: nije moguće koristiti ugrađene PDF fontove. diff --git a/third-party/pdfjs/web/locale/hsb/viewer.properties b/third-party/pdfjs/web/locale/hsb/viewer.properties index a8f31f1a5..9ba3c15a2 100644 --- a/third-party/pdfjs/web/locale/hsb/viewer.properties +++ b/third-party/pdfjs/web/locale/hsb/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Přetorhnyć printing_not_supported=Warnowanje: Ćišćenje so přez tutón wobhladowak połnje njepodpěruje. printing_not_ready=Warnowanje: PDF njeje so za ćišćenje dospołnje začitał. web_fonts_disabled=Webpisma su znjemóžnjene: njeje móžno, zasadźene PDF-pisma wužiwać. -document_colors_not_allowed=PDF-dokumenty njesmědźa swoje barby wužiwać: 'Stronam dowolić, swoje barby wužiwać' je we wobhladowaku znjemóžnjene. diff --git a/third-party/pdfjs/web/locale/hu/viewer.properties b/third-party/pdfjs/web/locale/hu/viewer.properties index cba69f0fc..88c1d0796 100644 --- a/third-party/pdfjs/web/locale/hu/viewer.properties +++ b/third-party/pdfjs/web/locale/hu/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Mégse printing_not_supported=Figyelmeztetés: Ez a böngésző nem teljesen támogatja a nyomtatást. printing_not_ready=Figyelmeztetés: A PDF nincs teljesen betöltve a nyomtatáshoz. web_fonts_disabled=Webes betűkészletek letiltva: nem használhatók a beágyazott PDF betűkészletek. -document_colors_not_allowed=A PDF dokumentumok nem használhatják saját színeiket: „Az oldalak a saját maguk által kiválasztott színeket használhatják” beállítás ki van kapcsolva a böngészőben. diff --git a/third-party/pdfjs/web/locale/hy-AM/viewer.properties b/third-party/pdfjs/web/locale/hy-AM/viewer.properties index f38581b21..09394f7d8 100644 --- a/third-party/pdfjs/web/locale/hy-AM/viewer.properties +++ b/third-party/pdfjs/web/locale/hy-AM/viewer.properties @@ -137,7 +137,7 @@ print_progress_close=Չեղարկել # (the _label strings are alt text for the buttons, the .title strings are # tooltips) toggle_sidebar.title=Բացել/Փակել Կողային վահանակը -toggle_sidebar_notification.title=Փոխանջատել Կողային գոտին (փաստաթուղթը պարունակում է ուրվագիծ/կցորդ) +toggle_sidebar_notification.title=Փոխարկել Կողային փեղկը (փաստաթուղթը պարունակում է ուրվագիծ/կցորդներ) toggle_sidebar_label=Բացել/Փակել Կողային վահանակը document_outline.title=Ցուցադրել փաստաթղթի ուրվագիծը (կրկնակի սեղմեք՝ միավորները ընդարձակելու/կոծկելու համար) document_outline_label=Փաստաթղթի բովանդակությունը @@ -245,4 +245,3 @@ password_cancel=Չեղարկել printing_not_supported=Զգուշացում. Տպելը ամբողջությամբ չի աջակցվում դիտարկիչի կողմից։ printing_not_ready=Զգուշացում. PDF-ը ամբողջությամբ չի բեռնավորվել տպելու համար: web_fonts_disabled=Վեբ-տառատեսակները անջատված են. հնարավոր չէ օգտագործել ներկառուցված PDF տառատեսակները: -document_colors_not_allowed=PDF փաստաթղթերին թույլատրված չէ օգտագործել իրենց սեփական գույները: “Թույլատրել էջերին ընտրել իրենց սեփական գույները“ ընտրանքը անջատված է դիտարկիչում: diff --git a/third-party/pdfjs/web/locale/hye/viewer.properties b/third-party/pdfjs/web/locale/hye/viewer.properties index b5c712772..80d43019e 100644 --- a/third-party/pdfjs/web/locale/hye/viewer.properties +++ b/third-party/pdfjs/web/locale/hye/viewer.properties @@ -244,4 +244,3 @@ password_cancel=Չեղարկել printing_not_supported=Զգուշացում. Տպելը ամբողջութեամբ չի աջակցուում զննարկիչի կողմից։ printing_not_ready=Զգուշացում. PDF֊ը ամբողջութեամբ չի բեռնաւորուել տպելու համար։ web_fonts_disabled=Վեբ-տառատեսակները անջատուած են. հնարաւոր չէ աւգտագործել ներկառուցուած PDF տառատեսակները։ -document_colors_not_allowed=PDF փաստաթղթերին թոյլատրուած չէ աւգտագործել իրենց սեփական գոյները։ “Թոյլատրել էջերին ընտրել իրենց սեփական գոյները“ ընտրանքը անջատուած է զննարկիչում։ diff --git a/third-party/pdfjs/web/locale/ia/viewer.properties b/third-party/pdfjs/web/locale/ia/viewer.properties index f69b26e40..167547adc 100644 --- a/third-party/pdfjs/web/locale/ia/viewer.properties +++ b/third-party/pdfjs/web/locale/ia/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancellar printing_not_supported=Attention : le impression non es totalmente supportate per ce navigator. printing_not_ready=Attention: le file PDF non es integremente cargate pro lo poter imprimer. web_fonts_disabled=Le typos de litteras web es disactivate: impossibile usar le typos de litteras PDF incorporate. -document_colors_not_allowed=Le documentos PDF non pote utilisar lor proprie colores: “Autorisar le paginas web a utilisar lor proprie colores” es disactivate in le navigator. diff --git a/third-party/pdfjs/web/locale/id/viewer.properties b/third-party/pdfjs/web/locale/id/viewer.properties index 0a904e16d..b9b9a730b 100644 --- a/third-party/pdfjs/web/locale/id/viewer.properties +++ b/third-party/pdfjs/web/locale/id/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Batal printing_not_supported=Peringatan: Pencetakan tidak didukung secara lengkap pada peramban ini. printing_not_ready=Peringatan: Berkas PDF masih belum dimuat secara lengkap untuk dapat dicetak. web_fonts_disabled=Font web dinonaktifkan: tidak dapat menggunakan font PDF yang tersemat. -document_colors_not_allowed=Dokumen PDF tidak diizinkan untuk menggunakan warnanya sendiri karena setelan 'Izinkan laman memilih warna sendiri' dinonaktifkan pada pengaturan. diff --git a/third-party/pdfjs/web/locale/is/viewer.properties b/third-party/pdfjs/web/locale/is/viewer.properties index d24c2adf5..72dc8acd6 100644 --- a/third-party/pdfjs/web/locale/is/viewer.properties +++ b/third-party/pdfjs/web/locale/is/viewer.properties @@ -236,4 +236,3 @@ password_cancel=Hætta við printing_not_supported=Aðvörun: Prentun er ekki með fyllilegan stuðning á þessum vafra. printing_not_ready=Aðvörun: Ekki er búið að hlaða inn allri PDF skránni fyrir prentun. web_fonts_disabled=Vef leturgerðir eru óvirkar: get ekki notað innbyggðar PDF leturgerðir. -document_colors_not_allowed=PDF skjöl hafa ekki leyfi til að nota sína eigin liti: “Leyfa síðum að velja eigin liti” er óvirkt í vafranum. diff --git a/third-party/pdfjs/web/locale/it/viewer.properties b/third-party/pdfjs/web/locale/it/viewer.properties index 1f0a20ac8..87c4050d8 100644 --- a/third-party/pdfjs/web/locale/it/viewer.properties +++ b/third-party/pdfjs/web/locale/it/viewer.properties @@ -2,13 +2,29 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.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. + previous.title = Pagina precedente previous_label = Precedente next.title = Pagina successiva next_label = Successiva + page.title = Pagina of_pages = di {{pagesCount}} page_of_pages = ({{pageNumber}} di {{pagesCount}}) + zoom_out.title = Riduci zoom zoom_out_label = Riduci zoom zoom_in.title = Aumenta zoom @@ -24,6 +40,7 @@ download.title = Scarica questo documento download_label = Download bookmark.title = Visualizzazione corrente (copia o apri in una nuova finestra) bookmark_label = Visualizzazione corrente + tools.title = Strumenti tools_label = Strumenti first_page.title = Vai alla prima pagina @@ -38,22 +55,26 @@ page_rotate_cw_label = Ruota in senso orario page_rotate_ccw.title = Ruota in senso antiorario page_rotate_ccw.label = Ruota in senso antiorario page_rotate_ccw_label = Ruota in senso antiorario + cursor_text_select_tool.title = Attiva strumento di selezione testo cursor_text_select_tool_label = Strumento di selezione testo cursor_hand_tool.title = Attiva strumento mano cursor_hand_tool_label = Strumento mano + scroll_vertical.title = Scorri le pagine in verticale scroll_vertical_label = Scorrimento verticale scroll_horizontal.title = Scorri le pagine in orizzontale scroll_horizontal_label = Scorrimento orizzontale scroll_wrapped.title = Scorri le pagine in verticale, disponendole da sinistra a destra e andando a capo automaticamente scroll_wrapped_label = Scorrimento con a capo automatico + spread_none.title = Non raggruppare pagine spread_none_label = Nessun raggruppamento spread_odd.title = Crea gruppi di pagine che iniziano con numeri di pagina dispari spread_odd_label = Raggruppamento dispari spread_even.title = Crea gruppi di pagine che iniziano con numeri di pagina pari spread_even_label = Raggruppamento pari + document_properties.title = Proprietà del documento… document_properties_label = Proprietà del documento… document_properties_file_name = Nome file: @@ -86,9 +107,11 @@ document_properties_linearized = Visualizzazione web veloce: document_properties_linearized_yes = Sì document_properties_linearized_no = No document_properties_close = Chiudi + print_progress_message = Preparazione documento per la stampa… print_progress_percent = {{progress}}% print_progress_close = Annulla + toggle_sidebar.title = Attiva/disattiva barra laterale toggle_sidebar_notification.title = Attiva/disattiva barra laterale (il documento contiene struttura/allegati) toggle_sidebar_label = Attiva/disattiva barra laterale @@ -100,9 +123,11 @@ thumbs.title = Mostra le miniature thumbs_label = Miniature findbar.title = Trova nel documento findbar_label = Trova + page_canvas = Pagina {{page}} thumb_page_title = Pagina {{page}} thumb_page_canvas = Miniatura della pagina {{page}} + find_input.title = Trova find_input.placeholder = Trova nel documento… find_previous.title = Trova l’occorrenza precedente del testo da cercare @@ -128,6 +153,7 @@ find_match_count_limit[few] = Più di {{limit}} corrispondenze find_match_count_limit[many] = Più di {{limit}} corrispondenze find_match_count_limit[other] = Più di {{limit}} corrispondenze find_not_found = Testo non trovato + error_more_info = Ulteriori informazioni error_less_info = Nascondi dettagli error_close = Chiudi @@ -137,23 +163,27 @@ error_stack = Stack: {{stack}} error_file = File: {{file}} error_line = Riga: {{line}} rendering_error = Si è verificato un errore durante il rendering della pagina. + page_scale_width = Larghezza pagina page_scale_fit = Adatta a una pagina page_scale_auto = Zoom automatico page_scale_actual = Dimensioni effettive page_scale_percent = {{scale}}% + loading_error_indicator = Errore loading_error = Si è verificato un errore durante il caricamento del PDF. invalid_file_error = File PDF non valido o danneggiato. missing_file_error = File PDF non disponibile. unexpected_response_error = Risposta imprevista del server + annotation_date_string = {{date}}, {{time}} + text_annotation_type.alt = [Annotazione: {{type}}] password_label = Inserire la password per aprire questo file PDF. password_invalid = Password non corretta. Riprovare. password_ok = OK password_cancel = Annulla + printing_not_supported = Attenzione: la stampa non è completamente supportata da questo browser. printing_not_ready = Attenzione: il PDF non è ancora stato caricato completamente per la stampa. web_fonts_disabled = I web font risultano disattivati: impossibile utilizzare i caratteri incorporati nel PDF. -document_colors_not_allowed = Non è possibile visualizzare i colori originali definiti nel file PDF: l’opzione del browser “Consenti alle pagine di scegliere i propri colori invece di quelli impostati” è disattivata. diff --git a/third-party/pdfjs/web/locale/ka/viewer.properties b/third-party/pdfjs/web/locale/ka/viewer.properties index d7a8f7a1f..86e91bbd1 100644 --- a/third-party/pdfjs/web/locale/ka/viewer.properties +++ b/third-party/pdfjs/web/locale/ka/viewer.properties @@ -122,7 +122,7 @@ document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}}) # LOCALIZATION NOTE (document_properties_linearized): The linearization status of # the document; usually called "Fast Web View" in English locales of Adobe software. -document_properties_linearized=სწრაფი შეთვალიერება: +document_properties_linearized=მსუბუქი ვებჩვენება: document_properties_linearized_yes=დიახ document_properties_linearized_no=არა document_properties_close=დახურვა @@ -245,4 +245,3 @@ password_cancel=გაუქმება printing_not_supported=გაფრთხილება: ამობეჭდვა ამ ბრაუზერში არაა სრულად მხარდაჭერილი. printing_not_ready=გაფრთხილება: PDF სრულად ჩატვირთული არაა, ამობეჭდვის დასაწყებად. web_fonts_disabled=ვებშრიფტები გამორთულია: ჩაშენებული PDF-შრიფტების გამოყენება ვერ ხერხდება. -document_colors_not_allowed=PDF-დოკუმენტებს არ აქვს საკუთარი ფერების გამოყენების ნებართვა: ბრაუზერში გამორთულია „გვერდებისთვის საკუთარი ფერების გამოყენების უფლება“. diff --git a/third-party/pdfjs/web/locale/kab/viewer.properties b/third-party/pdfjs/web/locale/kab/viewer.properties index e3d0dc4b1..a6f07f169 100644 --- a/third-party/pdfjs/web/locale/kab/viewer.properties +++ b/third-party/pdfjs/web/locale/kab/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Sefsex printing_not_supported=Ɣuṛ-k: Asiggez ur ittusefrak ara yakan imaṛṛa deg iminig-a. printing_not_ready=Ɣuṛ-k: Afaylu PDF ur d-yuli ara imeṛṛa akken ad ittusiggez. web_fonts_disabled=Tisefsiyin web ttwassensent; D awezɣi useqdec n tsefsiyin yettwarnan ɣer PDF. -document_colors_not_allowed=Isemliyen PDF ur zmiren ara ad sqedcen initen-nsen: 'Sireg isebtar akken ad fernen initen-nsen' ur yermid ara deg iminig. diff --git a/third-party/pdfjs/web/locale/kk/viewer.properties b/third-party/pdfjs/web/locale/kk/viewer.properties index 389b854b5..afd679ac7 100644 --- a/third-party/pdfjs/web/locale/kk/viewer.properties +++ b/third-party/pdfjs/web/locale/kk/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Бас тарту printing_not_supported=Ескерту: Баспаға шығаруды бұл браузер толығымен қолдамайды. printing_not_ready=Ескерту: Баспаға шығару үшін, бұл PDF толығымен жүктеліп алынбады. web_fonts_disabled=Веб қаріптері сөндірілген: құрамына енгізілген PDF қаріптерін қолдану мүмкін емес. -document_colors_not_allowed=PDF құжаттарына өздік түстерді қолдану рұқсат етілмеген: бұл браузерде 'Веб-сайттарға өздерінің түстерін қолдануға рұқсат беру' мүмкіндігі сөндірулі тұр. diff --git a/third-party/pdfjs/web/locale/km/viewer.properties b/third-party/pdfjs/web/locale/km/viewer.properties index e5403cc16..8615e8389 100644 --- a/third-party/pdfjs/web/locale/km/viewer.properties +++ b/third-party/pdfjs/web/locale/km/viewer.properties @@ -181,4 +181,3 @@ password_cancel=បោះបង់ printing_not_supported=ការ​ព្រមាន ៖ កា​រ​បោះពុម្ព​មិន​ត្រូវ​បាន​គាំទ្រ​ពេញលេញ​ដោយ​កម្មវិធី​រុករក​នេះ​ទេ ។ printing_not_ready=ព្រមាន៖ PDF មិន​ត្រូវ​បាន​ផ្ទុក​ទាំងស្រុង​ដើម្បី​បោះពុម្ព​ទេ។ web_fonts_disabled=បាន​បិទ​ពុម្ពអក្សរ​បណ្ដាញ ៖ មិន​អាច​ប្រើ​ពុម្ពអក្សរ PDF ដែល​បាន​បង្កប់​បាន​ទេ ។ -document_colors_not_allowed=ឯកសារ PDF មិន​ត្រូវ​បាន​អនុញ្ញាត​ឲ្យ​ប្រើ​ពណ៌​ផ្ទាល់​របស់​វា​ទេ៖ 'អនុញ្ញាត​​ឲ្យ​ទំព័រ​ជ្រើស​ពណ៌​ផ្ទាល់​ខ្លួន' ត្រូវ​បាន​ធ្វើ​ឲ្យ​អសកម្ម​ក្នុង​​កម្មវិធី​រុករក។ diff --git a/third-party/pdfjs/web/locale/kn/viewer.properties b/third-party/pdfjs/web/locale/kn/viewer.properties index cf3d0041c..b37a71c2e 100644 --- a/third-party/pdfjs/web/locale/kn/viewer.properties +++ b/third-party/pdfjs/web/locale/kn/viewer.properties @@ -190,4 +190,3 @@ password_cancel=ರದ್ದು ಮಾಡು printing_not_supported=ಎಚ್ಚರಿಕೆ: ಈ ಜಾಲವೀಕ್ಷಕದಲ್ಲಿ ಮುದ್ರಣಕ್ಕೆ ಸಂಪೂರ್ಣ ಬೆಂಬಲವಿಲ್ಲ. printing_not_ready=ಎಚ್ಚರಿಕೆ: PDF ಕಡತವು ಮುದ್ರಿಸಲು ಸಂಪೂರ್ಣವಾಗಿ ಲೋಡ್ ಆಗಿಲ್ಲ. web_fonts_disabled=ಜಾಲ ಅಕ್ಷರಶೈಲಿಯನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ: ಅಡಕಗೊಳಿಸಿದ PDF ಅಕ್ಷರಶೈಲಿಗಳನ್ನು ಬಳಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ. -document_colors_not_allowed=PDF ದಸ್ತಾವೇಜುಗಳು ತಮ್ಮದೆ ಆದ ಬಣ್ಣಗಳನ್ನು ಬಳಸಲು ಅನುಮತಿ ಇರುವುದಿಲ್ಲ: 'ಪುಟಗಳು ತಮ್ಮದೆ ಆದ ಬಣ್ಣವನ್ನು ಆಯ್ಕೆ ಮಾಡಲು ಅನುಮತಿಸು' ಅನ್ನು ಜಾಲವೀಕ್ಷಕದಲ್ಲಿ ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲಾಗಿರುತ್ತದೆ. diff --git a/third-party/pdfjs/web/locale/ko/viewer.properties b/third-party/pdfjs/web/locale/ko/viewer.properties index ef688a956..727f8d5c9 100644 --- a/third-party/pdfjs/web/locale/ko/viewer.properties +++ b/third-party/pdfjs/web/locale/ko/viewer.properties @@ -41,8 +41,8 @@ print.title=인쇄 print_label=인쇄 download.title=다운로드 download_label=다운로드 -bookmark.title=현재 뷰 (복사하거나 새 창에 열기) -bookmark_label=현재 뷰 +bookmark.title=현재 보기 (복사 또는 새 창에 열기) +bookmark_label=현재 보기 # Secondary toolbar and context menu tools.title=도구 @@ -137,7 +137,7 @@ print_progress_close=취소 # (the _label strings are alt text for the buttons, the .title strings are # tooltips) toggle_sidebar.title=탐색창 표시/숨기기 -toggle_sidebar_notification.title=탐색창 표시/숨기기 (문서에 아웃라인/첨부파일 포함) +toggle_sidebar_notification.title=탐색창 표시/숨기기 (문서에 아웃라인/첨부파일 포함됨) toggle_sidebar_label=탐색창 표시/숨기기 document_outline.title=문서 아웃라인 보기(더블 클릭해서 모든 항목 펼치기/접기) document_outline_label=문서 아웃라인 @@ -245,4 +245,3 @@ password_cancel=취소 printing_not_supported=경고: 이 브라우저는 인쇄를 완전히 지원하지 않습니다. printing_not_ready=경고: 이 PDF를 인쇄를 할 수 있을 정도로 읽어들이지 못했습니다. web_fonts_disabled=웹 폰트가 비활성화됨: 내장된 PDF 글꼴을 사용할 수 없습니다. -document_colors_not_allowed=PDF 문서의 자체 색상 허용 안됨: “페이지 자체 색상 허용”이 브라우저에서 비활성화 되어 있습니다. diff --git a/third-party/pdfjs/web/locale/lij/viewer.properties b/third-party/pdfjs/web/locale/lij/viewer.properties index 71a53062d..0cfa7d27f 100644 --- a/third-party/pdfjs/web/locale/lij/viewer.properties +++ b/third-party/pdfjs/web/locale/lij/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Anulla printing_not_supported=Atençion: a stanpa a no l'é conpletamente soportâ da sto navegatô. printing_not_ready=Atençion: o PDF o no l'é ancon caregou conpletamente pe-a stanpa. web_fonts_disabled=I font do web en dizativæ: inposcibile adeuviâ i carateri do PDF. -document_colors_not_allowed=No l'é poscibile adeuviâ i pròpi coî pe-i documenti PDF: l'opçion do navegatô “Permetti a-e pagine de çerne i pròpi coî in cangio de quelli inpostæ” a l'é dizativâ. diff --git a/third-party/pdfjs/web/locale/locale.properties b/third-party/pdfjs/web/locale/locale.properties index 411c19830..372dd5d32 100644 --- a/third-party/pdfjs/web/locale/locale.properties +++ b/third-party/pdfjs/web/locale/locale.properties @@ -43,6 +43,9 @@ [cak] @import url(cak/viewer.properties) +[ckb] +@import url(ckb/viewer.properties) + [cs] @import url(cs/viewer.properties) @@ -265,6 +268,9 @@ [sv-SE] @import url(sv-SE/viewer.properties) +[szl] +@import url(szl/viewer.properties) + [ta] @import url(ta/viewer.properties) diff --git a/third-party/pdfjs/web/locale/lt/viewer.properties b/third-party/pdfjs/web/locale/lt/viewer.properties index dbdc82136..daa76787c 100644 --- a/third-party/pdfjs/web/locale/lt/viewer.properties +++ b/third-party/pdfjs/web/locale/lt/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Atsisakyti printing_not_supported=Dėmesio! Spausdinimas šioje naršyklėje nėra pilnai realizuotas. printing_not_ready=Dėmesio! PDF failas dar nėra pilnai įkeltas spausdinimui. web_fonts_disabled=Saityno šriftai išjungti – PDF faile esančių šriftų naudoti negalima. -document_colors_not_allowed=PDF dokumentams neleidžiama nurodyti savo spalvų, nes išjungta naršyklės nuostata „Leisti tinklalapiams nurodyti spalvas“. diff --git a/third-party/pdfjs/web/locale/ltg/viewer.properties b/third-party/pdfjs/web/locale/ltg/viewer.properties index ecdb72352..4fffa864d 100644 --- a/third-party/pdfjs/web/locale/ltg/viewer.properties +++ b/third-party/pdfjs/web/locale/ltg/viewer.properties @@ -217,4 +217,3 @@ password_cancel=Atceļt printing_not_supported=Uzmaneibu: Drukuošona nu itei puorlūka dorbojās tikai daleji. printing_not_ready=Uzmaneibu: PDF nav pilneibā īluodeits drukuošonai. web_fonts_disabled=Šķārsteikla fonti nav aktivizāti: Navar īgult PDF fontus. -document_colors_not_allowed=PDF dokumentym nav atļauts izmantuot pošym sovys kruosys: „Atļaut lopom izavieleit pošom sovys kruosys“ ir deaktiveits puorlyukā. diff --git a/third-party/pdfjs/web/locale/lv/viewer.properties b/third-party/pdfjs/web/locale/lv/viewer.properties index 18ed55efb..b6d6ad38f 100644 --- a/third-party/pdfjs/web/locale/lv/viewer.properties +++ b/third-party/pdfjs/web/locale/lv/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Atcelt printing_not_supported=Uzmanību: Drukāšana no šī pārlūka darbojas tikai daļēji. printing_not_ready=Uzmanību: PDF nav pilnībā ielādēts drukāšanai. web_fonts_disabled=Tīmekļa fonti nav aktivizēti: Nevar iegult PDF fontus. -document_colors_not_allowed=PDF dokumentiem nav atļauts izmantot pašiem savas krāsas: „Atļaut lapām izvēlēties pašām savas krāsas“ ir deaktivēts pārlūkā. diff --git a/third-party/pdfjs/web/locale/mk/viewer.properties b/third-party/pdfjs/web/locale/mk/viewer.properties index 85350255a..c1b091ed6 100644 --- a/third-party/pdfjs/web/locale/mk/viewer.properties +++ b/third-party/pdfjs/web/locale/mk/viewer.properties @@ -142,4 +142,3 @@ password_cancel=Откажи printing_not_supported=Предупредување: Печатењето не е целосно поддржано во овој прелистувач. printing_not_ready=Предупредување: PDF документот не е целосно вчитан за печатење. web_fonts_disabled=Интернет фонтовите се оневозможени: не може да се користат вградените PDF фонтови. -document_colors_not_allowed=PDF-документите немаат дозвола да користат сопствени бои: Поставката „Дозволи страниците сами да ги избираат своите бои“ е деактивирана од прелистувачот. diff --git a/third-party/pdfjs/web/locale/mr/viewer.properties b/third-party/pdfjs/web/locale/mr/viewer.properties index 25229ea4f..b33646f51 100644 --- a/third-party/pdfjs/web/locale/mr/viewer.properties +++ b/third-party/pdfjs/web/locale/mr/viewer.properties @@ -235,4 +235,3 @@ password_cancel=रद्द करा printing_not_supported=सावधानता: या ब्राउझरतर्फे छपाइ पूर्णपणे समर्थीत नाही. printing_not_ready=सावधानता: छपाईकरिता PDF पूर्णतया लोड झाले नाही. web_fonts_disabled=वेब टंक असमर्थीत आहेत: एम्बेडेड PDF टंक वापर अशक्य. -document_colors_not_allowed=PDF दस्तऐवजांना त्यांचे रंग वापरण्यास अनुमती नाही: ब्राउझरमध्ये ' पृष्ठांना त्यांचे रंग निवडण्यास अनुमती द्या' बंद केले आहे. diff --git a/third-party/pdfjs/web/locale/ms/viewer.properties b/third-party/pdfjs/web/locale/ms/viewer.properties index 3bc7907b8..61f155397 100644 --- a/third-party/pdfjs/web/locale/ms/viewer.properties +++ b/third-party/pdfjs/web/locale/ms/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Batal printing_not_supported=Amaran: Cetakan ini tidak sepenuhnya disokong oleh pelayar ini. printing_not_ready=Amaran: PDF tidak sepenuhnya dimuatkan untuk dicetak. web_fonts_disabled=Fon web dinyahdayakan: tidak dapat menggunakan fon terbenam PDF. -document_colors_not_allowed=Dokumen PDF tidak dibenarkan untuk menggunakan warna sendiri: “Izinkan halaman untuk memilih warna sendiri” telah dinyahaktifkan dalam pelayar. diff --git a/third-party/pdfjs/web/locale/my/viewer.properties b/third-party/pdfjs/web/locale/my/viewer.properties index f5676198f..3e6f2c305 100644 --- a/third-party/pdfjs/web/locale/my/viewer.properties +++ b/third-party/pdfjs/web/locale/my/viewer.properties @@ -195,4 +195,3 @@ password_cancel=ပယ်​ဖျက်ပါ printing_not_supported=သတိပေးချက်၊ပရင့်ထုတ်ခြင်းကိုဤဘယောက်ဆာသည် ပြည့်ဝစွာထောက်ပံ့မထားပါ ။ printing_not_ready=သတိပေးချက်: ယခု PDF ဖိုင်သည် ပုံနှိပ်ရန် မပြည့်စုံပါ web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. -document_colors_not_allowed=PDF ဖိုင်အား ၎င်းဤ ကိုယ်ပိုင်အရောင်များကို အသုံးပြုခွင့်မပေးထားပါ ။ 'စာမျက်နှာအားလုံးအားအရောင်ရွေးချယ်ခွင့်' အား ယခု ဘယောက်ဆာတွင် ပိတ်ထားခြင်းကြောင့်ဖြစ် သှ် diff --git a/third-party/pdfjs/web/locale/nb-NO/viewer.properties b/third-party/pdfjs/web/locale/nb-NO/viewer.properties index 5612abb0b..47b209048 100644 --- a/third-party/pdfjs/web/locale/nb-NO/viewer.properties +++ b/third-party/pdfjs/web/locale/nb-NO/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Avbryt printing_not_supported=Advarsel: Utskrift er ikke fullstendig støttet av denne nettleseren. printing_not_ready=Advarsel: PDF er ikke fullstendig innlastet for utskrift. web_fonts_disabled=Web-fonter er avslått: Kan ikke bruke innbundne PDF-fonter. -document_colors_not_allowed=PDF-dokumenter tillates ikke å bruke deres egne farger: "Tillat sider å velge egne farger" er deaktivert i nettleseren. diff --git a/third-party/pdfjs/web/locale/ne-NP/viewer.properties b/third-party/pdfjs/web/locale/ne-NP/viewer.properties index 13bf69ba9..3bf8ed8f3 100644 --- a/third-party/pdfjs/web/locale/ne-NP/viewer.properties +++ b/third-party/pdfjs/web/locale/ne-NP/viewer.properties @@ -181,4 +181,3 @@ password_cancel=रद्द गर्नुहोस् printing_not_supported=चेतावनी: यो ब्राउजरमा मुद्रण पूर्णतया समर्थित छैन। printing_not_ready=चेतावनी: PDF मुद्रणका लागि पूर्णतया लोड भएको छैन। web_fonts_disabled=वेब फन्ट असक्षम छन्: एम्बेडेड PDF फन्ट प्रयोग गर्न असमर्थ। -document_colors_not_allowed=PDF कागजातहरूलाई आफ्नै रङ प्रयोग गर्न अनुमति छैन: 'पृष्ठलाई आफ्नै रङ चयन गर्न अनुमति दिने' ब्राउजरमा निष्क्रिय गरिएको छ। diff --git a/third-party/pdfjs/web/locale/nl/viewer.properties b/third-party/pdfjs/web/locale/nl/viewer.properties index af8fb681e..b37f1abf5 100644 --- a/third-party/pdfjs/web/locale/nl/viewer.properties +++ b/third-party/pdfjs/web/locale/nl/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Annuleren printing_not_supported=Waarschuwing: afdrukken wordt niet volledig ondersteund door deze browser. printing_not_ready=Waarschuwing: de PDF is niet volledig geladen voor afdrukken. web_fonts_disabled=Weblettertypen zijn uitgeschakeld: gebruik van ingebedde PDF-lettertypen is niet mogelijk. -document_colors_not_allowed=PDF-documenten mogen hun eigen kleuren niet gebruiken: ‘Pagina’s toestaan om hun eigen kleuren te kiezen’ is uitgeschakeld in de browser. diff --git a/third-party/pdfjs/web/locale/nn-NO/viewer.properties b/third-party/pdfjs/web/locale/nn-NO/viewer.properties index ad6de8f81..c9bac1010 100644 --- a/third-party/pdfjs/web/locale/nn-NO/viewer.properties +++ b/third-party/pdfjs/web/locale/nn-NO/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Avbryt printing_not_supported=Åtvaring: Utskrift er ikkje fullstendig støtta av denne nettlesaren. printing_not_ready=Åtvaring: PDF ikkje fullstendig innlasta for utskrift. web_fonts_disabled=Web-skrifter er slått av: Kan ikkje bruke innbundne PDF-skrifter. -document_colors_not_allowed=PDF-dokument kan ikkje bruke eigne fargar: «Tillat sider å velje eigne fargar» er deaktivert i nettlesaren. diff --git a/third-party/pdfjs/web/locale/oc/viewer.properties b/third-party/pdfjs/web/locale/oc/viewer.properties index 3732e943b..b1c6a3a0c 100644 --- a/third-party/pdfjs/web/locale/oc/viewer.properties +++ b/third-party/pdfjs/web/locale/oc/viewer.properties @@ -98,7 +98,7 @@ document_properties_creation_date=Data de creacion : document_properties_modification_date=Data de modificacion : # LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}" # will be replaced by the creation/modification date, and time, of the PDF file. -document_properties_date_string={{date}}, {{time}} +document_properties_date_string={{date}}, a {{time}} document_properties_creator=Creator : document_properties_producer=Aisina de conversion PDF : document_properties_version=Version PDF : @@ -245,4 +245,3 @@ password_cancel=Anullar printing_not_supported=Atencion : l'impression es pas completament gerida per aqueste navegador. printing_not_ready=Atencion : lo PDF es pas entièrament cargat per lo poder imprimir. web_fonts_disabled=Las poliças web son desactivadas : impossible d'utilizar las poliças integradas al PDF. -document_colors_not_allowed=Los documents PDF pòdon pas utilizar lors pròprias colors : « Autorizar las paginas web d'utilizar lors pròprias colors » es desactivat dins lo navegador. diff --git a/third-party/pdfjs/web/locale/pa-IN/viewer.properties b/third-party/pdfjs/web/locale/pa-IN/viewer.properties index e1ccb6541..0ab56319e 100644 --- a/third-party/pdfjs/web/locale/pa-IN/viewer.properties +++ b/third-party/pdfjs/web/locale/pa-IN/viewer.properties @@ -243,4 +243,3 @@ password_cancel=ਰੱਦ ਕਰੋ printing_not_supported=ਸਾਵਧਾਨ: ਇਹ ਬਰਾਊਜ਼ਰ ਪਰਿੰਟ ਕਰਨ ਲਈ ਪੂਰੀ ਤਰ੍ਹਾਂ ਸਹਾਇਕ ਨਹੀਂ ਹੈ। printing_not_ready=ਸਾਵਧਾਨ: PDF ਨੂੰ ਪਰਿੰਟ ਕਰਨ ਲਈ ਪੂਰੀ ਤਰ੍ਹਾਂ ਲੋਡ ਨਹੀਂ ਹੈ। web_fonts_disabled=ਵੈਬ ਫੋਂਟ ਬੰਦ ਹਨ: ਇੰਬੈਡ PDF ਫੋਂਟ ਨੂੰ ਵਰਤਣ ਲਈ ਅਸਮਰੱਥ ਹੈ। -document_colors_not_allowed=PDF ਦਸਤਾਵੇਜ਼ਾਂ ਨੂੰ ਆਪਣੇ ਰੰਗ ਵਰਤਣ ਦੀ ਇਜ਼ਾਜ਼ਤ ਨਹੀਂ ਹੈ।: ਬਰਾਊਜ਼ਰ ਵਿੱਚ “ਸਫ਼ਿਆਂ ਨੂੰ ਆਪਣੇ ਰੰਗ ਚੁਣਨ ਦੀ ਇਜ਼ਾਜ਼ਤ ਦਿਓ” ਨਾ-ਸਰਗਰਮ ਹੈ। diff --git a/third-party/pdfjs/web/locale/pl/viewer.properties b/third-party/pdfjs/web/locale/pl/viewer.properties index c18ea5ed8..cf170c8d2 100644 --- a/third-party/pdfjs/web/locale/pl/viewer.properties +++ b/third-party/pdfjs/web/locale/pl/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Anuluj printing_not_supported=Ostrzeżenie: drukowanie nie jest w pełni obsługiwane przez tę przeglądarkę. printing_not_ready=Ostrzeżenie: dokument PDF nie jest całkowicie wczytany, więc nie można go wydrukować. web_fonts_disabled=Czcionki sieciowe są wyłączone: nie można użyć osadzonych czcionek PDF. -document_colors_not_allowed=Dokumenty PDF nie mogą używać własnych kolorów: opcja „Pozwalaj stronom stosować inne kolory” w przeglądarce jest nieaktywna. diff --git a/third-party/pdfjs/web/locale/pt-BR/viewer.properties b/third-party/pdfjs/web/locale/pt-BR/viewer.properties index 5947d2d43..ca592b8f1 100644 --- a/third-party/pdfjs/web/locale/pt-BR/viewer.properties +++ b/third-party/pdfjs/web/locale/pt-BR/viewer.properties @@ -41,7 +41,7 @@ print.title=Imprimir print_label=Imprimir download.title=Download download_label=Download -bookmark.title=Visualização atual (copiar ou abrir em uma nova janela) +bookmark.title=Visão atual (copiar ou abrir em nova janela) bookmark_label=Visualização atual # Secondary toolbar and context menu @@ -165,7 +165,7 @@ find_previous.title=Procurar a ocorrência anterior da frase find_previous_label=Anterior find_next.title=Procurar a próxima ocorrência da frase find_next_label=Próxima -find_highlight=Realçar tudo +find_highlight=Destacar tudo find_match_case_label=Diferenciar maiúsculas/minúsculas find_entire_word_label=Palavras completas find_reached_top=Início do documento alcançado, continuando do fim @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Aviso: a impressão não é totalmente suportada neste navegador. printing_not_ready=Aviso: o PDF não está totalmente carregado para impressão. web_fonts_disabled=As fontes web estão desativadas: não foi possível usar fontes incorporadas do PDF. -document_colors_not_allowed=Documentos PDF não estão autorizados a usar as próprias cores: a opção “Permitir que as páginas escolham suas próprias cores” está desativada no navegador. diff --git a/third-party/pdfjs/web/locale/pt-PT/viewer.properties b/third-party/pdfjs/web/locale/pt-PT/viewer.properties index 5129a5226..57f481416 100644 --- a/third-party/pdfjs/web/locale/pt-PT/viewer.properties +++ b/third-party/pdfjs/web/locale/pt-PT/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Aviso: a impressão não é totalmente suportada por este navegador. printing_not_ready=Aviso: o PDF ainda não está totalmente carregado. web_fonts_disabled=Os tipos de letra web estão desativados: não é possível utilizar os tipos de letra PDF embutidos. -document_colors_not_allowed=Os documentos PDF não permitem a utilização das suas próprias cores: “Permitir às páginas escolher as suas próprias cores” está desativado no navegador. diff --git a/third-party/pdfjs/web/locale/rm/viewer.properties b/third-party/pdfjs/web/locale/rm/viewer.properties index 99aca5c6b..8c8cab892 100644 --- a/third-party/pdfjs/web/locale/rm/viewer.properties +++ b/third-party/pdfjs/web/locale/rm/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Interrumper printing_not_supported=Attenziun: Il stampar na funcziunescha anc betg dal tut en quest navigatur. printing_not_ready=Attenziun: Il PDF n'è betg chargià cumplettamain per stampar. web_fonts_disabled=Scrittiras dal web èn deactivadas: impussibel dad utilisar las scrittiras integradas en il PDF. -document_colors_not_allowed=Documents da PDF na dastgan betg duvrar las atgnas colurs: 'Permetter a paginas da tscherner lur atgna colur' è deactivà en il navigatur. diff --git a/third-party/pdfjs/web/locale/ro/viewer.properties b/third-party/pdfjs/web/locale/ro/viewer.properties index 691d9dc32..0e4fbf70e 100644 --- a/third-party/pdfjs/web/locale/ro/viewer.properties +++ b/third-party/pdfjs/web/locale/ro/viewer.properties @@ -32,7 +32,7 @@ zoom_out.title=Micșorează zoom_out_label=Micșorează zoom_in.title=Mărește zoom_in_label=Mărește -zoom.title=Focalizare +zoom.title=Zoom presentation_mode.title=Comută la modul de prezentare presentation_mode_label=Mod de prezentare open_file.title=Deschide un fișier @@ -53,12 +53,12 @@ first_page_label=Mergi la prima pagină last_page.title=Mergi la ultima pagină last_page.label=Mergi la ultima pagină last_page_label=Mergi la ultima pagină -page_rotate_cw.title=Rotește în sensul acelor de ceasornic -page_rotate_cw.label=Rotește în sensul acelor de ceasornic -page_rotate_cw_label=Rotește în sensul acelor de ceasornic -page_rotate_ccw.title=Rotește în sens invers al acelor de ceasornic -page_rotate_ccw.label=Rotește în sens invers al acelor de ceasornic -page_rotate_ccw_label=Rotește în sens invers al acelor de ceasornic +page_rotate_cw.title=Rotește în sensul acelor de ceas +page_rotate_cw.label=Rotește în sensul acelor de ceas +page_rotate_cw_label=Rotește în sensul acelor de ceas +page_rotate_ccw.title=Rotește în sens invers al acelor de ceas +page_rotate_ccw.label=Rotește în sens invers al acelor de ceas +page_rotate_ccw_label=Rotește în sens invers al acelor de ceas cursor_text_select_tool.title=Activează instrumentul de selecție a textului cursor_text_select_tool_label=Instrumentul de selecție a textului @@ -106,8 +106,8 @@ document_properties_page_count=Număr de pagini: document_properties_page_size=Mărimea paginii: document_properties_page_size_unit_inches=in document_properties_page_size_unit_millimeters=mm -document_properties_page_size_orientation_portrait=portret -document_properties_page_size_orientation_landscape=peisaj +document_properties_page_size_orientation_portrait=verticală +document_properties_page_size_orientation_landscape=orizontală document_properties_page_size_name_a3=A3 document_properties_page_size_name_a4=A4 document_properties_page_size_name_letter=Literă @@ -215,7 +215,7 @@ rendering_error=A intervenit o eroare la randarea paginii. # Predefined zoom values page_scale_width=Lățime pagină page_scale_fit=Potrivire la pagină -page_scale_auto=Focalizare automată +page_scale_auto=Zoom automat page_scale_actual=Mărime reală # LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a # numerical scale value. @@ -245,4 +245,3 @@ password_cancel=Renunță printing_not_supported=Avertisment: Tipărirea nu este suportată în totalitate de acest browser. printing_not_ready=Avertisment: PDF-ul nu este încărcat complet pentru tipărire. web_fonts_disabled=Fonturile web sunt dezactivate: nu se pot folosi fonturile PDF încorporate. -document_colors_not_allowed=Documentele PDF nu sunt autorizate să folosească propriile culori: „Permite paginilor să aleagă propriile culori” este dezactivat în browser. diff --git a/third-party/pdfjs/web/locale/ru/viewer.properties b/third-party/pdfjs/web/locale/ru/viewer.properties index bf417bcb4..dd4ee4810 100644 --- a/third-party/pdfjs/web/locale/ru/viewer.properties +++ b/third-party/pdfjs/web/locale/ru/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Отмена printing_not_supported=Предупреждение: В этом браузере не полностью поддерживается печать. printing_not_ready=Предупреждение: PDF не полностью загружен для печати. web_fonts_disabled=Веб-шрифты отключены: невозможно использовать встроенные PDF-шрифты. -document_colors_not_allowed=PDF-документам не разрешено использовать свои цвета: в браузере отключён параметр «Разрешить веб-сайтам использовать свои цвета». diff --git a/third-party/pdfjs/web/locale/sk/viewer.properties b/third-party/pdfjs/web/locale/sk/viewer.properties index a08911bf9..d86d77cfa 100644 --- a/third-party/pdfjs/web/locale/sk/viewer.properties +++ b/third-party/pdfjs/web/locale/sk/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Zrušiť printing_not_supported=Upozornenie: tlač nie je v tomto prehliadači plne podporovaná. printing_not_ready=Upozornenie: súbor PDF nie je plne načítaný pre tlač. web_fonts_disabled=Webové písma sú vypnuté: nie je možné použiť písma vložené do súboru PDF. -document_colors_not_allowed=Dokumenty PDF nemajú povolené používať vlastné farby, pretože voľba "Povoliť stránkam používať vlastné farby" je v nastaveniach prehliadača vypnutá. diff --git a/third-party/pdfjs/web/locale/sl/viewer.properties b/third-party/pdfjs/web/locale/sl/viewer.properties index 86db2d9ab..25a5e9c50 100644 --- a/third-party/pdfjs/web/locale/sl/viewer.properties +++ b/third-party/pdfjs/web/locale/sl/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Prekliči printing_not_supported=Opozorilo: ta brskalnik ne podpira vseh možnosti tiskanja. printing_not_ready=Opozorilo: PDF ni v celoti naložen za tiskanje. web_fonts_disabled=Spletne pisave so onemogočene: vgradnih pisav za PDF ni mogoče uporabiti. -document_colors_not_allowed=Dokumenti PDF ne smejo uporabljati svojih lastnih barv: možnost 'Dovoli stranem uporabo lastnih barv' je v brskalniku onemogočena. diff --git a/third-party/pdfjs/web/locale/son/viewer.properties b/third-party/pdfjs/web/locale/son/viewer.properties index f5c1b46f5..683ed14d4 100644 --- a/third-party/pdfjs/web/locale/son/viewer.properties +++ b/third-party/pdfjs/web/locale/son/viewer.properties @@ -177,4 +177,3 @@ password_cancel=Naŋ printing_not_supported=Yaamar: Karyan ši tee ka timme nda ceecikaa woo. printing_not_ready=Yaamar: PDF ši zunbu ka timme karyan še. web_fonts_disabled=Interneti šigirawey kay: ši hin ka goy nda PDF šigira hurantey. -document_colors_not_allowed=PDF takaddawey ši duu fondo ka ngey boŋ noonawey zaa: “Naŋ moɲey ma ngey boŋ noonawey suuba” ši dira ceecikaa ga. diff --git a/third-party/pdfjs/web/locale/sq/viewer.properties b/third-party/pdfjs/web/locale/sq/viewer.properties index b0f12b21e..f0710af5f 100644 --- a/third-party/pdfjs/web/locale/sq/viewer.properties +++ b/third-party/pdfjs/web/locale/sq/viewer.properties @@ -238,4 +238,3 @@ password_cancel=Anuloje printing_not_supported=Kujdes: Shtypja s’mbulohet plotësisht nga ky shfletues. printing_not_ready=Kujdes: PDF-ja s’është ngarkuar plotësisht që ta shtypni. web_fonts_disabled=Shkronjat Web janë të çaktivizuara: s’arrihet të përdoren shkronja të trupëzuara në PDF. -document_colors_not_allowed=Dokumenteve PDF s’u lejohet të përdorin ngjyrat e tyre: 'Lejoji faqet t’i zgjedhin vetë ngjyrat' është e çaktivizuar te shfletuesi. diff --git a/third-party/pdfjs/web/locale/sr/viewer.properties b/third-party/pdfjs/web/locale/sr/viewer.properties index cee0a4f83..8c4e92411 100644 --- a/third-party/pdfjs/web/locale/sr/viewer.properties +++ b/third-party/pdfjs/web/locale/sr/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Откажи printing_not_supported=Упозорење: Штампање није у потпуности подржано у овом прегледачу. printing_not_ready=Упозорење: PDF није у потпуности учитан за штампу. web_fonts_disabled=Веб фонтови су онемогућени: не могу користити уграђене PDF фонтове. -document_colors_not_allowed=PDF документи не могу да користе сопствене боје: “Дозволи страницама да изаберу своје боје” је деактивирано у прегледачу. diff --git a/third-party/pdfjs/web/locale/sv-SE/viewer.properties b/third-party/pdfjs/web/locale/sv-SE/viewer.properties index 3d2f0cf43..7c75281c3 100644 --- a/third-party/pdfjs/web/locale/sv-SE/viewer.properties +++ b/third-party/pdfjs/web/locale/sv-SE/viewer.properties @@ -137,17 +137,20 @@ print_progress_close=Avbryt # (the _label strings are alt text for the buttons, the .title strings are # tooltips) toggle_sidebar.title=Visa/dölj sidofält -toggle_sidebar_notification.title=Visa/dölj sidofält (dokument innehåller översikt/bilagor) +toggle_sidebar_notification2.title=Visa/dölj sidofält (dokument innehåller översikt/bilagor/lager) toggle_sidebar_label=Visa/dölj sidofält document_outline.title=Visa dokumentdisposition (dubbelklicka för att expandera/komprimera alla objekt) document_outline_label=Dokumentöversikt attachments.title=Visa Bilagor attachments_label=Bilagor +layers.title=Visa lager (dubbelklicka för att återställa alla lager till ursrungligt läge) +layers_label=Lager thumbs.title=Visa miniatyrer thumbs_label=Miniatyrer findbar.title=Sök i dokument findbar_label=Sök +additional_layers=Ytterligare lager # LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number. page_canvas=Sida {{page}} # Thumbnails panel item (tooltip and alt text for images) @@ -245,4 +248,3 @@ password_cancel=Avbryt printing_not_supported=Varning: Utskrifter stöds inte helt av den här webbläsaren. printing_not_ready=Varning: PDF:en är inte klar för utskrift. web_fonts_disabled=Webbtypsnitt är inaktiverade: kan inte använda inbäddade PDF-typsnitt. -document_colors_not_allowed=PDF-dokument tillåts inte använda egna färger: “Låt sidor använda egna färger” är inaktiverat i webbläsaren. diff --git a/third-party/pdfjs/web/locale/szl/viewer.properties b/third-party/pdfjs/web/locale/szl/viewer.properties new file mode 100644 index 000000000..282c59509 --- /dev/null +++ b/third-party/pdfjs/web/locale/szl/viewer.properties @@ -0,0 +1,247 @@ +# 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. + +# Main toolbar buttons (tooltips and alt text for images) +previous.title=Piyrwyjszo strōna +previous_label=Piyrwyjszo +next.title=Nastympno strōna +next_label=Dalij + +# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input. +page.title=Strōna +# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number +# representing the total number of pages in the document. +of_pages=ze {{pagesCount}} +# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}" +# will be replaced by a number representing the currently visible page, +# respectively a number representing the total number of pages in the document. +page_of_pages=({{pageNumber}} ze {{pagesCount}}) + +zoom_out.title=Zmyńsz +zoom_out_label=Zmyńsz +zoom_in.title=Zwiynksz +zoom_in_label=Zwiynksz +zoom.title=Srogość +presentation_mode.title=Przełōncz na tryb prezyntacyje +presentation_mode_label=Tryb prezyntacyje +open_file.title=Ôdewrzij zbiōr +open_file_label=Ôdewrzij +print.title=Durkuj +print_label=Durkuj +download.title=Pobier +download_label=Pobier +bookmark.title=Aktualny widok (kopiuj abo ôdewrzij w nowym ôknie) +bookmark_label=Aktualny widok + +# Secondary toolbar and context menu +tools.title=Noczynia +tools_label=Noczynia +first_page.title=Idź ku piyrszyj strōnie +first_page.label=Idź ku piyrszyj strōnie +first_page_label=Idź ku piyrszyj strōnie +last_page.title=Idź ku ôstatnij strōnie +last_page.label=Idź ku ôstatnij strōnie +last_page_label=Idź ku ôstatnij strōnie +page_rotate_cw.title=Zwyrtnij w prawo +page_rotate_cw.label=Zwyrtnij w prawo +page_rotate_cw_label=Zwyrtnij w prawo +page_rotate_ccw.title=Zwyrtnij w lewo +page_rotate_ccw.label=Zwyrtnij w lewo +page_rotate_ccw_label=Zwyrtnij w lewo + +cursor_text_select_tool.title=Załōncz noczynie ôbiyranio tekstu +cursor_text_select_tool_label=Noczynie ôbiyranio tekstu +cursor_hand_tool.title=Załōncz noczynie rōnczka +cursor_hand_tool_label=Noczynie rōnczka + +scroll_vertical.title=Używej piōnowego przewijanio +scroll_vertical_label=Piōnowe przewijanie +scroll_horizontal.title=Używej poziōmego przewijanio +scroll_horizontal_label=Poziōme przewijanie +scroll_wrapped.title=Używej szichtowego przewijanio +scroll_wrapped_label=Szichtowe przewijanie + +spread_none.title=Niy dowej strōn w widoku po dwie +spread_none_label=Po jednyj strōnie +spread_odd.title=Dej strōny po dwie: niyparzysto i parzysto +spread_odd_label=Niyparzysto i parzysto +spread_even.title=Dej strōny po dwie: parzysto i niyparzysto +spread_even_label=Parzysto i niyparzysto + +# Document properties dialog box +document_properties.title=Włosności dokumyntu… +document_properties_label=Włosności dokumyntu… +document_properties_file_name=Miano zbioru: +document_properties_file_size=Srogość zbioru: +# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}" +# will be replaced by the PDF file size in kilobytes, respectively in bytes. +document_properties_kb={{size_kb}} KB ({{size_b}} B) +# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}" +# will be replaced by the PDF file size in megabytes, respectively in bytes. +document_properties_mb={{size_mb}} MB ({{size_b}} B) +document_properties_title=Tytuł: +document_properties_author=Autōr: +document_properties_subject=Tymat: +document_properties_keywords=Kluczowe słowa: +document_properties_creation_date=Data zrychtowanio: +document_properties_modification_date=Data zmiany: +# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}" +# will be replaced by the creation/modification date, and time, of the PDF file. +document_properties_date_string={{date}}, {{time}} +document_properties_creator=Zrychtowane ôd: +document_properties_producer=PDF ôd: +document_properties_version=Wersyjo PDF: +document_properties_page_count=Wielość strōn: +document_properties_page_size=Srogość strōny: +document_properties_page_size_unit_inches=in +document_properties_page_size_unit_millimeters=mm +document_properties_page_size_orientation_portrait=piōnowo +document_properties_page_size_orientation_landscape=poziōmo +document_properties_page_size_name_a3=A3 +document_properties_page_size_name_a4=A4 +document_properties_page_size_name_letter=Letter +document_properties_page_size_name_legal=Legal +# LOCALIZATION NOTE (document_properties_page_size_dimension_string): +# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by +# the size, respectively their unit of measurement and orientation, of the (current) page. +document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} ({{orientation}}) +# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string): +# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by +# the size, respectively their unit of measurement, name, and orientation, of the (current) page. +document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}}) +# LOCALIZATION NOTE (document_properties_linearized): The linearization status of +# the document; usually called "Fast Web View" in English locales of Adobe software. +document_properties_linearized=Gibki necowy podglōnd: +document_properties_linearized_yes=Ja +document_properties_linearized_no=Niy +document_properties_close=Zawrzij + +print_progress_message=Rychtowanie dokumyntu do durku… +# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by +# a numerical per cent value. +print_progress_percent={{progress}}% +print_progress_close=Pociep + +# Tooltips and alt text for side panel toolbar buttons +# (the _label strings are alt text for the buttons, the .title strings are +# tooltips) +toggle_sidebar.title=Przełōncz posek na rancie +toggle_sidebar_notification.title=Przełōncz posek na rancie (dokumynt mo struktura/przidowki) +toggle_sidebar_label=Przełōncz posek na rancie +document_outline.title=Pokoż struktura dokumyntu (tuplowane klikniyncie rozszyrzo/swijo wszyskie elymynty) +document_outline_label=Struktura dokumyntu +attachments.title=Pokoż przidowki +attachments_label=Przidowki +thumbs.title=Pokoż miniatury +thumbs_label=Miniatury +findbar.title=Znojdź w dokumyncie +findbar_label=Znojdź + +# LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number. +page_canvas=Strōna {{page}} +# Thumbnails panel item (tooltip and alt text for images) +# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page +# number. +thumb_page_title=Strōna {{page}} +# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page +# number. +thumb_page_canvas=Miniatura strōny {{page}} + +# Find panel button title and messages +find_input.title=Znojdź +find_input.placeholder=Znojdź w dokumyncie… +find_previous.title=Znojdź piyrwyjsze pokozanie sie tyj frazy +find_previous_label=Piyrwyjszo +find_next.title=Znojdź nastympne pokozanie sie tyj frazy +find_next_label=Dalij +find_highlight=Ôbznocz wszysko +find_match_case_label=Poznowej srogość liter +find_entire_word_label=Cołke słowa +find_reached_top=Doszło do samego wiyrchu strōny, dalij ôd spodku +find_reached_bottom=Doszło do samego spodku strōny, dalij ôd wiyrchu +# LOCALIZATION NOTE (find_match_count): The supported plural forms are +# [one|two|few|many|other], with [other] as the default value. +# "{{current}}" and "{{total}}" will be replaced by a number representing the +# index of the currently active find result, respectively a number representing +# the total number of matches in the document. +find_match_count={[ plural(total) ]} +find_match_count[one]={{current}} ze {{total}}, co pasujōm +find_match_count[two]={{current}} ze {{total}}, co pasujōm +find_match_count[few]={{current}} ze {{total}}, co pasujōm +find_match_count[many]={{current}} ze {{total}}, co pasujōm +find_match_count[other]={{current}} ze {{total}}, co pasujōm +# LOCALIZATION NOTE (find_match_count_limit): The supported plural forms are +# [zero|one|two|few|many|other], with [other] as the default value. +# "{{limit}}" will be replaced by a numerical value. +find_match_count_limit={[ plural(total) ]} +find_match_count_limit[zero]=Wiyncyj jak {{limit}}, co pasujōm +find_match_count_limit[one]=Wiyncyj jak {{limit}}, co pasuje +find_match_count_limit[two]=Wiyncyj jak {{limit}}, co pasujōm +find_match_count_limit[few]=Wiyncyj jak {{limit}}, co pasujōm +find_match_count_limit[many]=Wiyncyj jak {{limit}}, co pasujōm +find_match_count_limit[other]=Wiyncyj jak {{limit}}, co pasujōm +find_not_found=Fraza niy ma znodniynto + +# Error panel labels +error_more_info=Wiyncyj informacyji +error_less_info=Mynij informacyji +error_close=Zawrzij +# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be +# replaced by the PDF.JS version and build ID. +error_version_info=PDF.js v{{version}} (build: {{build}}) +# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an +# english string describing the error. +error_message=Wiadōmość: {{message}} +# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack +# trace. +error_stack=Sztapel: {{stack}} +# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename +error_file=Zbiōr: {{file}} +# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number +error_line=Linijo: {{line}} +rendering_error=Przi renderowaniu strōny pokozoł sie feler. + +# Predefined zoom values +page_scale_width=Szyrzka strōny +page_scale_fit=Napasowanie strōny +page_scale_auto=Autōmatyczno srogość +page_scale_actual=Aktualno srogość +# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a +# numerical scale value. +page_scale_percent={{scale}}% + +# Loading indicator messages +loading_error_indicator=Feler +loading_error=Przi ladowaniu PDFa pokozoł sie feler. +invalid_file_error=Zły abo felerny zbiōr PDF. +missing_file_error=Chybio zbioru PDF. +unexpected_response_error=Niyôczekowano ôdpowiydź serwera. + +# LOCALIZATION NOTE (annotation_date_string): "{{date}}" and "{{time}}" will be +# replaced by the modification date, and time, of the annotation. +annotation_date_string={{date}}, {{time}} + +# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip. +# "{{type}}" will be replaced with an annotation type from a list defined in +# the PDF spec (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +text_annotation_type.alt=[Anotacyjo typu {{type}}] +password_label=Wkludź hasło, coby ôdewrzić tyn zbiōr PDF. +password_invalid=Hasło je złe. Sprōbuj jeszcze roz. +password_ok=OK +password_cancel=Pociep + +printing_not_supported=Pozōr: Ta przeglōndarka niy cołkiym ôbsuguje durk. +printing_not_ready=Pozōr: Tyn PDF niy ma za tela zaladowany do durku. +web_fonts_disabled=Necowe fōnty sōm zastawiōne: niy idzie użyć wkludzōnych fōntōw PDF. diff --git a/third-party/pdfjs/web/locale/ta/viewer.properties b/third-party/pdfjs/web/locale/ta/viewer.properties index 19a8de432..669ba0c56 100644 --- a/third-party/pdfjs/web/locale/ta/viewer.properties +++ b/third-party/pdfjs/web/locale/ta/viewer.properties @@ -198,4 +198,3 @@ password_cancel=ரத்து printing_not_supported=எச்சரிக்கை: இந்த உலாவி அச்சிடுதலை முழுமையாக ஆதரிக்கவில்லை. printing_not_ready=எச்சரிக்கை: PDF அச்சிட முழுவதுமாக ஏற்றப்படவில்லை. web_fonts_disabled=வலை எழுத்துருக்கள் முடக்கப்பட்டுள்ளன: உட்பொதிக்கப்பட்ட PDF எழுத்துருக்களைப் பயன்படுத்த முடியவில்லை. -document_colors_not_allowed=PDF ஆவணங்களுக்குச் சொந்த நிறங்களைப் பயன்படுத்த அனுமதியில்லை: உலாவியில் "பக்கங்கள் தங்கள் சொந்த நிறங்களைத் தேர்வு செய்துகொள்ள அனுமதி" என்னும் விருப்பம் முடக்கப்பட்டுள்ளது. diff --git a/third-party/pdfjs/web/locale/te/viewer.properties b/third-party/pdfjs/web/locale/te/viewer.properties index 56f954d43..498b64c8d 100644 --- a/third-party/pdfjs/web/locale/te/viewer.properties +++ b/third-party/pdfjs/web/locale/te/viewer.properties @@ -219,4 +219,3 @@ password_cancel=రద్దుచేయి printing_not_supported=హెచ్చరిక: ఈ విహారిణి చేత ముద్రణ పూర్తిగా తోడ్పాటు లేదు. printing_not_ready=హెచ్చరిక: ముద్రణ కొరకు ఈ PDF పూర్తిగా లోడవలేదు. web_fonts_disabled=వెబ్ ఫాంట్లు అచేతనించబడెను: ఎంబెడెడ్ PDF ఫాంట్లు ఉపయోగించలేక పోయింది. -document_colors_not_allowed=PDF పత్రాలు వాటి స్వంత రంగులను ఉపయోగించుకొనుటకు అనుమతించబడవు: విహరణి నందు “పేజీలను వాటి స్వంత రంగులను ఎంచుకొనుటకు అనుమతించు” అచేతనం చేయబడివుంది. diff --git a/third-party/pdfjs/web/locale/th/viewer.properties b/third-party/pdfjs/web/locale/th/viewer.properties index b66865fd1..a4ef7db14 100644 --- a/third-party/pdfjs/web/locale/th/viewer.properties +++ b/third-party/pdfjs/web/locale/th/viewer.properties @@ -245,4 +245,3 @@ password_cancel=ยกเลิก printing_not_supported=คำเตือน: เบราว์เซอร์นี้ไม่ได้สนับสนุนการพิมพ์อย่างเต็มที่ printing_not_ready=คำเตือน: PDF ไม่ได้รับการโหลดอย่างเต็มที่สำหรับการพิมพ์ web_fonts_disabled=แบบอักษรเว็บถูกปิดใช้งาน: ไม่สามารถใช้แบบอักษร PDF ฝังตัว -document_colors_not_allowed=เอกสาร PDF ไม่ได้รับอนุญาตให้ใช้สีของตัวเอง: "อนุญาตให้หน้าเอกสารสามารถเลือกสีของตัวเอง" ถูกปิดใช้งานในเบราว์เซอร์ diff --git a/third-party/pdfjs/web/locale/tl/viewer.properties b/third-party/pdfjs/web/locale/tl/viewer.properties index 32b348340..0209da154 100644 --- a/third-party/pdfjs/web/locale/tl/viewer.properties +++ b/third-party/pdfjs/web/locale/tl/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Kanselahin printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_ready=Warning: The PDF is not fully loaded for printing. web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. -document_colors_not_allowed=PDF documents are not allowed to use their own colors: “Allow pages to choose their own colors” is deactivated in the browser. diff --git a/third-party/pdfjs/web/locale/tr/viewer.properties b/third-party/pdfjs/web/locale/tr/viewer.properties index f398fc9f5..b189186c2 100644 --- a/third-party/pdfjs/web/locale/tr/viewer.properties +++ b/third-party/pdfjs/web/locale/tr/viewer.properties @@ -245,4 +245,3 @@ password_cancel=İptal printing_not_supported=Uyarı: Yazdırma bu tarayıcı tarafından tam olarak desteklenmemektedir. printing_not_ready=Uyarı: PDF tamamen yüklenmedi ve yazdırmaya hazır değil. web_fonts_disabled=Web fontları devre dışı: Gömülü PDF fontları kullanılamıyor. -document_colors_not_allowed=PDF belgelerinin kendi renklerini kullanması için izin verilmiyor: “Sayfalara kendi renklerini seçmesi için izin ver” tarayıcıda etkinleştirilmemiş. diff --git a/third-party/pdfjs/web/locale/uk/viewer.properties b/third-party/pdfjs/web/locale/uk/viewer.properties index 599c8f916..7b3a69c55 100644 --- a/third-party/pdfjs/web/locale/uk/viewer.properties +++ b/third-party/pdfjs/web/locale/uk/viewer.properties @@ -62,8 +62,8 @@ page_rotate_ccw_label=Повернути проти годинникової с cursor_text_select_tool.title=Увімкнути інструмент вибору тексту cursor_text_select_tool_label=Інструмент вибору тексту -cursor_hand_tool.title=Увімкнути інструмент «Рука» -cursor_hand_tool_label=Інструмент «Рука» +cursor_hand_tool.title=Увімкнути інструмент "Рука" +cursor_hand_tool_label=Інструмент "Рука" scroll_vertical.title=Використовувати вертикальне прокручування scroll_vertical_label=Вертикальне прокручування @@ -214,8 +214,8 @@ rendering_error=Під час виведення сторінки сталася # Predefined zoom values page_scale_width=За шириною -page_scale_fit=Умістити -page_scale_auto=Авто-масштаб +page_scale_fit=Вмістити +page_scale_auto=Автомасштаб page_scale_actual=Дійсний розмір # LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a # numerical scale value. @@ -245,4 +245,3 @@ password_cancel=Скасувати printing_not_supported=Попередження: Цей браузер не повністю підтримує друк. printing_not_ready=Попередження: PDF не повністю завантажений для друку. web_fonts_disabled=Веб-шрифти вимкнено: неможливо використати вбудовані у PDF шрифти. -document_colors_not_allowed=PDF-документам не дозволено використовувати власні кольори: в браузері вимкнено параметр «Дозволити сторінкам використовувати власні кольори». diff --git a/third-party/pdfjs/web/locale/ur/viewer.properties b/third-party/pdfjs/web/locale/ur/viewer.properties index 78e2029d4..162ca1475 100644 --- a/third-party/pdfjs/web/locale/ur/viewer.properties +++ b/third-party/pdfjs/web/locale/ur/viewer.properties @@ -171,7 +171,7 @@ find_reached_bottom=صفحہ کے اختتام پر پہنچ گیا، اوپر # index of the currently active find result, respectively a number representing # the total number of matches in the document. find_match_count={[ plural(total) ]} -find_match_count[one]={{total}} میچ کا {{current}}. +find_match_count[one]={{total}} میچ کا {{current}} find_match_count[few]={{total}} میچوں میں سے {{current}} find_match_count[many]={{total}} میچوں میں سے {{current}} find_match_count[other]={{total}} میچوں میں سے {{current}} @@ -239,4 +239,3 @@ password_cancel=منسوخ کریں printing_not_supported=تنبیہ:چھاپنا اس براؤزر پر پوری طرح معاونت شدہ نہیں ہے۔ printing_not_ready=تنبیہ: PDF چھپائی کے لیے پوری طرح لوڈ نہیں ہوئی۔ web_fonts_disabled=ویب فانٹ نا اہل ہیں: شامل PDF فانٹ استعمال کرنے میں ناکام۔ -document_colors_not_allowed=PDF دستاویزات کو اپنے رنگ استعمال کرنے کی اجازت نہیں: 'صفحات کو اپنے رنگ چنیں' کی اِجازت براؤزر میں بے عمل ہے۔ diff --git a/third-party/pdfjs/web/locale/uz/viewer.properties b/third-party/pdfjs/web/locale/uz/viewer.properties index e451c74ff..6ad24319e 100644 --- a/third-party/pdfjs/web/locale/uz/viewer.properties +++ b/third-party/pdfjs/web/locale/uz/viewer.properties @@ -166,4 +166,3 @@ password_ok=OK printing_not_supported=Diqqat: chop qilish bruzer tomonidan toʻliq qoʻllab-quvvatlanmaydi. printing_not_ready=Diqqat: PDF fayl chop qilish uchun toʻliq yuklanmadi. web_fonts_disabled=Veb shriftlar oʻchirilgan: ichki PDF shriftlardan foydalanib boʻlmmaydi. -document_colors_not_allowed=PDF hujjat oʻzining ranglaridan foydalanishga ruxsat bermaydi: 'Sahifalarga oʻzining rangidan foydalanishga ruxsat berish' ushbu brauzerda oʻchirib qoʻyilgan. diff --git a/third-party/pdfjs/web/locale/vi/viewer.properties b/third-party/pdfjs/web/locale/vi/viewer.properties index b8ee16e5c..64ae6e3a2 100644 --- a/third-party/pdfjs/web/locale/vi/viewer.properties +++ b/third-party/pdfjs/web/locale/vi/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Hủy bỏ printing_not_supported=Cảnh báo: In ấn không được hỗ trợ đầy đủ ở trình duyệt này. printing_not_ready=Cảnh báo: PDF chưa được tải hết để in. web_fonts_disabled=Phông chữ Web bị vô hiệu hóa: không thể sử dụng các phông chữ PDF được nhúng. -document_colors_not_allowed=Tài liệu PDF không được cho phép dùng màu riêng: 'Cho phép trang chọn màu riêng' đã bị tắt trên trình duyệt. diff --git a/third-party/pdfjs/web/locale/xh/viewer.properties b/third-party/pdfjs/web/locale/xh/viewer.properties index 1fa394bbd..52cd75e5b 100644 --- a/third-party/pdfjs/web/locale/xh/viewer.properties +++ b/third-party/pdfjs/web/locale/xh/viewer.properties @@ -181,4 +181,3 @@ password_cancel=Rhoxisa printing_not_supported=Isilumkiso: Ukuprinta akuxhaswa ngokupheleleyo yile bhrawuza. printing_not_ready=Isilumkiso: IPDF ayihlohlwanga ngokupheleleyo ukwenzela ukuprinta. web_fonts_disabled=Iifonti zewebhu ziqhwalelisiwe: ayikwazi ukusebenzisa iifonti ze-PDF ezincanyathelisiweyo. -document_colors_not_allowed=Amaxwebhu ePDF akavumelekanga ukuba asebenzise imibala yawo: 'Ukuvumela amaphepha ukuba asebenzise eyawo imibala' kuvaliwe ukuba kungasebenzi kwibhrawuza. diff --git a/third-party/pdfjs/web/locale/zh-CN/viewer.properties b/third-party/pdfjs/web/locale/zh-CN/viewer.properties index 2dc609bfb..214c746f1 100644 --- a/third-party/pdfjs/web/locale/zh-CN/viewer.properties +++ b/third-party/pdfjs/web/locale/zh-CN/viewer.properties @@ -245,4 +245,3 @@ password_cancel=取消 printing_not_supported=警告:此浏览器尚未完整支持打印功能。 printing_not_ready=警告:此 PDF 未完成载入,无法打印。 web_fonts_disabled=Web 字体已被禁用:无法使用嵌入的 PDF 字体。 -document_colors_not_allowed=PDF 文档无法使用自己的颜色:浏览器中“允许页面选择自己的颜色”的选项未被勾选。 diff --git a/third-party/pdfjs/web/locale/zh-TW/viewer.properties b/third-party/pdfjs/web/locale/zh-TW/viewer.properties index 29ff043bf..55626cabd 100644 --- a/third-party/pdfjs/web/locale/zh-TW/viewer.properties +++ b/third-party/pdfjs/web/locale/zh-TW/viewer.properties @@ -245,4 +245,3 @@ password_cancel=取消 printing_not_supported=警告: 此瀏覽器未完整支援列印功能。 printing_not_ready=警告: 此 PDF 未完成下載以供列印。 web_fonts_disabled=已停用網路字型 (Web fonts): 無法使用 PDF 內嵌字型。 -document_colors_not_allowed=瀏覽器的「優先使用網頁指定的色彩」未被勾選,PDF 文件無法使用自己的色彩。 diff --git a/third-party/pdfjs/web/viewer.css b/third-party/pdfjs/web/viewer.css index 8711953bf..605cad57e 100644 --- a/third-party/pdfjs/web/viewer.css +++ b/third-party/pdfjs/web/viewer.css @@ -1,5 +1,4 @@ /* Copyright 2014 Mozilla Foundation - * Modifications made for Epiphany by Jan-Michael Brummer * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +21,7 @@ bottom: 0; overflow: hidden; opacity: 0.2; - line-height: 1.0; + line-height: 1; } .textLayer > span { @@ -169,7 +168,7 @@ .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after, .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before { background-color: rgba(0, 0, 0, 1); - content: ''; + content: ""; display: block; position: absolute; } @@ -309,13 +308,16 @@ border: none; } -.pdfViewer.scrollHorizontal, .pdfViewer.scrollWrapped, .spread { +.pdfViewer.scrollHorizontal, +.pdfViewer.scrollWrapped, +.spread { margin-left: 3.5px; margin-right: 3.5px; text-align: center; } -.pdfViewer.scrollHorizontal, .spread { +.pdfViewer.scrollHorizontal, +.spread { white-space: nowrap; } @@ -365,7 +367,7 @@ top: 0; right: 0; bottom: 0; - background: url('images/loading-icon.gif') center no-repeat; + background: url("images/loading-icon.gif") center no-repeat; } .pdfPresentationMode .pdfViewer { @@ -407,6 +409,149 @@ --sidebar-width: 200px; --sidebar-transition-duration: 200ms; --sidebar-transition-timing-function: ease; + + --toolbar-icon-opacity: 0.7; + --doorhanger-icon-opacity: 0.9; + + --main-color: rgba(12, 12, 13, 1); + --body-bg-color: rgba(237, 237, 240, 1); + --errorWrapper-bg-color: rgba(255, 74, 74, 1); + --progressBar-color: rgba(10, 132, 255, 1); + --progressBar-indeterminate-bg-color: rgba(221, 221, 222, 1); + --progressBar-indeterminate-blend-color: rgba(116, 177, 239, 1); + --scrollbar-color: auto; + --scrollbar-bg-color: auto; + + --sidebar-bg-color: rgba(245, 246, 247, 1); + --toolbar-bg-color: rgba(249, 249, 250, 1); + --toolbar-border-color: rgba(204, 204, 204, 1); + --button-hover-color: rgba(221, 222, 223, 1); + --toggled-btn-bg-color: rgba(0, 0, 0, 0.3); + --dropdown-btn-bg-color: rgba(215, 215, 219, 1); + --separator-color: rgba(0, 0, 0, 0.3); + --field-color: rgba(6, 6, 6, 1); + --field-bg-color: rgba(255, 255, 255, 1); + --field-border-color: rgba(187, 187, 188, 1); + --findbar-nextprevious-btn-bg-color: rgba(227, 228, 230, 1); + --outline-color: rgba(0, 0, 0, 0.8); + --outline-hover-color: rgba(0, 0, 0, 0.9); + --outline-active-color: rgba(0, 0, 0, 0.08); + --outline-active-bg-color: rgba(0, 0, 0, 1); + --sidebaritem-bg-color: rgba(0, 0, 0, 0.15); + --doorhanger-bg-color: rgba(255, 255, 255, 1); + --doorhanger-border-color: rgba(12, 12, 13, 0.2); + --doorhanger-hover-color: rgba(237, 237, 237, 1); + --doorhanger-separator-color: rgba(222, 222, 222, 1); + --overlay-button-bg-color: rgba(12, 12, 13, 0.1); + --overlay-button-hover-color: rgba(12, 12, 13, 0.3); + + --loading-icon: url(images/loading.svg); + --treeitem-expanded-icon: url(images/treeitem-expanded.svg); + --treeitem-collapsed-icon: url(images/treeitem-collapsed.svg); + --toolbarButton-menuArrow-icon: url(images/toolbarButton-menuArrow.svg); + --toolbarButton-sidebarToggle-icon: url(images/toolbarButton-sidebarToggle.svg); + --toolbarButton-secondaryToolbarToggle-icon: url(images/toolbarButton-secondaryToolbarToggle.svg); + --toolbarButton-pageUp-icon: url(images/toolbarButton-pageUp.svg); + --toolbarButton-pageDown-icon: url(images/toolbarButton-pageDown.svg); + --toolbarButton-zoomOut-icon: url(images/toolbarButton-zoomOut.svg); + --toolbarButton-zoomIn-icon: url(images/toolbarButton-zoomIn.svg); + --toolbarButton-presentationMode-icon: url(images/toolbarButton-presentationMode.svg); + --toolbarButton-print-icon: url(images/toolbarButton-print.svg); + --toolbarButton-openFile-icon: url(images/toolbarButton-openFile.svg); + --toolbarButton-download-icon: url(images/toolbarButton-download.svg); + --toolbarButton-bookmark-icon: url(images/toolbarButton-bookmark.svg); + --toolbarButton-viewThumbnail-icon: url(images/toolbarButton-viewThumbnail.svg); + --toolbarButton-viewOutline-icon: url(images/toolbarButton-viewOutline.svg); + --toolbarButton-viewAttachments-icon: url(images/toolbarButton-viewAttachments.svg); + --toolbarButton-viewLayers-icon: url(images/toolbarButton-viewLayers.svg); + --toolbarButton-search-icon: url(images/toolbarButton-search.svg); + --findbarButton-previous-icon: url(images/findbarButton-previous.svg); + --findbarButton-next-icon: url(images/findbarButton-next.svg); + --secondaryToolbarButton-firstPage-icon: url(images/secondaryToolbarButton-firstPage.svg); + --secondaryToolbarButton-lastPage-icon: url(images/secondaryToolbarButton-lastPage.svg); + --secondaryToolbarButton-rotateCcw-icon: url(images/secondaryToolbarButton-rotateCcw.svg); + --secondaryToolbarButton-rotateCw-icon: url(images/secondaryToolbarButton-rotateCw.svg); + --secondaryToolbarButton-selectTool-icon: url(images/secondaryToolbarButton-selectTool.svg); + --secondaryToolbarButton-handTool-icon: url(images/secondaryToolbarButton-handTool.svg); + --secondaryToolbarButton-scrollVertical-icon: url(images/secondaryToolbarButton-scrollVertical.svg); + --secondaryToolbarButton-scrollHorizontal-icon: url(images/secondaryToolbarButton-scrollHorizontal.svg); + --secondaryToolbarButton-scrollWrapped-icon: url(images/secondaryToolbarButton-scrollWrapped.svg); + --secondaryToolbarButton-spreadNone-icon: url(images/secondaryToolbarButton-spreadNone.svg); + --secondaryToolbarButton-spreadOdd-icon: url(images/secondaryToolbarButton-spreadOdd.svg); + --secondaryToolbarButton-spreadEven-icon: url(images/secondaryToolbarButton-spreadEven.svg); + --secondaryToolbarButton-documentProperties-icon: url(images/secondaryToolbarButton-documentProperties.svg); +} + +@media (prefers-color-scheme: dark) { + :root { + --main-color: rgba(249, 249, 250, 1); + --body-bg-color: rgba(42, 42, 46, 1); + --errorWrapper-bg-color: rgba(199, 17, 17, 1); + --progressBar-color: rgba(0, 96, 223, 1); + --progressBar-indeterminate-bg-color: rgba(40, 40, 43, 1); + --progressBar-indeterminate-blend-color: rgba(20, 68, 133, 1); + --scrollbar-color: rgba(121, 121, 123, 1); + --scrollbar-bg-color: rgba(35, 35, 39, 1); + + --sidebar-bg-color: rgba(50, 50, 52, 1); + --toolbar-bg-color: rgba(56, 56, 61, 1); + --toolbar-border-color: rgba(12, 12, 13, 1); + --button-hover-color: rgba(102, 102, 103, 1); + --toggled-btn-bg-color: rgba(0, 0, 0, 0.3); + --dropdown-btn-bg-color: rgba(74, 74, 79, 1); + --separator-color: rgba(0, 0, 0, 0.3); + --field-color: rgba(250, 250, 250, 1); + --field-bg-color: rgba(64, 64, 68, 1); + --field-border-color: rgba(115, 115, 115, 1); + --findbar-nextprevious-btn-bg-color: rgba(89, 89, 89, 1); + --outline-color: rgba(255, 255, 255, 0.8); + --outline-hover-color: rgba(255, 255, 255, 0.9); + --outline-active-color: rgba(255, 255, 255, 0.08); + --outline-active-bg-color: rgba(255, 255, 255, 1); + --sidebaritem-bg-color: rgba(255, 255, 255, 0.15); + --doorhanger-bg-color: rgba(74, 74, 79, 1); + --doorhanger-border-color: rgba(39, 39, 43, 1); + --doorhanger-hover-color: rgba(93, 94, 98, 1); + --doorhanger-separator-color: rgba(92, 92, 97, 1); + --overlay-button-bg-color: rgba(92, 92, 97, 1); + --overlay-button-hover-color: rgba(115, 115, 115, 1); + + --loading-icon: url(images/loading-dark.svg); + --treeitem-expanded-icon: url(images/treeitem-expanded-dark.svg); + --treeitem-collapsed-icon: url(images/treeitem-collapsed-dark.svg); + --toolbarButton-menuArrow-icon: url(images/toolbarButton-menuArrow-dark.svg); + --toolbarButton-sidebarToggle-icon: url(images/toolbarButton-sidebarToggle-dark.svg); + --toolbarButton-secondaryToolbarToggle-icon: url(images/toolbarButton-secondaryToolbarToggle-dark.svg); + --toolbarButton-pageUp-icon: url(images/toolbarButton-pageUp-dark.svg); + --toolbarButton-pageDown-icon: url(images/toolbarButton-pageDown-dark.svg); + --toolbarButton-zoomOut-icon: url(images/toolbarButton-zoomOut-dark.svg); + --toolbarButton-zoomIn-icon: url(images/toolbarButton-zoomIn-dark.svg); + --toolbarButton-presentationMode-icon: url(images/toolbarButton-presentationMode-dark.svg); + --toolbarButton-print-icon: url(images/toolbarButton-print-dark.svg); + --toolbarButton-openFile-icon: url(images/toolbarButton-openFile-dark.svg); + --toolbarButton-download-icon: url(images/toolbarButton-download-dark.svg); + --toolbarButton-bookmark-icon: url(images/toolbarButton-bookmark-dark.svg); + --toolbarButton-viewThumbnail-icon: url(images/toolbarButton-viewThumbnail-dark.svg); + --toolbarButton-viewOutline-icon: url(images/toolbarButton-viewOutline-dark.svg); + --toolbarButton-viewAttachments-icon: url(images/toolbarButton-viewAttachments-dark.svg); + --toolbarButton-viewLayers-icon: url(images/toolbarButton-viewLayers-dark.svg); + --toolbarButton-search-icon: url(images/toolbarButton-search-dark.svg); + --findbarButton-previous-icon: url(images/findbarButton-previous-dark.svg); + --findbarButton-next-icon: url(images/findbarButton-next-dark.svg); + --secondaryToolbarButton-firstPage-icon: url(images/secondaryToolbarButton-firstPage-dark.svg); + --secondaryToolbarButton-lastPage-icon: url(images/secondaryToolbarButton-lastPage-dark.svg); + --secondaryToolbarButton-rotateCcw-icon: url(images/secondaryToolbarButton-rotateCcw-dark.svg); + --secondaryToolbarButton-rotateCw-icon: url(images/secondaryToolbarButton-rotateCw-dark.svg); + --secondaryToolbarButton-selectTool-icon: url(images/secondaryToolbarButton-selectTool-dark.svg); + --secondaryToolbarButton-handTool-icon: url(images/secondaryToolbarButton-handTool-dark.svg); + --secondaryToolbarButton-scrollVertical-icon: url(images/secondaryToolbarButton-scrollVertical-dark.svg); + --secondaryToolbarButton-scrollHorizontal-icon: url(images/secondaryToolbarButton-scrollHorizontal-dark.svg); + --secondaryToolbarButton-scrollWrapped-icon: url(images/secondaryToolbarButton-scrollWrapped-dark.svg); + --secondaryToolbarButton-spreadNone-icon: url(images/secondaryToolbarButton-spreadNone-dark.svg); + --secondaryToolbarButton-spreadOdd-icon: url(images/secondaryToolbarButton-spreadOdd-dark.svg); + --secondaryToolbarButton-spreadEven-icon: url(images/secondaryToolbarButton-spreadEven-dark.svg); + --secondaryToolbarButton-documentProperties-icon: url(images/secondaryToolbarButton-documentProperties-dark.svg); + } } * { @@ -424,16 +569,172 @@ html { body { height: 100%; width: 100%; - background-color: rgba(64, 64, 64, 1); - background-image: url(images/texture.png); + background-color: rgba(237, 237, 240, 1); + background-color: var(--body-bg-color); +} + +@media (prefers-color-scheme: dark) { + + body { + background-color: rgba(42, 42, 46, 1); + background-color: var(--body-bg-color); + } +} + +body { + font: message-box; + outline: none; + scrollbar-color: auto auto; + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + body { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + body { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + body { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + body { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +input { + font: message-box; + outline: none; + scrollbar-color: auto auto; + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + input { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + input { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + input { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + input { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +button { + font: message-box; + outline: none; + scrollbar-color: auto auto; + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + button { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + button { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + button { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + button { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } } -body, -input, -button, select { font: message-box; outline: none; + scrollbar-color: auto auto; + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + select { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + select { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + select { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + select { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } } .hidden { @@ -567,12 +868,12 @@ select { transition-timing-function: ease; transition-timing-function: var(--sidebar-transition-timing-function); } -html[dir='ltr'] #sidebarContainer { +html[dir="ltr"] #sidebarContainer { transition-property: left; left: -200px; left: calc(0px - var(--sidebar-width)); } -html[dir='rtl'] #sidebarContainer { +html[dir="rtl"] #sidebarContainer { transition-property: right; right: -200px; right: calc(0px - var(--sidebar-width)); @@ -596,10 +897,10 @@ html[dir='rtl'] #sidebarContainer { #outerContainer.sidebarOpen #sidebarContainer { visibility: visible; } -html[dir='ltr'] #outerContainer.sidebarOpen #sidebarContainer { +html[dir="ltr"] #outerContainer.sidebarOpen #sidebarContainer { left: 0px; } -html[dir='rtl'] #outerContainer.sidebarOpen #sidebarContainer { +html[dir="rtl"] #outerContainer.sidebarOpen #sidebarContainer { right: 0px; } @@ -621,11 +922,11 @@ html[dir='rtl'] #outerContainer.sidebarOpen #sidebarContainer { width: 100%; background-color: rgba(0, 0, 0, 0.1); } -html[dir='ltr'] #sidebarContent { +html[dir="ltr"] #sidebarContent { left: 0; box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25); } -html[dir='rtl'] #sidebarContent { +html[dir="rtl"] #sidebarContent { right: 0; box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.25); } @@ -646,24 +947,22 @@ html[dir='rtl'] #sidebarContent { transition-timing-function: ease; transition-timing-function: var(--sidebar-transition-timing-function); } -html[dir='ltr'] #viewerContainer { - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05); -} -html[dir='rtl'] #viewerContainer { - box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05); -} #outerContainer.sidebarResizing #viewerContainer { /* Improve responsiveness and avoid visual glitches when the sidebar is resized. */ transition-duration: 0s; } -html[dir='ltr'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode) { +html[dir="ltr"] + #outerContainer.sidebarOpen + #viewerContainer:not(.pdfPresentationMode) { transition-property: left; left: 200px; left: var(--sidebar-width); } -html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode) { +html[dir="rtl"] + #outerContainer.sidebarOpen + #viewerContainer:not(.pdfPresentationMode) { transition-property: right; right: 200px; right: var(--sidebar-width); @@ -684,21 +983,31 @@ html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentatio #toolbarSidebar { width: 100%; height: 32px; - background-color: rgba(66, 66, 66, 1); /* fallback */ - background-image: url(images/texture.png), - linear-gradient(rgba(77, 77, 77, 0.99), rgba(64, 64, 64, 0.95)); + background-color: rgba(245, 246, 247, 1); + background-color: var(--sidebar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + #toolbarSidebar { + background-color: rgba(50, 50, 52, 1); + background-color: var(--sidebar-bg-color); + } +} +html[dir="ltr"] #toolbarSidebar { + box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(0, 0, 0, 0.15), + 0 0 1px rgba(0, 0, 0, 0.1); +} +html[dir="rtl"] #toolbarSidebar { + box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(0, 0, 0, 0.15), + 0 0 1px rgba(0, 0, 0, 0.1); } -html[dir='ltr'] #toolbarSidebar { - box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25), - inset 0 -1px 0 rgba(255, 255, 255, 0.05), - 0 1px 0 rgba(0, 0, 0, 0.15), - 0 0 1px rgba(0, 0, 0, 0.1); + +html[dir="ltr"] #toolbarSidebar .toolbarButton { + margin-right: 2px !important; } -html[dir='rtl'] #toolbarSidebar { - box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.25), - inset 0 1px 0 rgba(255, 255, 255, 0.05), - 0 1px 0 rgba(0, 0, 0, 0.15), - 0 0 1px rgba(0, 0, 0, 0.1); +html[dir="rtl"] #toolbarSidebar .toolbarButton { + margin-left: 2px !important; } #sidebarResizer { @@ -709,31 +1018,122 @@ html[dir='rtl'] #toolbarSidebar { z-index: 200; cursor: ew-resize; } -html[dir='ltr'] #sidebarResizer { +html[dir="ltr"] #sidebarResizer { right: -6px; } -html[dir='rtl'] #sidebarResizer { +html[dir="rtl"] #sidebarResizer { left: -6px; } -#toolbarContainer, .findbar, .secondaryToolbar { +#toolbarContainer { + position: relative; + height: 32px; + background-color: rgba(249, 249, 250, 1); + background-color: var(--toolbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + #toolbarContainer { + background-color: rgba(56, 56, 61, 1); + background-color: var(--toolbar-bg-color); + } +} + +.findbar { + position: relative; + height: 32px; + background-color: rgba(249, 249, 250, 1); + background-color: var(--toolbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .findbar { + background-color: rgba(56, 56, 61, 1); + background-color: var(--toolbar-bg-color); + } +} + +.secondaryToolbar { position: relative; height: 32px; - background-color: rgba(71, 71, 71, 1); /* fallback */ - background-image: url(images/texture.png), - linear-gradient(rgba(82, 82, 82, 0.99), rgba(69, 69, 69, 0.95)); + background-color: rgba(249, 249, 250, 1); + background-color: var(--toolbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbar { + background-color: rgba(56, 56, 61, 1); + background-color: var(--toolbar-bg-color); + } +} +html[dir="ltr"] #toolbarContainer { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); +} +@media (prefers-color-scheme: dark) { + + html[dir="ltr"] #toolbarContainer { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } +} +.findbar { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); +} +@media (prefers-color-scheme: dark) { + + .findbar { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } +} +.secondaryToolbar { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); +} +@media (prefers-color-scheme: dark) { + + .secondaryToolbar { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } +} +html[dir="rtl"] #toolbarContainer { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); +} +@media (prefers-color-scheme: dark) { + + html[dir="rtl"] #toolbarContainer { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } +} +.findbar { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); } -html[dir='ltr'] #toolbarContainer, .findbar, .secondaryToolbar { - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.15), - inset 0 -1px 0 rgba(255, 255, 255, 0.05), - 0 1px 0 rgba(0, 0, 0, 0.15), - 0 1px 1px rgba(0, 0, 0, 0.1); +@media (prefers-color-scheme: dark) { + + .findbar { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } +} +.secondaryToolbar { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); } -html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar { - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.15), - inset 0 -1px 0 rgba(255, 255, 255, 0.05), - 0 1px 0 rgba(0, 0, 0, 0.15), - 0 1px 1px rgba(0, 0, 0, 0.1); +@media (prefers-color-scheme: dark) { + + .secondaryToolbar { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } } #toolbarViewer { @@ -744,8 +1144,26 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar { position: relative; width: 100%; height: 4px; - background-color: rgba(51, 51, 51, 1); - border-bottom: 1px solid rgba(51, 51, 51, 1); + background-color: rgba(237, 237, 240, 1); + background-color: var(--body-bg-color); + border-bottom: 1px solid rgba(204, 204, 204, 1); + border-bottom: 1px solid var(--toolbar-border-color); +} + +@media (prefers-color-scheme: dark) { + + #loadingBar { + border-bottom: 1px solid rgba(12, 12, 13, 1); + border-bottom: 1px solid var(--toolbar-border-color); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar { + background-color: rgba(42, 42, 46, 1); + background-color: var(--body-bg-color); + } } #loadingBar .progress { @@ -754,47 +1172,304 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar { left: 0; width: 0%; height: 100%; - background-color: rgba(221, 221, 221, 1); + background-color: rgba(10, 132, 255, 1); + background-color: var(--progressBar-color); overflow: hidden; transition: width 200ms; } +@media (prefers-color-scheme: dark) { + + #loadingBar .progress { + background-color: rgba(0, 96, 223, 1); + background-color: var(--progressBar-color); + } +} + @-webkit-keyframes progressIndeterminate { - 0% { left: -142px; } - 100% { left: 0; } + 0% { + left: -142px; + } + 100% { + left: 0; + } } @keyframes progressIndeterminate { - 0% { left: -142px; } - 100% { left: 0; } + 0% { + left: -142px; + } + 100% { + left: 0; + } } #loadingBar .progress.indeterminate { - background-color: rgba(153, 153, 153, 1); + background-color: rgba(221, 221, 222, 1); + background-color: var(--progressBar-indeterminate-bg-color); transition: none; } +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate { + background-color: rgba(40, 40, 43, 1); + background-color: var(--progressBar-indeterminate-bg-color); + } +} + #loadingBar .progress.indeterminate .glimmer { position: absolute; top: 0; left: 0; height: 100%; width: calc(100% + 150px); - background: repeating-linear-gradient(135deg, - rgba(187, 187, 187, 1) 0, rgba(153, 153, 153, 1) 5px, - rgba(153, 153, 153, 1) 45px, rgba(221, 221, 221, 1) 55px, - rgba(221, 221, 221, 1) 95px, rgba(187, 187, 187, 1) 100px); - -webkit-animation: progressIndeterminate 950ms linear infinite; - animation: progressIndeterminate 950ms linear infinite; -} - -.findbar, .secondaryToolbar { + background: repeating-linear-gradient( + 135deg, + rgba(116, 177, 239, 1) 0, + rgba(221, 221, 222, 1) 5px, + rgba(221, 221, 222, 1) 45px, + rgba(10, 132, 255, 1) 55px, + rgba(10, 132, 255, 1) 95px, + rgba(116, 177, 239, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + var(--progressBar-indeterminate-blend-color) 0, + var(--progressBar-indeterminate-bg-color) 5px, + var(--progressBar-indeterminate-bg-color) 45px, + var(--progressBar-color) 55px, + var(--progressBar-color) 95px, + var(--progressBar-indeterminate-blend-color) 100px + ); + -webkit-animation: progressIndeterminate 1s linear infinite; + animation: progressIndeterminate 1s linear infinite; +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + var(--progressBar-indeterminate-blend-color) 0, + var(--progressBar-indeterminate-bg-color) 5px, + var(--progressBar-indeterminate-bg-color) 45px, + var(--progressBar-color) 55px, + var(--progressBar-color) 95px, + var(--progressBar-indeterminate-blend-color) 100px + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + var(--progressBar-indeterminate-blend-color) 0, + var(--progressBar-indeterminate-bg-color) 5px, + var(--progressBar-indeterminate-bg-color) 45px, + var(--progressBar-color) 55px, + var(--progressBar-color) 95px, + var(--progressBar-indeterminate-blend-color) 100px + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + var(--progressBar-indeterminate-blend-color) 0, + var(--progressBar-indeterminate-bg-color) 5px, + var(--progressBar-indeterminate-bg-color) 45px, + var(--progressBar-color) 55px, + var(--progressBar-color) 95px, + var(--progressBar-indeterminate-blend-color) 100px + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + var(--progressBar-indeterminate-blend-color) 0, + var(--progressBar-indeterminate-bg-color) 5px, + var(--progressBar-indeterminate-bg-color) 45px, + var(--progressBar-color) 55px, + var(--progressBar-color) 95px, + var(--progressBar-indeterminate-blend-color) 100px + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + var(--progressBar-indeterminate-blend-color) 0, + var(--progressBar-indeterminate-bg-color) 5px, + var(--progressBar-indeterminate-bg-color) 45px, + var(--progressBar-color) 55px, + var(--progressBar-color) 95px, + var(--progressBar-indeterminate-blend-color) 100px + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + var(--progressBar-indeterminate-blend-color) 0, + var(--progressBar-indeterminate-bg-color) 5px, + var(--progressBar-indeterminate-bg-color) 45px, + var(--progressBar-color) 55px, + var(--progressBar-color) 95px, + var(--progressBar-indeterminate-blend-color) 100px + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + var(--progressBar-indeterminate-blend-color) 0, + var(--progressBar-indeterminate-bg-color) 5px, + var(--progressBar-indeterminate-bg-color) 45px, + var(--progressBar-color) 55px, + var(--progressBar-color) 95px, + var(--progressBar-indeterminate-blend-color) 100px + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + var(--progressBar-indeterminate-blend-color) 0, + var(--progressBar-indeterminate-bg-color) 5px, + var(--progressBar-indeterminate-bg-color) 45px, + var(--progressBar-color) 55px, + var(--progressBar-color) 95px, + var(--progressBar-indeterminate-blend-color) 100px + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + var(--progressBar-indeterminate-blend-color) 0, + var(--progressBar-indeterminate-bg-color) 5px, + var(--progressBar-indeterminate-bg-color) 45px, + var(--progressBar-color) 55px, + var(--progressBar-color) 95px, + var(--progressBar-indeterminate-blend-color) 100px + ); + } +} + +.findbar, +.secondaryToolbar { top: 32px; position: absolute; z-index: 10000; height: auto; min-width: 16px; - padding: 0px 6px 0px 6px; + padding: 0px 4px 0px 4px; margin: 4px 2px 4px 2px; color: rgba(217, 217, 217, 1); font-size: 12px; @@ -805,6 +1480,16 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar { .findbar { min-width: 300px; + background-color: rgba(249, 249, 250, 1); + background-color: var(--toolbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .findbar { + background-color: rgba(56, 56, 61, 1); + background-color: var(--toolbar-bg-color); + } } .findbar > div { height: 32px; @@ -815,11 +1500,114 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar { .findbar.wrapContainers > div#findbarMessageContainer { height: auto; } -html[dir='ltr'] .findbar { - left: 68px; +html[dir="ltr"] .findbar { + left: 64px; +} +html[dir="rtl"] .findbar { + right: 64px; +} + +html[dir="ltr"] .findbar .splitToolbarButton { + margin-left: 0px; + margin-top: 3px; +} + +html[dir="rtl"] .findbar .splitToolbarButton { + margin-right: 0px; + margin-top: 3px; +} + +.findbar .splitToolbarButton .findNext { + width: 29px; +} + +html[dir="ltr"] .findbar .splitToolbarButton .findNext { + border-right: 1px solid rgba(187, 187, 188, 1); + border-right: 1px solid var(--field-border-color); +} + +@media (prefers-color-scheme: dark) { + + html[dir="ltr"] .findbar .splitToolbarButton .findNext { + border-right: 1px solid rgba(115, 115, 115, 1); + border-right: 1px solid var(--field-border-color); + } +} + +html[dir="rtl"] .findbar .splitToolbarButton .findNext { + border-left: 1px solid rgba(187, 187, 188, 1); + border-left: 1px solid var(--field-border-color); +} + +@media (prefers-color-scheme: dark) { + + html[dir="rtl"] .findbar .splitToolbarButton .findNext { + border-left: 1px solid rgba(115, 115, 115, 1); + border-left: 1px solid var(--field-border-color); + } +} + +.findbar .splitToolbarButton .toolbarButton { + background-color: rgba(227, 228, 230, 1); + background-color: var(--findbar-nextprevious-btn-bg-color); + border-radius: 0px; + height: 26px; + border-top: 1px solid rgba(187, 187, 188, 1); + border-top: 1px solid var(--field-border-color); + border-bottom: 1px solid rgba(187, 187, 188, 1); + border-bottom: 1px solid var(--field-border-color); +} + +@media (prefers-color-scheme: dark) { + + .findbar .splitToolbarButton .toolbarButton { + border-bottom: 1px solid rgba(115, 115, 115, 1); + border-bottom: 1px solid var(--field-border-color); + } +} + +@media (prefers-color-scheme: dark) { + + .findbar .splitToolbarButton .toolbarButton { + border-top: 1px solid rgba(115, 115, 115, 1); + border-top: 1px solid var(--field-border-color); + } +} + +@media (prefers-color-scheme: dark) { + + .findbar .splitToolbarButton .toolbarButton { + background-color: rgba(89, 89, 89, 1); + background-color: var(--findbar-nextprevious-btn-bg-color); + } +} + +.findbar .splitToolbarButton .toolbarButton::before { + top: 5px; +} + +html[dir="ltr"] .findbar .splitToolbarButton > .findPrevious { + border-radius: 0; +} +html[dir="ltr"] .findbar .splitToolbarButton > .findNext { + border-bottom-left-radius: 0; + border-bottom-right-radius: 2px; + border-top-left-radius: 0; + border-top-right-radius: 2px; +} + +html[dir="rtl"] .findbar .splitToolbarButton > .findPrevious { + border-radius: 0; +} +html[dir="rtl"] .findbar .splitToolbarButton > .findNext { + border-bottom-left-radius: 2px; + border-bottom-right-radius: 0; + border-top-left-radius: 2px; + border-top-right-radius: 0; } -html[dir='rtl'] .findbar { - right: 68px; + +.findbar input[type="checkbox"] { + pointer-events: none; } .findbar label { @@ -829,6 +1617,55 @@ html[dir='rtl'] .findbar { user-select: none; } +.findbar label:hover { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .findbar label:hover { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + +.findbar input:focus + label { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .findbar input:focus + label { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + +html[dir="ltr"] #findInput { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +html[dir="rtl"] #findInput { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.findbar .toolbarField[type="checkbox"]:checked + .toolbarLabel { + background-color: rgba(0, 0, 0, 0.3) !important; + background-color: var(--toggled-btn-bg-color) !important; +} + +@media (prefers-color-scheme: dark) { + + .findbar .toolbarField[type="checkbox"]:checked + .toolbarLabel { + background-color: rgba(0, 0, 0, 0.3) !important; + background-color: var(--toggled-btn-bg-color) !important; + } +} + #findInput { width: 200px; } @@ -836,40 +1673,58 @@ html[dir='rtl'] .findbar { color: rgba(191, 191, 191, 1); } #findInput::-moz-placeholder { - font-style: italic; + font-style: normal; } #findInput:-ms-input-placeholder { - font-style: italic; + font-style: normal; } #findInput::-ms-input-placeholder { - font-style: italic; + font-style: normal; } #findInput::placeholder { - font-style: italic; + font-style: normal; } #findInput[data-status="pending"] { - background-image: url(images/loading-small.png); + background-image: url(images/loading.svg); + background-image: var(--loading-icon); background-repeat: no-repeat; - background-position: right; + background-position: 98%; +} +@media (prefers-color-scheme: dark) { + + #findInput[data-status="pending"] { + background-image: url(images/loading-dark.svg); + background-image: var(--loading-icon); + } } -html[dir='rtl'] #findInput[data-status="pending"] { - background-position: left; +html[dir="rtl"] #findInput[data-status="pending"] { + background-position: 3px; } .secondaryToolbar { - padding: 6px; + padding: 6px 0 10px 0; height: auto; z-index: 30000; + background-color: rgba(255, 255, 255, 1); + background-color: var(--doorhanger-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbar { + background-color: rgba(74, 74, 79, 1); + background-color: var(--doorhanger-bg-color); + } } -html[dir='ltr'] .secondaryToolbar { +html[dir="ltr"] .secondaryToolbar { right: 4px; } -html[dir='rtl'] .secondaryToolbar { +html[dir="rtl"] .secondaryToolbar { left: 4px; } #secondaryToolbarButtonContainer { - max-width: 200px; + max-width: 220px; max-height: 400px; overflow-y: auto; -webkit-overflow-scrolling: touch; @@ -881,14 +1736,45 @@ html[dir='rtl'] .secondaryToolbar { display: none !important; } -.doorHanger, +.doorHanger { + border-radius: 2px; + box-shadow: 0 1px 5px rgba(12, 12, 13, 0.2), + 0 0 0 1px rgba(12, 12, 13, 0.2); + box-shadow: 0 1px 5px var(--doorhanger-border-color), + 0 0 0 1px var(--doorhanger-border-color); +} + +@media (prefers-color-scheme: dark) { + + .doorHanger { + box-shadow: 0 1px 5px rgba(39, 39, 43, 1), + 0 0 0 1px rgba(39, 39, 43, 1); + box-shadow: 0 1px 5px var(--doorhanger-border-color), + 0 0 0 1px var(--doorhanger-border-color); + } +} + .doorHangerRight { - border: 1px solid rgba(0, 0, 0, 0.5); border-radius: 2px; - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + box-shadow: 0 1px 5px rgba(12, 12, 13, 0.2), + 0 0 0 1px rgba(12, 12, 13, 0.2); + box-shadow: 0 1px 5px var(--doorhanger-border-color), + 0 0 0 1px var(--doorhanger-border-color); } -.doorHanger:after, .doorHanger:before, -.doorHangerRight:after, .doorHangerRight:before { + +@media (prefers-color-scheme: dark) { + + .doorHangerRight { + box-shadow: 0 1px 5px rgba(39, 39, 43, 1), + 0 0 0 1px rgba(39, 39, 43, 1); + box-shadow: 0 1px 5px var(--doorhanger-border-color), + 0 0 0 1px var(--doorhanger-border-color); + } +} +.doorHanger:after, +.doorHanger:before, +.doorHangerRight:after, +.doorHangerRight:before { bottom: 100%; border: solid rgba(0, 0, 0, 0); content: " "; @@ -899,36 +1785,76 @@ html[dir='rtl'] .secondaryToolbar { } .doorHanger:after, .doorHangerRight:after { - border-bottom-color: rgba(82, 82, 82, 0.99); border-width: 8px; } -.doorHanger:before, +.doorHanger:after { + border-bottom-color: rgba(249, 249, 250, 1); + border-bottom-color: var(--toolbar-bg-color); +} +@media (prefers-color-scheme: dark) { + + .doorHanger:after { + border-bottom-color: rgba(56, 56, 61, 1); + border-bottom-color: var(--toolbar-bg-color); + } +} +.doorHangerRight:after { + border-bottom-color: rgba(255, 255, 255, 1); + border-bottom-color: var(--doorhanger-bg-color); +} +@media (prefers-color-scheme: dark) { + + .doorHangerRight:after { + border-bottom-color: rgba(74, 74, 79, 1); + border-bottom-color: var(--doorhanger-bg-color); + } +} +.doorHanger:before { + border-bottom-color: rgba(12, 12, 13, 0.2); + border-bottom-color: var(--doorhanger-border-color); + border-width: 9px; +} +@media (prefers-color-scheme: dark) { + + .doorHanger:before { + border-bottom-color: rgba(39, 39, 43, 1); + border-bottom-color: var(--doorhanger-border-color); + } +} .doorHangerRight:before { - border-bottom-color: rgba(0, 0, 0, 0.5); + border-bottom-color: rgba(12, 12, 13, 0.2); + border-bottom-color: var(--doorhanger-border-color); border-width: 9px; } +@media (prefers-color-scheme: dark) { -html[dir='ltr'] .doorHanger:after, -html[dir='rtl'] .doorHangerRight:after { - left: 13px; + .doorHangerRight:before { + border-bottom-color: rgba(39, 39, 43, 1); + border-bottom-color: var(--doorhanger-border-color); + } +} + +html[dir="ltr"] .doorHanger:after, +html[dir="rtl"] .doorHangerRight:after { + left: 10px; margin-left: -8px; } -html[dir='ltr'] .doorHanger:before, -html[dir='rtl'] .doorHangerRight:before { - left: 13px; +html[dir="ltr"] .doorHanger:before, +html[dir="rtl"] .doorHangerRight:before { + left: 10px; margin-left: -9px; } -html[dir='rtl'] .doorHanger:after, -html[dir='ltr'] .doorHangerRight:after { - right: 13px; +html[dir="rtl"] .doorHanger:after, +html[dir="ltr"] .doorHangerRight:after { + right: 10px; margin-right: -8px; } -html[dir='rtl'] .doorHanger:before, -html[dir='ltr'] .doorHangerRight:before { - right: 13px; +html[dir="rtl"] .doorHanger:before, +html[dir="ltr"] .doorHangerRight:before { + right: 10px; margin-right: -9px; } @@ -937,11 +1863,11 @@ html[dir='ltr'] .doorHangerRight:before { color: rgba(82, 82, 82, 1); text-align: center; padding: 3px 4px; + margin: 5px; } #findMsg { - font-style: italic; - color: rgba(166, 183, 208, 1); + color: rgba(251, 0, 0, 1); } #findMsg:empty { display: none; @@ -957,43 +1883,43 @@ html[dir='ltr'] .doorHangerRight:before { transform: translateX(-50%); } -html[dir='ltr'] #toolbarViewerLeft, -html[dir='rtl'] #toolbarViewerRight { +html[dir="ltr"] #toolbarViewerLeft, +html[dir="rtl"] #toolbarViewerRight { float: left; } -html[dir='ltr'] #toolbarViewerRight, -html[dir='rtl'] #toolbarViewerLeft { +html[dir="ltr"] #toolbarViewerRight, +html[dir="rtl"] #toolbarViewerLeft { float: right; } -html[dir='ltr'] #toolbarViewerLeft > *, -html[dir='ltr'] #toolbarViewerMiddle > *, -html[dir='ltr'] #toolbarViewerRight > *, -html[dir='ltr'] .findbar * { +html[dir="ltr"] #toolbarViewerLeft > *, +html[dir="ltr"] #toolbarViewerMiddle > *, +html[dir="ltr"] #toolbarViewerRight > *, +html[dir="ltr"] .findbar * { position: relative; float: left; } -html[dir='rtl'] #toolbarViewerLeft > *, -html[dir='rtl'] #toolbarViewerMiddle > *, -html[dir='rtl'] #toolbarViewerRight > *, -html[dir='rtl'] .findbar * { +html[dir="rtl"] #toolbarViewerLeft > *, +html[dir="rtl"] #toolbarViewerMiddle > *, +html[dir="rtl"] #toolbarViewerRight > *, +html[dir="rtl"] .findbar * { position: relative; float: right; } -html[dir='ltr'] .splitToolbarButton { - margin: 3px 2px 4px 0; +html[dir="ltr"] .splitToolbarButton { + margin: 2px 2px 0; display: inline-block; } -html[dir='rtl'] .splitToolbarButton { - margin: 3px 0 4px 2px; +html[dir="rtl"] .splitToolbarButton { + margin: 2px 2px 0; display: inline-block; } -html[dir='ltr'] .splitToolbarButton > .toolbarButton { - border-radius: 0; +html[dir="ltr"] .splitToolbarButton > .toolbarButton { + border-radius: 2px; float: left; } -html[dir='rtl'] .splitToolbarButton > .toolbarButton { - border-radius: 0; +html[dir="rtl"] .splitToolbarButton > .toolbarButton { + border-radius: 2px; float: right; } @@ -1002,8 +1928,45 @@ html[dir='rtl'] .splitToolbarButton > .toolbarButton { .overlayButton { border: 0 none; background: none; - width: 32px; - height: 25px; + width: 28px; + height: 28px; +} +.overlayButton { + background-color: rgba(12, 12, 13, 0.1); + background-color: var(--overlay-button-bg-color); +} +@media (prefers-color-scheme: dark) { + + .overlayButton { + background-color: rgba(92, 92, 97, 1); + background-color: var(--overlay-button-bg-color); + } +} + +.overlayButton:hover { + background-color: rgba(12, 12, 13, 0.3); + background-color: var(--overlay-button-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .overlayButton:hover { + background-color: rgba(115, 115, 115, 1); + background-color: var(--overlay-button-hover-color); + } +} + +.overlayButton:focus { + background-color: rgba(12, 12, 13, 0.3); + background-color: var(--overlay-button-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .overlayButton:focus { + background-color: rgba(115, 115, 115, 1); + background-color: var(--overlay-button-hover-color); + } } .toolbarButton > span { @@ -1016,94 +1979,219 @@ html[dir='rtl'] .splitToolbarButton > .toolbarButton { .toolbarButton[disabled], .secondaryToolbarButton[disabled], .overlayButton[disabled] { - opacity: .5; + opacity: 0.5; } .splitToolbarButton.toggled .toolbarButton { margin: 0; } -.splitToolbarButton:hover > .toolbarButton, -.splitToolbarButton:focus > .toolbarButton, -.splitToolbarButton.toggled > .toolbarButton, -.toolbarButton.textButton { - background-color: rgba(0, 0, 0, 0.12); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, 0.35); - border-color: rgba(0, 0, 0, 0.32) rgba(0, 0, 0, 0.38) rgba(0, 0, 0, 0.42); - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, - 0 0 1px rgba(255, 255, 255, 0.15) inset, - 0 1px 0 rgba(255, 255, 255, 0.05); -} -.splitToolbarButton > .toolbarButton:hover, -.splitToolbarButton > .toolbarButton:focus, -.dropdownToolbarButton:hover, -.overlayButton:hover, -.overlayButton:focus, -.toolbarButton.textButton:hover, -.toolbarButton.textButton:focus { - background-color: rgba(0,0,0,0.2); - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, - 0 0 1px rgba(255, 255, 255, 0.15) inset, - 0 0 1px rgba(0, 0, 0, 0.05); +.splitToolbarButton > .toolbarButton:hover { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); + z-index: 199; +} + +@media (prefers-color-scheme: dark) { + + .splitToolbarButton > .toolbarButton:hover { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + +.splitToolbarButton > .toolbarButton:focus { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); z-index: 199; } + +@media (prefers-color-scheme: dark) { + + .splitToolbarButton > .toolbarButton:focus { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + .dropdownToolbarButton:hover { - background-color: rgba(0, 0, 0, 0.26); + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); + z-index: 199; +} + +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton:hover { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + +.toolbarButton.textButton:hover { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); + z-index: 199; +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.textButton:hover { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + +.toolbarButton.textButton:focus { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); + z-index: 199; +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.textButton:focus { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } } .splitToolbarButton > .toolbarButton { position: relative; } -html[dir='ltr'] .splitToolbarButton > .toolbarButton:first-child, -html[dir='rtl'] .splitToolbarButton > .toolbarButton:last-child { +html[dir="ltr"] .splitToolbarButton > .toolbarButton:first-child, +html[dir="rtl"] .splitToolbarButton > .toolbarButton:last-child { position: relative; margin: 0; - margin-right: -1px; - border-top-left-radius: 2px; - border-bottom-left-radius: 2px; - border-right-color: rgba(0, 0, 0, 0); } -html[dir='ltr'] .splitToolbarButton > .toolbarButton:last-child, -html[dir='rtl'] .splitToolbarButton > .toolbarButton:first-child { +html[dir="ltr"] .splitToolbarButton > .toolbarButton:last-child, +html[dir="rtl"] .splitToolbarButton > .toolbarButton:first-child { position: relative; margin: 0; - margin-left: -1px; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-left-color: rgba(0, 0, 0, 0); } .splitToolbarButtonSeparator { - padding: 8px 0; + padding: 10px 0; width: 1px; - background-color: rgba(0, 0, 0, 0.5); + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--separator-color); z-index: 99; - box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); display: inline-block; - margin: 5px 0; + margin: 4px 0; +} +@media (prefers-color-scheme: dark) { + + .splitToolbarButtonSeparator { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--separator-color); + } +} + +.findbar .splitToolbarButtonSeparator { + background-color: rgba(187, 187, 188, 1); + background-color: var(--field-border-color); + margin: 0; + padding: 13px 0; +} + +@media (prefers-color-scheme: dark) { + + .findbar .splitToolbarButtonSeparator { + background-color: rgba(115, 115, 115, 1); + background-color: var(--field-border-color); + } } -html[dir='ltr'] .splitToolbarButtonSeparator { + +html[dir="ltr"] .splitToolbarButtonSeparator { float: left; } -html[dir='rtl'] .splitToolbarButtonSeparator { +html[dir="rtl"] .splitToolbarButtonSeparator { float: right; } -.splitToolbarButton:hover > .splitToolbarButtonSeparator, -.splitToolbarButton.toggled > .splitToolbarButtonSeparator { - padding: 12px 0; - margin: 1px 0; - box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03); + +.toolbarButton { + min-width: 16px; + padding: 2px 6px 0; + border: none; + border-radius: 2px; + color: rgba(12, 12, 13, 1); + color: var(--main-color); + font-size: 12px; + line-height: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* Opera does not support user-select, use <... unselectable="on"> instead */ + cursor: default; + box-sizing: border-box; +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } +} + +.dropdownToolbarButton { + min-width: 16px; + padding: 2px 6px 0; + border: none; + border-radius: 2px; + color: rgba(12, 12, 13, 1); + color: var(--main-color); + font-size: 12px; + line-height: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* Opera does not support user-select, use <... unselectable="on"> instead */ + cursor: default; + box-sizing: border-box; +} + +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } +} + +.secondaryToolbarButton { + min-width: 16px; + padding: 2px 6px 0; + border: none; + border-radius: 2px; + color: rgba(12, 12, 13, 1); + color: var(--main-color); + font-size: 12px; + line-height: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* Opera does not support user-select, use <... unselectable="on"> instead */ + cursor: default; + box-sizing: border-box; +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } } -.toolbarButton, -.dropdownToolbarButton, -.secondaryToolbarButton, .overlayButton { min-width: 16px; padding: 2px 6px 0; - border: 1px solid rgba(0, 0, 0, 0); + border: none; border-radius: 2px; - color: rgba(255, 255, 255, 0.8); + color: rgba(12, 12, 13, 1); + color: var(--main-color); font-size: 12px; line-height: 14px; -webkit-user-select: none; @@ -1112,100 +2200,236 @@ html[dir='rtl'] .splitToolbarButtonSeparator { user-select: none; /* Opera does not support user-select, use <... unselectable="on"> instead */ cursor: default; + box-sizing: border-box; +} + +@media (prefers-color-scheme: dark) { + + .overlayButton { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } } -html[dir='ltr'] .toolbarButton, -html[dir='ltr'] .overlayButton, -html[dir='ltr'] .dropdownToolbarButton { - margin: 3px 2px 4px 0; +html[dir="ltr"] .toolbarButton, +html[dir="ltr"] .overlayButton, +html[dir="ltr"] .dropdownToolbarButton { + margin: 2px 1px; } -html[dir='rtl'] .toolbarButton, -html[dir='rtl'] .overlayButton, -html[dir='rtl'] .dropdownToolbarButton { - margin: 3px 0 4px 2px; +html[dir="rtl"] .toolbarButton, +html[dir="rtl"] .overlayButton, +html[dir="rtl"] .dropdownToolbarButton { + margin: 2px 1px; } -.toolbarButton:hover, -.toolbarButton:focus, -.dropdownToolbarButton, -.overlayButton, -.secondaryToolbarButton:hover, +html[dir="ltr"] #toolbarViewerLeft > .toolbarButton:first-child, +html[dir="rtl"] #toolbarViewerRight > .toolbarButton:last-child { + margin-left: 2px; +} + +html[dir="ltr"] #toolbarViewerRight > .toolbarButton:last-child, +html[dir="rtl"] #toolbarViewerLeft > .toolbarButton:first-child { + margin-right: 2px; +} +.toolbarButton:hover { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); +} +@media (prefers-color-scheme: dark) { + + .toolbarButton:hover { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} +.toolbarButton:focus { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); +} +@media (prefers-color-scheme: dark) { + + .toolbarButton:focus { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} +.secondaryToolbarButton:hover { + background-color: rgba(237, 237, 237, 1); + background-color: var(--doorhanger-hover-color); +} +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton:hover { + background-color: rgba(93, 94, 98, 1); + background-color: var(--doorhanger-hover-color); + } +} .secondaryToolbarButton:focus { - background-color: rgba(0, 0, 0, 0.12); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, 0.35); - border-color: rgba(0, 0, 0, 0.32) rgba(0, 0, 0, 0.38) rgba(0, 0, 0, 0.42); - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, - 0 0 1px rgba(255, 255, 255, 0.15) inset, - 0 1px 0 rgba(255, 255, 255, 0.05); + background-color: rgba(237, 237, 237, 1); + background-color: var(--doorhanger-hover-color); } +@media (prefers-color-scheme: dark) { -.toolbarButton:hover:active, -.overlayButton:hover:active, -.dropdownToolbarButton:hover:active, -.secondaryToolbarButton:hover:active { - background-color: rgba(0, 0, 0, 0.2); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); - border-color: rgba(0, 0, 0, 0.35) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.45); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1) inset, - 0 0 1px rgba(0, 0, 0, 0.2) inset, - 0 1px 0 rgba(255, 255, 255, 0.05); + .secondaryToolbarButton:focus { + background-color: rgba(93, 94, 98, 1); + background-color: var(--doorhanger-hover-color); + } +} + +.toolbarButton.toggled { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--toggled-btn-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.toggled { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--toggled-btn-bg-color); + } +} + +.splitToolbarButton.toggled > .toolbarButton.toggled { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--toggled-btn-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .splitToolbarButton.toggled > .toolbarButton.toggled { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--toggled-btn-bg-color); + } } -.toolbarButton.toggled, -.splitToolbarButton.toggled > .toolbarButton.toggled, .secondaryToolbarButton.toggled { background-color: rgba(0, 0, 0, 0.3); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); - border-color: rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.45) rgba(0, 0, 0, 0.5); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1) inset, - 0 0 1px rgba(0, 0, 0, 0.2) inset, - 0 1px 0 rgba(255, 255, 255, 0.05); + background-color: var(--toggled-btn-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.toggled { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--toggled-btn-bg-color); + } } .toolbarButton.toggled:hover:active, .splitToolbarButton.toggled > .toolbarButton.toggled:hover:active, .secondaryToolbarButton.toggled:hover:active { background-color: rgba(0, 0, 0, 0.4); - border-color: rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.5) rgba(0, 0, 0, 0.55); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2) inset, - 0 0 1px rgba(0, 0, 0, 0.3) inset, - 0 1px 0 rgba(255, 255, 255, 0.05); } .dropdownToolbarButton { width: 140px; padding: 0; overflow: hidden; + background-color: rgba(215, 215, 219, 1); + background-color: var(--dropdown-btn-bg-color); + margin-top: 2px !important; +} + +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton { + background-color: rgba(74, 74, 79, 1); + background-color: var(--dropdown-btn-bg-color); + } } .dropdownToolbarButton::after { position: absolute; display: inline-block; - top: 4px; - content: url(images/toolbarButton-menuArrows.png); + top: 6px; + content: url(images/toolbarButton-menuArrow.svg); + content: var(--toolbarButton-menuArrow-icon); + pointer-events: none; + max-width: 16px; } -html[dir='ltr'] .dropdownToolbarButton::after { - right: 8px; +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton::after { + content: url(images/toolbarButton-menuArrow-dark.svg); + content: var(--toolbarButton-menuArrow-icon); + } } -html[dir='rtl'] .dropdownToolbarButton::after { - left: 8px; +html[dir="ltr"] .dropdownToolbarButton::after { + right: 7px; +} +html[dir="rtl"] .dropdownToolbarButton::after { + left: 7px; } .dropdownToolbarButton > select { - -webkit-appearance: none; width: 162px; - height: 23px; + height: 28px; font-size: 12px; - color: rgba(242, 242, 242, 1); + color: rgba(12, 12, 13, 1); + color: var(--main-color); margin: 0; - padding: 3px 2px 2px; + padding: 1px 0 2px; border: none; - background: rgba(0,0,0,0); /* Opera does not support 'transparent'