mol-pdf 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +168 -0
- package/lib/cafe-pdf/index.js +7 -0
- package/lib/cafe-pdf/src/CMapReaderFactory.js +18 -0
- package/lib/cafe-pdf/src/index.vue +350 -0
- package/lib/cafe-pdf/src/pdfjs-dist/CODE_OF_CONDUCT.md +15 -0
- package/lib/cafe-pdf/src/pdfjs-dist/LICENSE +177 -0
- package/lib/cafe-pdf/src/pdfjs-dist/README.md +10 -0
- package/lib/cafe-pdf/src/pdfjs-dist/bower.json +14 -0
- package/lib/cafe-pdf/src/pdfjs-dist/build/pdf.js +24893 -0
- package/lib/cafe-pdf/src/pdfjs-dist/build/pdf.js.map +1 -0
- package/lib/cafe-pdf/src/pdfjs-dist/build/pdf.min.js +1 -0
- package/lib/cafe-pdf/src/pdfjs-dist/build/pdf.worker.entry.js +17 -0
- package/lib/cafe-pdf/src/pdfjs-dist/build/pdf.worker.js +56524 -0
- package/lib/cafe-pdf/src/pdfjs-dist/build/pdf.worker.js.map +1 -0
- package/lib/cafe-pdf/src/pdfjs-dist/build/pdf.worker.min.js +1 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/78-EUC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/78-EUC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/78-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/78-RKSJ-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/78-RKSJ-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/78-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Add-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Add-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/B5-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/B5-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/B5pc-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/B5pc-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/CNS-EUC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/CNS-EUC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/CNS1-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/CNS1-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/CNS2-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/CNS2-V.bcmap +3 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/ETHK-B5-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/ETHK-B5-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/ETen-B5-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/ETen-B5-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/ETenms-B5-H.bcmap +3 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/ETenms-B5-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/EUC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/EUC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Ext-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Ext-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GB-EUC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GB-EUC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GB-H.bcmap +4 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GB-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBK-EUC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBK-EUC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBK2K-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBK2K-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBT-EUC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBT-EUC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBT-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBT-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKdla-B5-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKdla-B5-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKm314-B5-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKm314-B5-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKm471-B5-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKm471-B5-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKscs-B5-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/HKscs-B5-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Hankaku.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Hiragana.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSC-EUC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSC-EUC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSC-Johab-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSC-Johab-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Katakana.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/LICENSE +36 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/NWP-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/NWP-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/RKSJ-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/RKSJ-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/Roman.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/V.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/cmaps/WP-Symbol.bcmap +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/image_decoders/pdf.image_decoders.js +11500 -0
- package/lib/cafe-pdf/src/pdfjs-dist/image_decoders/pdf.image_decoders.js.map +1 -0
- package/lib/cafe-pdf/src/pdfjs-dist/image_decoders/pdf.image_decoders.min.js +1 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/annotation.js +1481 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/arithmetic_decoder.js +385 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/bidi.js +319 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/ccitt.js +713 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/ccitt_stream.js +81 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/cff_parser.js +1815 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/charsets.js +33 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/chunked_stream.js +756 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/cmap.js +971 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/colorspace.js +1225 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/core_utils.js +173 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/crypto.js +1663 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/document.js +869 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/encodings.js +69 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/evaluator.js +3482 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/font_renderer.js +1024 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/fonts.js +3188 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/function.js +1362 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/glyphlist.js +4556 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/image.js +686 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/image_utils.js +111 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/jbig2.js +2231 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/jbig2_stream.js +98 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/jpeg_stream.js +127 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/jpg.js +1236 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/jpx.js +2350 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/jpx_stream.js +102 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/metrics.js +2969 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/murmurhash3.js +156 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/obj.js +2453 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/operator_list.js +659 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/parser.js +1353 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/pattern.js +954 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/pdf_manager.js +389 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/primitives.js +361 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/ps_parser.js +308 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/standard_fonts.js +758 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/stream.js +1311 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/type1_parser.js +716 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/unicode.js +1899 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/worker.js +599 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/core/worker_stream.js +277 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/annotation_layer.js +1470 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/api.js +2595 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/api_compatibility.js +45 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/canvas.js +2087 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/content_disposition.js +222 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/display_utils.js +777 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/fetch_stream.js +425 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/font_loader.js +545 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/metadata.js +155 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/network.js +707 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/network_utils.js +106 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/node_stream.js +666 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/pattern_helper.js +464 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/svg.js +1779 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/text_layer.js +705 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/transport_stream.js +508 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/webgl.js +475 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/worker_options.js +31 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/display/xml_parser.js +547 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/examples/node/domstubs.js +302 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/pdf.js +103 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/pdf.worker.js +29 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/shared/compatibility.js +273 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/shared/global_scope.js +24 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/shared/is_node.js +28 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/shared/message_handler.js +488 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/shared/streams_polyfill.js +43 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/shared/util.js +973 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/annotation_spec.js +2163 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/api_spec.js +1540 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/bidi_spec.js +41 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/cff_parser_spec.js +321 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/clitests_helper.js +41 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/cmap_spec.js +359 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/colorspace_spec.js +342 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/core_utils_spec.js +191 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/crypto_spec.js +537 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/custom_spec.js +110 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/display_svg_spec.js +161 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/display_utils_spec.js +273 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/document_spec.js +42 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/encodings_spec.js +67 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/evaluator_spec.js +336 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/fetch_stream_spec.js +111 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/function_spec.js +643 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/jasmine-boot.js +139 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/message_handler_spec.js +355 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/metadata_spec.js +118 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/murmurhash3_spec.js +71 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/network_spec.js +120 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/network_utils_spec.js +349 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/node_stream_spec.js +243 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/parser_spec.js +246 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/pdf_find_controller_spec.js +230 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/pdf_find_utils_spec.js +63 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/pdf_history_spec.js +95 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/primitives_spec.js +331 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/stream_spec.js +76 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/test_utils.js +383 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/testreporter.js +102 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/type1_parser_spec.js +104 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/ui_utils_spec.js +819 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/unicode_spec.js +121 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/test/unit/util_spec.js +262 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/annotation_layer_builder.js +163 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/app.js +2453 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/app_options.js +273 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/base_viewer.js +1173 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/chromecom.js +477 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/debugger.js +726 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/download_manager.js +119 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/firefox_print_service.js +114 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/firefoxcom.js +562 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/genericcom.js +151 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/genericl10n.js +194 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/grab_to_pan.js +180 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/interfaces.js +303 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/overlay_manager.js +302 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/password_prompt.js +120 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_attachment_viewer.js +189 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_cursor_tools.js +166 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_document_properties.js +464 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_find_bar.js +260 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_find_controller.js +753 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_find_utils.js +111 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_history.js +612 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_link_service.js +502 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_outline_viewer.js +276 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_page_view.js +671 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_presentation_mode.js +473 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_print_service.js +328 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_rendering_queue.js +172 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_sidebar.js +437 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_sidebar_resizer.js +191 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_single_page_viewer.js +186 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_thumbnail_view.js +446 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_thumbnail_viewer.js +292 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_viewer.component.js +148 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/pdf_viewer.js +162 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/preferences.js +369 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/secondary_toolbar.js +365 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/text_layer_builder.js +434 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/toolbar.js +280 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/ui_utils.js +903 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/view_history.js +285 -0
- package/lib/cafe-pdf/src/pdfjs-dist/lib/web/viewer_compatibility.js +36 -0
- package/lib/cafe-pdf/src/pdfjs-dist/package.json +33 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/annotation-check.svg +11 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/annotation-comment.svg +16 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/annotation-help.svg +26 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/annotation-insert.svg +10 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/annotation-key.svg +11 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/annotation-newparagraph.svg +11 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/annotation-noicon.svg +7 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/annotation-note.svg +42 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/annotation-paragraph.svg +16 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/loading-icon.gif +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/shadow.png +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/images/texture.png +0 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/pdf_viewer.css +400 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/pdf_viewer.js +7677 -0
- package/lib/cafe-pdf/src/pdfjs-dist/web/pdf_viewer.js.map +1 -0
- package/lib/cafe-pdf/src/pdfjs-dist/webpack.js +24 -0
- package/lib/cafe-pdf/src/tree/index.vue +144 -0
- package/lib/index.js +12 -0
- package/package/7f9ebfad849b2bfdfe92.worker.js +13853 -0
- package/package/cafe-pdf.common.js +26714 -0
- package/package/cafe-pdf.common.noprefetch-78-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-78-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-78-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-78-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-78-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-78-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-78ms-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-78ms-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-83pv-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-90ms-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-90ms-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-90msp-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-90msp-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-90pv-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-90pv-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Add-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Add-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Add-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Add-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-CNS1-0-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-CNS1-1-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-CNS1-2-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-CNS1-3-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-CNS1-4-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-CNS1-5-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-CNS1-6-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-CNS1-UCS2-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-GB1-0-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-GB1-1-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-GB1-2-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-GB1-3-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-GB1-4-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-GB1-5-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-GB1-UCS2-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Japan1-0-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Japan1-1-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Japan1-2-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Japan1-3-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Japan1-4-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Japan1-5-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Japan1-6-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Japan1-UCS2-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Korea1-0-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Korea1-1-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Korea1-2-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Adobe-Korea1-UCS2-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-B5pc-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-B5pc-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-CNS-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-CNS-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-CNS1-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-CNS1-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-CNS2-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-CNS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-ETHK-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-ETHK-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-ETen-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-ETen-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-ETenms-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-ETenms-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Ext-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Ext-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Ext-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Ext-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GB-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GB-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GB-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GB-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBK-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBK-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBK2K-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBK2K-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBKp-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBKp-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBT-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBT-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBT-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBT-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBTpc-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBTpc-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBpc-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-GBpc-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKdla-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKdla-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKdlb-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKdlb-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKgccs-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKgccs-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKm314-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKm314-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKm471-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKm471-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKscs-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-HKscs-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Hankaku-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Hiragana-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSC-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSC-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSC-Johab-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSC-Johab-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSCms-UHC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSCms-UHC-HW-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSCms-UHC-HW-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSCms-UHC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSCpc-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-KSCpc-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Katakana-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-NWP-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-NWP-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-Roman-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniCNS-UCS2-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniCNS-UCS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniCNS-UTF16-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniCNS-UTF16-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniCNS-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniCNS-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniCNS-UTF8-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniCNS-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniGB-UCS2-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniGB-UCS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniGB-UTF16-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniGB-UTF16-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniGB-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniGB-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniGB-UTF8-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniGB-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS-UCS2-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS-UCS2-HW-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS-UCS2-HW-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS-UCS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS-UTF16-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS-UTF16-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS-UTF8-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS2004-UTF16-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS2004-UTF16-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS2004-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS2004-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS2004-UTF8-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJIS2004-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJISPro-UCS2-HW-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJISPro-UCS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJISPro-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJISX0213-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJISX0213-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJISX02132004-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniJISX02132004-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniKS-UCS2-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniKS-UCS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniKS-UTF16-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniKS-UTF16-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniKS-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniKS-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniKS-UTF8-H-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-UniKS-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-V-bcmap.js +11 -0
- package/package/cafe-pdf.common.noprefetch-WP-Symbol-bcmap.js +11 -0
- package/package/cafe-pdf.common.pdfjsWorker.js +230 -0
- package/package/cafe-pdf.css +1 -0
- package/package/cafe-pdf.umd.js +26724 -0
- package/package/cafe-pdf.umd.min.js +10 -0
- package/package/cafe-pdf.umd.min.noprefetch-78-EUC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-78-EUC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-78-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-78-RKSJ-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-78-RKSJ-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-78-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-78ms-RKSJ-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-78ms-RKSJ-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-83pv-RKSJ-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-90ms-RKSJ-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-90ms-RKSJ-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-90msp-RKSJ-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-90msp-RKSJ-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-90pv-RKSJ-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-90pv-RKSJ-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Add-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Add-RKSJ-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Add-RKSJ-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Add-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-CNS1-0-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-CNS1-1-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-CNS1-2-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-CNS1-3-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-CNS1-4-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-CNS1-5-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-CNS1-6-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-CNS1-UCS2-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-GB1-0-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-GB1-1-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-GB1-2-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-GB1-3-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-GB1-4-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-GB1-5-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-GB1-UCS2-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Japan1-0-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Japan1-1-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Japan1-2-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Japan1-3-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Japan1-4-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Japan1-5-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Japan1-6-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Japan1-UCS2-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Korea1-0-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Korea1-1-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Korea1-2-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Adobe-Korea1-UCS2-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-B5-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-B5-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-B5pc-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-B5pc-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-CNS-EUC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-CNS-EUC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-CNS1-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-CNS1-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-CNS2-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-CNS2-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-ETHK-B5-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-ETHK-B5-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-ETen-B5-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-ETen-B5-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-ETenms-B5-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-ETenms-B5-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-EUC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-EUC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Ext-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Ext-RKSJ-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Ext-RKSJ-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Ext-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GB-EUC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GB-EUC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GB-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GB-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBK-EUC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBK-EUC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBK2K-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBK2K-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBKp-EUC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBKp-EUC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBT-EUC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBT-EUC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBT-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBT-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBTpc-EUC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBTpc-EUC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBpc-EUC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-GBpc-EUC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKdla-B5-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKdla-B5-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKdlb-B5-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKdlb-B5-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKgccs-B5-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKgccs-B5-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKm314-B5-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKm314-B5-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKm471-B5-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKm471-B5-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKscs-B5-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-HKscs-B5-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Hankaku-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Hiragana-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSC-EUC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSC-EUC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSC-Johab-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSC-Johab-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSCms-UHC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSCms-UHC-HW-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSCms-UHC-HW-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSCms-UHC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSCpc-EUC-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-KSCpc-EUC-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Katakana-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-NWP-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-NWP-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-RKSJ-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-RKSJ-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-Roman-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniCNS-UCS2-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniCNS-UCS2-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniCNS-UTF16-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniCNS-UTF16-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniCNS-UTF32-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniCNS-UTF32-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniCNS-UTF8-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniCNS-UTF8-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniGB-UCS2-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniGB-UCS2-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniGB-UTF16-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniGB-UTF16-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniGB-UTF32-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniGB-UTF32-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniGB-UTF8-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniGB-UTF8-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS-UCS2-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS-UCS2-HW-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS-UCS2-HW-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS-UCS2-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS-UTF16-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS-UTF16-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS-UTF32-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS-UTF32-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS-UTF8-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS-UTF8-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS2004-UTF16-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS2004-UTF16-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS2004-UTF32-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS2004-UTF32-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS2004-UTF8-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJIS2004-UTF8-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJISPro-UCS2-HW-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJISPro-UCS2-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJISPro-UTF8-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJISX0213-UTF32-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJISX0213-UTF32-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJISX02132004-UTF32-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniJISX02132004-UTF32-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniKS-UCS2-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniKS-UCS2-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniKS-UTF16-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniKS-UTF16-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniKS-UTF32-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniKS-UTF32-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniKS-UTF8-H-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-UniKS-UTF8-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-V-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.noprefetch-WP-Symbol-bcmap.js +1 -0
- package/package/cafe-pdf.umd.min.pdfjsWorker.js +1 -0
- package/package/cafe-pdf.umd.noprefetch-78-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-78-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-78-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-78-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-78-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-78-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-78ms-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-78ms-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-83pv-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-90ms-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-90ms-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-90msp-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-90msp-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-90pv-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-90pv-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Add-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Add-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Add-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Add-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-CNS1-0-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-CNS1-1-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-CNS1-2-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-CNS1-3-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-CNS1-4-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-CNS1-5-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-CNS1-6-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-CNS1-UCS2-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-GB1-0-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-GB1-1-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-GB1-2-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-GB1-3-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-GB1-4-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-GB1-5-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-GB1-UCS2-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Japan1-0-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Japan1-1-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Japan1-2-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Japan1-3-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Japan1-4-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Japan1-5-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Japan1-6-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Japan1-UCS2-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Korea1-0-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Korea1-1-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Korea1-2-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Adobe-Korea1-UCS2-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-B5pc-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-B5pc-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-CNS-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-CNS-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-CNS1-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-CNS1-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-CNS2-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-CNS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-ETHK-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-ETHK-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-ETen-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-ETen-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-ETenms-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-ETenms-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Ext-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Ext-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Ext-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Ext-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GB-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GB-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GB-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GB-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBK-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBK-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBK2K-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBK2K-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBKp-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBKp-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBT-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBT-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBT-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBT-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBTpc-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBTpc-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBpc-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-GBpc-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKdla-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKdla-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKdlb-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKdlb-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKgccs-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKgccs-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKm314-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKm314-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKm471-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKm471-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKscs-B5-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-HKscs-B5-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Hankaku-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Hiragana-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSC-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSC-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSC-Johab-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSC-Johab-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSCms-UHC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSCms-UHC-HW-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSCms-UHC-HW-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSCms-UHC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSCpc-EUC-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-KSCpc-EUC-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Katakana-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-NWP-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-NWP-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-RKSJ-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-RKSJ-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-Roman-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniCNS-UCS2-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniCNS-UCS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniCNS-UTF16-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniCNS-UTF16-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniCNS-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniCNS-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniCNS-UTF8-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniCNS-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniGB-UCS2-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniGB-UCS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniGB-UTF16-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniGB-UTF16-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniGB-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniGB-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniGB-UTF8-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniGB-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS-UCS2-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS-UCS2-HW-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS-UCS2-HW-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS-UCS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS-UTF16-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS-UTF16-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS-UTF8-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS2004-UTF16-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS2004-UTF16-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS2004-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS2004-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS2004-UTF8-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJIS2004-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJISPro-UCS2-HW-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJISPro-UCS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJISPro-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJISX0213-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJISX0213-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJISX02132004-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniJISX02132004-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniKS-UCS2-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniKS-UCS2-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniKS-UTF16-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniKS-UTF16-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniKS-UTF32-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniKS-UTF32-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniKS-UTF8-H-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-UniKS-UTF8-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-V-bcmap.js +11 -0
- package/package/cafe-pdf.umd.noprefetch-WP-Symbol-bcmap.js +11 -0
- package/package/cafe-pdf.umd.pdfjsWorker.js +230 -0
- package/package/cda8beb0a7b3fc08c6f6.worker.js +10 -0
- package/package/demo.html +10 -0
- package/package.json +45 -0
@@ -0,0 +1,3482 @@
|
|
1
|
+
/**
|
2
|
+
* @licstart The following is the entire license notice for the
|
3
|
+
* Javascript code in this page
|
4
|
+
*
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
18
|
+
*
|
19
|
+
* @licend The above is the entire license notice for the
|
20
|
+
* Javascript code in this page
|
21
|
+
*/
|
22
|
+
"use strict";
|
23
|
+
|
24
|
+
Object.defineProperty(exports, "__esModule", {
|
25
|
+
value: true
|
26
|
+
});
|
27
|
+
exports.PartialEvaluator = void 0;
|
28
|
+
|
29
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
30
|
+
|
31
|
+
var _util = require("../shared/util");
|
32
|
+
|
33
|
+
var _cmap = require("./cmap");
|
34
|
+
|
35
|
+
var _primitives = require("./primitives");
|
36
|
+
|
37
|
+
var _fonts = require("./fonts");
|
38
|
+
|
39
|
+
var _encodings = require("./encodings");
|
40
|
+
|
41
|
+
var _unicode = require("./unicode");
|
42
|
+
|
43
|
+
var _standard_fonts = require("./standard_fonts");
|
44
|
+
|
45
|
+
var _pattern = require("./pattern");
|
46
|
+
|
47
|
+
var _parser = require("./parser");
|
48
|
+
|
49
|
+
var _bidi = require("./bidi");
|
50
|
+
|
51
|
+
var _colorspace = require("./colorspace");
|
52
|
+
|
53
|
+
var _stream = require("./stream");
|
54
|
+
|
55
|
+
var _glyphlist = require("./glyphlist");
|
56
|
+
|
57
|
+
var _core_utils = require("./core_utils");
|
58
|
+
|
59
|
+
var _metrics = require("./metrics");
|
60
|
+
|
61
|
+
var _function = require("./function");
|
62
|
+
|
63
|
+
var _jpeg_stream = require("./jpeg_stream");
|
64
|
+
|
65
|
+
var _murmurhash = require("./murmurhash3");
|
66
|
+
|
67
|
+
var _image_utils = require("./image_utils");
|
68
|
+
|
69
|
+
var _operator_list = require("./operator_list");
|
70
|
+
|
71
|
+
var _image = require("./image");
|
72
|
+
|
73
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
74
|
+
|
75
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
76
|
+
|
77
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
78
|
+
|
79
|
+
var PartialEvaluator = function PartialEvaluatorClosure() {
|
80
|
+
var DefaultPartialEvaluatorOptions = {
|
81
|
+
forceDataSchema: false,
|
82
|
+
maxImageSize: -1,
|
83
|
+
disableFontFace: false,
|
84
|
+
nativeImageDecoderSupport: _util.NativeImageDecoding.DECODE,
|
85
|
+
ignoreErrors: false,
|
86
|
+
isEvalSupported: true
|
87
|
+
};
|
88
|
+
|
89
|
+
function PartialEvaluator(_ref) {
|
90
|
+
var _this = this;
|
91
|
+
|
92
|
+
var xref = _ref.xref,
|
93
|
+
handler = _ref.handler,
|
94
|
+
pageIndex = _ref.pageIndex,
|
95
|
+
idFactory = _ref.idFactory,
|
96
|
+
fontCache = _ref.fontCache,
|
97
|
+
builtInCMapCache = _ref.builtInCMapCache,
|
98
|
+
_ref$options = _ref.options,
|
99
|
+
options = _ref$options === void 0 ? null : _ref$options,
|
100
|
+
pdfFunctionFactory = _ref.pdfFunctionFactory;
|
101
|
+
this.xref = xref;
|
102
|
+
this.handler = handler;
|
103
|
+
this.pageIndex = pageIndex;
|
104
|
+
this.idFactory = idFactory;
|
105
|
+
this.fontCache = fontCache;
|
106
|
+
this.builtInCMapCache = builtInCMapCache;
|
107
|
+
this.options = options || DefaultPartialEvaluatorOptions;
|
108
|
+
this.pdfFunctionFactory = pdfFunctionFactory;
|
109
|
+
this.parsingType3Font = false;
|
110
|
+
|
111
|
+
this.fetchBuiltInCMap =
|
112
|
+
/*#__PURE__*/
|
113
|
+
function () {
|
114
|
+
var _ref2 = _asyncToGenerator(
|
115
|
+
/*#__PURE__*/
|
116
|
+
_regenerator["default"].mark(function _callee(name) {
|
117
|
+
var readableStream, reader, data;
|
118
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
119
|
+
while (1) {
|
120
|
+
switch (_context.prev = _context.next) {
|
121
|
+
case 0:
|
122
|
+
if (!_this.builtInCMapCache.has(name)) {
|
123
|
+
_context.next = 2;
|
124
|
+
break;
|
125
|
+
}
|
126
|
+
|
127
|
+
return _context.abrupt("return", _this.builtInCMapCache.get(name));
|
128
|
+
|
129
|
+
case 2:
|
130
|
+
readableStream = _this.handler.sendWithStream('FetchBuiltInCMap', {
|
131
|
+
name: name
|
132
|
+
});
|
133
|
+
reader = readableStream.getReader();
|
134
|
+
_context.next = 6;
|
135
|
+
return new Promise(function (resolve, reject) {
|
136
|
+
function pump() {
|
137
|
+
reader.read().then(function (_ref3) {
|
138
|
+
var value = _ref3.value,
|
139
|
+
done = _ref3.done;
|
140
|
+
|
141
|
+
if (done) {
|
142
|
+
return;
|
143
|
+
}
|
144
|
+
|
145
|
+
resolve(value);
|
146
|
+
pump();
|
147
|
+
}, reject);
|
148
|
+
}
|
149
|
+
|
150
|
+
pump();
|
151
|
+
});
|
152
|
+
|
153
|
+
case 6:
|
154
|
+
data = _context.sent;
|
155
|
+
|
156
|
+
if (data.compressionType !== _util.CMapCompressionType.NONE) {
|
157
|
+
_this.builtInCMapCache.set(name, data);
|
158
|
+
}
|
159
|
+
|
160
|
+
return _context.abrupt("return", data);
|
161
|
+
|
162
|
+
case 9:
|
163
|
+
case "end":
|
164
|
+
return _context.stop();
|
165
|
+
}
|
166
|
+
}
|
167
|
+
}, _callee);
|
168
|
+
}));
|
169
|
+
|
170
|
+
return function (_x) {
|
171
|
+
return _ref2.apply(this, arguments);
|
172
|
+
};
|
173
|
+
}();
|
174
|
+
}
|
175
|
+
|
176
|
+
var TIME_SLOT_DURATION_MS = 20;
|
177
|
+
var CHECK_TIME_EVERY = 100;
|
178
|
+
|
179
|
+
function TimeSlotManager() {
|
180
|
+
this.reset();
|
181
|
+
}
|
182
|
+
|
183
|
+
TimeSlotManager.prototype = {
|
184
|
+
check: function TimeSlotManager_check() {
|
185
|
+
if (++this.checked < CHECK_TIME_EVERY) {
|
186
|
+
return false;
|
187
|
+
}
|
188
|
+
|
189
|
+
this.checked = 0;
|
190
|
+
return this.endTime <= Date.now();
|
191
|
+
},
|
192
|
+
reset: function TimeSlotManager_reset() {
|
193
|
+
this.endTime = Date.now() + TIME_SLOT_DURATION_MS;
|
194
|
+
this.checked = 0;
|
195
|
+
}
|
196
|
+
};
|
197
|
+
|
198
|
+
function normalizeBlendMode(value) {
|
199
|
+
if (!(0, _primitives.isName)(value)) {
|
200
|
+
return 'source-over';
|
201
|
+
}
|
202
|
+
|
203
|
+
switch (value.name) {
|
204
|
+
case 'Normal':
|
205
|
+
case 'Compatible':
|
206
|
+
return 'source-over';
|
207
|
+
|
208
|
+
case 'Multiply':
|
209
|
+
return 'multiply';
|
210
|
+
|
211
|
+
case 'Screen':
|
212
|
+
return 'screen';
|
213
|
+
|
214
|
+
case 'Overlay':
|
215
|
+
return 'overlay';
|
216
|
+
|
217
|
+
case 'Darken':
|
218
|
+
return 'darken';
|
219
|
+
|
220
|
+
case 'Lighten':
|
221
|
+
return 'lighten';
|
222
|
+
|
223
|
+
case 'ColorDodge':
|
224
|
+
return 'color-dodge';
|
225
|
+
|
226
|
+
case 'ColorBurn':
|
227
|
+
return 'color-burn';
|
228
|
+
|
229
|
+
case 'HardLight':
|
230
|
+
return 'hard-light';
|
231
|
+
|
232
|
+
case 'SoftLight':
|
233
|
+
return 'soft-light';
|
234
|
+
|
235
|
+
case 'Difference':
|
236
|
+
return 'difference';
|
237
|
+
|
238
|
+
case 'Exclusion':
|
239
|
+
return 'exclusion';
|
240
|
+
|
241
|
+
case 'Hue':
|
242
|
+
return 'hue';
|
243
|
+
|
244
|
+
case 'Saturation':
|
245
|
+
return 'saturation';
|
246
|
+
|
247
|
+
case 'Color':
|
248
|
+
return 'color';
|
249
|
+
|
250
|
+
case 'Luminosity':
|
251
|
+
return 'luminosity';
|
252
|
+
}
|
253
|
+
|
254
|
+
(0, _util.warn)('Unsupported blend mode: ' + value.name);
|
255
|
+
return 'source-over';
|
256
|
+
}
|
257
|
+
|
258
|
+
var deferred = Promise.resolve();
|
259
|
+
var TILING_PATTERN = 1,
|
260
|
+
SHADING_PATTERN = 2;
|
261
|
+
PartialEvaluator.prototype = {
|
262
|
+
clone: function clone() {
|
263
|
+
var newOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DefaultPartialEvaluatorOptions;
|
264
|
+
var newEvaluator = Object.create(this);
|
265
|
+
newEvaluator.options = newOptions;
|
266
|
+
return newEvaluator;
|
267
|
+
},
|
268
|
+
hasBlendModes: function PartialEvaluator_hasBlendModes(resources) {
|
269
|
+
if (!(0, _primitives.isDict)(resources)) {
|
270
|
+
return false;
|
271
|
+
}
|
272
|
+
|
273
|
+
var processed = Object.create(null);
|
274
|
+
|
275
|
+
if (resources.objId) {
|
276
|
+
processed[resources.objId] = true;
|
277
|
+
}
|
278
|
+
|
279
|
+
var nodes = [resources],
|
280
|
+
xref = this.xref;
|
281
|
+
|
282
|
+
while (nodes.length) {
|
283
|
+
var key, i, ii;
|
284
|
+
var node = nodes.shift();
|
285
|
+
var graphicStates = node.get('ExtGState');
|
286
|
+
|
287
|
+
if ((0, _primitives.isDict)(graphicStates)) {
|
288
|
+
var graphicStatesKeys = graphicStates.getKeys();
|
289
|
+
|
290
|
+
for (i = 0, ii = graphicStatesKeys.length; i < ii; i++) {
|
291
|
+
key = graphicStatesKeys[i];
|
292
|
+
var graphicState = graphicStates.get(key);
|
293
|
+
var bm = graphicState.get('BM');
|
294
|
+
|
295
|
+
if ((0, _primitives.isName)(bm) && bm.name !== 'Normal') {
|
296
|
+
return true;
|
297
|
+
}
|
298
|
+
}
|
299
|
+
}
|
300
|
+
|
301
|
+
var xObjects = node.get('XObject');
|
302
|
+
|
303
|
+
if (!(0, _primitives.isDict)(xObjects)) {
|
304
|
+
continue;
|
305
|
+
}
|
306
|
+
|
307
|
+
var xObjectsKeys = xObjects.getKeys();
|
308
|
+
|
309
|
+
for (i = 0, ii = xObjectsKeys.length; i < ii; i++) {
|
310
|
+
key = xObjectsKeys[i];
|
311
|
+
var xObject = xObjects.getRaw(key);
|
312
|
+
|
313
|
+
if ((0, _primitives.isRef)(xObject)) {
|
314
|
+
if (processed[xObject.toString()]) {
|
315
|
+
continue;
|
316
|
+
}
|
317
|
+
|
318
|
+
xObject = xref.fetch(xObject);
|
319
|
+
}
|
320
|
+
|
321
|
+
if (!(0, _primitives.isStream)(xObject)) {
|
322
|
+
continue;
|
323
|
+
}
|
324
|
+
|
325
|
+
if (xObject.dict.objId) {
|
326
|
+
if (processed[xObject.dict.objId]) {
|
327
|
+
continue;
|
328
|
+
}
|
329
|
+
|
330
|
+
processed[xObject.dict.objId] = true;
|
331
|
+
}
|
332
|
+
|
333
|
+
var xResources = xObject.dict.get('Resources');
|
334
|
+
|
335
|
+
if ((0, _primitives.isDict)(xResources) && (!xResources.objId || !processed[xResources.objId])) {
|
336
|
+
nodes.push(xResources);
|
337
|
+
|
338
|
+
if (xResources.objId) {
|
339
|
+
processed[xResources.objId] = true;
|
340
|
+
}
|
341
|
+
}
|
342
|
+
}
|
343
|
+
}
|
344
|
+
|
345
|
+
return false;
|
346
|
+
},
|
347
|
+
buildFormXObject: function PartialEvaluator_buildFormXObject(resources, xobj, smask, operatorList, task, initialState) {
|
348
|
+
var dict = xobj.dict;
|
349
|
+
var matrix = dict.getArray('Matrix');
|
350
|
+
var bbox = dict.getArray('BBox');
|
351
|
+
|
352
|
+
if (Array.isArray(bbox) && bbox.length === 4) {
|
353
|
+
bbox = _util.Util.normalizeRect(bbox);
|
354
|
+
} else {
|
355
|
+
bbox = null;
|
356
|
+
}
|
357
|
+
|
358
|
+
var group = dict.get('Group');
|
359
|
+
|
360
|
+
if (group) {
|
361
|
+
var groupOptions = {
|
362
|
+
matrix: matrix,
|
363
|
+
bbox: bbox,
|
364
|
+
smask: smask,
|
365
|
+
isolated: false,
|
366
|
+
knockout: false
|
367
|
+
};
|
368
|
+
var groupSubtype = group.get('S');
|
369
|
+
var colorSpace = null;
|
370
|
+
|
371
|
+
if ((0, _primitives.isName)(groupSubtype, 'Transparency')) {
|
372
|
+
groupOptions.isolated = group.get('I') || false;
|
373
|
+
groupOptions.knockout = group.get('K') || false;
|
374
|
+
|
375
|
+
if (group.has('CS')) {
|
376
|
+
colorSpace = group.get('CS');
|
377
|
+
|
378
|
+
if (colorSpace) {
|
379
|
+
colorSpace = _colorspace.ColorSpace.parse(colorSpace, this.xref, resources, this.pdfFunctionFactory);
|
380
|
+
} else {
|
381
|
+
(0, _util.warn)('buildFormXObject - invalid/non-existent Group /CS entry: ' + group.getRaw('CS'));
|
382
|
+
}
|
383
|
+
}
|
384
|
+
}
|
385
|
+
|
386
|
+
if (smask && smask.backdrop) {
|
387
|
+
colorSpace = colorSpace || _colorspace.ColorSpace.singletons.rgb;
|
388
|
+
smask.backdrop = colorSpace.getRgb(smask.backdrop, 0);
|
389
|
+
}
|
390
|
+
|
391
|
+
operatorList.addOp(_util.OPS.beginGroup, [groupOptions]);
|
392
|
+
}
|
393
|
+
|
394
|
+
operatorList.addOp(_util.OPS.paintFormXObjectBegin, [matrix, bbox]);
|
395
|
+
return this.getOperatorList({
|
396
|
+
stream: xobj,
|
397
|
+
task: task,
|
398
|
+
resources: dict.get('Resources') || resources,
|
399
|
+
operatorList: operatorList,
|
400
|
+
initialState: initialState
|
401
|
+
}).then(function () {
|
402
|
+
operatorList.addOp(_util.OPS.paintFormXObjectEnd, []);
|
403
|
+
|
404
|
+
if (group) {
|
405
|
+
operatorList.addOp(_util.OPS.endGroup, [groupOptions]);
|
406
|
+
}
|
407
|
+
});
|
408
|
+
},
|
409
|
+
buildPaintImageXObject: function () {
|
410
|
+
var _buildPaintImageXObject = _asyncToGenerator(
|
411
|
+
/*#__PURE__*/
|
412
|
+
_regenerator["default"].mark(function _callee2(_ref4) {
|
413
|
+
var _this2 = this;
|
414
|
+
|
415
|
+
var resources, image, _ref4$isInline, isInline, operatorList, cacheKey, imageCache, _ref4$forceDisableNat, forceDisableNativeImageDecoder, dict, w, h, maxImageSize, imageMask, imgData, args, width, height, bitStrideLength, imgArray, decode, softMask, mask, SMALL_IMAGE_DIMENSIONS, imageObj, nativeImageDecoderSupport, objId, nativeImageDecoder, imgPromise;
|
416
|
+
|
417
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
418
|
+
while (1) {
|
419
|
+
switch (_context2.prev = _context2.next) {
|
420
|
+
case 0:
|
421
|
+
resources = _ref4.resources, image = _ref4.image, _ref4$isInline = _ref4.isInline, isInline = _ref4$isInline === void 0 ? false : _ref4$isInline, operatorList = _ref4.operatorList, cacheKey = _ref4.cacheKey, imageCache = _ref4.imageCache, _ref4$forceDisableNat = _ref4.forceDisableNativeImageDecoder, forceDisableNativeImageDecoder = _ref4$forceDisableNat === void 0 ? false : _ref4$forceDisableNat;
|
422
|
+
dict = image.dict;
|
423
|
+
w = dict.get('Width', 'W');
|
424
|
+
h = dict.get('Height', 'H');
|
425
|
+
|
426
|
+
if (!(!(w && (0, _util.isNum)(w)) || !(h && (0, _util.isNum)(h)))) {
|
427
|
+
_context2.next = 7;
|
428
|
+
break;
|
429
|
+
}
|
430
|
+
|
431
|
+
(0, _util.warn)('Image dimensions are missing, or not numbers.');
|
432
|
+
return _context2.abrupt("return", undefined);
|
433
|
+
|
434
|
+
case 7:
|
435
|
+
maxImageSize = this.options.maxImageSize;
|
436
|
+
|
437
|
+
if (!(maxImageSize !== -1 && w * h > maxImageSize)) {
|
438
|
+
_context2.next = 11;
|
439
|
+
break;
|
440
|
+
}
|
441
|
+
|
442
|
+
(0, _util.warn)('Image exceeded maximum allowed size and was removed.');
|
443
|
+
return _context2.abrupt("return", undefined);
|
444
|
+
|
445
|
+
case 11:
|
446
|
+
imageMask = dict.get('ImageMask', 'IM') || false;
|
447
|
+
|
448
|
+
if (!imageMask) {
|
449
|
+
_context2.next = 24;
|
450
|
+
break;
|
451
|
+
}
|
452
|
+
|
453
|
+
width = dict.get('Width', 'W');
|
454
|
+
height = dict.get('Height', 'H');
|
455
|
+
bitStrideLength = width + 7 >> 3;
|
456
|
+
imgArray = image.getBytes(bitStrideLength * height, true);
|
457
|
+
decode = dict.getArray('Decode', 'D');
|
458
|
+
imgData = _image.PDFImage.createMask({
|
459
|
+
imgArray: imgArray,
|
460
|
+
width: width,
|
461
|
+
height: height,
|
462
|
+
imageIsFromDecodeStream: image instanceof _stream.DecodeStream,
|
463
|
+
inverseDecode: !!decode && decode[0] > 0
|
464
|
+
});
|
465
|
+
imgData.cached = !!cacheKey;
|
466
|
+
args = [imgData];
|
467
|
+
operatorList.addOp(_util.OPS.paintImageMaskXObject, args);
|
468
|
+
|
469
|
+
if (cacheKey) {
|
470
|
+
imageCache[cacheKey] = {
|
471
|
+
fn: _util.OPS.paintImageMaskXObject,
|
472
|
+
args: args
|
473
|
+
};
|
474
|
+
}
|
475
|
+
|
476
|
+
return _context2.abrupt("return", undefined);
|
477
|
+
|
478
|
+
case 24:
|
479
|
+
softMask = dict.get('SMask', 'SM') || false;
|
480
|
+
mask = dict.get('Mask') || false;
|
481
|
+
SMALL_IMAGE_DIMENSIONS = 200;
|
482
|
+
|
483
|
+
if (!(isInline && !softMask && !mask && !(image instanceof _jpeg_stream.JpegStream) && w + h < SMALL_IMAGE_DIMENSIONS)) {
|
484
|
+
_context2.next = 32;
|
485
|
+
break;
|
486
|
+
}
|
487
|
+
|
488
|
+
imageObj = new _image.PDFImage({
|
489
|
+
xref: this.xref,
|
490
|
+
res: resources,
|
491
|
+
image: image,
|
492
|
+
isInline: isInline,
|
493
|
+
pdfFunctionFactory: this.pdfFunctionFactory
|
494
|
+
});
|
495
|
+
imgData = imageObj.createImageData(true);
|
496
|
+
operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]);
|
497
|
+
return _context2.abrupt("return", undefined);
|
498
|
+
|
499
|
+
case 32:
|
500
|
+
nativeImageDecoderSupport = forceDisableNativeImageDecoder ? _util.NativeImageDecoding.NONE : this.options.nativeImageDecoderSupport;
|
501
|
+
objId = "img_".concat(this.idFactory.createObjId());
|
502
|
+
|
503
|
+
if (this.parsingType3Font) {
|
504
|
+
(0, _util.assert)(nativeImageDecoderSupport === _util.NativeImageDecoding.NONE, 'Type3 image resources should be completely decoded in the worker.');
|
505
|
+
objId = "".concat(this.idFactory.getDocId(), "_type3res_").concat(objId);
|
506
|
+
}
|
507
|
+
|
508
|
+
if (!(nativeImageDecoderSupport !== _util.NativeImageDecoding.NONE && !softMask && !mask && image instanceof _jpeg_stream.JpegStream && _image_utils.NativeImageDecoder.isSupported(image, this.xref, resources, this.pdfFunctionFactory))) {
|
509
|
+
_context2.next = 37;
|
510
|
+
break;
|
511
|
+
}
|
512
|
+
|
513
|
+
return _context2.abrupt("return", this.handler.sendWithPromise('obj', [objId, this.pageIndex, 'JpegStream', image.getIR(this.options.forceDataSchema)]).then(function () {
|
514
|
+
operatorList.addDependency(objId);
|
515
|
+
args = [objId, w, h];
|
516
|
+
operatorList.addOp(_util.OPS.paintJpegXObject, args);
|
517
|
+
|
518
|
+
if (cacheKey) {
|
519
|
+
imageCache[cacheKey] = {
|
520
|
+
fn: _util.OPS.paintJpegXObject,
|
521
|
+
args: args
|
522
|
+
};
|
523
|
+
}
|
524
|
+
}, function (reason) {
|
525
|
+
(0, _util.warn)('Native JPEG decoding failed -- trying to recover: ' + (reason && reason.message));
|
526
|
+
return _this2.buildPaintImageXObject({
|
527
|
+
resources: resources,
|
528
|
+
image: image,
|
529
|
+
isInline: isInline,
|
530
|
+
operatorList: operatorList,
|
531
|
+
cacheKey: cacheKey,
|
532
|
+
imageCache: imageCache,
|
533
|
+
forceDisableNativeImageDecoder: true
|
534
|
+
});
|
535
|
+
}));
|
536
|
+
|
537
|
+
case 37:
|
538
|
+
nativeImageDecoder = null;
|
539
|
+
|
540
|
+
if (nativeImageDecoderSupport === _util.NativeImageDecoding.DECODE && (image instanceof _jpeg_stream.JpegStream || mask instanceof _jpeg_stream.JpegStream || softMask instanceof _jpeg_stream.JpegStream)) {
|
541
|
+
nativeImageDecoder = new _image_utils.NativeImageDecoder({
|
542
|
+
xref: this.xref,
|
543
|
+
resources: resources,
|
544
|
+
handler: this.handler,
|
545
|
+
forceDataSchema: this.options.forceDataSchema,
|
546
|
+
pdfFunctionFactory: this.pdfFunctionFactory
|
547
|
+
});
|
548
|
+
}
|
549
|
+
|
550
|
+
operatorList.addDependency(objId);
|
551
|
+
args = [objId, w, h];
|
552
|
+
imgPromise = _image.PDFImage.buildImage({
|
553
|
+
handler: this.handler,
|
554
|
+
xref: this.xref,
|
555
|
+
res: resources,
|
556
|
+
image: image,
|
557
|
+
isInline: isInline,
|
558
|
+
nativeDecoder: nativeImageDecoder,
|
559
|
+
pdfFunctionFactory: this.pdfFunctionFactory
|
560
|
+
}).then(function (imageObj) {
|
561
|
+
var imgData = imageObj.createImageData(false);
|
562
|
+
|
563
|
+
if (_this2.parsingType3Font) {
|
564
|
+
return _this2.handler.sendWithPromise('commonobj', [objId, 'FontType3Res', imgData], [imgData.data.buffer]);
|
565
|
+
}
|
566
|
+
|
567
|
+
_this2.handler.send('obj', [objId, _this2.pageIndex, 'Image', imgData], [imgData.data.buffer]);
|
568
|
+
|
569
|
+
return undefined;
|
570
|
+
})["catch"](function (reason) {
|
571
|
+
(0, _util.warn)('Unable to decode image: ' + reason);
|
572
|
+
|
573
|
+
if (_this2.parsingType3Font) {
|
574
|
+
return _this2.handler.sendWithPromise('commonobj', [objId, 'FontType3Res', null]);
|
575
|
+
}
|
576
|
+
|
577
|
+
_this2.handler.send('obj', [objId, _this2.pageIndex, 'Image', null]);
|
578
|
+
|
579
|
+
return undefined;
|
580
|
+
});
|
581
|
+
|
582
|
+
if (!this.parsingType3Font) {
|
583
|
+
_context2.next = 45;
|
584
|
+
break;
|
585
|
+
}
|
586
|
+
|
587
|
+
_context2.next = 45;
|
588
|
+
return imgPromise;
|
589
|
+
|
590
|
+
case 45:
|
591
|
+
operatorList.addOp(_util.OPS.paintImageXObject, args);
|
592
|
+
|
593
|
+
if (cacheKey) {
|
594
|
+
imageCache[cacheKey] = {
|
595
|
+
fn: _util.OPS.paintImageXObject,
|
596
|
+
args: args
|
597
|
+
};
|
598
|
+
}
|
599
|
+
|
600
|
+
return _context2.abrupt("return", undefined);
|
601
|
+
|
602
|
+
case 48:
|
603
|
+
case "end":
|
604
|
+
return _context2.stop();
|
605
|
+
}
|
606
|
+
}
|
607
|
+
}, _callee2, this);
|
608
|
+
}));
|
609
|
+
|
610
|
+
function buildPaintImageXObject(_x2) {
|
611
|
+
return _buildPaintImageXObject.apply(this, arguments);
|
612
|
+
}
|
613
|
+
|
614
|
+
return buildPaintImageXObject;
|
615
|
+
}(),
|
616
|
+
handleSMask: function PartialEvaluator_handleSmask(smask, resources, operatorList, task, stateManager) {
|
617
|
+
var smaskContent = smask.get('G');
|
618
|
+
var smaskOptions = {
|
619
|
+
subtype: smask.get('S').name,
|
620
|
+
backdrop: smask.get('BC')
|
621
|
+
};
|
622
|
+
var transferObj = smask.get('TR');
|
623
|
+
|
624
|
+
if ((0, _function.isPDFFunction)(transferObj)) {
|
625
|
+
var transferFn = this.pdfFunctionFactory.create(transferObj);
|
626
|
+
var transferMap = new Uint8Array(256);
|
627
|
+
var tmp = new Float32Array(1);
|
628
|
+
|
629
|
+
for (var i = 0; i < 256; i++) {
|
630
|
+
tmp[0] = i / 255;
|
631
|
+
transferFn(tmp, 0, tmp, 0);
|
632
|
+
transferMap[i] = tmp[0] * 255 | 0;
|
633
|
+
}
|
634
|
+
|
635
|
+
smaskOptions.transferMap = transferMap;
|
636
|
+
}
|
637
|
+
|
638
|
+
return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone());
|
639
|
+
},
|
640
|
+
handleTilingType: function handleTilingType(fn, args, resources, pattern, patternDict, operatorList, task) {
|
641
|
+
var _this3 = this;
|
642
|
+
|
643
|
+
var tilingOpList = new _operator_list.OperatorList();
|
644
|
+
var resourcesArray = [patternDict.get('Resources'), resources];
|
645
|
+
|
646
|
+
var patternResources = _primitives.Dict.merge(this.xref, resourcesArray);
|
647
|
+
|
648
|
+
return this.getOperatorList({
|
649
|
+
stream: pattern,
|
650
|
+
task: task,
|
651
|
+
resources: patternResources,
|
652
|
+
operatorList: tilingOpList
|
653
|
+
}).then(function () {
|
654
|
+
return (0, _pattern.getTilingPatternIR)({
|
655
|
+
fnArray: tilingOpList.fnArray,
|
656
|
+
argsArray: tilingOpList.argsArray
|
657
|
+
}, patternDict, args);
|
658
|
+
}).then(function (tilingPatternIR) {
|
659
|
+
operatorList.addDependencies(tilingOpList.dependencies);
|
660
|
+
operatorList.addOp(fn, tilingPatternIR);
|
661
|
+
}, function (reason) {
|
662
|
+
if (reason instanceof _util.AbortException) {
|
663
|
+
return;
|
664
|
+
}
|
665
|
+
|
666
|
+
if (_this3.options.ignoreErrors) {
|
667
|
+
_this3.handler.send('UnsupportedFeature', {
|
668
|
+
featureId: _util.UNSUPPORTED_FEATURES.unknown
|
669
|
+
});
|
670
|
+
|
671
|
+
(0, _util.warn)("handleTilingType - ignoring pattern: \"".concat(reason, "\"."));
|
672
|
+
return;
|
673
|
+
}
|
674
|
+
|
675
|
+
throw reason;
|
676
|
+
});
|
677
|
+
},
|
678
|
+
handleSetFont: function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, operatorList, task, state) {
|
679
|
+
var _this4 = this;
|
680
|
+
|
681
|
+
var fontName;
|
682
|
+
|
683
|
+
if (fontArgs) {
|
684
|
+
fontArgs = fontArgs.slice();
|
685
|
+
fontName = fontArgs[0].name;
|
686
|
+
}
|
687
|
+
|
688
|
+
return this.loadFont(fontName, fontRef, resources).then(function (translated) {
|
689
|
+
if (!translated.font.isType3Font) {
|
690
|
+
return translated;
|
691
|
+
}
|
692
|
+
|
693
|
+
return translated.loadType3Data(_this4, resources, operatorList, task).then(function () {
|
694
|
+
return translated;
|
695
|
+
})["catch"](function (reason) {
|
696
|
+
_this4.handler.send('UnsupportedFeature', {
|
697
|
+
featureId: _util.UNSUPPORTED_FEATURES.font
|
698
|
+
});
|
699
|
+
|
700
|
+
return new TranslatedFont('g_font_error', new _fonts.ErrorFont('Type3 font load error: ' + reason), translated.font);
|
701
|
+
});
|
702
|
+
}).then(function (translated) {
|
703
|
+
state.font = translated.font;
|
704
|
+
translated.send(_this4.handler);
|
705
|
+
return translated.loadedName;
|
706
|
+
});
|
707
|
+
},
|
708
|
+
handleText: function handleText(chars, state) {
|
709
|
+
var font = state.font;
|
710
|
+
var glyphs = font.charsToGlyphs(chars);
|
711
|
+
|
712
|
+
if (font.data) {
|
713
|
+
var isAddToPathSet = !!(state.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG);
|
714
|
+
|
715
|
+
if (isAddToPathSet || state.fillColorSpace.name === 'Pattern' || font.disableFontFace || this.options.disableFontFace) {
|
716
|
+
PartialEvaluator.buildFontPaths(font, glyphs, this.handler);
|
717
|
+
}
|
718
|
+
}
|
719
|
+
|
720
|
+
return glyphs;
|
721
|
+
},
|
722
|
+
setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, stateManager) {
|
723
|
+
var _this5 = this;
|
724
|
+
|
725
|
+
var gStateObj = [];
|
726
|
+
var gStateKeys = gState.getKeys();
|
727
|
+
var promise = Promise.resolve();
|
728
|
+
|
729
|
+
var _loop = function _loop() {
|
730
|
+
var key = gStateKeys[i];
|
731
|
+
var value = gState.get(key);
|
732
|
+
|
733
|
+
switch (key) {
|
734
|
+
case 'Type':
|
735
|
+
break;
|
736
|
+
|
737
|
+
case 'LW':
|
738
|
+
case 'LC':
|
739
|
+
case 'LJ':
|
740
|
+
case 'ML':
|
741
|
+
case 'D':
|
742
|
+
case 'RI':
|
743
|
+
case 'FL':
|
744
|
+
case 'CA':
|
745
|
+
case 'ca':
|
746
|
+
gStateObj.push([key, value]);
|
747
|
+
break;
|
748
|
+
|
749
|
+
case 'Font':
|
750
|
+
promise = promise.then(function () {
|
751
|
+
return _this5.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) {
|
752
|
+
operatorList.addDependency(loadedName);
|
753
|
+
gStateObj.push([key, [loadedName, value[1]]]);
|
754
|
+
});
|
755
|
+
});
|
756
|
+
break;
|
757
|
+
|
758
|
+
case 'BM':
|
759
|
+
gStateObj.push([key, normalizeBlendMode(value)]);
|
760
|
+
break;
|
761
|
+
|
762
|
+
case 'SMask':
|
763
|
+
if ((0, _primitives.isName)(value, 'None')) {
|
764
|
+
gStateObj.push([key, false]);
|
765
|
+
break;
|
766
|
+
}
|
767
|
+
|
768
|
+
if ((0, _primitives.isDict)(value)) {
|
769
|
+
promise = promise.then(function () {
|
770
|
+
return _this5.handleSMask(value, resources, operatorList, task, stateManager);
|
771
|
+
});
|
772
|
+
gStateObj.push([key, true]);
|
773
|
+
} else {
|
774
|
+
(0, _util.warn)('Unsupported SMask type');
|
775
|
+
}
|
776
|
+
|
777
|
+
break;
|
778
|
+
|
779
|
+
case 'OP':
|
780
|
+
case 'op':
|
781
|
+
case 'OPM':
|
782
|
+
case 'BG':
|
783
|
+
case 'BG2':
|
784
|
+
case 'UCR':
|
785
|
+
case 'UCR2':
|
786
|
+
case 'TR':
|
787
|
+
case 'TR2':
|
788
|
+
case 'HT':
|
789
|
+
case 'SM':
|
790
|
+
case 'SA':
|
791
|
+
case 'AIS':
|
792
|
+
case 'TK':
|
793
|
+
(0, _util.info)('graphic state operator ' + key);
|
794
|
+
break;
|
795
|
+
|
796
|
+
default:
|
797
|
+
(0, _util.info)('Unknown graphic state operator ' + key);
|
798
|
+
break;
|
799
|
+
}
|
800
|
+
};
|
801
|
+
|
802
|
+
for (var i = 0, ii = gStateKeys.length; i < ii; i++) {
|
803
|
+
_loop();
|
804
|
+
}
|
805
|
+
|
806
|
+
return promise.then(function () {
|
807
|
+
if (gStateObj.length > 0) {
|
808
|
+
operatorList.addOp(_util.OPS.setGState, [gStateObj]);
|
809
|
+
}
|
810
|
+
});
|
811
|
+
},
|
812
|
+
loadFont: function PartialEvaluator_loadFont(fontName, font, resources) {
|
813
|
+
var _this6 = this;
|
814
|
+
|
815
|
+
function errorFont() {
|
816
|
+
return Promise.resolve(new TranslatedFont('g_font_error', new _fonts.ErrorFont('Font ' + fontName + ' is not available'), font));
|
817
|
+
}
|
818
|
+
|
819
|
+
var fontRef,
|
820
|
+
xref = this.xref;
|
821
|
+
|
822
|
+
if (font) {
|
823
|
+
if (!(0, _primitives.isRef)(font)) {
|
824
|
+
throw new Error('The "font" object should be a reference.');
|
825
|
+
}
|
826
|
+
|
827
|
+
fontRef = font;
|
828
|
+
} else {
|
829
|
+
var fontRes = resources.get('Font');
|
830
|
+
|
831
|
+
if (fontRes) {
|
832
|
+
fontRef = fontRes.getRaw(fontName);
|
833
|
+
} else {
|
834
|
+
(0, _util.warn)('fontRes not available');
|
835
|
+
return errorFont();
|
836
|
+
}
|
837
|
+
}
|
838
|
+
|
839
|
+
if (!fontRef) {
|
840
|
+
(0, _util.warn)('fontRef not available');
|
841
|
+
return errorFont();
|
842
|
+
}
|
843
|
+
|
844
|
+
if (this.fontCache.has(fontRef)) {
|
845
|
+
return this.fontCache.get(fontRef);
|
846
|
+
}
|
847
|
+
|
848
|
+
font = xref.fetchIfRef(fontRef);
|
849
|
+
|
850
|
+
if (!(0, _primitives.isDict)(font)) {
|
851
|
+
return errorFont();
|
852
|
+
}
|
853
|
+
|
854
|
+
if (font.translated) {
|
855
|
+
return font.translated;
|
856
|
+
}
|
857
|
+
|
858
|
+
var fontCapability = (0, _util.createPromiseCapability)();
|
859
|
+
var preEvaluatedFont = this.preEvaluateFont(font);
|
860
|
+
var descriptor = preEvaluatedFont.descriptor,
|
861
|
+
hash = preEvaluatedFont.hash;
|
862
|
+
var fontRefIsRef = (0, _primitives.isRef)(fontRef),
|
863
|
+
fontID;
|
864
|
+
|
865
|
+
if (fontRefIsRef) {
|
866
|
+
fontID = fontRef.toString();
|
867
|
+
}
|
868
|
+
|
869
|
+
if (hash && (0, _primitives.isDict)(descriptor)) {
|
870
|
+
if (!descriptor.fontAliases) {
|
871
|
+
descriptor.fontAliases = Object.create(null);
|
872
|
+
}
|
873
|
+
|
874
|
+
var fontAliases = descriptor.fontAliases;
|
875
|
+
|
876
|
+
if (fontAliases[hash]) {
|
877
|
+
var aliasFontRef = fontAliases[hash].aliasRef;
|
878
|
+
|
879
|
+
if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) {
|
880
|
+
this.fontCache.putAlias(fontRef, aliasFontRef);
|
881
|
+
return this.fontCache.get(fontRef);
|
882
|
+
}
|
883
|
+
} else {
|
884
|
+
fontAliases[hash] = {
|
885
|
+
fontID: _fonts.Font.getFontID()
|
886
|
+
};
|
887
|
+
}
|
888
|
+
|
889
|
+
if (fontRefIsRef) {
|
890
|
+
fontAliases[hash].aliasRef = fontRef;
|
891
|
+
}
|
892
|
+
|
893
|
+
fontID = fontAliases[hash].fontID;
|
894
|
+
}
|
895
|
+
|
896
|
+
if (fontRefIsRef) {
|
897
|
+
this.fontCache.put(fontRef, fontCapability.promise);
|
898
|
+
} else {
|
899
|
+
if (!fontID) {
|
900
|
+
fontID = this.idFactory.createObjId();
|
901
|
+
}
|
902
|
+
|
903
|
+
this.fontCache.put("id_".concat(fontID), fontCapability.promise);
|
904
|
+
}
|
905
|
+
|
906
|
+
(0, _util.assert)(fontID, 'The "fontID" must be defined.');
|
907
|
+
font.loadedName = "".concat(this.idFactory.getDocId(), "_f").concat(fontID);
|
908
|
+
font.translated = fontCapability.promise;
|
909
|
+
var translatedPromise;
|
910
|
+
|
911
|
+
try {
|
912
|
+
translatedPromise = this.translateFont(preEvaluatedFont);
|
913
|
+
} catch (e) {
|
914
|
+
translatedPromise = Promise.reject(e);
|
915
|
+
}
|
916
|
+
|
917
|
+
translatedPromise.then(function (translatedFont) {
|
918
|
+
if (translatedFont.fontType !== undefined) {
|
919
|
+
var xrefFontStats = xref.stats.fontTypes;
|
920
|
+
xrefFontStats[translatedFont.fontType] = true;
|
921
|
+
}
|
922
|
+
|
923
|
+
fontCapability.resolve(new TranslatedFont(font.loadedName, translatedFont, font));
|
924
|
+
})["catch"](function (reason) {
|
925
|
+
_this6.handler.send('UnsupportedFeature', {
|
926
|
+
featureId: _util.UNSUPPORTED_FEATURES.font
|
927
|
+
});
|
928
|
+
|
929
|
+
try {
|
930
|
+
var fontFile3 = descriptor && descriptor.get('FontFile3');
|
931
|
+
var subtype = fontFile3 && fontFile3.get('Subtype');
|
932
|
+
var fontType = (0, _fonts.getFontType)(preEvaluatedFont.type, subtype && subtype.name);
|
933
|
+
var xrefFontStats = xref.stats.fontTypes;
|
934
|
+
xrefFontStats[fontType] = true;
|
935
|
+
} catch (ex) {}
|
936
|
+
|
937
|
+
fontCapability.resolve(new TranslatedFont(font.loadedName, new _fonts.ErrorFont(reason instanceof Error ? reason.message : reason), font));
|
938
|
+
});
|
939
|
+
return fontCapability.promise;
|
940
|
+
},
|
941
|
+
buildPath: function buildPath(operatorList, fn, args) {
|
942
|
+
var parsingText = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
943
|
+
var lastIndex = operatorList.length - 1;
|
944
|
+
|
945
|
+
if (!args) {
|
946
|
+
args = [];
|
947
|
+
}
|
948
|
+
|
949
|
+
if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== _util.OPS.constructPath) {
|
950
|
+
if (parsingText) {
|
951
|
+
(0, _util.warn)("Encountered path operator \"".concat(fn, "\" inside of a text object."));
|
952
|
+
operatorList.addOp(_util.OPS.save, null);
|
953
|
+
}
|
954
|
+
|
955
|
+
operatorList.addOp(_util.OPS.constructPath, [[fn], args]);
|
956
|
+
|
957
|
+
if (parsingText) {
|
958
|
+
operatorList.addOp(_util.OPS.restore, null);
|
959
|
+
}
|
960
|
+
} else {
|
961
|
+
var opArgs = operatorList.argsArray[lastIndex];
|
962
|
+
opArgs[0].push(fn);
|
963
|
+
Array.prototype.push.apply(opArgs[1], args);
|
964
|
+
}
|
965
|
+
},
|
966
|
+
handleColorN: function () {
|
967
|
+
var _handleColorN = _asyncToGenerator(
|
968
|
+
/*#__PURE__*/
|
969
|
+
_regenerator["default"].mark(function _callee3(operatorList, fn, args, cs, patterns, resources, task) {
|
970
|
+
var patternName, pattern, dict, typeNum, color, shading, matrix;
|
971
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
972
|
+
while (1) {
|
973
|
+
switch (_context3.prev = _context3.next) {
|
974
|
+
case 0:
|
975
|
+
patternName = args[args.length - 1];
|
976
|
+
|
977
|
+
if (!((0, _primitives.isName)(patternName) && (pattern = patterns.get(patternName.name)))) {
|
978
|
+
_context3.next = 16;
|
979
|
+
break;
|
980
|
+
}
|
981
|
+
|
982
|
+
dict = (0, _primitives.isStream)(pattern) ? pattern.dict : pattern;
|
983
|
+
typeNum = dict.get('PatternType');
|
984
|
+
|
985
|
+
if (!(typeNum === TILING_PATTERN)) {
|
986
|
+
_context3.next = 9;
|
987
|
+
break;
|
988
|
+
}
|
989
|
+
|
990
|
+
color = cs.base ? cs.base.getRgb(args, 0) : null;
|
991
|
+
return _context3.abrupt("return", this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task));
|
992
|
+
|
993
|
+
case 9:
|
994
|
+
if (!(typeNum === SHADING_PATTERN)) {
|
995
|
+
_context3.next = 15;
|
996
|
+
break;
|
997
|
+
}
|
998
|
+
|
999
|
+
shading = dict.get('Shading');
|
1000
|
+
matrix = dict.getArray('Matrix');
|
1001
|
+
pattern = _pattern.Pattern.parseShading(shading, matrix, this.xref, resources, this.handler, this.pdfFunctionFactory);
|
1002
|
+
operatorList.addOp(fn, pattern.getIR());
|
1003
|
+
return _context3.abrupt("return", undefined);
|
1004
|
+
|
1005
|
+
case 15:
|
1006
|
+
throw new _util.FormatError("Unknown PatternType: ".concat(typeNum));
|
1007
|
+
|
1008
|
+
case 16:
|
1009
|
+
throw new _util.FormatError("Unknown PatternName: ".concat(patternName));
|
1010
|
+
|
1011
|
+
case 17:
|
1012
|
+
case "end":
|
1013
|
+
return _context3.stop();
|
1014
|
+
}
|
1015
|
+
}
|
1016
|
+
}, _callee3, this);
|
1017
|
+
}));
|
1018
|
+
|
1019
|
+
function handleColorN(_x3, _x4, _x5, _x6, _x7, _x8, _x9) {
|
1020
|
+
return _handleColorN.apply(this, arguments);
|
1021
|
+
}
|
1022
|
+
|
1023
|
+
return handleColorN;
|
1024
|
+
}(),
|
1025
|
+
getOperatorList: function getOperatorList(_ref5) {
|
1026
|
+
var _this7 = this;
|
1027
|
+
|
1028
|
+
var stream = _ref5.stream,
|
1029
|
+
task = _ref5.task,
|
1030
|
+
resources = _ref5.resources,
|
1031
|
+
operatorList = _ref5.operatorList,
|
1032
|
+
_ref5$initialState = _ref5.initialState,
|
1033
|
+
initialState = _ref5$initialState === void 0 ? null : _ref5$initialState;
|
1034
|
+
resources = resources || _primitives.Dict.empty;
|
1035
|
+
initialState = initialState || new EvalState();
|
1036
|
+
|
1037
|
+
if (!operatorList) {
|
1038
|
+
throw new Error('getOperatorList: missing "operatorList" parameter');
|
1039
|
+
}
|
1040
|
+
|
1041
|
+
var self = this;
|
1042
|
+
var xref = this.xref;
|
1043
|
+
var parsingText = false;
|
1044
|
+
var imageCache = Object.create(null);
|
1045
|
+
|
1046
|
+
var xobjs = resources.get('XObject') || _primitives.Dict.empty;
|
1047
|
+
|
1048
|
+
var patterns = resources.get('Pattern') || _primitives.Dict.empty;
|
1049
|
+
|
1050
|
+
var stateManager = new StateManager(initialState);
|
1051
|
+
var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
|
1052
|
+
var timeSlotManager = new TimeSlotManager();
|
1053
|
+
|
1054
|
+
function closePendingRestoreOPS(argument) {
|
1055
|
+
for (var i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) {
|
1056
|
+
operatorList.addOp(_util.OPS.restore, []);
|
1057
|
+
}
|
1058
|
+
}
|
1059
|
+
|
1060
|
+
return new Promise(function promiseBody(resolve, reject) {
|
1061
|
+
var next = function next(promise) {
|
1062
|
+
Promise.all([promise, operatorList.ready]).then(function () {
|
1063
|
+
try {
|
1064
|
+
promiseBody(resolve, reject);
|
1065
|
+
} catch (ex) {
|
1066
|
+
reject(ex);
|
1067
|
+
}
|
1068
|
+
}, reject);
|
1069
|
+
};
|
1070
|
+
|
1071
|
+
task.ensureNotTerminated();
|
1072
|
+
timeSlotManager.reset();
|
1073
|
+
var stop,
|
1074
|
+
operation = {},
|
1075
|
+
i,
|
1076
|
+
ii,
|
1077
|
+
cs;
|
1078
|
+
|
1079
|
+
while (!(stop = timeSlotManager.check())) {
|
1080
|
+
operation.args = null;
|
1081
|
+
|
1082
|
+
if (!preprocessor.read(operation)) {
|
1083
|
+
break;
|
1084
|
+
}
|
1085
|
+
|
1086
|
+
var args = operation.args;
|
1087
|
+
var fn = operation.fn;
|
1088
|
+
|
1089
|
+
switch (fn | 0) {
|
1090
|
+
case _util.OPS.paintXObject:
|
1091
|
+
var name = args[0].name;
|
1092
|
+
|
1093
|
+
if (name && imageCache[name] !== undefined) {
|
1094
|
+
operatorList.addOp(imageCache[name].fn, imageCache[name].args);
|
1095
|
+
args = null;
|
1096
|
+
continue;
|
1097
|
+
}
|
1098
|
+
|
1099
|
+
next(new Promise(function (resolveXObject, rejectXObject) {
|
1100
|
+
if (!name) {
|
1101
|
+
throw new _util.FormatError('XObject must be referred to by name.');
|
1102
|
+
}
|
1103
|
+
|
1104
|
+
var xobj = xobjs.get(name);
|
1105
|
+
|
1106
|
+
if (!xobj) {
|
1107
|
+
operatorList.addOp(fn, args);
|
1108
|
+
resolveXObject();
|
1109
|
+
return;
|
1110
|
+
}
|
1111
|
+
|
1112
|
+
if (!(0, _primitives.isStream)(xobj)) {
|
1113
|
+
throw new _util.FormatError('XObject should be a stream');
|
1114
|
+
}
|
1115
|
+
|
1116
|
+
var type = xobj.dict.get('Subtype');
|
1117
|
+
|
1118
|
+
if (!(0, _primitives.isName)(type)) {
|
1119
|
+
throw new _util.FormatError('XObject should have a Name subtype');
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
if (type.name === 'Form') {
|
1123
|
+
stateManager.save();
|
1124
|
+
self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone()).then(function () {
|
1125
|
+
stateManager.restore();
|
1126
|
+
resolveXObject();
|
1127
|
+
}, rejectXObject);
|
1128
|
+
return;
|
1129
|
+
} else if (type.name === 'Image') {
|
1130
|
+
self.buildPaintImageXObject({
|
1131
|
+
resources: resources,
|
1132
|
+
image: xobj,
|
1133
|
+
operatorList: operatorList,
|
1134
|
+
cacheKey: name,
|
1135
|
+
imageCache: imageCache
|
1136
|
+
}).then(resolveXObject, rejectXObject);
|
1137
|
+
return;
|
1138
|
+
} else if (type.name === 'PS') {
|
1139
|
+
(0, _util.info)('Ignored XObject subtype PS');
|
1140
|
+
} else {
|
1141
|
+
throw new _util.FormatError("Unhandled XObject subtype ".concat(type.name));
|
1142
|
+
}
|
1143
|
+
|
1144
|
+
resolveXObject();
|
1145
|
+
})["catch"](function (reason) {
|
1146
|
+
if (reason instanceof _util.AbortException) {
|
1147
|
+
return;
|
1148
|
+
}
|
1149
|
+
|
1150
|
+
if (self.options.ignoreErrors) {
|
1151
|
+
self.handler.send('UnsupportedFeature', {
|
1152
|
+
featureId: _util.UNSUPPORTED_FEATURES.unknown
|
1153
|
+
});
|
1154
|
+
(0, _util.warn)("getOperatorList - ignoring XObject: \"".concat(reason, "\"."));
|
1155
|
+
return;
|
1156
|
+
}
|
1157
|
+
|
1158
|
+
throw reason;
|
1159
|
+
}));
|
1160
|
+
return;
|
1161
|
+
|
1162
|
+
case _util.OPS.setFont:
|
1163
|
+
var fontSize = args[1];
|
1164
|
+
next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state).then(function (loadedName) {
|
1165
|
+
operatorList.addDependency(loadedName);
|
1166
|
+
operatorList.addOp(_util.OPS.setFont, [loadedName, fontSize]);
|
1167
|
+
}));
|
1168
|
+
return;
|
1169
|
+
|
1170
|
+
case _util.OPS.beginText:
|
1171
|
+
parsingText = true;
|
1172
|
+
break;
|
1173
|
+
|
1174
|
+
case _util.OPS.endText:
|
1175
|
+
parsingText = false;
|
1176
|
+
break;
|
1177
|
+
|
1178
|
+
case _util.OPS.endInlineImage:
|
1179
|
+
var cacheKey = args[0].cacheKey;
|
1180
|
+
|
1181
|
+
if (cacheKey) {
|
1182
|
+
var cacheEntry = imageCache[cacheKey];
|
1183
|
+
|
1184
|
+
if (cacheEntry !== undefined) {
|
1185
|
+
operatorList.addOp(cacheEntry.fn, cacheEntry.args);
|
1186
|
+
args = null;
|
1187
|
+
continue;
|
1188
|
+
}
|
1189
|
+
}
|
1190
|
+
|
1191
|
+
next(self.buildPaintImageXObject({
|
1192
|
+
resources: resources,
|
1193
|
+
image: args[0],
|
1194
|
+
isInline: true,
|
1195
|
+
operatorList: operatorList,
|
1196
|
+
cacheKey: cacheKey,
|
1197
|
+
imageCache: imageCache
|
1198
|
+
}));
|
1199
|
+
return;
|
1200
|
+
|
1201
|
+
case _util.OPS.showText:
|
1202
|
+
args[0] = self.handleText(args[0], stateManager.state);
|
1203
|
+
break;
|
1204
|
+
|
1205
|
+
case _util.OPS.showSpacedText:
|
1206
|
+
var arr = args[0];
|
1207
|
+
var combinedGlyphs = [];
|
1208
|
+
var arrLength = arr.length;
|
1209
|
+
var state = stateManager.state;
|
1210
|
+
|
1211
|
+
for (i = 0; i < arrLength; ++i) {
|
1212
|
+
var arrItem = arr[i];
|
1213
|
+
|
1214
|
+
if ((0, _util.isString)(arrItem)) {
|
1215
|
+
Array.prototype.push.apply(combinedGlyphs, self.handleText(arrItem, state));
|
1216
|
+
} else if ((0, _util.isNum)(arrItem)) {
|
1217
|
+
combinedGlyphs.push(arrItem);
|
1218
|
+
}
|
1219
|
+
}
|
1220
|
+
|
1221
|
+
args[0] = combinedGlyphs;
|
1222
|
+
fn = _util.OPS.showText;
|
1223
|
+
break;
|
1224
|
+
|
1225
|
+
case _util.OPS.nextLineShowText:
|
1226
|
+
operatorList.addOp(_util.OPS.nextLine);
|
1227
|
+
args[0] = self.handleText(args[0], stateManager.state);
|
1228
|
+
fn = _util.OPS.showText;
|
1229
|
+
break;
|
1230
|
+
|
1231
|
+
case _util.OPS.nextLineSetSpacingShowText:
|
1232
|
+
operatorList.addOp(_util.OPS.nextLine);
|
1233
|
+
operatorList.addOp(_util.OPS.setWordSpacing, [args.shift()]);
|
1234
|
+
operatorList.addOp(_util.OPS.setCharSpacing, [args.shift()]);
|
1235
|
+
args[0] = self.handleText(args[0], stateManager.state);
|
1236
|
+
fn = _util.OPS.showText;
|
1237
|
+
break;
|
1238
|
+
|
1239
|
+
case _util.OPS.setTextRenderingMode:
|
1240
|
+
stateManager.state.textRenderingMode = args[0];
|
1241
|
+
break;
|
1242
|
+
|
1243
|
+
case _util.OPS.setFillColorSpace:
|
1244
|
+
stateManager.state.fillColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources, self.pdfFunctionFactory);
|
1245
|
+
continue;
|
1246
|
+
|
1247
|
+
case _util.OPS.setStrokeColorSpace:
|
1248
|
+
stateManager.state.strokeColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources, self.pdfFunctionFactory);
|
1249
|
+
continue;
|
1250
|
+
|
1251
|
+
case _util.OPS.setFillColor:
|
1252
|
+
cs = stateManager.state.fillColorSpace;
|
1253
|
+
args = cs.getRgb(args, 0);
|
1254
|
+
fn = _util.OPS.setFillRGBColor;
|
1255
|
+
break;
|
1256
|
+
|
1257
|
+
case _util.OPS.setStrokeColor:
|
1258
|
+
cs = stateManager.state.strokeColorSpace;
|
1259
|
+
args = cs.getRgb(args, 0);
|
1260
|
+
fn = _util.OPS.setStrokeRGBColor;
|
1261
|
+
break;
|
1262
|
+
|
1263
|
+
case _util.OPS.setFillGray:
|
1264
|
+
stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.gray;
|
1265
|
+
args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0);
|
1266
|
+
fn = _util.OPS.setFillRGBColor;
|
1267
|
+
break;
|
1268
|
+
|
1269
|
+
case _util.OPS.setStrokeGray:
|
1270
|
+
stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.gray;
|
1271
|
+
args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0);
|
1272
|
+
fn = _util.OPS.setStrokeRGBColor;
|
1273
|
+
break;
|
1274
|
+
|
1275
|
+
case _util.OPS.setFillCMYKColor:
|
1276
|
+
stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.cmyk;
|
1277
|
+
args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0);
|
1278
|
+
fn = _util.OPS.setFillRGBColor;
|
1279
|
+
break;
|
1280
|
+
|
1281
|
+
case _util.OPS.setStrokeCMYKColor:
|
1282
|
+
stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.cmyk;
|
1283
|
+
args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0);
|
1284
|
+
fn = _util.OPS.setStrokeRGBColor;
|
1285
|
+
break;
|
1286
|
+
|
1287
|
+
case _util.OPS.setFillRGBColor:
|
1288
|
+
stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.rgb;
|
1289
|
+
args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0);
|
1290
|
+
break;
|
1291
|
+
|
1292
|
+
case _util.OPS.setStrokeRGBColor:
|
1293
|
+
stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.rgb;
|
1294
|
+
args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0);
|
1295
|
+
break;
|
1296
|
+
|
1297
|
+
case _util.OPS.setFillColorN:
|
1298
|
+
cs = stateManager.state.fillColorSpace;
|
1299
|
+
|
1300
|
+
if (cs.name === 'Pattern') {
|
1301
|
+
next(self.handleColorN(operatorList, _util.OPS.setFillColorN, args, cs, patterns, resources, task));
|
1302
|
+
return;
|
1303
|
+
}
|
1304
|
+
|
1305
|
+
args = cs.getRgb(args, 0);
|
1306
|
+
fn = _util.OPS.setFillRGBColor;
|
1307
|
+
break;
|
1308
|
+
|
1309
|
+
case _util.OPS.setStrokeColorN:
|
1310
|
+
cs = stateManager.state.strokeColorSpace;
|
1311
|
+
|
1312
|
+
if (cs.name === 'Pattern') {
|
1313
|
+
next(self.handleColorN(operatorList, _util.OPS.setStrokeColorN, args, cs, patterns, resources, task));
|
1314
|
+
return;
|
1315
|
+
}
|
1316
|
+
|
1317
|
+
args = cs.getRgb(args, 0);
|
1318
|
+
fn = _util.OPS.setStrokeRGBColor;
|
1319
|
+
break;
|
1320
|
+
|
1321
|
+
case _util.OPS.shadingFill:
|
1322
|
+
var shadingRes = resources.get('Shading');
|
1323
|
+
|
1324
|
+
if (!shadingRes) {
|
1325
|
+
throw new _util.FormatError('No shading resource found');
|
1326
|
+
}
|
1327
|
+
|
1328
|
+
var shading = shadingRes.get(args[0].name);
|
1329
|
+
|
1330
|
+
if (!shading) {
|
1331
|
+
throw new _util.FormatError('No shading object found');
|
1332
|
+
}
|
1333
|
+
|
1334
|
+
var shadingFill = _pattern.Pattern.parseShading(shading, null, xref, resources, self.handler, self.pdfFunctionFactory);
|
1335
|
+
|
1336
|
+
var patternIR = shadingFill.getIR();
|
1337
|
+
args = [patternIR];
|
1338
|
+
fn = _util.OPS.shadingFill;
|
1339
|
+
break;
|
1340
|
+
|
1341
|
+
case _util.OPS.setGState:
|
1342
|
+
var dictName = args[0];
|
1343
|
+
var extGState = resources.get('ExtGState');
|
1344
|
+
|
1345
|
+
if (!(0, _primitives.isDict)(extGState) || !extGState.has(dictName.name)) {
|
1346
|
+
break;
|
1347
|
+
}
|
1348
|
+
|
1349
|
+
var gState = extGState.get(dictName.name);
|
1350
|
+
next(self.setGState(resources, gState, operatorList, task, stateManager));
|
1351
|
+
return;
|
1352
|
+
|
1353
|
+
case _util.OPS.moveTo:
|
1354
|
+
case _util.OPS.lineTo:
|
1355
|
+
case _util.OPS.curveTo:
|
1356
|
+
case _util.OPS.curveTo2:
|
1357
|
+
case _util.OPS.curveTo3:
|
1358
|
+
case _util.OPS.closePath:
|
1359
|
+
case _util.OPS.rectangle:
|
1360
|
+
self.buildPath(operatorList, fn, args, parsingText);
|
1361
|
+
continue;
|
1362
|
+
|
1363
|
+
case _util.OPS.markPoint:
|
1364
|
+
case _util.OPS.markPointProps:
|
1365
|
+
case _util.OPS.beginMarkedContent:
|
1366
|
+
case _util.OPS.beginMarkedContentProps:
|
1367
|
+
case _util.OPS.endMarkedContent:
|
1368
|
+
case _util.OPS.beginCompat:
|
1369
|
+
case _util.OPS.endCompat:
|
1370
|
+
continue;
|
1371
|
+
|
1372
|
+
default:
|
1373
|
+
if (args !== null) {
|
1374
|
+
for (i = 0, ii = args.length; i < ii; i++) {
|
1375
|
+
if (args[i] instanceof _primitives.Dict) {
|
1376
|
+
break;
|
1377
|
+
}
|
1378
|
+
}
|
1379
|
+
|
1380
|
+
if (i < ii) {
|
1381
|
+
(0, _util.warn)('getOperatorList - ignoring operator: ' + fn);
|
1382
|
+
continue;
|
1383
|
+
}
|
1384
|
+
}
|
1385
|
+
|
1386
|
+
}
|
1387
|
+
|
1388
|
+
operatorList.addOp(fn, args);
|
1389
|
+
}
|
1390
|
+
|
1391
|
+
if (stop) {
|
1392
|
+
next(deferred);
|
1393
|
+
return;
|
1394
|
+
}
|
1395
|
+
|
1396
|
+
closePendingRestoreOPS();
|
1397
|
+
resolve();
|
1398
|
+
})["catch"](function (reason) {
|
1399
|
+
if (reason instanceof _util.AbortException) {
|
1400
|
+
return;
|
1401
|
+
}
|
1402
|
+
|
1403
|
+
if (_this7.options.ignoreErrors) {
|
1404
|
+
_this7.handler.send('UnsupportedFeature', {
|
1405
|
+
featureId: _util.UNSUPPORTED_FEATURES.unknown
|
1406
|
+
});
|
1407
|
+
|
1408
|
+
(0, _util.warn)("getOperatorList - ignoring errors during \"".concat(task.name, "\" ") + "task: \"".concat(reason, "\"."));
|
1409
|
+
closePendingRestoreOPS();
|
1410
|
+
return;
|
1411
|
+
}
|
1412
|
+
|
1413
|
+
throw reason;
|
1414
|
+
});
|
1415
|
+
},
|
1416
|
+
getTextContent: function getTextContent(_ref6) {
|
1417
|
+
var _this8 = this;
|
1418
|
+
|
1419
|
+
var stream = _ref6.stream,
|
1420
|
+
task = _ref6.task,
|
1421
|
+
resources = _ref6.resources,
|
1422
|
+
_ref6$stateManager = _ref6.stateManager,
|
1423
|
+
stateManager = _ref6$stateManager === void 0 ? null : _ref6$stateManager,
|
1424
|
+
_ref6$normalizeWhites = _ref6.normalizeWhitespace,
|
1425
|
+
normalizeWhitespace = _ref6$normalizeWhites === void 0 ? false : _ref6$normalizeWhites,
|
1426
|
+
_ref6$combineTextItem = _ref6.combineTextItems,
|
1427
|
+
combineTextItems = _ref6$combineTextItem === void 0 ? false : _ref6$combineTextItem,
|
1428
|
+
sink = _ref6.sink,
|
1429
|
+
_ref6$seenStyles = _ref6.seenStyles,
|
1430
|
+
seenStyles = _ref6$seenStyles === void 0 ? Object.create(null) : _ref6$seenStyles;
|
1431
|
+
resources = resources || _primitives.Dict.empty;
|
1432
|
+
stateManager = stateManager || new StateManager(new TextState());
|
1433
|
+
var WhitespaceRegexp = /\s/g;
|
1434
|
+
var textContent = {
|
1435
|
+
items: [],
|
1436
|
+
styles: Object.create(null)
|
1437
|
+
};
|
1438
|
+
var textContentItem = {
|
1439
|
+
initialized: false,
|
1440
|
+
str: [],
|
1441
|
+
width: 0,
|
1442
|
+
height: 0,
|
1443
|
+
vertical: false,
|
1444
|
+
lastAdvanceWidth: 0,
|
1445
|
+
lastAdvanceHeight: 0,
|
1446
|
+
textAdvanceScale: 0,
|
1447
|
+
spaceWidth: 0,
|
1448
|
+
fakeSpaceMin: Infinity,
|
1449
|
+
fakeMultiSpaceMin: Infinity,
|
1450
|
+
fakeMultiSpaceMax: -0,
|
1451
|
+
textRunBreakAllowed: false,
|
1452
|
+
transform: null,
|
1453
|
+
fontName: null
|
1454
|
+
};
|
1455
|
+
var SPACE_FACTOR = 0.3;
|
1456
|
+
var MULTI_SPACE_FACTOR = 1.5;
|
1457
|
+
var MULTI_SPACE_FACTOR_MAX = 4;
|
1458
|
+
var self = this;
|
1459
|
+
var xref = this.xref;
|
1460
|
+
var xobjs = null;
|
1461
|
+
var skipEmptyXObjs = Object.create(null);
|
1462
|
+
var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
|
1463
|
+
var textState;
|
1464
|
+
|
1465
|
+
function ensureTextContentItem() {
|
1466
|
+
if (textContentItem.initialized) {
|
1467
|
+
return textContentItem;
|
1468
|
+
}
|
1469
|
+
|
1470
|
+
var font = textState.font;
|
1471
|
+
|
1472
|
+
if (!(font.loadedName in seenStyles)) {
|
1473
|
+
seenStyles[font.loadedName] = true;
|
1474
|
+
textContent.styles[font.loadedName] = {
|
1475
|
+
fontFamily: font.fallbackName,
|
1476
|
+
ascent: font.ascent,
|
1477
|
+
descent: font.descent,
|
1478
|
+
vertical: !!font.vertical
|
1479
|
+
};
|
1480
|
+
}
|
1481
|
+
|
1482
|
+
textContentItem.fontName = font.loadedName;
|
1483
|
+
var tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise];
|
1484
|
+
|
1485
|
+
if (font.isType3Font && textState.fontSize <= 1 && !(0, _util.isArrayEqual)(textState.fontMatrix, _util.FONT_IDENTITY_MATRIX)) {
|
1486
|
+
var glyphHeight = font.bbox[3] - font.bbox[1];
|
1487
|
+
|
1488
|
+
if (glyphHeight > 0) {
|
1489
|
+
tsm[3] *= glyphHeight * textState.fontMatrix[3];
|
1490
|
+
}
|
1491
|
+
}
|
1492
|
+
|
1493
|
+
var trm = _util.Util.transform(textState.ctm, _util.Util.transform(textState.textMatrix, tsm));
|
1494
|
+
|
1495
|
+
textContentItem.transform = trm;
|
1496
|
+
|
1497
|
+
if (!font.vertical) {
|
1498
|
+
textContentItem.width = 0;
|
1499
|
+
textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]);
|
1500
|
+
textContentItem.vertical = false;
|
1501
|
+
} else {
|
1502
|
+
textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]);
|
1503
|
+
textContentItem.height = 0;
|
1504
|
+
textContentItem.vertical = true;
|
1505
|
+
}
|
1506
|
+
|
1507
|
+
var a = textState.textLineMatrix[0];
|
1508
|
+
var b = textState.textLineMatrix[1];
|
1509
|
+
var scaleLineX = Math.sqrt(a * a + b * b);
|
1510
|
+
a = textState.ctm[0];
|
1511
|
+
b = textState.ctm[1];
|
1512
|
+
var scaleCtmX = Math.sqrt(a * a + b * b);
|
1513
|
+
textContentItem.textAdvanceScale = scaleCtmX * scaleLineX;
|
1514
|
+
textContentItem.lastAdvanceWidth = 0;
|
1515
|
+
textContentItem.lastAdvanceHeight = 0;
|
1516
|
+
var spaceWidth = font.spaceWidth / 1000 * textState.fontSize;
|
1517
|
+
|
1518
|
+
if (spaceWidth) {
|
1519
|
+
textContentItem.spaceWidth = spaceWidth;
|
1520
|
+
textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR;
|
1521
|
+
textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR;
|
1522
|
+
textContentItem.fakeMultiSpaceMax = spaceWidth * MULTI_SPACE_FACTOR_MAX;
|
1523
|
+
textContentItem.textRunBreakAllowed = !font.isMonospace;
|
1524
|
+
} else {
|
1525
|
+
textContentItem.spaceWidth = 0;
|
1526
|
+
textContentItem.fakeSpaceMin = Infinity;
|
1527
|
+
textContentItem.fakeMultiSpaceMin = Infinity;
|
1528
|
+
textContentItem.fakeMultiSpaceMax = 0;
|
1529
|
+
textContentItem.textRunBreakAllowed = false;
|
1530
|
+
}
|
1531
|
+
|
1532
|
+
textContentItem.initialized = true;
|
1533
|
+
return textContentItem;
|
1534
|
+
}
|
1535
|
+
|
1536
|
+
function replaceWhitespace(str) {
|
1537
|
+
var i = 0,
|
1538
|
+
ii = str.length,
|
1539
|
+
code;
|
1540
|
+
|
1541
|
+
while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7F) {
|
1542
|
+
i++;
|
1543
|
+
}
|
1544
|
+
|
1545
|
+
return i < ii ? str.replace(WhitespaceRegexp, ' ') : str;
|
1546
|
+
}
|
1547
|
+
|
1548
|
+
function runBidiTransform(textChunk) {
|
1549
|
+
var str = textChunk.str.join('');
|
1550
|
+
var bidiResult = (0, _bidi.bidi)(str, -1, textChunk.vertical);
|
1551
|
+
return {
|
1552
|
+
str: normalizeWhitespace ? replaceWhitespace(bidiResult.str) : bidiResult.str,
|
1553
|
+
dir: bidiResult.dir,
|
1554
|
+
width: textChunk.width,
|
1555
|
+
height: textChunk.height,
|
1556
|
+
transform: textChunk.transform,
|
1557
|
+
fontName: textChunk.fontName
|
1558
|
+
};
|
1559
|
+
}
|
1560
|
+
|
1561
|
+
function handleSetFont(fontName, fontRef) {
|
1562
|
+
return self.loadFont(fontName, fontRef, resources).then(function (translated) {
|
1563
|
+
textState.font = translated.font;
|
1564
|
+
textState.fontMatrix = translated.font.fontMatrix || _util.FONT_IDENTITY_MATRIX;
|
1565
|
+
});
|
1566
|
+
}
|
1567
|
+
|
1568
|
+
function buildTextContentItem(chars) {
|
1569
|
+
var font = textState.font;
|
1570
|
+
var textChunk = ensureTextContentItem();
|
1571
|
+
var width = 0;
|
1572
|
+
var height = 0;
|
1573
|
+
var glyphs = font.charsToGlyphs(chars);
|
1574
|
+
|
1575
|
+
for (var i = 0; i < glyphs.length; i++) {
|
1576
|
+
var glyph = glyphs[i];
|
1577
|
+
var glyphWidth = null;
|
1578
|
+
|
1579
|
+
if (font.vertical && glyph.vmetric) {
|
1580
|
+
glyphWidth = glyph.vmetric[0];
|
1581
|
+
} else {
|
1582
|
+
glyphWidth = glyph.width;
|
1583
|
+
}
|
1584
|
+
|
1585
|
+
var glyphUnicode = glyph.unicode;
|
1586
|
+
var NormalizedUnicodes = (0, _unicode.getNormalizedUnicodes)();
|
1587
|
+
|
1588
|
+
if (NormalizedUnicodes[glyphUnicode] !== undefined) {
|
1589
|
+
glyphUnicode = NormalizedUnicodes[glyphUnicode];
|
1590
|
+
}
|
1591
|
+
|
1592
|
+
glyphUnicode = (0, _unicode.reverseIfRtl)(glyphUnicode);
|
1593
|
+
var charSpacing = textState.charSpacing;
|
1594
|
+
|
1595
|
+
if (glyph.isSpace) {
|
1596
|
+
var wordSpacing = textState.wordSpacing;
|
1597
|
+
charSpacing += wordSpacing;
|
1598
|
+
|
1599
|
+
if (wordSpacing > 0) {
|
1600
|
+
addFakeSpaces(wordSpacing, textChunk.str);
|
1601
|
+
}
|
1602
|
+
}
|
1603
|
+
|
1604
|
+
var tx = 0;
|
1605
|
+
var ty = 0;
|
1606
|
+
|
1607
|
+
if (!font.vertical) {
|
1608
|
+
var w0 = glyphWidth * textState.fontMatrix[0];
|
1609
|
+
tx = (w0 * textState.fontSize + charSpacing) * textState.textHScale;
|
1610
|
+
width += tx;
|
1611
|
+
} else {
|
1612
|
+
var w1 = glyphWidth * textState.fontMatrix[0];
|
1613
|
+
ty = w1 * textState.fontSize + charSpacing;
|
1614
|
+
height += ty;
|
1615
|
+
}
|
1616
|
+
|
1617
|
+
textState.translateTextMatrix(tx, ty);
|
1618
|
+
textChunk.str.push(glyphUnicode);
|
1619
|
+
}
|
1620
|
+
|
1621
|
+
if (!font.vertical) {
|
1622
|
+
textChunk.lastAdvanceWidth = width;
|
1623
|
+
textChunk.width += width;
|
1624
|
+
} else {
|
1625
|
+
textChunk.lastAdvanceHeight = height;
|
1626
|
+
textChunk.height += Math.abs(height);
|
1627
|
+
}
|
1628
|
+
|
1629
|
+
return textChunk;
|
1630
|
+
}
|
1631
|
+
|
1632
|
+
function addFakeSpaces(width, strBuf) {
|
1633
|
+
if (width < textContentItem.fakeSpaceMin) {
|
1634
|
+
return;
|
1635
|
+
}
|
1636
|
+
|
1637
|
+
if (width < textContentItem.fakeMultiSpaceMin) {
|
1638
|
+
strBuf.push(' ');
|
1639
|
+
return;
|
1640
|
+
}
|
1641
|
+
|
1642
|
+
var fakeSpaces = Math.round(width / textContentItem.spaceWidth);
|
1643
|
+
|
1644
|
+
while (fakeSpaces-- > 0) {
|
1645
|
+
strBuf.push(' ');
|
1646
|
+
}
|
1647
|
+
}
|
1648
|
+
|
1649
|
+
function flushTextContentItem() {
|
1650
|
+
if (!textContentItem.initialized) {
|
1651
|
+
return;
|
1652
|
+
}
|
1653
|
+
|
1654
|
+
if (!textContentItem.vertical) {
|
1655
|
+
textContentItem.width *= textContentItem.textAdvanceScale;
|
1656
|
+
} else {
|
1657
|
+
textContentItem.height *= textContentItem.textAdvanceScale;
|
1658
|
+
}
|
1659
|
+
|
1660
|
+
textContent.items.push(runBidiTransform(textContentItem));
|
1661
|
+
textContentItem.initialized = false;
|
1662
|
+
textContentItem.str.length = 0;
|
1663
|
+
}
|
1664
|
+
|
1665
|
+
function enqueueChunk() {
|
1666
|
+
var length = textContent.items.length;
|
1667
|
+
|
1668
|
+
if (length > 0) {
|
1669
|
+
sink.enqueue(textContent, length);
|
1670
|
+
textContent.items = [];
|
1671
|
+
textContent.styles = Object.create(null);
|
1672
|
+
}
|
1673
|
+
}
|
1674
|
+
|
1675
|
+
var timeSlotManager = new TimeSlotManager();
|
1676
|
+
return new Promise(function promiseBody(resolve, reject) {
|
1677
|
+
var next = function next(promise) {
|
1678
|
+
enqueueChunk();
|
1679
|
+
Promise.all([promise, sink.ready]).then(function () {
|
1680
|
+
try {
|
1681
|
+
promiseBody(resolve, reject);
|
1682
|
+
} catch (ex) {
|
1683
|
+
reject(ex);
|
1684
|
+
}
|
1685
|
+
}, reject);
|
1686
|
+
};
|
1687
|
+
|
1688
|
+
task.ensureNotTerminated();
|
1689
|
+
timeSlotManager.reset();
|
1690
|
+
var stop,
|
1691
|
+
operation = {},
|
1692
|
+
args = [];
|
1693
|
+
|
1694
|
+
while (!(stop = timeSlotManager.check())) {
|
1695
|
+
args.length = 0;
|
1696
|
+
operation.args = args;
|
1697
|
+
|
1698
|
+
if (!preprocessor.read(operation)) {
|
1699
|
+
break;
|
1700
|
+
}
|
1701
|
+
|
1702
|
+
textState = stateManager.state;
|
1703
|
+
var fn = operation.fn;
|
1704
|
+
args = operation.args;
|
1705
|
+
var advance, diff;
|
1706
|
+
|
1707
|
+
switch (fn | 0) {
|
1708
|
+
case _util.OPS.setFont:
|
1709
|
+
var fontNameArg = args[0].name,
|
1710
|
+
fontSizeArg = args[1];
|
1711
|
+
|
1712
|
+
if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) {
|
1713
|
+
break;
|
1714
|
+
}
|
1715
|
+
|
1716
|
+
flushTextContentItem();
|
1717
|
+
textState.fontName = fontNameArg;
|
1718
|
+
textState.fontSize = fontSizeArg;
|
1719
|
+
next(handleSetFont(fontNameArg, null));
|
1720
|
+
return;
|
1721
|
+
|
1722
|
+
case _util.OPS.setTextRise:
|
1723
|
+
flushTextContentItem();
|
1724
|
+
textState.textRise = args[0];
|
1725
|
+
break;
|
1726
|
+
|
1727
|
+
case _util.OPS.setHScale:
|
1728
|
+
flushTextContentItem();
|
1729
|
+
textState.textHScale = args[0] / 100;
|
1730
|
+
break;
|
1731
|
+
|
1732
|
+
case _util.OPS.setLeading:
|
1733
|
+
flushTextContentItem();
|
1734
|
+
textState.leading = args[0];
|
1735
|
+
break;
|
1736
|
+
|
1737
|
+
case _util.OPS.moveText:
|
1738
|
+
var isSameTextLine = !textState.font ? false : (textState.font.vertical ? args[0] : args[1]) === 0;
|
1739
|
+
advance = args[0] - args[1];
|
1740
|
+
|
1741
|
+
if (combineTextItems && isSameTextLine && textContentItem.initialized && advance > 0 && advance <= textContentItem.fakeMultiSpaceMax) {
|
1742
|
+
textState.translateTextLineMatrix(args[0], args[1]);
|
1743
|
+
textContentItem.width += args[0] - textContentItem.lastAdvanceWidth;
|
1744
|
+
textContentItem.height += args[1] - textContentItem.lastAdvanceHeight;
|
1745
|
+
diff = args[0] - textContentItem.lastAdvanceWidth - (args[1] - textContentItem.lastAdvanceHeight);
|
1746
|
+
addFakeSpaces(diff, textContentItem.str);
|
1747
|
+
break;
|
1748
|
+
}
|
1749
|
+
|
1750
|
+
flushTextContentItem();
|
1751
|
+
textState.translateTextLineMatrix(args[0], args[1]);
|
1752
|
+
textState.textMatrix = textState.textLineMatrix.slice();
|
1753
|
+
break;
|
1754
|
+
|
1755
|
+
case _util.OPS.setLeadingMoveText:
|
1756
|
+
flushTextContentItem();
|
1757
|
+
textState.leading = -args[1];
|
1758
|
+
textState.translateTextLineMatrix(args[0], args[1]);
|
1759
|
+
textState.textMatrix = textState.textLineMatrix.slice();
|
1760
|
+
break;
|
1761
|
+
|
1762
|
+
case _util.OPS.nextLine:
|
1763
|
+
flushTextContentItem();
|
1764
|
+
textState.carriageReturn();
|
1765
|
+
break;
|
1766
|
+
|
1767
|
+
case _util.OPS.setTextMatrix:
|
1768
|
+
advance = textState.calcTextLineMatrixAdvance(args[0], args[1], args[2], args[3], args[4], args[5]);
|
1769
|
+
|
1770
|
+
if (combineTextItems && advance !== null && textContentItem.initialized && advance.value > 0 && advance.value <= textContentItem.fakeMultiSpaceMax) {
|
1771
|
+
textState.translateTextLineMatrix(advance.width, advance.height);
|
1772
|
+
textContentItem.width += advance.width - textContentItem.lastAdvanceWidth;
|
1773
|
+
textContentItem.height += advance.height - textContentItem.lastAdvanceHeight;
|
1774
|
+
diff = advance.width - textContentItem.lastAdvanceWidth - (advance.height - textContentItem.lastAdvanceHeight);
|
1775
|
+
addFakeSpaces(diff, textContentItem.str);
|
1776
|
+
break;
|
1777
|
+
}
|
1778
|
+
|
1779
|
+
flushTextContentItem();
|
1780
|
+
textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]);
|
1781
|
+
textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]);
|
1782
|
+
break;
|
1783
|
+
|
1784
|
+
case _util.OPS.setCharSpacing:
|
1785
|
+
textState.charSpacing = args[0];
|
1786
|
+
break;
|
1787
|
+
|
1788
|
+
case _util.OPS.setWordSpacing:
|
1789
|
+
textState.wordSpacing = args[0];
|
1790
|
+
break;
|
1791
|
+
|
1792
|
+
case _util.OPS.beginText:
|
1793
|
+
flushTextContentItem();
|
1794
|
+
textState.textMatrix = _util.IDENTITY_MATRIX.slice();
|
1795
|
+
textState.textLineMatrix = _util.IDENTITY_MATRIX.slice();
|
1796
|
+
break;
|
1797
|
+
|
1798
|
+
case _util.OPS.showSpacedText:
|
1799
|
+
var items = args[0];
|
1800
|
+
var offset;
|
1801
|
+
|
1802
|
+
for (var j = 0, jj = items.length; j < jj; j++) {
|
1803
|
+
if (typeof items[j] === 'string') {
|
1804
|
+
buildTextContentItem(items[j]);
|
1805
|
+
} else if ((0, _util.isNum)(items[j])) {
|
1806
|
+
ensureTextContentItem();
|
1807
|
+
advance = items[j] * textState.fontSize / 1000;
|
1808
|
+
var breakTextRun = false;
|
1809
|
+
|
1810
|
+
if (textState.font.vertical) {
|
1811
|
+
offset = advance;
|
1812
|
+
textState.translateTextMatrix(0, offset);
|
1813
|
+
breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax;
|
1814
|
+
|
1815
|
+
if (!breakTextRun) {
|
1816
|
+
textContentItem.height += offset;
|
1817
|
+
}
|
1818
|
+
} else {
|
1819
|
+
advance = -advance;
|
1820
|
+
offset = advance * textState.textHScale;
|
1821
|
+
textState.translateTextMatrix(offset, 0);
|
1822
|
+
breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax;
|
1823
|
+
|
1824
|
+
if (!breakTextRun) {
|
1825
|
+
textContentItem.width += offset;
|
1826
|
+
}
|
1827
|
+
}
|
1828
|
+
|
1829
|
+
if (breakTextRun) {
|
1830
|
+
flushTextContentItem();
|
1831
|
+
} else if (advance > 0) {
|
1832
|
+
addFakeSpaces(advance, textContentItem.str);
|
1833
|
+
}
|
1834
|
+
}
|
1835
|
+
}
|
1836
|
+
|
1837
|
+
break;
|
1838
|
+
|
1839
|
+
case _util.OPS.showText:
|
1840
|
+
buildTextContentItem(args[0]);
|
1841
|
+
break;
|
1842
|
+
|
1843
|
+
case _util.OPS.nextLineShowText:
|
1844
|
+
flushTextContentItem();
|
1845
|
+
textState.carriageReturn();
|
1846
|
+
buildTextContentItem(args[0]);
|
1847
|
+
break;
|
1848
|
+
|
1849
|
+
case _util.OPS.nextLineSetSpacingShowText:
|
1850
|
+
flushTextContentItem();
|
1851
|
+
textState.wordSpacing = args[0];
|
1852
|
+
textState.charSpacing = args[1];
|
1853
|
+
textState.carriageReturn();
|
1854
|
+
buildTextContentItem(args[2]);
|
1855
|
+
break;
|
1856
|
+
|
1857
|
+
case _util.OPS.paintXObject:
|
1858
|
+
flushTextContentItem();
|
1859
|
+
|
1860
|
+
if (!xobjs) {
|
1861
|
+
xobjs = resources.get('XObject') || _primitives.Dict.empty;
|
1862
|
+
}
|
1863
|
+
|
1864
|
+
var name = args[0].name;
|
1865
|
+
|
1866
|
+
if (name && skipEmptyXObjs[name] !== undefined) {
|
1867
|
+
break;
|
1868
|
+
}
|
1869
|
+
|
1870
|
+
next(new Promise(function (resolveXObject, rejectXObject) {
|
1871
|
+
if (!name) {
|
1872
|
+
throw new _util.FormatError('XObject must be referred to by name.');
|
1873
|
+
}
|
1874
|
+
|
1875
|
+
var xobj = xobjs.get(name);
|
1876
|
+
|
1877
|
+
if (!xobj) {
|
1878
|
+
resolveXObject();
|
1879
|
+
return;
|
1880
|
+
}
|
1881
|
+
|
1882
|
+
if (!(0, _primitives.isStream)(xobj)) {
|
1883
|
+
throw new _util.FormatError('XObject should be a stream');
|
1884
|
+
}
|
1885
|
+
|
1886
|
+
var type = xobj.dict.get('Subtype');
|
1887
|
+
|
1888
|
+
if (!(0, _primitives.isName)(type)) {
|
1889
|
+
throw new _util.FormatError('XObject should have a Name subtype');
|
1890
|
+
}
|
1891
|
+
|
1892
|
+
if (type.name !== 'Form') {
|
1893
|
+
skipEmptyXObjs[name] = true;
|
1894
|
+
resolveXObject();
|
1895
|
+
return;
|
1896
|
+
}
|
1897
|
+
|
1898
|
+
var currentState = stateManager.state.clone();
|
1899
|
+
var xObjStateManager = new StateManager(currentState);
|
1900
|
+
var matrix = xobj.dict.getArray('Matrix');
|
1901
|
+
|
1902
|
+
if (Array.isArray(matrix) && matrix.length === 6) {
|
1903
|
+
xObjStateManager.transform(matrix);
|
1904
|
+
}
|
1905
|
+
|
1906
|
+
enqueueChunk();
|
1907
|
+
var sinkWrapper = {
|
1908
|
+
enqueueInvoked: false,
|
1909
|
+
enqueue: function enqueue(chunk, size) {
|
1910
|
+
this.enqueueInvoked = true;
|
1911
|
+
sink.enqueue(chunk, size);
|
1912
|
+
},
|
1913
|
+
|
1914
|
+
get desiredSize() {
|
1915
|
+
return sink.desiredSize;
|
1916
|
+
},
|
1917
|
+
|
1918
|
+
get ready() {
|
1919
|
+
return sink.ready;
|
1920
|
+
}
|
1921
|
+
|
1922
|
+
};
|
1923
|
+
self.getTextContent({
|
1924
|
+
stream: xobj,
|
1925
|
+
task: task,
|
1926
|
+
resources: xobj.dict.get('Resources') || resources,
|
1927
|
+
stateManager: xObjStateManager,
|
1928
|
+
normalizeWhitespace: normalizeWhitespace,
|
1929
|
+
combineTextItems: combineTextItems,
|
1930
|
+
sink: sinkWrapper,
|
1931
|
+
seenStyles: seenStyles
|
1932
|
+
}).then(function () {
|
1933
|
+
if (!sinkWrapper.enqueueInvoked) {
|
1934
|
+
skipEmptyXObjs[name] = true;
|
1935
|
+
}
|
1936
|
+
|
1937
|
+
resolveXObject();
|
1938
|
+
}, rejectXObject);
|
1939
|
+
})["catch"](function (reason) {
|
1940
|
+
if (reason instanceof _util.AbortException) {
|
1941
|
+
return;
|
1942
|
+
}
|
1943
|
+
|
1944
|
+
if (self.options.ignoreErrors) {
|
1945
|
+
(0, _util.warn)("getTextContent - ignoring XObject: \"".concat(reason, "\"."));
|
1946
|
+
return;
|
1947
|
+
}
|
1948
|
+
|
1949
|
+
throw reason;
|
1950
|
+
}));
|
1951
|
+
return;
|
1952
|
+
|
1953
|
+
case _util.OPS.setGState:
|
1954
|
+
flushTextContentItem();
|
1955
|
+
var dictName = args[0];
|
1956
|
+
var extGState = resources.get('ExtGState');
|
1957
|
+
|
1958
|
+
if (!(0, _primitives.isDict)(extGState) || !(0, _primitives.isName)(dictName)) {
|
1959
|
+
break;
|
1960
|
+
}
|
1961
|
+
|
1962
|
+
var gState = extGState.get(dictName.name);
|
1963
|
+
|
1964
|
+
if (!(0, _primitives.isDict)(gState)) {
|
1965
|
+
break;
|
1966
|
+
}
|
1967
|
+
|
1968
|
+
var gStateFont = gState.get('Font');
|
1969
|
+
|
1970
|
+
if (gStateFont) {
|
1971
|
+
textState.fontName = null;
|
1972
|
+
textState.fontSize = gStateFont[1];
|
1973
|
+
next(handleSetFont(null, gStateFont[0]));
|
1974
|
+
return;
|
1975
|
+
}
|
1976
|
+
|
1977
|
+
break;
|
1978
|
+
}
|
1979
|
+
|
1980
|
+
if (textContent.items.length >= sink.desiredSize) {
|
1981
|
+
stop = true;
|
1982
|
+
break;
|
1983
|
+
}
|
1984
|
+
}
|
1985
|
+
|
1986
|
+
if (stop) {
|
1987
|
+
next(deferred);
|
1988
|
+
return;
|
1989
|
+
}
|
1990
|
+
|
1991
|
+
flushTextContentItem();
|
1992
|
+
enqueueChunk();
|
1993
|
+
resolve();
|
1994
|
+
})["catch"](function (reason) {
|
1995
|
+
if (reason instanceof _util.AbortException) {
|
1996
|
+
return;
|
1997
|
+
}
|
1998
|
+
|
1999
|
+
if (_this8.options.ignoreErrors) {
|
2000
|
+
(0, _util.warn)("getTextContent - ignoring errors during \"".concat(task.name, "\" ") + "task: \"".concat(reason, "\"."));
|
2001
|
+
flushTextContentItem();
|
2002
|
+
enqueueChunk();
|
2003
|
+
return;
|
2004
|
+
}
|
2005
|
+
|
2006
|
+
throw reason;
|
2007
|
+
});
|
2008
|
+
},
|
2009
|
+
extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, properties) {
|
2010
|
+
var _this9 = this;
|
2011
|
+
|
2012
|
+
var xref = this.xref,
|
2013
|
+
cidToGidBytes;
|
2014
|
+
var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode');
|
2015
|
+
var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined);
|
2016
|
+
|
2017
|
+
if (properties.composite) {
|
2018
|
+
var cidSystemInfo = dict.get('CIDSystemInfo');
|
2019
|
+
|
2020
|
+
if ((0, _primitives.isDict)(cidSystemInfo)) {
|
2021
|
+
properties.cidSystemInfo = {
|
2022
|
+
registry: (0, _util.stringToPDFString)(cidSystemInfo.get('Registry')),
|
2023
|
+
ordering: (0, _util.stringToPDFString)(cidSystemInfo.get('Ordering')),
|
2024
|
+
supplement: cidSystemInfo.get('Supplement')
|
2025
|
+
};
|
2026
|
+
}
|
2027
|
+
|
2028
|
+
var cidToGidMap = dict.get('CIDToGIDMap');
|
2029
|
+
|
2030
|
+
if ((0, _primitives.isStream)(cidToGidMap)) {
|
2031
|
+
cidToGidBytes = cidToGidMap.getBytes();
|
2032
|
+
}
|
2033
|
+
}
|
2034
|
+
|
2035
|
+
var differences = [];
|
2036
|
+
var baseEncodingName = null;
|
2037
|
+
var encoding;
|
2038
|
+
|
2039
|
+
if (dict.has('Encoding')) {
|
2040
|
+
encoding = dict.get('Encoding');
|
2041
|
+
|
2042
|
+
if ((0, _primitives.isDict)(encoding)) {
|
2043
|
+
baseEncodingName = encoding.get('BaseEncoding');
|
2044
|
+
baseEncodingName = (0, _primitives.isName)(baseEncodingName) ? baseEncodingName.name : null;
|
2045
|
+
|
2046
|
+
if (encoding.has('Differences')) {
|
2047
|
+
var diffEncoding = encoding.get('Differences');
|
2048
|
+
var index = 0;
|
2049
|
+
|
2050
|
+
for (var j = 0, jj = diffEncoding.length; j < jj; j++) {
|
2051
|
+
var data = xref.fetchIfRef(diffEncoding[j]);
|
2052
|
+
|
2053
|
+
if ((0, _util.isNum)(data)) {
|
2054
|
+
index = data;
|
2055
|
+
} else if ((0, _primitives.isName)(data)) {
|
2056
|
+
differences[index++] = data.name;
|
2057
|
+
} else {
|
2058
|
+
throw new _util.FormatError("Invalid entry in 'Differences' array: ".concat(data));
|
2059
|
+
}
|
2060
|
+
}
|
2061
|
+
}
|
2062
|
+
} else if ((0, _primitives.isName)(encoding)) {
|
2063
|
+
baseEncodingName = encoding.name;
|
2064
|
+
} else {
|
2065
|
+
throw new _util.FormatError('Encoding is not a Name nor a Dict');
|
2066
|
+
}
|
2067
|
+
|
2068
|
+
if (baseEncodingName !== 'MacRomanEncoding' && baseEncodingName !== 'MacExpertEncoding' && baseEncodingName !== 'WinAnsiEncoding') {
|
2069
|
+
baseEncodingName = null;
|
2070
|
+
}
|
2071
|
+
}
|
2072
|
+
|
2073
|
+
if (baseEncodingName) {
|
2074
|
+
properties.defaultEncoding = (0, _encodings.getEncoding)(baseEncodingName).slice();
|
2075
|
+
} else {
|
2076
|
+
var isSymbolicFont = !!(properties.flags & _fonts.FontFlags.Symbolic);
|
2077
|
+
var isNonsymbolicFont = !!(properties.flags & _fonts.FontFlags.Nonsymbolic);
|
2078
|
+
encoding = _encodings.StandardEncoding;
|
2079
|
+
|
2080
|
+
if (properties.type === 'TrueType' && !isNonsymbolicFont) {
|
2081
|
+
encoding = _encodings.WinAnsiEncoding;
|
2082
|
+
}
|
2083
|
+
|
2084
|
+
if (isSymbolicFont) {
|
2085
|
+
encoding = _encodings.MacRomanEncoding;
|
2086
|
+
|
2087
|
+
if (!properties.file) {
|
2088
|
+
if (/Symbol/i.test(properties.name)) {
|
2089
|
+
encoding = _encodings.SymbolSetEncoding;
|
2090
|
+
} else if (/Dingbats/i.test(properties.name)) {
|
2091
|
+
encoding = _encodings.ZapfDingbatsEncoding;
|
2092
|
+
}
|
2093
|
+
}
|
2094
|
+
}
|
2095
|
+
|
2096
|
+
properties.defaultEncoding = encoding;
|
2097
|
+
}
|
2098
|
+
|
2099
|
+
properties.differences = differences;
|
2100
|
+
properties.baseEncodingName = baseEncodingName;
|
2101
|
+
properties.hasEncoding = !!baseEncodingName || differences.length > 0;
|
2102
|
+
properties.dict = dict;
|
2103
|
+
return toUnicodePromise.then(function (toUnicode) {
|
2104
|
+
properties.toUnicode = toUnicode;
|
2105
|
+
return _this9.buildToUnicode(properties);
|
2106
|
+
}).then(function (toUnicode) {
|
2107
|
+
properties.toUnicode = toUnicode;
|
2108
|
+
|
2109
|
+
if (cidToGidBytes) {
|
2110
|
+
properties.cidToGidMap = _this9.readCidToGidMap(cidToGidBytes, toUnicode);
|
2111
|
+
}
|
2112
|
+
|
2113
|
+
return properties;
|
2114
|
+
});
|
2115
|
+
},
|
2116
|
+
_buildSimpleFontToUnicode: function _buildSimpleFontToUnicode(properties) {
|
2117
|
+
(0, _util.assert)(!properties.composite, 'Must be a simple font.');
|
2118
|
+
var toUnicode = [],
|
2119
|
+
charcode,
|
2120
|
+
glyphName;
|
2121
|
+
var encoding = properties.defaultEncoding.slice();
|
2122
|
+
var baseEncodingName = properties.baseEncodingName;
|
2123
|
+
var differences = properties.differences;
|
2124
|
+
|
2125
|
+
for (charcode in differences) {
|
2126
|
+
glyphName = differences[charcode];
|
2127
|
+
|
2128
|
+
if (glyphName === '.notdef') {
|
2129
|
+
continue;
|
2130
|
+
}
|
2131
|
+
|
2132
|
+
encoding[charcode] = glyphName;
|
2133
|
+
}
|
2134
|
+
|
2135
|
+
var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)();
|
2136
|
+
|
2137
|
+
for (charcode in encoding) {
|
2138
|
+
glyphName = encoding[charcode];
|
2139
|
+
|
2140
|
+
if (glyphName === '') {
|
2141
|
+
continue;
|
2142
|
+
} else if (glyphsUnicodeMap[glyphName] === undefined) {
|
2143
|
+
var code = 0;
|
2144
|
+
|
2145
|
+
switch (glyphName[0]) {
|
2146
|
+
case 'G':
|
2147
|
+
if (glyphName.length === 3) {
|
2148
|
+
code = parseInt(glyphName.substring(1), 16);
|
2149
|
+
}
|
2150
|
+
|
2151
|
+
break;
|
2152
|
+
|
2153
|
+
case 'g':
|
2154
|
+
if (glyphName.length === 5) {
|
2155
|
+
code = parseInt(glyphName.substring(1), 16);
|
2156
|
+
}
|
2157
|
+
|
2158
|
+
break;
|
2159
|
+
|
2160
|
+
case 'C':
|
2161
|
+
case 'c':
|
2162
|
+
if (glyphName.length >= 3) {
|
2163
|
+
code = +glyphName.substring(1);
|
2164
|
+
}
|
2165
|
+
|
2166
|
+
break;
|
2167
|
+
|
2168
|
+
default:
|
2169
|
+
var unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap);
|
2170
|
+
|
2171
|
+
if (unicode !== -1) {
|
2172
|
+
code = unicode;
|
2173
|
+
}
|
2174
|
+
|
2175
|
+
}
|
2176
|
+
|
2177
|
+
if (code) {
|
2178
|
+
if (baseEncodingName && code === +charcode) {
|
2179
|
+
var baseEncoding = (0, _encodings.getEncoding)(baseEncodingName);
|
2180
|
+
|
2181
|
+
if (baseEncoding && (glyphName = baseEncoding[charcode])) {
|
2182
|
+
toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]);
|
2183
|
+
continue;
|
2184
|
+
}
|
2185
|
+
}
|
2186
|
+
|
2187
|
+
toUnicode[charcode] = String.fromCodePoint(code);
|
2188
|
+
}
|
2189
|
+
|
2190
|
+
continue;
|
2191
|
+
}
|
2192
|
+
|
2193
|
+
toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]);
|
2194
|
+
}
|
2195
|
+
|
2196
|
+
return new _fonts.ToUnicodeMap(toUnicode);
|
2197
|
+
},
|
2198
|
+
buildToUnicode: function buildToUnicode(properties) {
|
2199
|
+
properties.hasIncludedToUnicodeMap = !!properties.toUnicode && properties.toUnicode.length > 0;
|
2200
|
+
|
2201
|
+
if (properties.hasIncludedToUnicodeMap) {
|
2202
|
+
if (!properties.composite && properties.hasEncoding) {
|
2203
|
+
properties.fallbackToUnicode = this._buildSimpleFontToUnicode(properties);
|
2204
|
+
}
|
2205
|
+
|
2206
|
+
return Promise.resolve(properties.toUnicode);
|
2207
|
+
}
|
2208
|
+
|
2209
|
+
if (!properties.composite) {
|
2210
|
+
return Promise.resolve(this._buildSimpleFontToUnicode(properties));
|
2211
|
+
}
|
2212
|
+
|
2213
|
+
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'))) {
|
2214
|
+
var registry = properties.cidSystemInfo.registry;
|
2215
|
+
var ordering = properties.cidSystemInfo.ordering;
|
2216
|
+
|
2217
|
+
var ucs2CMapName = _primitives.Name.get(registry + '-' + ordering + '-UCS2');
|
2218
|
+
|
2219
|
+
return _cmap.CMapFactory.create({
|
2220
|
+
encoding: ucs2CMapName,
|
2221
|
+
fetchBuiltInCMap: this.fetchBuiltInCMap,
|
2222
|
+
useCMap: null
|
2223
|
+
}).then(function (ucs2CMap) {
|
2224
|
+
var cMap = properties.cMap;
|
2225
|
+
var toUnicode = [];
|
2226
|
+
cMap.forEach(function (charcode, cid) {
|
2227
|
+
if (cid > 0xffff) {
|
2228
|
+
throw new _util.FormatError('Max size of CID is 65,535');
|
2229
|
+
}
|
2230
|
+
|
2231
|
+
var ucs2 = ucs2CMap.lookup(cid);
|
2232
|
+
|
2233
|
+
if (ucs2) {
|
2234
|
+
toUnicode[charcode] = String.fromCharCode((ucs2.charCodeAt(0) << 8) + ucs2.charCodeAt(1));
|
2235
|
+
}
|
2236
|
+
});
|
2237
|
+
return new _fonts.ToUnicodeMap(toUnicode);
|
2238
|
+
});
|
2239
|
+
}
|
2240
|
+
|
2241
|
+
return Promise.resolve(new _fonts.IdentityToUnicodeMap(properties.firstChar, properties.lastChar));
|
2242
|
+
},
|
2243
|
+
readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) {
|
2244
|
+
var cmapObj = toUnicode;
|
2245
|
+
|
2246
|
+
if ((0, _primitives.isName)(cmapObj)) {
|
2247
|
+
return _cmap.CMapFactory.create({
|
2248
|
+
encoding: cmapObj,
|
2249
|
+
fetchBuiltInCMap: this.fetchBuiltInCMap,
|
2250
|
+
useCMap: null
|
2251
|
+
}).then(function (cmap) {
|
2252
|
+
if (cmap instanceof _cmap.IdentityCMap) {
|
2253
|
+
return new _fonts.IdentityToUnicodeMap(0, 0xFFFF);
|
2254
|
+
}
|
2255
|
+
|
2256
|
+
return new _fonts.ToUnicodeMap(cmap.getMap());
|
2257
|
+
});
|
2258
|
+
} else if ((0, _primitives.isStream)(cmapObj)) {
|
2259
|
+
return _cmap.CMapFactory.create({
|
2260
|
+
encoding: cmapObj,
|
2261
|
+
fetchBuiltInCMap: this.fetchBuiltInCMap,
|
2262
|
+
useCMap: null
|
2263
|
+
}).then(function (cmap) {
|
2264
|
+
if (cmap instanceof _cmap.IdentityCMap) {
|
2265
|
+
return new _fonts.IdentityToUnicodeMap(0, 0xFFFF);
|
2266
|
+
}
|
2267
|
+
|
2268
|
+
var map = new Array(cmap.length);
|
2269
|
+
cmap.forEach(function (charCode, token) {
|
2270
|
+
var str = [];
|
2271
|
+
|
2272
|
+
for (var k = 0; k < token.length; k += 2) {
|
2273
|
+
var w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1);
|
2274
|
+
|
2275
|
+
if ((w1 & 0xF800) !== 0xD800) {
|
2276
|
+
str.push(w1);
|
2277
|
+
continue;
|
2278
|
+
}
|
2279
|
+
|
2280
|
+
k += 2;
|
2281
|
+
var w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1);
|
2282
|
+
str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000);
|
2283
|
+
}
|
2284
|
+
|
2285
|
+
map[charCode] = String.fromCodePoint.apply(String, str);
|
2286
|
+
});
|
2287
|
+
return new _fonts.ToUnicodeMap(map);
|
2288
|
+
});
|
2289
|
+
}
|
2290
|
+
|
2291
|
+
return Promise.resolve(null);
|
2292
|
+
},
|
2293
|
+
readCidToGidMap: function readCidToGidMap(glyphsData, toUnicode) {
|
2294
|
+
var result = [];
|
2295
|
+
|
2296
|
+
for (var j = 0, jj = glyphsData.length; j < jj; j++) {
|
2297
|
+
var glyphID = glyphsData[j++] << 8 | glyphsData[j];
|
2298
|
+
var code = j >> 1;
|
2299
|
+
|
2300
|
+
if (glyphID === 0 && !toUnicode.has(code)) {
|
2301
|
+
continue;
|
2302
|
+
}
|
2303
|
+
|
2304
|
+
result[code] = glyphID;
|
2305
|
+
}
|
2306
|
+
|
2307
|
+
return result;
|
2308
|
+
},
|
2309
|
+
extractWidths: function PartialEvaluator_extractWidths(dict, descriptor, properties) {
|
2310
|
+
var xref = this.xref;
|
2311
|
+
var glyphsWidths = [];
|
2312
|
+
var defaultWidth = 0;
|
2313
|
+
var glyphsVMetrics = [];
|
2314
|
+
var defaultVMetrics;
|
2315
|
+
var i, ii, j, jj, start, code, widths;
|
2316
|
+
|
2317
|
+
if (properties.composite) {
|
2318
|
+
defaultWidth = dict.has('DW') ? dict.get('DW') : 1000;
|
2319
|
+
widths = dict.get('W');
|
2320
|
+
|
2321
|
+
if (widths) {
|
2322
|
+
for (i = 0, ii = widths.length; i < ii; i++) {
|
2323
|
+
start = xref.fetchIfRef(widths[i++]);
|
2324
|
+
code = xref.fetchIfRef(widths[i]);
|
2325
|
+
|
2326
|
+
if (Array.isArray(code)) {
|
2327
|
+
for (j = 0, jj = code.length; j < jj; j++) {
|
2328
|
+
glyphsWidths[start++] = xref.fetchIfRef(code[j]);
|
2329
|
+
}
|
2330
|
+
} else {
|
2331
|
+
var width = xref.fetchIfRef(widths[++i]);
|
2332
|
+
|
2333
|
+
for (j = start; j <= code; j++) {
|
2334
|
+
glyphsWidths[j] = width;
|
2335
|
+
}
|
2336
|
+
}
|
2337
|
+
}
|
2338
|
+
}
|
2339
|
+
|
2340
|
+
if (properties.vertical) {
|
2341
|
+
var vmetrics = dict.getArray('DW2') || [880, -1000];
|
2342
|
+
defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]];
|
2343
|
+
vmetrics = dict.get('W2');
|
2344
|
+
|
2345
|
+
if (vmetrics) {
|
2346
|
+
for (i = 0, ii = vmetrics.length; i < ii; i++) {
|
2347
|
+
start = xref.fetchIfRef(vmetrics[i++]);
|
2348
|
+
code = xref.fetchIfRef(vmetrics[i]);
|
2349
|
+
|
2350
|
+
if (Array.isArray(code)) {
|
2351
|
+
for (j = 0, jj = code.length; j < jj; j++) {
|
2352
|
+
glyphsVMetrics[start++] = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])];
|
2353
|
+
}
|
2354
|
+
} else {
|
2355
|
+
var vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])];
|
2356
|
+
|
2357
|
+
for (j = start; j <= code; j++) {
|
2358
|
+
glyphsVMetrics[j] = vmetric;
|
2359
|
+
}
|
2360
|
+
}
|
2361
|
+
}
|
2362
|
+
}
|
2363
|
+
}
|
2364
|
+
} else {
|
2365
|
+
var firstChar = properties.firstChar;
|
2366
|
+
widths = dict.get('Widths');
|
2367
|
+
|
2368
|
+
if (widths) {
|
2369
|
+
j = firstChar;
|
2370
|
+
|
2371
|
+
for (i = 0, ii = widths.length; i < ii; i++) {
|
2372
|
+
glyphsWidths[j++] = xref.fetchIfRef(widths[i]);
|
2373
|
+
}
|
2374
|
+
|
2375
|
+
defaultWidth = parseFloat(descriptor.get('MissingWidth')) || 0;
|
2376
|
+
} else {
|
2377
|
+
var baseFontName = dict.get('BaseFont');
|
2378
|
+
|
2379
|
+
if ((0, _primitives.isName)(baseFontName)) {
|
2380
|
+
var metrics = this.getBaseFontMetrics(baseFontName.name);
|
2381
|
+
glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties);
|
2382
|
+
defaultWidth = metrics.defaultWidth;
|
2383
|
+
}
|
2384
|
+
}
|
2385
|
+
}
|
2386
|
+
|
2387
|
+
var isMonospace = true;
|
2388
|
+
var firstWidth = defaultWidth;
|
2389
|
+
|
2390
|
+
for (var glyph in glyphsWidths) {
|
2391
|
+
var glyphWidth = glyphsWidths[glyph];
|
2392
|
+
|
2393
|
+
if (!glyphWidth) {
|
2394
|
+
continue;
|
2395
|
+
}
|
2396
|
+
|
2397
|
+
if (!firstWidth) {
|
2398
|
+
firstWidth = glyphWidth;
|
2399
|
+
continue;
|
2400
|
+
}
|
2401
|
+
|
2402
|
+
if (firstWidth !== glyphWidth) {
|
2403
|
+
isMonospace = false;
|
2404
|
+
break;
|
2405
|
+
}
|
2406
|
+
}
|
2407
|
+
|
2408
|
+
if (isMonospace) {
|
2409
|
+
properties.flags |= _fonts.FontFlags.FixedPitch;
|
2410
|
+
}
|
2411
|
+
|
2412
|
+
properties.defaultWidth = defaultWidth;
|
2413
|
+
properties.widths = glyphsWidths;
|
2414
|
+
properties.defaultVMetrics = defaultVMetrics;
|
2415
|
+
properties.vmetrics = glyphsVMetrics;
|
2416
|
+
},
|
2417
|
+
isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) {
|
2418
|
+
var fontNameWoStyle = baseFontName.split('-')[0];
|
2419
|
+
return fontNameWoStyle in (0, _standard_fonts.getSerifFonts)() || fontNameWoStyle.search(/serif/gi) !== -1;
|
2420
|
+
},
|
2421
|
+
getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) {
|
2422
|
+
var defaultWidth = 0;
|
2423
|
+
var widths = [];
|
2424
|
+
var monospace = false;
|
2425
|
+
var stdFontMap = (0, _standard_fonts.getStdFontMap)();
|
2426
|
+
var lookupName = stdFontMap[name] || name;
|
2427
|
+
var Metrics = (0, _metrics.getMetrics)();
|
2428
|
+
|
2429
|
+
if (!(lookupName in Metrics)) {
|
2430
|
+
if (this.isSerifFont(name)) {
|
2431
|
+
lookupName = 'Times-Roman';
|
2432
|
+
} else {
|
2433
|
+
lookupName = 'Helvetica';
|
2434
|
+
}
|
2435
|
+
}
|
2436
|
+
|
2437
|
+
var glyphWidths = Metrics[lookupName];
|
2438
|
+
|
2439
|
+
if ((0, _util.isNum)(glyphWidths)) {
|
2440
|
+
defaultWidth = glyphWidths;
|
2441
|
+
monospace = true;
|
2442
|
+
} else {
|
2443
|
+
widths = glyphWidths();
|
2444
|
+
}
|
2445
|
+
|
2446
|
+
return {
|
2447
|
+
defaultWidth: defaultWidth,
|
2448
|
+
monospace: monospace,
|
2449
|
+
widths: widths
|
2450
|
+
};
|
2451
|
+
},
|
2452
|
+
buildCharCodeToWidth: function PartialEvaluator_bulildCharCodeToWidth(widthsByGlyphName, properties) {
|
2453
|
+
var widths = Object.create(null);
|
2454
|
+
var differences = properties.differences;
|
2455
|
+
var encoding = properties.defaultEncoding;
|
2456
|
+
|
2457
|
+
for (var charCode = 0; charCode < 256; charCode++) {
|
2458
|
+
if (charCode in differences && widthsByGlyphName[differences[charCode]]) {
|
2459
|
+
widths[charCode] = widthsByGlyphName[differences[charCode]];
|
2460
|
+
continue;
|
2461
|
+
}
|
2462
|
+
|
2463
|
+
if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) {
|
2464
|
+
widths[charCode] = widthsByGlyphName[encoding[charCode]];
|
2465
|
+
continue;
|
2466
|
+
}
|
2467
|
+
}
|
2468
|
+
|
2469
|
+
return widths;
|
2470
|
+
},
|
2471
|
+
preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict) {
|
2472
|
+
var baseDict = dict;
|
2473
|
+
var type = dict.get('Subtype');
|
2474
|
+
|
2475
|
+
if (!(0, _primitives.isName)(type)) {
|
2476
|
+
throw new _util.FormatError('invalid font Subtype');
|
2477
|
+
}
|
2478
|
+
|
2479
|
+
var composite = false;
|
2480
|
+
var uint8array;
|
2481
|
+
|
2482
|
+
if (type.name === 'Type0') {
|
2483
|
+
var df = dict.get('DescendantFonts');
|
2484
|
+
|
2485
|
+
if (!df) {
|
2486
|
+
throw new _util.FormatError('Descendant fonts are not specified');
|
2487
|
+
}
|
2488
|
+
|
2489
|
+
dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df;
|
2490
|
+
type = dict.get('Subtype');
|
2491
|
+
|
2492
|
+
if (!(0, _primitives.isName)(type)) {
|
2493
|
+
throw new _util.FormatError('invalid font Subtype');
|
2494
|
+
}
|
2495
|
+
|
2496
|
+
composite = true;
|
2497
|
+
}
|
2498
|
+
|
2499
|
+
var descriptor = dict.get('FontDescriptor');
|
2500
|
+
|
2501
|
+
if (descriptor) {
|
2502
|
+
var hash = new _murmurhash.MurmurHash3_64();
|
2503
|
+
var encoding = baseDict.getRaw('Encoding');
|
2504
|
+
|
2505
|
+
if ((0, _primitives.isName)(encoding)) {
|
2506
|
+
hash.update(encoding.name);
|
2507
|
+
} else if ((0, _primitives.isRef)(encoding)) {
|
2508
|
+
hash.update(encoding.toString());
|
2509
|
+
} else if ((0, _primitives.isDict)(encoding)) {
|
2510
|
+
var keys = encoding.getKeys();
|
2511
|
+
|
2512
|
+
for (var i = 0, ii = keys.length; i < ii; i++) {
|
2513
|
+
var entry = encoding.getRaw(keys[i]);
|
2514
|
+
|
2515
|
+
if ((0, _primitives.isName)(entry)) {
|
2516
|
+
hash.update(entry.name);
|
2517
|
+
} else if ((0, _primitives.isRef)(entry)) {
|
2518
|
+
hash.update(entry.toString());
|
2519
|
+
} else if (Array.isArray(entry)) {
|
2520
|
+
var diffLength = entry.length,
|
2521
|
+
diffBuf = new Array(diffLength);
|
2522
|
+
|
2523
|
+
for (var j = 0; j < diffLength; j++) {
|
2524
|
+
var diffEntry = entry[j];
|
2525
|
+
|
2526
|
+
if ((0, _primitives.isName)(diffEntry)) {
|
2527
|
+
diffBuf[j] = diffEntry.name;
|
2528
|
+
} else if ((0, _util.isNum)(diffEntry) || (0, _primitives.isRef)(diffEntry)) {
|
2529
|
+
diffBuf[j] = diffEntry.toString();
|
2530
|
+
}
|
2531
|
+
}
|
2532
|
+
|
2533
|
+
hash.update(diffBuf.join());
|
2534
|
+
}
|
2535
|
+
}
|
2536
|
+
}
|
2537
|
+
|
2538
|
+
var firstChar = dict.get('FirstChar') || 0;
|
2539
|
+
var lastChar = dict.get('LastChar') || (composite ? 0xFFFF : 0xFF);
|
2540
|
+
hash.update("".concat(firstChar, "-").concat(lastChar));
|
2541
|
+
var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode');
|
2542
|
+
|
2543
|
+
if ((0, _primitives.isStream)(toUnicode)) {
|
2544
|
+
var stream = toUnicode.str || toUnicode;
|
2545
|
+
uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start);
|
2546
|
+
hash.update(uint8array);
|
2547
|
+
} else if ((0, _primitives.isName)(toUnicode)) {
|
2548
|
+
hash.update(toUnicode.name);
|
2549
|
+
}
|
2550
|
+
|
2551
|
+
var widths = dict.get('Widths') || baseDict.get('Widths');
|
2552
|
+
|
2553
|
+
if (widths) {
|
2554
|
+
uint8array = new Uint8Array(new Uint32Array(widths).buffer);
|
2555
|
+
hash.update(uint8array);
|
2556
|
+
}
|
2557
|
+
}
|
2558
|
+
|
2559
|
+
return {
|
2560
|
+
descriptor: descriptor,
|
2561
|
+
dict: dict,
|
2562
|
+
baseDict: baseDict,
|
2563
|
+
composite: composite,
|
2564
|
+
type: type.name,
|
2565
|
+
hash: hash ? hash.hexdigest() : ''
|
2566
|
+
};
|
2567
|
+
},
|
2568
|
+
translateFont: function PartialEvaluator_translateFont(preEvaluatedFont) {
|
2569
|
+
var _this10 = this;
|
2570
|
+
|
2571
|
+
var baseDict = preEvaluatedFont.baseDict;
|
2572
|
+
var dict = preEvaluatedFont.dict;
|
2573
|
+
var composite = preEvaluatedFont.composite;
|
2574
|
+
var descriptor = preEvaluatedFont.descriptor;
|
2575
|
+
var type = preEvaluatedFont.type;
|
2576
|
+
var maxCharIndex = composite ? 0xFFFF : 0xFF;
|
2577
|
+
var properties;
|
2578
|
+
|
2579
|
+
if (!descriptor) {
|
2580
|
+
if (type === 'Type3') {
|
2581
|
+
descriptor = new _primitives.Dict(null);
|
2582
|
+
descriptor.set('FontName', _primitives.Name.get(type));
|
2583
|
+
descriptor.set('FontBBox', dict.getArray('FontBBox'));
|
2584
|
+
} else {
|
2585
|
+
var baseFontName = dict.get('BaseFont');
|
2586
|
+
|
2587
|
+
if (!(0, _primitives.isName)(baseFontName)) {
|
2588
|
+
throw new _util.FormatError('Base font is not specified');
|
2589
|
+
}
|
2590
|
+
|
2591
|
+
baseFontName = baseFontName.name.replace(/[,_]/g, '-');
|
2592
|
+
var metrics = this.getBaseFontMetrics(baseFontName);
|
2593
|
+
var fontNameWoStyle = baseFontName.split('-')[0];
|
2594
|
+
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);
|
2595
|
+
properties = {
|
2596
|
+
type: type,
|
2597
|
+
name: baseFontName,
|
2598
|
+
widths: metrics.widths,
|
2599
|
+
defaultWidth: metrics.defaultWidth,
|
2600
|
+
flags: flags,
|
2601
|
+
firstChar: 0,
|
2602
|
+
lastChar: maxCharIndex
|
2603
|
+
};
|
2604
|
+
return this.extractDataStructures(dict, dict, properties).then(function (properties) {
|
2605
|
+
properties.widths = _this10.buildCharCodeToWidth(metrics.widths, properties);
|
2606
|
+
return new _fonts.Font(baseFontName, null, properties);
|
2607
|
+
});
|
2608
|
+
}
|
2609
|
+
}
|
2610
|
+
|
2611
|
+
var firstChar = dict.get('FirstChar') || 0;
|
2612
|
+
var lastChar = dict.get('LastChar') || maxCharIndex;
|
2613
|
+
var fontName = descriptor.get('FontName');
|
2614
|
+
var baseFont = dict.get('BaseFont');
|
2615
|
+
|
2616
|
+
if ((0, _util.isString)(fontName)) {
|
2617
|
+
fontName = _primitives.Name.get(fontName);
|
2618
|
+
}
|
2619
|
+
|
2620
|
+
if ((0, _util.isString)(baseFont)) {
|
2621
|
+
baseFont = _primitives.Name.get(baseFont);
|
2622
|
+
}
|
2623
|
+
|
2624
|
+
if (type !== 'Type3') {
|
2625
|
+
var fontNameStr = fontName && fontName.name;
|
2626
|
+
var baseFontStr = baseFont && baseFont.name;
|
2627
|
+
|
2628
|
+
if (fontNameStr !== baseFontStr) {
|
2629
|
+
(0, _util.info)("The FontDescriptor's FontName is \"".concat(fontNameStr, "\" but ") + "should be the same as the Font's BaseFont \"".concat(baseFontStr, "\"."));
|
2630
|
+
|
2631
|
+
if (fontNameStr && baseFontStr && baseFontStr.startsWith(fontNameStr)) {
|
2632
|
+
fontName = baseFont;
|
2633
|
+
}
|
2634
|
+
}
|
2635
|
+
}
|
2636
|
+
|
2637
|
+
fontName = fontName || baseFont;
|
2638
|
+
|
2639
|
+
if (!(0, _primitives.isName)(fontName)) {
|
2640
|
+
throw new _util.FormatError('invalid font name');
|
2641
|
+
}
|
2642
|
+
|
2643
|
+
var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3');
|
2644
|
+
|
2645
|
+
if (fontFile) {
|
2646
|
+
if (fontFile.dict) {
|
2647
|
+
var subtype = fontFile.dict.get('Subtype');
|
2648
|
+
|
2649
|
+
if (subtype) {
|
2650
|
+
subtype = subtype.name;
|
2651
|
+
}
|
2652
|
+
|
2653
|
+
var length1 = fontFile.dict.get('Length1');
|
2654
|
+
var length2 = fontFile.dict.get('Length2');
|
2655
|
+
var length3 = fontFile.dict.get('Length3');
|
2656
|
+
}
|
2657
|
+
}
|
2658
|
+
|
2659
|
+
properties = {
|
2660
|
+
type: type,
|
2661
|
+
name: fontName.name,
|
2662
|
+
subtype: subtype,
|
2663
|
+
file: fontFile,
|
2664
|
+
length1: length1,
|
2665
|
+
length2: length2,
|
2666
|
+
length3: length3,
|
2667
|
+
loadedName: baseDict.loadedName,
|
2668
|
+
composite: composite,
|
2669
|
+
wideChars: composite,
|
2670
|
+
fixedPitch: false,
|
2671
|
+
fontMatrix: dict.getArray('FontMatrix') || _util.FONT_IDENTITY_MATRIX,
|
2672
|
+
firstChar: firstChar || 0,
|
2673
|
+
lastChar: lastChar || maxCharIndex,
|
2674
|
+
bbox: descriptor.getArray('FontBBox'),
|
2675
|
+
ascent: descriptor.get('Ascent'),
|
2676
|
+
descent: descriptor.get('Descent'),
|
2677
|
+
xHeight: descriptor.get('XHeight'),
|
2678
|
+
capHeight: descriptor.get('CapHeight'),
|
2679
|
+
flags: descriptor.get('Flags'),
|
2680
|
+
italicAngle: descriptor.get('ItalicAngle'),
|
2681
|
+
isType3Font: false
|
2682
|
+
};
|
2683
|
+
var cMapPromise;
|
2684
|
+
|
2685
|
+
if (composite) {
|
2686
|
+
var cidEncoding = baseDict.get('Encoding');
|
2687
|
+
|
2688
|
+
if ((0, _primitives.isName)(cidEncoding)) {
|
2689
|
+
properties.cidEncoding = cidEncoding.name;
|
2690
|
+
}
|
2691
|
+
|
2692
|
+
cMapPromise = _cmap.CMapFactory.create({
|
2693
|
+
encoding: cidEncoding,
|
2694
|
+
fetchBuiltInCMap: this.fetchBuiltInCMap,
|
2695
|
+
useCMap: null
|
2696
|
+
}).then(function (cMap) {
|
2697
|
+
properties.cMap = cMap;
|
2698
|
+
properties.vertical = properties.cMap.vertical;
|
2699
|
+
});
|
2700
|
+
} else {
|
2701
|
+
cMapPromise = Promise.resolve(undefined);
|
2702
|
+
}
|
2703
|
+
|
2704
|
+
return cMapPromise.then(function () {
|
2705
|
+
return _this10.extractDataStructures(dict, baseDict, properties);
|
2706
|
+
}).then(function (properties) {
|
2707
|
+
_this10.extractWidths(dict, descriptor, properties);
|
2708
|
+
|
2709
|
+
if (type === 'Type3') {
|
2710
|
+
properties.isType3Font = true;
|
2711
|
+
}
|
2712
|
+
|
2713
|
+
return new _fonts.Font(fontName.name, fontFile, properties);
|
2714
|
+
});
|
2715
|
+
}
|
2716
|
+
};
|
2717
|
+
|
2718
|
+
PartialEvaluator.buildFontPaths = function (font, glyphs, handler) {
|
2719
|
+
function buildPath(fontChar) {
|
2720
|
+
if (font.renderer.hasBuiltPath(fontChar)) {
|
2721
|
+
return;
|
2722
|
+
}
|
2723
|
+
|
2724
|
+
handler.send('commonobj', ["".concat(font.loadedName, "_path_").concat(fontChar), 'FontPath', font.renderer.getPathJs(fontChar)]);
|
2725
|
+
}
|
2726
|
+
|
2727
|
+
var _iteratorNormalCompletion = true;
|
2728
|
+
var _didIteratorError = false;
|
2729
|
+
var _iteratorError = undefined;
|
2730
|
+
|
2731
|
+
try {
|
2732
|
+
for (var _iterator = glyphs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
2733
|
+
var glyph = _step.value;
|
2734
|
+
buildPath(glyph.fontChar);
|
2735
|
+
var accent = glyph.accent;
|
2736
|
+
|
2737
|
+
if (accent && accent.fontChar) {
|
2738
|
+
buildPath(accent.fontChar);
|
2739
|
+
}
|
2740
|
+
}
|
2741
|
+
} catch (err) {
|
2742
|
+
_didIteratorError = true;
|
2743
|
+
_iteratorError = err;
|
2744
|
+
} finally {
|
2745
|
+
try {
|
2746
|
+
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
2747
|
+
_iterator["return"]();
|
2748
|
+
}
|
2749
|
+
} finally {
|
2750
|
+
if (_didIteratorError) {
|
2751
|
+
throw _iteratorError;
|
2752
|
+
}
|
2753
|
+
}
|
2754
|
+
}
|
2755
|
+
};
|
2756
|
+
|
2757
|
+
return PartialEvaluator;
|
2758
|
+
}();
|
2759
|
+
|
2760
|
+
exports.PartialEvaluator = PartialEvaluator;
|
2761
|
+
|
2762
|
+
var TranslatedFont = function TranslatedFontClosure() {
|
2763
|
+
function TranslatedFont(loadedName, font, dict) {
|
2764
|
+
this.loadedName = loadedName;
|
2765
|
+
this.font = font;
|
2766
|
+
this.dict = dict;
|
2767
|
+
this.type3Loaded = null;
|
2768
|
+
this.sent = false;
|
2769
|
+
}
|
2770
|
+
|
2771
|
+
TranslatedFont.prototype = {
|
2772
|
+
send: function send(handler) {
|
2773
|
+
if (this.sent) {
|
2774
|
+
return;
|
2775
|
+
}
|
2776
|
+
|
2777
|
+
this.sent = true;
|
2778
|
+
handler.send('commonobj', [this.loadedName, 'Font', this.font.exportData()]);
|
2779
|
+
},
|
2780
|
+
fallback: function fallback(handler) {
|
2781
|
+
if (!this.font.data) {
|
2782
|
+
return;
|
2783
|
+
}
|
2784
|
+
|
2785
|
+
this.font.disableFontFace = true;
|
2786
|
+
var glyphs = this.font.glyphCacheValues;
|
2787
|
+
PartialEvaluator.buildFontPaths(this.font, glyphs, handler);
|
2788
|
+
},
|
2789
|
+
loadType3Data: function loadType3Data(evaluator, resources, parentOperatorList, task) {
|
2790
|
+
if (!this.font.isType3Font) {
|
2791
|
+
throw new Error('Must be a Type3 font.');
|
2792
|
+
}
|
2793
|
+
|
2794
|
+
if (this.type3Loaded) {
|
2795
|
+
return this.type3Loaded;
|
2796
|
+
}
|
2797
|
+
|
2798
|
+
var type3Options = Object.create(evaluator.options);
|
2799
|
+
type3Options.ignoreErrors = false;
|
2800
|
+
type3Options.nativeImageDecoderSupport = _util.NativeImageDecoding.NONE;
|
2801
|
+
var type3Evaluator = evaluator.clone(type3Options);
|
2802
|
+
type3Evaluator.parsingType3Font = true;
|
2803
|
+
var translatedFont = this.font;
|
2804
|
+
var loadCharProcsPromise = Promise.resolve();
|
2805
|
+
var charProcs = this.dict.get('CharProcs');
|
2806
|
+
var fontResources = this.dict.get('Resources') || resources;
|
2807
|
+
var charProcKeys = charProcs.getKeys();
|
2808
|
+
var charProcOperatorList = Object.create(null);
|
2809
|
+
|
2810
|
+
var _loop2 = function _loop2() {
|
2811
|
+
var key = charProcKeys[i];
|
2812
|
+
loadCharProcsPromise = loadCharProcsPromise.then(function () {
|
2813
|
+
var glyphStream = charProcs.get(key);
|
2814
|
+
var operatorList = new _operator_list.OperatorList();
|
2815
|
+
return type3Evaluator.getOperatorList({
|
2816
|
+
stream: glyphStream,
|
2817
|
+
task: task,
|
2818
|
+
resources: fontResources,
|
2819
|
+
operatorList: operatorList
|
2820
|
+
}).then(function () {
|
2821
|
+
charProcOperatorList[key] = operatorList.getIR();
|
2822
|
+
parentOperatorList.addDependencies(operatorList.dependencies);
|
2823
|
+
})["catch"](function (reason) {
|
2824
|
+
(0, _util.warn)("Type3 font resource \"".concat(key, "\" is not available."));
|
2825
|
+
var operatorList = new _operator_list.OperatorList();
|
2826
|
+
charProcOperatorList[key] = operatorList.getIR();
|
2827
|
+
});
|
2828
|
+
});
|
2829
|
+
};
|
2830
|
+
|
2831
|
+
for (var i = 0, n = charProcKeys.length; i < n; ++i) {
|
2832
|
+
_loop2();
|
2833
|
+
}
|
2834
|
+
|
2835
|
+
this.type3Loaded = loadCharProcsPromise.then(function () {
|
2836
|
+
translatedFont.charProcOperatorList = charProcOperatorList;
|
2837
|
+
});
|
2838
|
+
return this.type3Loaded;
|
2839
|
+
}
|
2840
|
+
};
|
2841
|
+
return TranslatedFont;
|
2842
|
+
}();
|
2843
|
+
|
2844
|
+
var StateManager = function StateManagerClosure() {
|
2845
|
+
function StateManager(initialState) {
|
2846
|
+
this.state = initialState;
|
2847
|
+
this.stateStack = [];
|
2848
|
+
}
|
2849
|
+
|
2850
|
+
StateManager.prototype = {
|
2851
|
+
save: function save() {
|
2852
|
+
var old = this.state;
|
2853
|
+
this.stateStack.push(this.state);
|
2854
|
+
this.state = old.clone();
|
2855
|
+
},
|
2856
|
+
restore: function restore() {
|
2857
|
+
var prev = this.stateStack.pop();
|
2858
|
+
|
2859
|
+
if (prev) {
|
2860
|
+
this.state = prev;
|
2861
|
+
}
|
2862
|
+
},
|
2863
|
+
transform: function transform(args) {
|
2864
|
+
this.state.ctm = _util.Util.transform(this.state.ctm, args);
|
2865
|
+
}
|
2866
|
+
};
|
2867
|
+
return StateManager;
|
2868
|
+
}();
|
2869
|
+
|
2870
|
+
var TextState = function TextStateClosure() {
|
2871
|
+
function TextState() {
|
2872
|
+
this.ctm = new Float32Array(_util.IDENTITY_MATRIX);
|
2873
|
+
this.fontName = null;
|
2874
|
+
this.fontSize = 0;
|
2875
|
+
this.font = null;
|
2876
|
+
this.fontMatrix = _util.FONT_IDENTITY_MATRIX;
|
2877
|
+
this.textMatrix = _util.IDENTITY_MATRIX.slice();
|
2878
|
+
this.textLineMatrix = _util.IDENTITY_MATRIX.slice();
|
2879
|
+
this.charSpacing = 0;
|
2880
|
+
this.wordSpacing = 0;
|
2881
|
+
this.leading = 0;
|
2882
|
+
this.textHScale = 1;
|
2883
|
+
this.textRise = 0;
|
2884
|
+
}
|
2885
|
+
|
2886
|
+
TextState.prototype = {
|
2887
|
+
setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) {
|
2888
|
+
var m = this.textMatrix;
|
2889
|
+
m[0] = a;
|
2890
|
+
m[1] = b;
|
2891
|
+
m[2] = c;
|
2892
|
+
m[3] = d;
|
2893
|
+
m[4] = e;
|
2894
|
+
m[5] = f;
|
2895
|
+
},
|
2896
|
+
setTextLineMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) {
|
2897
|
+
var m = this.textLineMatrix;
|
2898
|
+
m[0] = a;
|
2899
|
+
m[1] = b;
|
2900
|
+
m[2] = c;
|
2901
|
+
m[3] = d;
|
2902
|
+
m[4] = e;
|
2903
|
+
m[5] = f;
|
2904
|
+
},
|
2905
|
+
translateTextMatrix: function TextState_translateTextMatrix(x, y) {
|
2906
|
+
var m = this.textMatrix;
|
2907
|
+
m[4] = m[0] * x + m[2] * y + m[4];
|
2908
|
+
m[5] = m[1] * x + m[3] * y + m[5];
|
2909
|
+
},
|
2910
|
+
translateTextLineMatrix: function TextState_translateTextMatrix(x, y) {
|
2911
|
+
var m = this.textLineMatrix;
|
2912
|
+
m[4] = m[0] * x + m[2] * y + m[4];
|
2913
|
+
m[5] = m[1] * x + m[3] * y + m[5];
|
2914
|
+
},
|
2915
|
+
calcTextLineMatrixAdvance: function TextState_calcTextLineMatrixAdvance(a, b, c, d, e, f) {
|
2916
|
+
var font = this.font;
|
2917
|
+
|
2918
|
+
if (!font) {
|
2919
|
+
return null;
|
2920
|
+
}
|
2921
|
+
|
2922
|
+
var m = this.textLineMatrix;
|
2923
|
+
|
2924
|
+
if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) {
|
2925
|
+
return null;
|
2926
|
+
}
|
2927
|
+
|
2928
|
+
var txDiff = e - m[4],
|
2929
|
+
tyDiff = f - m[5];
|
2930
|
+
|
2931
|
+
if (font.vertical && txDiff !== 0 || !font.vertical && tyDiff !== 0) {
|
2932
|
+
return null;
|
2933
|
+
}
|
2934
|
+
|
2935
|
+
var tx,
|
2936
|
+
ty,
|
2937
|
+
denominator = a * d - b * c;
|
2938
|
+
|
2939
|
+
if (font.vertical) {
|
2940
|
+
tx = -tyDiff * c / denominator;
|
2941
|
+
ty = tyDiff * a / denominator;
|
2942
|
+
} else {
|
2943
|
+
tx = txDiff * d / denominator;
|
2944
|
+
ty = -txDiff * b / denominator;
|
2945
|
+
}
|
2946
|
+
|
2947
|
+
return {
|
2948
|
+
width: tx,
|
2949
|
+
height: ty,
|
2950
|
+
value: font.vertical ? ty : tx
|
2951
|
+
};
|
2952
|
+
},
|
2953
|
+
calcRenderMatrix: function TextState_calcRendeMatrix(ctm) {
|
2954
|
+
var tsm = [this.fontSize * this.textHScale, 0, 0, this.fontSize, 0, this.textRise];
|
2955
|
+
return _util.Util.transform(ctm, _util.Util.transform(this.textMatrix, tsm));
|
2956
|
+
},
|
2957
|
+
carriageReturn: function TextState_carriageReturn() {
|
2958
|
+
this.translateTextLineMatrix(0, -this.leading);
|
2959
|
+
this.textMatrix = this.textLineMatrix.slice();
|
2960
|
+
},
|
2961
|
+
clone: function TextState_clone() {
|
2962
|
+
var clone = Object.create(this);
|
2963
|
+
clone.textMatrix = this.textMatrix.slice();
|
2964
|
+
clone.textLineMatrix = this.textLineMatrix.slice();
|
2965
|
+
clone.fontMatrix = this.fontMatrix.slice();
|
2966
|
+
return clone;
|
2967
|
+
}
|
2968
|
+
};
|
2969
|
+
return TextState;
|
2970
|
+
}();
|
2971
|
+
|
2972
|
+
var EvalState = function EvalStateClosure() {
|
2973
|
+
function EvalState() {
|
2974
|
+
this.ctm = new Float32Array(_util.IDENTITY_MATRIX);
|
2975
|
+
this.font = null;
|
2976
|
+
this.textRenderingMode = _util.TextRenderingMode.FILL;
|
2977
|
+
this.fillColorSpace = _colorspace.ColorSpace.singletons.gray;
|
2978
|
+
this.strokeColorSpace = _colorspace.ColorSpace.singletons.gray;
|
2979
|
+
}
|
2980
|
+
|
2981
|
+
EvalState.prototype = {
|
2982
|
+
clone: function CanvasExtraState_clone() {
|
2983
|
+
return Object.create(this);
|
2984
|
+
}
|
2985
|
+
};
|
2986
|
+
return EvalState;
|
2987
|
+
}();
|
2988
|
+
|
2989
|
+
var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() {
|
2990
|
+
var getOPMap = (0, _core_utils.getLookupTableFactory)(function (t) {
|
2991
|
+
t['w'] = {
|
2992
|
+
id: _util.OPS.setLineWidth,
|
2993
|
+
numArgs: 1,
|
2994
|
+
variableArgs: false
|
2995
|
+
};
|
2996
|
+
t['J'] = {
|
2997
|
+
id: _util.OPS.setLineCap,
|
2998
|
+
numArgs: 1,
|
2999
|
+
variableArgs: false
|
3000
|
+
};
|
3001
|
+
t['j'] = {
|
3002
|
+
id: _util.OPS.setLineJoin,
|
3003
|
+
numArgs: 1,
|
3004
|
+
variableArgs: false
|
3005
|
+
};
|
3006
|
+
t['M'] = {
|
3007
|
+
id: _util.OPS.setMiterLimit,
|
3008
|
+
numArgs: 1,
|
3009
|
+
variableArgs: false
|
3010
|
+
};
|
3011
|
+
t['d'] = {
|
3012
|
+
id: _util.OPS.setDash,
|
3013
|
+
numArgs: 2,
|
3014
|
+
variableArgs: false
|
3015
|
+
};
|
3016
|
+
t['ri'] = {
|
3017
|
+
id: _util.OPS.setRenderingIntent,
|
3018
|
+
numArgs: 1,
|
3019
|
+
variableArgs: false
|
3020
|
+
};
|
3021
|
+
t['i'] = {
|
3022
|
+
id: _util.OPS.setFlatness,
|
3023
|
+
numArgs: 1,
|
3024
|
+
variableArgs: false
|
3025
|
+
};
|
3026
|
+
t['gs'] = {
|
3027
|
+
id: _util.OPS.setGState,
|
3028
|
+
numArgs: 1,
|
3029
|
+
variableArgs: false
|
3030
|
+
};
|
3031
|
+
t['q'] = {
|
3032
|
+
id: _util.OPS.save,
|
3033
|
+
numArgs: 0,
|
3034
|
+
variableArgs: false
|
3035
|
+
};
|
3036
|
+
t['Q'] = {
|
3037
|
+
id: _util.OPS.restore,
|
3038
|
+
numArgs: 0,
|
3039
|
+
variableArgs: false
|
3040
|
+
};
|
3041
|
+
t['cm'] = {
|
3042
|
+
id: _util.OPS.transform,
|
3043
|
+
numArgs: 6,
|
3044
|
+
variableArgs: false
|
3045
|
+
};
|
3046
|
+
t['m'] = {
|
3047
|
+
id: _util.OPS.moveTo,
|
3048
|
+
numArgs: 2,
|
3049
|
+
variableArgs: false
|
3050
|
+
};
|
3051
|
+
t['l'] = {
|
3052
|
+
id: _util.OPS.lineTo,
|
3053
|
+
numArgs: 2,
|
3054
|
+
variableArgs: false
|
3055
|
+
};
|
3056
|
+
t['c'] = {
|
3057
|
+
id: _util.OPS.curveTo,
|
3058
|
+
numArgs: 6,
|
3059
|
+
variableArgs: false
|
3060
|
+
};
|
3061
|
+
t['v'] = {
|
3062
|
+
id: _util.OPS.curveTo2,
|
3063
|
+
numArgs: 4,
|
3064
|
+
variableArgs: false
|
3065
|
+
};
|
3066
|
+
t['y'] = {
|
3067
|
+
id: _util.OPS.curveTo3,
|
3068
|
+
numArgs: 4,
|
3069
|
+
variableArgs: false
|
3070
|
+
};
|
3071
|
+
t['h'] = {
|
3072
|
+
id: _util.OPS.closePath,
|
3073
|
+
numArgs: 0,
|
3074
|
+
variableArgs: false
|
3075
|
+
};
|
3076
|
+
t['re'] = {
|
3077
|
+
id: _util.OPS.rectangle,
|
3078
|
+
numArgs: 4,
|
3079
|
+
variableArgs: false
|
3080
|
+
};
|
3081
|
+
t['S'] = {
|
3082
|
+
id: _util.OPS.stroke,
|
3083
|
+
numArgs: 0,
|
3084
|
+
variableArgs: false
|
3085
|
+
};
|
3086
|
+
t['s'] = {
|
3087
|
+
id: _util.OPS.closeStroke,
|
3088
|
+
numArgs: 0,
|
3089
|
+
variableArgs: false
|
3090
|
+
};
|
3091
|
+
t['f'] = {
|
3092
|
+
id: _util.OPS.fill,
|
3093
|
+
numArgs: 0,
|
3094
|
+
variableArgs: false
|
3095
|
+
};
|
3096
|
+
t['F'] = {
|
3097
|
+
id: _util.OPS.fill,
|
3098
|
+
numArgs: 0,
|
3099
|
+
variableArgs: false
|
3100
|
+
};
|
3101
|
+
t['f*'] = {
|
3102
|
+
id: _util.OPS.eoFill,
|
3103
|
+
numArgs: 0,
|
3104
|
+
variableArgs: false
|
3105
|
+
};
|
3106
|
+
t['B'] = {
|
3107
|
+
id: _util.OPS.fillStroke,
|
3108
|
+
numArgs: 0,
|
3109
|
+
variableArgs: false
|
3110
|
+
};
|
3111
|
+
t['B*'] = {
|
3112
|
+
id: _util.OPS.eoFillStroke,
|
3113
|
+
numArgs: 0,
|
3114
|
+
variableArgs: false
|
3115
|
+
};
|
3116
|
+
t['b'] = {
|
3117
|
+
id: _util.OPS.closeFillStroke,
|
3118
|
+
numArgs: 0,
|
3119
|
+
variableArgs: false
|
3120
|
+
};
|
3121
|
+
t['b*'] = {
|
3122
|
+
id: _util.OPS.closeEOFillStroke,
|
3123
|
+
numArgs: 0,
|
3124
|
+
variableArgs: false
|
3125
|
+
};
|
3126
|
+
t['n'] = {
|
3127
|
+
id: _util.OPS.endPath,
|
3128
|
+
numArgs: 0,
|
3129
|
+
variableArgs: false
|
3130
|
+
};
|
3131
|
+
t['W'] = {
|
3132
|
+
id: _util.OPS.clip,
|
3133
|
+
numArgs: 0,
|
3134
|
+
variableArgs: false
|
3135
|
+
};
|
3136
|
+
t['W*'] = {
|
3137
|
+
id: _util.OPS.eoClip,
|
3138
|
+
numArgs: 0,
|
3139
|
+
variableArgs: false
|
3140
|
+
};
|
3141
|
+
t['BT'] = {
|
3142
|
+
id: _util.OPS.beginText,
|
3143
|
+
numArgs: 0,
|
3144
|
+
variableArgs: false
|
3145
|
+
};
|
3146
|
+
t['ET'] = {
|
3147
|
+
id: _util.OPS.endText,
|
3148
|
+
numArgs: 0,
|
3149
|
+
variableArgs: false
|
3150
|
+
};
|
3151
|
+
t['Tc'] = {
|
3152
|
+
id: _util.OPS.setCharSpacing,
|
3153
|
+
numArgs: 1,
|
3154
|
+
variableArgs: false
|
3155
|
+
};
|
3156
|
+
t['Tw'] = {
|
3157
|
+
id: _util.OPS.setWordSpacing,
|
3158
|
+
numArgs: 1,
|
3159
|
+
variableArgs: false
|
3160
|
+
};
|
3161
|
+
t['Tz'] = {
|
3162
|
+
id: _util.OPS.setHScale,
|
3163
|
+
numArgs: 1,
|
3164
|
+
variableArgs: false
|
3165
|
+
};
|
3166
|
+
t['TL'] = {
|
3167
|
+
id: _util.OPS.setLeading,
|
3168
|
+
numArgs: 1,
|
3169
|
+
variableArgs: false
|
3170
|
+
};
|
3171
|
+
t['Tf'] = {
|
3172
|
+
id: _util.OPS.setFont,
|
3173
|
+
numArgs: 2,
|
3174
|
+
variableArgs: false
|
3175
|
+
};
|
3176
|
+
t['Tr'] = {
|
3177
|
+
id: _util.OPS.setTextRenderingMode,
|
3178
|
+
numArgs: 1,
|
3179
|
+
variableArgs: false
|
3180
|
+
};
|
3181
|
+
t['Ts'] = {
|
3182
|
+
id: _util.OPS.setTextRise,
|
3183
|
+
numArgs: 1,
|
3184
|
+
variableArgs: false
|
3185
|
+
};
|
3186
|
+
t['Td'] = {
|
3187
|
+
id: _util.OPS.moveText,
|
3188
|
+
numArgs: 2,
|
3189
|
+
variableArgs: false
|
3190
|
+
};
|
3191
|
+
t['TD'] = {
|
3192
|
+
id: _util.OPS.setLeadingMoveText,
|
3193
|
+
numArgs: 2,
|
3194
|
+
variableArgs: false
|
3195
|
+
};
|
3196
|
+
t['Tm'] = {
|
3197
|
+
id: _util.OPS.setTextMatrix,
|
3198
|
+
numArgs: 6,
|
3199
|
+
variableArgs: false
|
3200
|
+
};
|
3201
|
+
t['T*'] = {
|
3202
|
+
id: _util.OPS.nextLine,
|
3203
|
+
numArgs: 0,
|
3204
|
+
variableArgs: false
|
3205
|
+
};
|
3206
|
+
t['Tj'] = {
|
3207
|
+
id: _util.OPS.showText,
|
3208
|
+
numArgs: 1,
|
3209
|
+
variableArgs: false
|
3210
|
+
};
|
3211
|
+
t['TJ'] = {
|
3212
|
+
id: _util.OPS.showSpacedText,
|
3213
|
+
numArgs: 1,
|
3214
|
+
variableArgs: false
|
3215
|
+
};
|
3216
|
+
t['\''] = {
|
3217
|
+
id: _util.OPS.nextLineShowText,
|
3218
|
+
numArgs: 1,
|
3219
|
+
variableArgs: false
|
3220
|
+
};
|
3221
|
+
t['"'] = {
|
3222
|
+
id: _util.OPS.nextLineSetSpacingShowText,
|
3223
|
+
numArgs: 3,
|
3224
|
+
variableArgs: false
|
3225
|
+
};
|
3226
|
+
t['d0'] = {
|
3227
|
+
id: _util.OPS.setCharWidth,
|
3228
|
+
numArgs: 2,
|
3229
|
+
variableArgs: false
|
3230
|
+
};
|
3231
|
+
t['d1'] = {
|
3232
|
+
id: _util.OPS.setCharWidthAndBounds,
|
3233
|
+
numArgs: 6,
|
3234
|
+
variableArgs: false
|
3235
|
+
};
|
3236
|
+
t['CS'] = {
|
3237
|
+
id: _util.OPS.setStrokeColorSpace,
|
3238
|
+
numArgs: 1,
|
3239
|
+
variableArgs: false
|
3240
|
+
};
|
3241
|
+
t['cs'] = {
|
3242
|
+
id: _util.OPS.setFillColorSpace,
|
3243
|
+
numArgs: 1,
|
3244
|
+
variableArgs: false
|
3245
|
+
};
|
3246
|
+
t['SC'] = {
|
3247
|
+
id: _util.OPS.setStrokeColor,
|
3248
|
+
numArgs: 4,
|
3249
|
+
variableArgs: true
|
3250
|
+
};
|
3251
|
+
t['SCN'] = {
|
3252
|
+
id: _util.OPS.setStrokeColorN,
|
3253
|
+
numArgs: 33,
|
3254
|
+
variableArgs: true
|
3255
|
+
};
|
3256
|
+
t['sc'] = {
|
3257
|
+
id: _util.OPS.setFillColor,
|
3258
|
+
numArgs: 4,
|
3259
|
+
variableArgs: true
|
3260
|
+
};
|
3261
|
+
t['scn'] = {
|
3262
|
+
id: _util.OPS.setFillColorN,
|
3263
|
+
numArgs: 33,
|
3264
|
+
variableArgs: true
|
3265
|
+
};
|
3266
|
+
t['G'] = {
|
3267
|
+
id: _util.OPS.setStrokeGray,
|
3268
|
+
numArgs: 1,
|
3269
|
+
variableArgs: false
|
3270
|
+
};
|
3271
|
+
t['g'] = {
|
3272
|
+
id: _util.OPS.setFillGray,
|
3273
|
+
numArgs: 1,
|
3274
|
+
variableArgs: false
|
3275
|
+
};
|
3276
|
+
t['RG'] = {
|
3277
|
+
id: _util.OPS.setStrokeRGBColor,
|
3278
|
+
numArgs: 3,
|
3279
|
+
variableArgs: false
|
3280
|
+
};
|
3281
|
+
t['rg'] = {
|
3282
|
+
id: _util.OPS.setFillRGBColor,
|
3283
|
+
numArgs: 3,
|
3284
|
+
variableArgs: false
|
3285
|
+
};
|
3286
|
+
t['K'] = {
|
3287
|
+
id: _util.OPS.setStrokeCMYKColor,
|
3288
|
+
numArgs: 4,
|
3289
|
+
variableArgs: false
|
3290
|
+
};
|
3291
|
+
t['k'] = {
|
3292
|
+
id: _util.OPS.setFillCMYKColor,
|
3293
|
+
numArgs: 4,
|
3294
|
+
variableArgs: false
|
3295
|
+
};
|
3296
|
+
t['sh'] = {
|
3297
|
+
id: _util.OPS.shadingFill,
|
3298
|
+
numArgs: 1,
|
3299
|
+
variableArgs: false
|
3300
|
+
};
|
3301
|
+
t['BI'] = {
|
3302
|
+
id: _util.OPS.beginInlineImage,
|
3303
|
+
numArgs: 0,
|
3304
|
+
variableArgs: false
|
3305
|
+
};
|
3306
|
+
t['ID'] = {
|
3307
|
+
id: _util.OPS.beginImageData,
|
3308
|
+
numArgs: 0,
|
3309
|
+
variableArgs: false
|
3310
|
+
};
|
3311
|
+
t['EI'] = {
|
3312
|
+
id: _util.OPS.endInlineImage,
|
3313
|
+
numArgs: 1,
|
3314
|
+
variableArgs: false
|
3315
|
+
};
|
3316
|
+
t['Do'] = {
|
3317
|
+
id: _util.OPS.paintXObject,
|
3318
|
+
numArgs: 1,
|
3319
|
+
variableArgs: false
|
3320
|
+
};
|
3321
|
+
t['MP'] = {
|
3322
|
+
id: _util.OPS.markPoint,
|
3323
|
+
numArgs: 1,
|
3324
|
+
variableArgs: false
|
3325
|
+
};
|
3326
|
+
t['DP'] = {
|
3327
|
+
id: _util.OPS.markPointProps,
|
3328
|
+
numArgs: 2,
|
3329
|
+
variableArgs: false
|
3330
|
+
};
|
3331
|
+
t['BMC'] = {
|
3332
|
+
id: _util.OPS.beginMarkedContent,
|
3333
|
+
numArgs: 1,
|
3334
|
+
variableArgs: false
|
3335
|
+
};
|
3336
|
+
t['BDC'] = {
|
3337
|
+
id: _util.OPS.beginMarkedContentProps,
|
3338
|
+
numArgs: 2,
|
3339
|
+
variableArgs: false
|
3340
|
+
};
|
3341
|
+
t['EMC'] = {
|
3342
|
+
id: _util.OPS.endMarkedContent,
|
3343
|
+
numArgs: 0,
|
3344
|
+
variableArgs: false
|
3345
|
+
};
|
3346
|
+
t['BX'] = {
|
3347
|
+
id: _util.OPS.beginCompat,
|
3348
|
+
numArgs: 0,
|
3349
|
+
variableArgs: false
|
3350
|
+
};
|
3351
|
+
t['EX'] = {
|
3352
|
+
id: _util.OPS.endCompat,
|
3353
|
+
numArgs: 0,
|
3354
|
+
variableArgs: false
|
3355
|
+
};
|
3356
|
+
t['BM'] = null;
|
3357
|
+
t['BD'] = null;
|
3358
|
+
t['true'] = null;
|
3359
|
+
t['fa'] = null;
|
3360
|
+
t['fal'] = null;
|
3361
|
+
t['fals'] = null;
|
3362
|
+
t['false'] = null;
|
3363
|
+
t['nu'] = null;
|
3364
|
+
t['nul'] = null;
|
3365
|
+
t['null'] = null;
|
3366
|
+
});
|
3367
|
+
var MAX_INVALID_PATH_OPS = 20;
|
3368
|
+
|
3369
|
+
function EvaluatorPreprocessor(stream, xref, stateManager) {
|
3370
|
+
this.opMap = getOPMap();
|
3371
|
+
this.parser = new _parser.Parser({
|
3372
|
+
lexer: new _parser.Lexer(stream, this.opMap),
|
3373
|
+
xref: xref
|
3374
|
+
});
|
3375
|
+
this.stateManager = stateManager;
|
3376
|
+
this.nonProcessedArgs = [];
|
3377
|
+
this._numInvalidPathOPS = 0;
|
3378
|
+
}
|
3379
|
+
|
3380
|
+
EvaluatorPreprocessor.prototype = {
|
3381
|
+
get savedStatesDepth() {
|
3382
|
+
return this.stateManager.stateStack.length;
|
3383
|
+
},
|
3384
|
+
|
3385
|
+
read: function EvaluatorPreprocessor_read(operation) {
|
3386
|
+
var args = operation.args;
|
3387
|
+
|
3388
|
+
while (true) {
|
3389
|
+
var obj = this.parser.getObj();
|
3390
|
+
|
3391
|
+
if (obj instanceof _primitives.Cmd) {
|
3392
|
+
var cmd = obj.cmd;
|
3393
|
+
var opSpec = this.opMap[cmd];
|
3394
|
+
|
3395
|
+
if (!opSpec) {
|
3396
|
+
(0, _util.warn)("Unknown command \"".concat(cmd, "\"."));
|
3397
|
+
continue;
|
3398
|
+
}
|
3399
|
+
|
3400
|
+
var fn = opSpec.id;
|
3401
|
+
var numArgs = opSpec.numArgs;
|
3402
|
+
var argsLength = args !== null ? args.length : 0;
|
3403
|
+
|
3404
|
+
if (!opSpec.variableArgs) {
|
3405
|
+
if (argsLength !== numArgs) {
|
3406
|
+
var nonProcessedArgs = this.nonProcessedArgs;
|
3407
|
+
|
3408
|
+
while (argsLength > numArgs) {
|
3409
|
+
nonProcessedArgs.push(args.shift());
|
3410
|
+
argsLength--;
|
3411
|
+
}
|
3412
|
+
|
3413
|
+
while (argsLength < numArgs && nonProcessedArgs.length !== 0) {
|
3414
|
+
if (args === null) {
|
3415
|
+
args = [];
|
3416
|
+
}
|
3417
|
+
|
3418
|
+
args.unshift(nonProcessedArgs.pop());
|
3419
|
+
argsLength++;
|
3420
|
+
}
|
3421
|
+
}
|
3422
|
+
|
3423
|
+
if (argsLength < numArgs) {
|
3424
|
+
var partialMsg = "command ".concat(cmd, ": expected ").concat(numArgs, " args, ") + "but received ".concat(argsLength, " args.");
|
3425
|
+
|
3426
|
+
if (fn >= _util.OPS.moveTo && fn <= _util.OPS.endPath && ++this._numInvalidPathOPS > MAX_INVALID_PATH_OPS) {
|
3427
|
+
throw new _util.FormatError("Invalid ".concat(partialMsg));
|
3428
|
+
}
|
3429
|
+
|
3430
|
+
(0, _util.warn)("Skipping ".concat(partialMsg));
|
3431
|
+
|
3432
|
+
if (args !== null) {
|
3433
|
+
args.length = 0;
|
3434
|
+
}
|
3435
|
+
|
3436
|
+
continue;
|
3437
|
+
}
|
3438
|
+
} else if (argsLength > numArgs) {
|
3439
|
+
(0, _util.info)("Command ".concat(cmd, ": expected [0, ").concat(numArgs, "] args, ") + "but received ".concat(argsLength, " args."));
|
3440
|
+
}
|
3441
|
+
|
3442
|
+
this.preprocessCommand(fn, args);
|
3443
|
+
operation.fn = fn;
|
3444
|
+
operation.args = args;
|
3445
|
+
return true;
|
3446
|
+
}
|
3447
|
+
|
3448
|
+
if (obj === _primitives.EOF) {
|
3449
|
+
return false;
|
3450
|
+
}
|
3451
|
+
|
3452
|
+
if (obj !== null) {
|
3453
|
+
if (args === null) {
|
3454
|
+
args = [];
|
3455
|
+
}
|
3456
|
+
|
3457
|
+
args.push(obj);
|
3458
|
+
|
3459
|
+
if (args.length > 33) {
|
3460
|
+
throw new _util.FormatError('Too many arguments');
|
3461
|
+
}
|
3462
|
+
}
|
3463
|
+
}
|
3464
|
+
},
|
3465
|
+
preprocessCommand: function EvaluatorPreprocessor_preprocessCommand(fn, args) {
|
3466
|
+
switch (fn | 0) {
|
3467
|
+
case _util.OPS.save:
|
3468
|
+
this.stateManager.save();
|
3469
|
+
break;
|
3470
|
+
|
3471
|
+
case _util.OPS.restore:
|
3472
|
+
this.stateManager.restore();
|
3473
|
+
break;
|
3474
|
+
|
3475
|
+
case _util.OPS.transform:
|
3476
|
+
this.stateManager.transform(args);
|
3477
|
+
break;
|
3478
|
+
}
|
3479
|
+
}
|
3480
|
+
};
|
3481
|
+
return EvaluatorPreprocessor;
|
3482
|
+
}();
|