@box/pdfjs-dist 0.0.0-stage → 6.4.299-box.2

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.
Files changed (555) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/CODE_OF_CONDUCT.md +15 -0
  3. package/LICENSE +177 -0
  4. package/README.md +23 -2
  5. package/build/pdf.min.mjs +28 -0
  6. package/build/pdf.mjs +28336 -0
  7. package/build/pdf.mjs.map +1 -0
  8. package/build/pdf.sandbox.min.mjs +28 -0
  9. package/build/pdf.sandbox.mjs +211 -0
  10. package/build/pdf.sandbox.mjs.map +1 -0
  11. package/build/pdf.worker.min.mjs +28 -0
  12. package/build/pdf.worker.mjs +64908 -0
  13. package/build/pdf.worker.mjs.map +1 -0
  14. package/cmaps/78-EUC-H.bcmap +0 -0
  15. package/cmaps/78-EUC-V.bcmap +0 -0
  16. package/cmaps/78-H.bcmap +0 -0
  17. package/cmaps/78-RKSJ-H.bcmap +0 -0
  18. package/cmaps/78-RKSJ-V.bcmap +0 -0
  19. package/cmaps/78-V.bcmap +0 -0
  20. package/cmaps/78ms-RKSJ-H.bcmap +0 -0
  21. package/cmaps/78ms-RKSJ-V.bcmap +0 -0
  22. package/cmaps/83pv-RKSJ-H.bcmap +0 -0
  23. package/cmaps/90ms-RKSJ-H.bcmap +0 -0
  24. package/cmaps/90ms-RKSJ-V.bcmap +0 -0
  25. package/cmaps/90msp-RKSJ-H.bcmap +0 -0
  26. package/cmaps/90msp-RKSJ-V.bcmap +0 -0
  27. package/cmaps/90pv-RKSJ-H.bcmap +0 -0
  28. package/cmaps/90pv-RKSJ-V.bcmap +0 -0
  29. package/cmaps/Add-H.bcmap +0 -0
  30. package/cmaps/Add-RKSJ-H.bcmap +0 -0
  31. package/cmaps/Add-RKSJ-V.bcmap +0 -0
  32. package/cmaps/Add-V.bcmap +0 -0
  33. package/cmaps/Adobe-CNS1-0.bcmap +0 -0
  34. package/cmaps/Adobe-CNS1-1.bcmap +0 -0
  35. package/cmaps/Adobe-CNS1-2.bcmap +0 -0
  36. package/cmaps/Adobe-CNS1-3.bcmap +0 -0
  37. package/cmaps/Adobe-CNS1-4.bcmap +0 -0
  38. package/cmaps/Adobe-CNS1-5.bcmap +0 -0
  39. package/cmaps/Adobe-CNS1-6.bcmap +0 -0
  40. package/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  41. package/cmaps/Adobe-GB1-0.bcmap +0 -0
  42. package/cmaps/Adobe-GB1-1.bcmap +0 -0
  43. package/cmaps/Adobe-GB1-2.bcmap +0 -0
  44. package/cmaps/Adobe-GB1-3.bcmap +0 -0
  45. package/cmaps/Adobe-GB1-4.bcmap +0 -0
  46. package/cmaps/Adobe-GB1-5.bcmap +0 -0
  47. package/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  48. package/cmaps/Adobe-Japan1-0.bcmap +0 -0
  49. package/cmaps/Adobe-Japan1-1.bcmap +0 -0
  50. package/cmaps/Adobe-Japan1-2.bcmap +0 -0
  51. package/cmaps/Adobe-Japan1-3.bcmap +0 -0
  52. package/cmaps/Adobe-Japan1-4.bcmap +0 -0
  53. package/cmaps/Adobe-Japan1-5.bcmap +0 -0
  54. package/cmaps/Adobe-Japan1-6.bcmap +0 -0
  55. package/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  56. package/cmaps/Adobe-Korea1-0.bcmap +0 -0
  57. package/cmaps/Adobe-Korea1-1.bcmap +0 -0
  58. package/cmaps/Adobe-Korea1-2.bcmap +0 -0
  59. package/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  60. package/cmaps/B5-H.bcmap +0 -0
  61. package/cmaps/B5-V.bcmap +0 -0
  62. package/cmaps/B5pc-H.bcmap +0 -0
  63. package/cmaps/B5pc-V.bcmap +0 -0
  64. package/cmaps/CNS-EUC-H.bcmap +0 -0
  65. package/cmaps/CNS-EUC-V.bcmap +0 -0
  66. package/cmaps/CNS1-H.bcmap +0 -0
  67. package/cmaps/CNS1-V.bcmap +0 -0
  68. package/cmaps/CNS2-H.bcmap +0 -0
  69. package/cmaps/CNS2-V.bcmap +3 -0
  70. package/cmaps/ETHK-B5-H.bcmap +0 -0
  71. package/cmaps/ETHK-B5-V.bcmap +0 -0
  72. package/cmaps/ETen-B5-H.bcmap +0 -0
  73. package/cmaps/ETen-B5-V.bcmap +0 -0
  74. package/cmaps/ETenms-B5-H.bcmap +3 -0
  75. package/cmaps/ETenms-B5-V.bcmap +0 -0
  76. package/cmaps/EUC-H.bcmap +0 -0
  77. package/cmaps/EUC-V.bcmap +0 -0
  78. package/cmaps/Ext-H.bcmap +0 -0
  79. package/cmaps/Ext-RKSJ-H.bcmap +0 -0
  80. package/cmaps/Ext-RKSJ-V.bcmap +0 -0
  81. package/cmaps/Ext-V.bcmap +0 -0
  82. package/cmaps/GB-EUC-H.bcmap +0 -0
  83. package/cmaps/GB-EUC-V.bcmap +0 -0
  84. package/cmaps/GB-H.bcmap +4 -0
  85. package/cmaps/GB-V.bcmap +0 -0
  86. package/cmaps/GBK-EUC-H.bcmap +0 -0
  87. package/cmaps/GBK-EUC-V.bcmap +0 -0
  88. package/cmaps/GBK2K-H.bcmap +0 -0
  89. package/cmaps/GBK2K-V.bcmap +0 -0
  90. package/cmaps/GBKp-EUC-H.bcmap +0 -0
  91. package/cmaps/GBKp-EUC-V.bcmap +0 -0
  92. package/cmaps/GBT-EUC-H.bcmap +0 -0
  93. package/cmaps/GBT-EUC-V.bcmap +0 -0
  94. package/cmaps/GBT-H.bcmap +0 -0
  95. package/cmaps/GBT-V.bcmap +0 -0
  96. package/cmaps/GBTpc-EUC-H.bcmap +0 -0
  97. package/cmaps/GBTpc-EUC-V.bcmap +0 -0
  98. package/cmaps/GBpc-EUC-H.bcmap +0 -0
  99. package/cmaps/GBpc-EUC-V.bcmap +0 -0
  100. package/cmaps/H.bcmap +0 -0
  101. package/cmaps/HKdla-B5-H.bcmap +0 -0
  102. package/cmaps/HKdla-B5-V.bcmap +0 -0
  103. package/cmaps/HKdlb-B5-H.bcmap +0 -0
  104. package/cmaps/HKdlb-B5-V.bcmap +0 -0
  105. package/cmaps/HKgccs-B5-H.bcmap +0 -0
  106. package/cmaps/HKgccs-B5-V.bcmap +0 -0
  107. package/cmaps/HKm314-B5-H.bcmap +0 -0
  108. package/cmaps/HKm314-B5-V.bcmap +0 -0
  109. package/cmaps/HKm471-B5-H.bcmap +0 -0
  110. package/cmaps/HKm471-B5-V.bcmap +0 -0
  111. package/cmaps/HKscs-B5-H.bcmap +0 -0
  112. package/cmaps/HKscs-B5-V.bcmap +0 -0
  113. package/cmaps/Hankaku.bcmap +0 -0
  114. package/cmaps/Hiragana.bcmap +0 -0
  115. package/cmaps/KSC-EUC-H.bcmap +0 -0
  116. package/cmaps/KSC-EUC-V.bcmap +0 -0
  117. package/cmaps/KSC-H.bcmap +0 -0
  118. package/cmaps/KSC-Johab-H.bcmap +0 -0
  119. package/cmaps/KSC-Johab-V.bcmap +0 -0
  120. package/cmaps/KSC-V.bcmap +0 -0
  121. package/cmaps/KSCms-UHC-H.bcmap +0 -0
  122. package/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  123. package/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  124. package/cmaps/KSCms-UHC-V.bcmap +0 -0
  125. package/cmaps/KSCpc-EUC-H.bcmap +0 -0
  126. package/cmaps/KSCpc-EUC-V.bcmap +0 -0
  127. package/cmaps/Katakana.bcmap +0 -0
  128. package/cmaps/LICENSE +36 -0
  129. package/cmaps/NWP-H.bcmap +0 -0
  130. package/cmaps/NWP-V.bcmap +0 -0
  131. package/cmaps/RKSJ-H.bcmap +0 -0
  132. package/cmaps/RKSJ-V.bcmap +0 -0
  133. package/cmaps/Roman.bcmap +0 -0
  134. package/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  135. package/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  136. package/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  137. package/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  138. package/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  139. package/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  140. package/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  141. package/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  142. package/cmaps/UniGB-UCS2-H.bcmap +0 -0
  143. package/cmaps/UniGB-UCS2-V.bcmap +0 -0
  144. package/cmaps/UniGB-UTF16-H.bcmap +0 -0
  145. package/cmaps/UniGB-UTF16-V.bcmap +0 -0
  146. package/cmaps/UniGB-UTF32-H.bcmap +0 -0
  147. package/cmaps/UniGB-UTF32-V.bcmap +0 -0
  148. package/cmaps/UniGB-UTF8-H.bcmap +0 -0
  149. package/cmaps/UniGB-UTF8-V.bcmap +0 -0
  150. package/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  151. package/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  152. package/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  153. package/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  154. package/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  155. package/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  156. package/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  157. package/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  158. package/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  159. package/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  160. package/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  161. package/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  162. package/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  163. package/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  164. package/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  165. package/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  166. package/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  167. package/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  168. package/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  169. package/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  170. package/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  171. package/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  172. package/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  173. package/cmaps/UniKS-UCS2-H.bcmap +0 -0
  174. package/cmaps/UniKS-UCS2-V.bcmap +0 -0
  175. package/cmaps/UniKS-UTF16-H.bcmap +0 -0
  176. package/cmaps/UniKS-UTF16-V.bcmap +0 -0
  177. package/cmaps/UniKS-UTF32-H.bcmap +0 -0
  178. package/cmaps/UniKS-UTF32-V.bcmap +0 -0
  179. package/cmaps/UniKS-UTF8-H.bcmap +0 -0
  180. package/cmaps/UniKS-UTF8-V.bcmap +0 -0
  181. package/cmaps/V.bcmap +0 -0
  182. package/cmaps/WP-Symbol.bcmap +0 -0
  183. package/iccs/CGATS001Compat-v2-micro.icc +0 -0
  184. package/iccs/LICENSE +116 -0
  185. package/image_decoders/pdf.image_decoders.min.mjs +28 -0
  186. package/image_decoders/pdf.image_decoders.mjs +5378 -0
  187. package/image_decoders/pdf.image_decoders.mjs.map +1 -0
  188. package/legacy/build/pdf.d.mts +1 -0
  189. package/legacy/build/pdf.min.mjs +27 -0
  190. package/legacy/build/pdf.mjs +34799 -0
  191. package/legacy/build/pdf.mjs.map +1 -0
  192. package/legacy/build/pdf.sandbox.min.mjs +27 -0
  193. package/legacy/build/pdf.sandbox.mjs +2502 -0
  194. package/legacy/build/pdf.sandbox.mjs.map +1 -0
  195. package/legacy/build/pdf.worker.min.mjs +27 -0
  196. package/legacy/build/pdf.worker.mjs +71124 -0
  197. package/legacy/build/pdf.worker.mjs.map +1 -0
  198. package/legacy/image_decoders/pdf.image_decoders.min.mjs +27 -0
  199. package/legacy/image_decoders/pdf.image_decoders.mjs +9845 -0
  200. package/legacy/image_decoders/pdf.image_decoders.mjs.map +1 -0
  201. package/legacy/web/images/altText_add.svg +3 -0
  202. package/legacy/web/images/altText_disclaimer.svg +3 -0
  203. package/legacy/web/images/altText_done.svg +3 -0
  204. package/legacy/web/images/altText_spinner.svg +30 -0
  205. package/legacy/web/images/altText_warning.svg +3 -0
  206. package/legacy/web/images/annotation-check.svg +11 -0
  207. package/legacy/web/images/annotation-comment.svg +16 -0
  208. package/legacy/web/images/annotation-help.svg +26 -0
  209. package/legacy/web/images/annotation-insert.svg +10 -0
  210. package/legacy/web/images/annotation-key.svg +11 -0
  211. package/legacy/web/images/annotation-newparagraph.svg +11 -0
  212. package/legacy/web/images/annotation-noicon.svg +7 -0
  213. package/legacy/web/images/annotation-note.svg +42 -0
  214. package/legacy/web/images/annotation-paperclip.svg +6 -0
  215. package/legacy/web/images/annotation-paragraph.svg +16 -0
  216. package/legacy/web/images/annotation-pushpin.svg +7 -0
  217. package/legacy/web/images/checkmark.svg +5 -0
  218. package/legacy/web/images/comment-actionsButton.svg +3 -0
  219. package/legacy/web/images/comment-closeButton.svg +3 -0
  220. package/legacy/web/images/comment-editButton.svg +8 -0
  221. package/legacy/web/images/comment-popup-editButton.svg +5 -0
  222. package/legacy/web/images/cursor-editorFreeHighlight.svg +6 -0
  223. package/legacy/web/images/cursor-editorFreeText.svg +3 -0
  224. package/legacy/web/images/cursor-editorInk.svg +4 -0
  225. package/legacy/web/images/cursor-editorTextHighlight.svg +8 -0
  226. package/legacy/web/images/editor-toolbar-delete.svg +5 -0
  227. package/legacy/web/images/editor-toolbar-edit.svg +3 -0
  228. package/legacy/web/images/findbarButton-next.svg +3 -0
  229. package/legacy/web/images/findbarButton-previous.svg +3 -0
  230. package/legacy/web/images/gv-toolbarButton-download.svg +3 -0
  231. package/legacy/web/images/loading-icon.gif +0 -0
  232. package/legacy/web/images/loading.svg +1 -0
  233. package/legacy/web/images/messageBar_closingButton.svg +3 -0
  234. package/legacy/web/images/messageBar_info.svg +3 -0
  235. package/legacy/web/images/messageBar_warning.svg +3 -0
  236. package/legacy/web/images/pages_closeButton.svg +3 -0
  237. package/legacy/web/images/pages_selected.svg +7 -0
  238. package/legacy/web/images/pages_viewArrow.svg +3 -0
  239. package/legacy/web/images/pages_viewButton.svg +3 -0
  240. package/legacy/web/images/secondaryToolbarButton-documentProperties.svg +3 -0
  241. package/legacy/web/images/secondaryToolbarButton-firstPage.svg +3 -0
  242. package/legacy/web/images/secondaryToolbarButton-handTool.svg +3 -0
  243. package/legacy/web/images/secondaryToolbarButton-lastPage.svg +3 -0
  244. package/legacy/web/images/secondaryToolbarButton-rotateCcw.svg +3 -0
  245. package/legacy/web/images/secondaryToolbarButton-rotateCw.svg +3 -0
  246. package/legacy/web/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
  247. package/legacy/web/images/secondaryToolbarButton-scrollPage.svg +3 -0
  248. package/legacy/web/images/secondaryToolbarButton-scrollVertical.svg +3 -0
  249. package/legacy/web/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
  250. package/legacy/web/images/secondaryToolbarButton-selectTool.svg +3 -0
  251. package/legacy/web/images/secondaryToolbarButton-spreadEven.svg +3 -0
  252. package/legacy/web/images/secondaryToolbarButton-spreadNone.svg +3 -0
  253. package/legacy/web/images/secondaryToolbarButton-spreadOdd.svg +3 -0
  254. package/legacy/web/images/signature-properties-row-check.svg +4 -0
  255. package/legacy/web/images/toolbarButton-bookmark.svg +3 -0
  256. package/legacy/web/images/toolbarButton-currentOutlineItem.svg +3 -0
  257. package/legacy/web/images/toolbarButton-download.svg +4 -0
  258. package/legacy/web/images/toolbarButton-editorFreeText.svg +5 -0
  259. package/legacy/web/images/toolbarButton-editorHighlight.svg +6 -0
  260. package/legacy/web/images/toolbarButton-editorInk.svg +4 -0
  261. package/legacy/web/images/toolbarButton-editorSignature.svg +6 -0
  262. package/legacy/web/images/toolbarButton-editorStamp.svg +8 -0
  263. package/legacy/web/images/toolbarButton-menuArrow.svg +3 -0
  264. package/legacy/web/images/toolbarButton-menuArrowNova.svg +3 -0
  265. package/legacy/web/images/toolbarButton-openFile.svg +3 -0
  266. package/legacy/web/images/toolbarButton-pageDown.svg +3 -0
  267. package/legacy/web/images/toolbarButton-pageUp.svg +3 -0
  268. package/legacy/web/images/toolbarButton-presentationMode.svg +3 -0
  269. package/legacy/web/images/toolbarButton-print.svg +3 -0
  270. package/legacy/web/images/toolbarButton-search.svg +3 -0
  271. package/legacy/web/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
  272. package/legacy/web/images/toolbarButton-signaturePropertiesError.svg +7 -0
  273. package/legacy/web/images/toolbarButton-signaturePropertiesVerified.svg +7 -0
  274. package/legacy/web/images/toolbarButton-viewAttachments.svg +3 -0
  275. package/legacy/web/images/toolbarButton-viewLayers.svg +3 -0
  276. package/legacy/web/images/toolbarButton-viewOutline.svg +3 -0
  277. package/legacy/web/images/toolbarButton-viewThumbnail.svg +3 -0
  278. package/legacy/web/images/toolbarButton-viewsManagerToggle.svg +3 -0
  279. package/legacy/web/images/toolbarButton-zoomIn.svg +3 -0
  280. package/legacy/web/images/toolbarButton-zoomOut.svg +3 -0
  281. package/legacy/web/images/treeitem-collapsed.svg +1 -0
  282. package/legacy/web/images/treeitem-expanded.svg +1 -0
  283. package/legacy/web/pdf_viewer.css +6463 -0
  284. package/legacy/web/pdf_viewer.d.mts +1 -0
  285. package/legacy/web/pdf_viewer.mjs +14798 -0
  286. package/legacy/web/pdf_viewer.mjs.map +1 -0
  287. package/legacy/webpack.mjs +26 -0
  288. package/package.json +33 -4
  289. package/standard_fonts/FoxitDingbats.pfb +0 -0
  290. package/standard_fonts/FoxitFixed.pfb +0 -0
  291. package/standard_fonts/FoxitFixedBold.pfb +0 -0
  292. package/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  293. package/standard_fonts/FoxitFixedItalic.pfb +0 -0
  294. package/standard_fonts/FoxitSerif.pfb +0 -0
  295. package/standard_fonts/FoxitSerifBold.pfb +0 -0
  296. package/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  297. package/standard_fonts/FoxitSerifItalic.pfb +0 -0
  298. package/standard_fonts/FoxitSymbol.pfb +0 -0
  299. package/standard_fonts/LICENSE_FOXIT +27 -0
  300. package/standard_fonts/LICENSE_LIBERATION +363 -0
  301. package/standard_fonts/LiberationSans-Bold.ttf +0 -0
  302. package/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  303. package/standard_fonts/LiberationSans-Italic.ttf +0 -0
  304. package/standard_fonts/LiberationSans-Regular.ttf +0 -0
  305. package/types/external/brotli/decode.d.ts +5 -0
  306. package/types/external/jbig2/jbig2.d.ts +2 -0
  307. package/types/external/openjpeg/openjpeg.d.ts +2 -0
  308. package/types/external/qcms/qcms.d.ts +96 -0
  309. package/types/external/qcms/qcms_utils.d.ts +9 -0
  310. package/types/src/core/ascii_85_stream.d.ts +7 -0
  311. package/types/src/core/ascii_hex_stream.d.ts +7 -0
  312. package/types/src/core/base_stream.d.ts +52 -0
  313. package/types/src/core/brotli_stream.d.ts +9 -0
  314. package/types/src/core/calculate_md5.d.ts +1 -0
  315. package/types/src/core/calculate_sha256.d.ts +1 -0
  316. package/types/src/core/calculate_sha_other.d.ts +2 -0
  317. package/types/src/core/catalog.d.ts +169 -0
  318. package/types/src/core/ccitt_stream.d.ts +18 -0
  319. package/types/src/core/cleanup_helper.d.ts +1 -0
  320. package/types/src/core/colorspace.d.ts +168 -0
  321. package/types/src/core/colorspace_utils.d.ts +21 -0
  322. package/types/src/core/core_utils.d.ts +136 -0
  323. package/types/src/core/crypto.d.ts +135 -0
  324. package/types/src/core/decode_stream.d.ts +32 -0
  325. package/types/src/core/decrypt_stream.d.ts +9 -0
  326. package/types/src/core/file_spec.d.ts +67 -0
  327. package/types/src/core/flate_stream.d.ts +14 -0
  328. package/types/src/core/icc_colorspace.d.ts +21 -0
  329. package/types/src/core/image_resizer.d.ts +24 -0
  330. package/types/src/core/image_utils.d.ts +52 -0
  331. package/types/src/core/jbig2_ccittFax.d.ts +13 -0
  332. package/types/src/core/jbig2_stream.d.ts +17 -0
  333. package/types/src/core/jpeg_stream.d.ts +24 -0
  334. package/types/src/core/jpg.d.ts +58 -0
  335. package/types/src/core/jpx.d.ts +24 -0
  336. package/types/src/core/jpx_stream.d.ts +15 -0
  337. package/types/src/core/lzw_stream.d.ts +19 -0
  338. package/types/src/core/metadata_parser.d.ts +13 -0
  339. package/types/src/core/name_number_tree.d.ts +21 -0
  340. package/types/src/core/parser.d.ts +119 -0
  341. package/types/src/core/pattern.d.ts +61 -0
  342. package/types/src/core/predictor_stream.d.ts +14 -0
  343. package/types/src/core/primitives.d.ts +95 -0
  344. package/types/src/core/run_length_stream.d.ts +6 -0
  345. package/types/src/core/sasl_prep.d.ts +1 -0
  346. package/types/src/core/sound.d.ts +39 -0
  347. package/types/src/core/stream.d.ts +20 -0
  348. package/types/src/core/string_utils.d.ts +5 -0
  349. package/types/src/core/struct_tree.d.ts +93 -0
  350. package/types/src/core/unicode.d.ts +5 -0
  351. package/types/src/core/wasm_image.d.ts +21 -0
  352. package/types/src/core/xml_parser.d.ts +78 -0
  353. package/types/src/core/xref.d.ts +39 -0
  354. package/types/src/display/annotation_layer.d.ts +265 -0
  355. package/types/src/display/annotation_storage.d.ts +94 -0
  356. package/types/src/display/api.d.ts +1693 -0
  357. package/types/src/display/api_utils.d.ts +13 -0
  358. package/types/src/display/binary_data_factory.d.ts +22 -0
  359. package/types/src/display/canvas.d.ts +257 -0
  360. package/types/src/display/canvas_dependency_tracker.d.ts +221 -0
  361. package/types/src/display/canvas_factory.d.ts +29 -0
  362. package/types/src/display/content_disposition.d.ts +6 -0
  363. package/types/src/display/display_utils.d.ts +172 -0
  364. package/types/src/display/draw_layer.d.ts +143 -0
  365. package/types/src/display/editor/alt_text.d.ts +34 -0
  366. package/types/src/display/editor/annotation_editor_layer.d.ts +226 -0
  367. package/types/src/display/editor/color_picker.d.ts +40 -0
  368. package/types/src/display/editor/comment.d.ts +59 -0
  369. package/types/src/display/editor/draw.d.ts +175 -0
  370. package/types/src/display/editor/drawers/contour.d.ts +3 -0
  371. package/types/src/display/editor/drawers/freedraw.d.ts +34 -0
  372. package/types/src/display/editor/drawers/highlight.d.ts +120 -0
  373. package/types/src/display/editor/drawers/inkdraw.d.ts +134 -0
  374. package/types/src/display/editor/drawers/outline.d.ts +81 -0
  375. package/types/src/display/editor/drawers/signaturedraw.d.ts +79 -0
  376. package/types/src/display/editor/editor.d.ts +581 -0
  377. package/types/src/display/editor/freetext.d.ts +63 -0
  378. package/types/src/display/editor/highlight.d.ts +85 -0
  379. package/types/src/display/editor/ink.d.ts +49 -0
  380. package/types/src/display/editor/signature.d.ts +77 -0
  381. package/types/src/display/editor/stamp.d.ts +49 -0
  382. package/types/src/display/editor/toolbar.d.ts +26 -0
  383. package/types/src/display/editor/tools.d.ts +503 -0
  384. package/types/src/display/fetch_stream.d.ts +7 -0
  385. package/types/src/display/filter_factory.d.ts +53 -0
  386. package/types/src/display/font_loader.d.ts +52 -0
  387. package/types/src/display/metadata.d.ts +10 -0
  388. package/types/src/display/network.d.ts +20 -0
  389. package/types/src/display/network_stream.d.ts +2 -0
  390. package/types/src/display/network_utils.d.ts +16 -0
  391. package/types/src/display/node_stream.d.ts +4 -0
  392. package/types/src/display/node_utils.d.ts +18 -0
  393. package/types/src/display/obj_bin_transform_display.d.ts +50 -0
  394. package/types/src/display/optional_content_config.d.ts +28 -0
  395. package/types/src/display/page_viewport.d.ts +137 -0
  396. package/types/src/display/pages_mapper.d.ts +78 -0
  397. package/types/src/display/pattern_helper.d.ts +88 -0
  398. package/types/src/display/pdf_objects.d.ts +38 -0
  399. package/types/src/display/svg_factory.d.ts +14 -0
  400. package/types/src/display/text_layer.d.ts +93 -0
  401. package/types/src/display/text_layer_images.d.ts +10 -0
  402. package/types/src/display/touch_manager.d.ts +55 -0
  403. package/types/src/display/transport_stream.d.ts +11 -0
  404. package/types/src/display/webgpu.d.ts +11 -0
  405. package/types/src/display/worker_options.d.ts +25 -0
  406. package/types/src/display/xfa_layer.d.ts +49 -0
  407. package/types/src/display/xfa_text.d.ts +18 -0
  408. package/types/src/pdf.d.ts +69 -0
  409. package/types/src/shared/base_pdf_stream.d.ts +120 -0
  410. package/types/src/shared/css_utils.d.ts +8 -0
  411. package/types/src/shared/image_utils.d.ts +28 -0
  412. package/types/src/shared/internal_evt.d.ts +7 -0
  413. package/types/src/shared/math_clamp.d.ts +1 -0
  414. package/types/src/shared/message_handler.d.ts +39 -0
  415. package/types/src/shared/murmurhash3.d.ts +7 -0
  416. package/types/src/shared/obj_bin_transform_utils.d.ts +27 -0
  417. package/types/src/shared/scripting_utils.d.ts +18 -0
  418. package/types/src/shared/util.d.ts +433 -0
  419. package/types/web/annotation_editor_layer_builder.d.ts +66 -0
  420. package/types/web/annotation_layer_builder.d.ts +107 -0
  421. package/types/web/app_options.d.ts +16 -0
  422. package/types/web/autolinker.d.ts +29 -0
  423. package/types/web/base_download_manager.d.ts +24 -0
  424. package/types/web/base_pdf_page_view.d.ts +29 -0
  425. package/types/web/comment_manager.d.ts +20 -0
  426. package/types/web/download_manager.d.ts +4 -0
  427. package/types/web/draw_layer_builder.d.ts +64 -0
  428. package/types/web/event_utils.d.ts +68 -0
  429. package/types/web/generic_scripting.d.ts +8 -0
  430. package/types/web/genericl10n.d.ts +18 -0
  431. package/types/web/internal_evt.d.ts +7 -0
  432. package/types/web/l10n.d.ts +31 -0
  433. package/types/web/menu.d.ts +11 -0
  434. package/types/web/pdf_find_controller.d.ts +142 -0
  435. package/types/web/pdf_find_utils.d.ts +10 -0
  436. package/types/web/pdf_history.d.ts +116 -0
  437. package/types/web/pdf_link_service.d.ts +148 -0
  438. package/types/web/pdf_page_detail_view.d.ts +27 -0
  439. package/types/web/pdf_page_view.d.ts +256 -0
  440. package/types/web/pdf_rendering_queue.d.ts +49 -0
  441. package/types/web/pdf_scripting_manager.component.d.ts +5 -0
  442. package/types/web/pdf_scripting_manager.d.ts +57 -0
  443. package/types/web/pdf_single_page_viewer.d.ts +7 -0
  444. package/types/web/pdf_thumbnail_view.d.ts +108 -0
  445. package/types/web/pdf_thumbnail_viewer.d.ts +179 -0
  446. package/types/web/pdf_viewer.component.d.ts +23 -0
  447. package/types/web/pdf_viewer.d.ts +653 -0
  448. package/types/web/renderable_view.d.ts +33 -0
  449. package/types/web/sidebar.d.ts +65 -0
  450. package/types/web/struct_tree_layer_builder.d.ts +39 -0
  451. package/types/web/text_accessibility.d.ts +46 -0
  452. package/types/web/text_highlighter.d.ts +62 -0
  453. package/types/web/text_layer_builder.d.ts +70 -0
  454. package/types/web/ui_utils.d.ts +260 -0
  455. package/types/web/xfa_layer_builder.d.ts +50 -0
  456. package/wasm/LICENSE_JBIG2 +196 -0
  457. package/wasm/LICENSE_OPENJPEG +39 -0
  458. package/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  459. package/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  460. package/wasm/LICENSE_PDFJS_QCMS +19 -0
  461. package/wasm/LICENSE_QCMS +21 -0
  462. package/wasm/jbig2.wasm +0 -0
  463. package/wasm/jbig2_nowasm_fallback.js +15 -0
  464. package/wasm/openjpeg.wasm +0 -0
  465. package/wasm/openjpeg_nowasm_fallback.js +17 -0
  466. package/wasm/qcms_bg.wasm +0 -0
  467. package/wasm/quickjs-eval.js +16 -0
  468. package/wasm/quickjs-eval.wasm +0 -0
  469. package/web/images/altText_add.svg +3 -0
  470. package/web/images/altText_disclaimer.svg +3 -0
  471. package/web/images/altText_done.svg +3 -0
  472. package/web/images/altText_spinner.svg +30 -0
  473. package/web/images/altText_warning.svg +3 -0
  474. package/web/images/annotation-check.svg +11 -0
  475. package/web/images/annotation-comment.svg +16 -0
  476. package/web/images/annotation-help.svg +26 -0
  477. package/web/images/annotation-insert.svg +10 -0
  478. package/web/images/annotation-key.svg +11 -0
  479. package/web/images/annotation-newparagraph.svg +11 -0
  480. package/web/images/annotation-noicon.svg +7 -0
  481. package/web/images/annotation-note.svg +42 -0
  482. package/web/images/annotation-paperclip.svg +6 -0
  483. package/web/images/annotation-paragraph.svg +16 -0
  484. package/web/images/annotation-pushpin.svg +7 -0
  485. package/web/images/checkmark.svg +5 -0
  486. package/web/images/comment-actionsButton.svg +3 -0
  487. package/web/images/comment-closeButton.svg +3 -0
  488. package/web/images/comment-editButton.svg +8 -0
  489. package/web/images/comment-popup-editButton.svg +5 -0
  490. package/web/images/cursor-editorFreeHighlight.svg +6 -0
  491. package/web/images/cursor-editorFreeText.svg +3 -0
  492. package/web/images/cursor-editorInk.svg +4 -0
  493. package/web/images/cursor-editorTextHighlight.svg +8 -0
  494. package/web/images/editor-toolbar-delete.svg +5 -0
  495. package/web/images/editor-toolbar-edit.svg +3 -0
  496. package/web/images/findbarButton-next.svg +3 -0
  497. package/web/images/findbarButton-previous.svg +3 -0
  498. package/web/images/gv-toolbarButton-download.svg +3 -0
  499. package/web/images/loading-icon.gif +0 -0
  500. package/web/images/loading.svg +1 -0
  501. package/web/images/messageBar_closingButton.svg +3 -0
  502. package/web/images/messageBar_info.svg +3 -0
  503. package/web/images/messageBar_warning.svg +3 -0
  504. package/web/images/pages_closeButton.svg +3 -0
  505. package/web/images/pages_selected.svg +7 -0
  506. package/web/images/pages_viewArrow.svg +3 -0
  507. package/web/images/pages_viewButton.svg +3 -0
  508. package/web/images/secondaryToolbarButton-documentProperties.svg +3 -0
  509. package/web/images/secondaryToolbarButton-firstPage.svg +3 -0
  510. package/web/images/secondaryToolbarButton-handTool.svg +3 -0
  511. package/web/images/secondaryToolbarButton-lastPage.svg +3 -0
  512. package/web/images/secondaryToolbarButton-rotateCcw.svg +3 -0
  513. package/web/images/secondaryToolbarButton-rotateCw.svg +3 -0
  514. package/web/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
  515. package/web/images/secondaryToolbarButton-scrollPage.svg +3 -0
  516. package/web/images/secondaryToolbarButton-scrollVertical.svg +3 -0
  517. package/web/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
  518. package/web/images/secondaryToolbarButton-selectTool.svg +3 -0
  519. package/web/images/secondaryToolbarButton-spreadEven.svg +3 -0
  520. package/web/images/secondaryToolbarButton-spreadNone.svg +3 -0
  521. package/web/images/secondaryToolbarButton-spreadOdd.svg +3 -0
  522. package/web/images/signature-properties-row-check.svg +4 -0
  523. package/web/images/toolbarButton-bookmark.svg +3 -0
  524. package/web/images/toolbarButton-currentOutlineItem.svg +3 -0
  525. package/web/images/toolbarButton-download.svg +4 -0
  526. package/web/images/toolbarButton-editorFreeText.svg +5 -0
  527. package/web/images/toolbarButton-editorHighlight.svg +6 -0
  528. package/web/images/toolbarButton-editorInk.svg +4 -0
  529. package/web/images/toolbarButton-editorSignature.svg +6 -0
  530. package/web/images/toolbarButton-editorStamp.svg +8 -0
  531. package/web/images/toolbarButton-menuArrow.svg +3 -0
  532. package/web/images/toolbarButton-menuArrowNova.svg +3 -0
  533. package/web/images/toolbarButton-openFile.svg +3 -0
  534. package/web/images/toolbarButton-pageDown.svg +3 -0
  535. package/web/images/toolbarButton-pageUp.svg +3 -0
  536. package/web/images/toolbarButton-presentationMode.svg +3 -0
  537. package/web/images/toolbarButton-print.svg +3 -0
  538. package/web/images/toolbarButton-search.svg +3 -0
  539. package/web/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
  540. package/web/images/toolbarButton-signaturePropertiesError.svg +7 -0
  541. package/web/images/toolbarButton-signaturePropertiesVerified.svg +7 -0
  542. package/web/images/toolbarButton-viewAttachments.svg +3 -0
  543. package/web/images/toolbarButton-viewLayers.svg +3 -0
  544. package/web/images/toolbarButton-viewOutline.svg +3 -0
  545. package/web/images/toolbarButton-viewThumbnail.svg +3 -0
  546. package/web/images/toolbarButton-viewsManagerToggle.svg +3 -0
  547. package/web/images/toolbarButton-zoomIn.svg +3 -0
  548. package/web/images/toolbarButton-zoomOut.svg +3 -0
  549. package/web/images/treeitem-collapsed.svg +1 -0
  550. package/web/images/treeitem-expanded.svg +1 -0
  551. package/web/pdf_viewer.css +6463 -0
  552. package/web/pdf_viewer.d.mts +1 -0
  553. package/web/pdf_viewer.mjs +9811 -0
  554. package/web/pdf_viewer.mjs.map +1 -0
  555. package/webpack.mjs +26 -0
@@ -0,0 +1,1693 @@
1
+ export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
2
+ export type RefProxy = {
3
+ num: number;
4
+ gen: number;
5
+ };
6
+ /**
7
+ * Document initialization / loading parameters object.
8
+ */
9
+ export type DocumentInitParameters = {
10
+ /**
11
+ * - The URL of the PDF.
12
+ */
13
+ url?: string | URL | undefined;
14
+ /**
15
+ * -
16
+ * Binary PDF data.
17
+ * Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is
18
+ * BASE64-encoded, use `atob()` to convert it to a binary string first.
19
+ *
20
+ * NOTE: If TypedArrays are used they will generally be transferred to the
21
+ * worker-thread. This will help reduce main-thread memory usage, however
22
+ * it will take ownership of the TypedArrays.
23
+ */
24
+ data?: string | number[] | ArrayBuffer | TypedArray | undefined;
25
+ /**
26
+ * - Basic authentication headers.
27
+ */
28
+ httpHeaders?: object | undefined;
29
+ /**
30
+ * - Indicates whether or not
31
+ * cross-site Access-Control requests should be made using credentials such
32
+ * as cookies or authorization headers. The default is `false`.
33
+ */
34
+ withCredentials?: boolean | undefined;
35
+ /**
36
+ * - For decrypting password-protected PDFs.
37
+ */
38
+ password?: string | undefined;
39
+ /**
40
+ * - Allows for using a custom range
41
+ * transport implementation.
42
+ */
43
+ range?: PDFDataRangeTransport | undefined;
44
+ /**
45
+ * - Specify maximum number of bytes fetched
46
+ * per range request. The default value is 65536 (= 2^16).
47
+ */
48
+ rangeChunkSize?: number | undefined;
49
+ /**
50
+ * - The worker that will be used for loading and
51
+ * parsing the PDF data.
52
+ */
53
+ worker?: PDFWorker | undefined;
54
+ /**
55
+ * - Controls the logging level; the constants
56
+ * from {@link VerbosityLevel} should be used.
57
+ */
58
+ verbosity?: number | undefined;
59
+ /**
60
+ * - The base URL of the document, used when
61
+ * attempting to recover valid absolute URLs for annotations, and outline
62
+ * items, that (incorrectly) only specify relative URLs.
63
+ */
64
+ docBaseUrl?: string | undefined;
65
+ /**
66
+ * - The URL where the predefined Adobe CMaps are
67
+ * located. Include the trailing slash.
68
+ */
69
+ cMapUrl?: string | undefined;
70
+ /**
71
+ * - Specifies if the Adobe CMaps are binary
72
+ * packed or not. The default value is `true`.
73
+ */
74
+ cMapPacked?: boolean | undefined;
75
+ /**
76
+ * - The URL where the predefined ICC profiles are
77
+ * located. Include the trailing slash.
78
+ */
79
+ iccUrl?: string | undefined;
80
+ /**
81
+ * - When `true`, fonts that aren't
82
+ * embedded in the PDF document will fallback to a system font.
83
+ * The default value is `true` in web environments and `false` in Node.js;
84
+ * unless `disableFontFace === true` in which case this defaults to `false`
85
+ * regardless of the environment (to prevent completely broken fonts).
86
+ */
87
+ useSystemFonts?: boolean | undefined;
88
+ /**
89
+ * - The URL where the standard font
90
+ * files are located. Include the trailing slash.
91
+ */
92
+ standardFontDataUrl?: string | undefined;
93
+ /**
94
+ * - The URL where the wasm files are located.
95
+ * Include the trailing slash.
96
+ */
97
+ wasmUrl?: string | undefined;
98
+ /**
99
+ * - Enable using the Fetch API in the
100
+ * worker-thread when reading built-in CMap files, standard font files,
101
+ * and wasm files. If `true`, the `BinaryDataFactory` option is ignored.
102
+ * The default value is `true` in web environments and `false` in Node.js.
103
+ */
104
+ useWorkerFetch?: boolean | undefined;
105
+ /**
106
+ * - Attempt to use WebAssembly in order to
107
+ * improve e.g. image decoding performance.
108
+ * The default value is `true`.
109
+ */
110
+ useWasm?: boolean | undefined;
111
+ /**
112
+ * - Reject certain promises, e.g.
113
+ * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated
114
+ * PDF data cannot be successfully parsed, instead of attempting to recover
115
+ * whatever possible of the data. The default value is `false`.
116
+ */
117
+ stopAtErrors?: boolean | undefined;
118
+ /**
119
+ * - The maximum allowed image size in total
120
+ * pixels, i.e. width * height. Images above this value will not be rendered.
121
+ * Use -1 for no limit, which is also the default value.
122
+ */
123
+ maxImageSize?: number | undefined;
124
+ /**
125
+ * - Determines if we can use
126
+ * `OffscreenCanvas` in the worker. Primarily used to improve performance of
127
+ * image conversion/rendering.
128
+ * The default value is `true` in web environments and `false` in Node.js.
129
+ */
130
+ isOffscreenCanvasSupported?: boolean | undefined;
131
+ /**
132
+ * - Determines if we can use
133
+ * `ImageDecoder` in the worker. Primarily used to improve performance of
134
+ * image conversion/rendering.
135
+ * The default value is `true` in web environments and `false` in Node.js.
136
+ */
137
+ isImageDecoderSupported?: boolean | undefined;
138
+ /**
139
+ * - The integer value is used to
140
+ * know when an image must be resized (uses `OffscreenCanvas` in the worker).
141
+ * If it's -1 then a possibly slow algorithm is used to guess the max value.
142
+ */
143
+ canvasMaxAreaInBytes?: number | undefined;
144
+ /**
145
+ * - By default fonts are converted to
146
+ * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.
147
+ * If disabled, fonts will be rendered using a built-in font renderer that
148
+ * constructs the glyphs with primitive path commands.
149
+ * The default value is `false` in web environments and `true` in Node.js.
150
+ */
151
+ disableFontFace?: boolean | undefined;
152
+ /**
153
+ * - Include additional properties,
154
+ * which are unused during rendering of PDF documents, when exporting the
155
+ * parsed font data from the worker-thread. This may be useful for debugging
156
+ * purposes (and backwards compatibility), but note that it will lead to
157
+ * increased memory usage. The default value is `false`.
158
+ */
159
+ fontExtraProperties?: boolean | undefined;
160
+ /**
161
+ * - Render Xfa forms if any.
162
+ * The default value is `false`.
163
+ */
164
+ enableXfa?: boolean | undefined;
165
+ /**
166
+ * - Specify an explicit document
167
+ * context to create elements with and to load resources, such as fonts,
168
+ * into. Defaults to the current document.
169
+ */
170
+ ownerDocument?: HTMLDocument | undefined;
171
+ /**
172
+ * - Disable range request loading of PDF
173
+ * files. When enabled, and if the server supports partial content requests,
174
+ * then the PDF will be fetched in chunks. The default value is `false`.
175
+ */
176
+ disableRange?: boolean | undefined;
177
+ /**
178
+ * - Disable streaming of PDF file data.
179
+ * By default PDF.js attempts to load PDF files in chunks. The default value
180
+ * is `false`.
181
+ */
182
+ disableStream?: boolean | undefined;
183
+ /**
184
+ * - Disable pre-fetching of PDF file
185
+ * data. When range requests are enabled PDF.js will automatically keep
186
+ * fetching more data even if it isn't needed to display the current page.
187
+ * The default value is `false`.
188
+ *
189
+ * NOTE: It is also necessary to disable streaming, see above, in order for
190
+ * disabling of pre-fetching to work correctly.
191
+ */
192
+ disableAutoFetch?: boolean | undefined;
193
+ /**
194
+ * - Enables special hooks for debugging PDF.js
195
+ * (see `web/debugger.js`). The default value is `false`.
196
+ */
197
+ pdfBug?: boolean | undefined;
198
+ /**
199
+ * - The factory that will be used when
200
+ * creating canvases. The default value is {DOMCanvasFactory}.
201
+ */
202
+ CanvasFactory?: object | undefined;
203
+ /**
204
+ * - The factory that will be used to
205
+ * create SVG filters when rendering some images on the main canvas.
206
+ * The default value is {DOMFilterFactory}.
207
+ */
208
+ FilterFactory?: object | undefined;
209
+ /**
210
+ * - The factory that will be used when
211
+ * falling back to reading built-in CMap files, standard font files,
212
+ * and wasm files in the main-thread.
213
+ * The default value is {DOMBinaryDataFactory}.
214
+ */
215
+ BinaryDataFactory?: object | undefined;
216
+ /**
217
+ * - Enables hardware acceleration for
218
+ * rendering. The default value is `false`.
219
+ */
220
+ enableHWA?: boolean | undefined;
221
+ /**
222
+ * - The pages mapper that will be used to map
223
+ * page ids and page numbers. It's used when the page order is changed or some
224
+ * pages are removed, cloned, etc.
225
+ */
226
+ pagesMapper?: object | undefined;
227
+ };
228
+ export type OnProgressParameters = {
229
+ /**
230
+ * - Currently loaded number of bytes.
231
+ */
232
+ loaded: number;
233
+ /**
234
+ * - Total number of bytes in the PDF file.
235
+ */
236
+ total: number;
237
+ /**
238
+ * - Currently loaded percentage, as an integer value
239
+ * in the [0, 100] range. If `total` is undefined, the percentage is `NaN`.
240
+ */
241
+ percent: number;
242
+ };
243
+ /**
244
+ * Page getViewport parameters.
245
+ */
246
+ export type GetViewportParameters = {
247
+ /**
248
+ * - The desired scale of the viewport.
249
+ */
250
+ scale: number;
251
+ /**
252
+ * - The desired rotation, in degrees, of
253
+ * the viewport. If omitted it defaults to the page rotation.
254
+ */
255
+ rotation?: number | undefined;
256
+ /**
257
+ * - The horizontal, i.e. x-axis, offset.
258
+ * The default value is `0`.
259
+ */
260
+ offsetX?: number | undefined;
261
+ /**
262
+ * - The vertical, i.e. y-axis, offset.
263
+ * The default value is `0`.
264
+ */
265
+ offsetY?: number | undefined;
266
+ /**
267
+ * - If true, the y-axis will not be
268
+ * flipped. The default value is `false`.
269
+ */
270
+ dontFlip?: boolean | undefined;
271
+ };
272
+ /**
273
+ * Page getTextContent parameters.
274
+ */
275
+ export type getTextContentParameters = {
276
+ /**
277
+ * - When true include marked
278
+ * content items in the items array of TextContent. The default is `false`.
279
+ */
280
+ includeMarkedContent?: boolean | undefined;
281
+ /**
282
+ * - When true the text is *not*
283
+ * normalized in the worker-thread. The default is `false`.
284
+ */
285
+ disableNormalization?: boolean | undefined;
286
+ };
287
+ /**
288
+ * Page text content.
289
+ */
290
+ export type TextContent = {
291
+ /**
292
+ * - Array of
293
+ * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent
294
+ * items are included when includeMarkedContent is true.
295
+ */
296
+ items: Array<TextItem | TextMarkedContent>;
297
+ /**
298
+ * - {@link TextStyle} objects,
299
+ * indexed by font name.
300
+ */
301
+ styles: Record<string, TextStyle>;
302
+ /**
303
+ * - The document /Lang attribute.
304
+ */
305
+ lang: string | null;
306
+ };
307
+ /**
308
+ * Page text content part.
309
+ */
310
+ export type TextItem = {
311
+ /**
312
+ * - Text content.
313
+ */
314
+ str: string;
315
+ /**
316
+ * - Text direction: 'ttb', 'ltr' or 'rtl'.
317
+ */
318
+ dir: string;
319
+ /**
320
+ * - Transformation matrix.
321
+ */
322
+ transform: Array<any>;
323
+ /**
324
+ * - Width in device space.
325
+ */
326
+ width: number;
327
+ /**
328
+ * - Height in device space.
329
+ */
330
+ height: number;
331
+ /**
332
+ * - Font name used by PDF.js for converted font.
333
+ */
334
+ fontName: string;
335
+ /**
336
+ * - Indicating if the text content is followed by a
337
+ * line-break.
338
+ */
339
+ hasEOL: boolean;
340
+ };
341
+ /**
342
+ * Page text marked content part.
343
+ */
344
+ export type TextMarkedContent = {
345
+ /**
346
+ * - Either 'beginMarkedContent',
347
+ * 'beginMarkedContentProps', or 'endMarkedContent'.
348
+ */
349
+ type: string;
350
+ /**
351
+ * - The marked content identifier. Only used for type
352
+ * 'beginMarkedContentProps'.
353
+ */
354
+ id: string;
355
+ };
356
+ /**
357
+ * Text style.
358
+ */
359
+ export type TextStyle = {
360
+ /**
361
+ * - Font ascent.
362
+ */
363
+ ascent: number;
364
+ /**
365
+ * - Font descent.
366
+ */
367
+ descent: number;
368
+ /**
369
+ * - Whether or not the text is in vertical mode.
370
+ */
371
+ vertical: boolean;
372
+ /**
373
+ * - The possible font family.
374
+ */
375
+ fontFamily: string;
376
+ };
377
+ /**
378
+ * Page annotation parameters.
379
+ */
380
+ export type GetAnnotationsParameters = {
381
+ /**
382
+ * - Determines the annotations that are fetched,
383
+ * can be 'display' (viewable annotations), 'print' (printable annotations),
384
+ * or 'any' (all annotations). The default value is 'display'.
385
+ */
386
+ intent?: string | undefined;
387
+ };
388
+ /**
389
+ * Page render parameters.
390
+ */
391
+ export type RenderParameters = {
392
+ /**
393
+ * - A DOM Canvas object. The default
394
+ * value is the canvas associated with the `canvasContext` parameter if no
395
+ * value is provided explicitly.
396
+ */
397
+ canvas: HTMLCanvasElement | null;
398
+ /**
399
+ * - Rendering viewport obtained by calling
400
+ * the `PDFPageProxy.getViewport` method.
401
+ */
402
+ viewport: PageViewport;
403
+ /**
404
+ * - 2D context of a DOM
405
+ * Canvas object for backwards compatibility; it is recommended to use the
406
+ * `canvas` parameter instead.
407
+ * If the context must absolutely be used to render the page, the canvas must
408
+ * be null.
409
+ */
410
+ canvasContext?: CanvasRenderingContext2D | undefined;
411
+ /**
412
+ * - Rendering intent, can be 'display', 'print',
413
+ * or 'any'. The default value is 'display'.
414
+ */
415
+ intent?: string | undefined;
416
+ /**
417
+ * Controls which annotations are rendered
418
+ * onto the canvas, for annotations with appearance-data; the values from
419
+ * {@link AnnotationMode} should be used. The following values are supported:
420
+ * - `AnnotationMode.DISABLE`, which disables all annotations.
421
+ * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus
422
+ * it also depends on the `intent`-option, see above).
423
+ * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain
424
+ * interactive form elements (those will be rendered in the display layer).
425
+ * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations
426
+ * (as above) but where interactive form elements are updated with data
427
+ * from the {@link AnnotationStorage}-instance; useful e.g. for printing.
428
+ * The default value is `AnnotationMode.ENABLE`.
429
+ */
430
+ annotationMode?: number | undefined;
431
+ /**
432
+ * - Additional transform, applied just
433
+ * before viewport transform.
434
+ */
435
+ transform?: any[] | undefined;
436
+ /**
437
+ * - Background
438
+ * to use for the canvas.
439
+ * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS
440
+ * <color> value, a `CanvasGradient` object (a linear or radial gradient) or
441
+ * a `CanvasPattern` object (a repetitive image). The default value is
442
+ * 'rgb(255,255,255)'.
443
+ *
444
+ * NOTE: This option may be partially, or completely, ignored when the
445
+ * `pageColors`-option is used.
446
+ */
447
+ background?: string | CanvasGradient | CanvasPattern | undefined;
448
+ /**
449
+ * - Overwrites background and foreground colors
450
+ * with user defined ones in order to improve readability in high contrast
451
+ * mode.
452
+ */
453
+ pageColors?: object | undefined;
454
+ /**
455
+ * -
456
+ * A promise that should resolve with an {@link OptionalContentConfig}created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,
457
+ * the configuration will be fetched automatically with the default visibility
458
+ * states set.
459
+ */
460
+ optionalContentConfigPromise?: Promise<OptionalContentConfig> | undefined;
461
+ /**
462
+ * - Map some
463
+ * annotation ids with canvases used to render them.
464
+ */
465
+ annotationCanvasMap?: Map<string, HTMLCanvasElement> | undefined;
466
+ printAnnotationStorage?: PrintAnnotationStorage | undefined;
467
+ /**
468
+ * - Render the page in editing mode.
469
+ */
470
+ isEditing?: boolean | undefined;
471
+ /**
472
+ * - Record the location of images in the PDF
473
+ */
474
+ recordImages?: boolean | undefined;
475
+ /**
476
+ * - Record the dependencies and bounding
477
+ * boxes of all PDF operations that render onto the canvas.
478
+ */
479
+ recordOperations?: boolean | undefined;
480
+ /**
481
+ * - If provided, only
482
+ * run for which this function returns `true`.
483
+ */
484
+ operationsFilter?: OperationsFilter | undefined;
485
+ };
486
+ export type OperationsFilter = (index: number, operatorList: PDFOperatorList) => boolean;
487
+ /**
488
+ * Page getOperatorList parameters.
489
+ */
490
+ export type GetOperatorListParameters = {
491
+ /**
492
+ * - Rendering intent, can be 'display', 'print',
493
+ * or 'any'. The default value is 'display'.
494
+ */
495
+ intent?: string | undefined;
496
+ /**
497
+ * Controls which annotations are included
498
+ * in the operatorList, for annotations with appearance-data; the values from
499
+ * {@link AnnotationMode} should be used. The following values are supported:
500
+ * - `AnnotationMode.DISABLE`, which disables all annotations.
501
+ * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus
502
+ * it also depends on the `intent`-option, see above).
503
+ * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain
504
+ * interactive form elements (those will be rendered in the display layer).
505
+ * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations
506
+ * (as above) but where interactive form elements are updated with data
507
+ * from the {@link AnnotationStorage}-instance; useful e.g. for printing.
508
+ * The default value is `AnnotationMode.ENABLE`.
509
+ */
510
+ annotationMode?: number | undefined;
511
+ printAnnotationStorage?: PrintAnnotationStorage | undefined;
512
+ /**
513
+ * - Render the page in editing mode.
514
+ */
515
+ isEditing?: boolean | undefined;
516
+ };
517
+ /**
518
+ * Structure tree node. The root node will have a role "Root".
519
+ */
520
+ export type StructTreeNode = {
521
+ /**
522
+ * - Array of
523
+ * {@link StructTreeNode} and {@link StructTreeContent} objects.
524
+ */
525
+ children: Array<StructTreeNode | StructTreeContent>;
526
+ /**
527
+ * - element's role, already mapped if a role map exists
528
+ * in the PDF.
529
+ */
530
+ role: string;
531
+ /**
532
+ * - A table header's structure element
533
+ * identifier, i.e. its `ID` entry. Note that this is unrelated to the `id`
534
+ * property of a {@link StructTreeContent} object.
535
+ */
536
+ structId?: string | undefined;
537
+ /**
538
+ * - The number of rows spanned by a table cell.
539
+ */
540
+ rowSpan?: number | undefined;
541
+ /**
542
+ * - The number of columns spanned by a table cell.
543
+ */
544
+ colSpan?: number | undefined;
545
+ /**
546
+ * - The `structId` values of the table
547
+ * headers associated with a table cell.
548
+ */
549
+ headers?: string[] | undefined;
550
+ /**
551
+ * - The cells to which a table
552
+ * header applies.
553
+ */
554
+ scope?: "Row" | "Column" | "Both" | undefined;
555
+ /**
556
+ * - An abbreviated version of a table header's
557
+ * content.
558
+ */
559
+ short?: string | undefined;
560
+ /**
561
+ * - A summary of a table's purpose and structure.
562
+ */
563
+ summary?: string | undefined;
564
+ };
565
+ /**
566
+ * Structure tree content.
567
+ */
568
+ export type StructTreeContent = {
569
+ /**
570
+ * - either "content" for page and stream structure
571
+ * elements or "object" for object references.
572
+ */
573
+ type: string;
574
+ /**
575
+ * - unique id that will map to the text layer.
576
+ */
577
+ id: string;
578
+ };
579
+ /**
580
+ * PDF page operator list.
581
+ */
582
+ export type PDFOperatorList = {
583
+ /**
584
+ * - Array containing the operator functions.
585
+ */
586
+ fnArray: Array<number>;
587
+ /**
588
+ * - Array containing the arguments of the
589
+ * functions.
590
+ */
591
+ argsArray: Array<any>;
592
+ };
593
+ export type PDFWorkerParameters = {
594
+ /**
595
+ * - The name of the worker.
596
+ */
597
+ name?: string | undefined;
598
+ /**
599
+ * - The `workerPort` object.
600
+ */
601
+ port?: Worker | undefined;
602
+ /**
603
+ * - Controls the logging level;
604
+ * the constants from {@link VerbosityLevel} should be used.
605
+ */
606
+ verbosity?: number | undefined;
607
+ };
608
+ /** @type {string} */
609
+ export const build: string;
610
+ /**
611
+ * @import {
612
+ * CatalogAttachmentContent,
613
+ * CatalogAttachment
614
+ * } from "../core/catalog.js";
615
+ */
616
+ /**
617
+ * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |
618
+ * Int16Array | Uint16Array |
619
+ * Int32Array | Uint32Array | Float32Array |
620
+ * Float64Array
621
+ * } TypedArray
622
+ */
623
+ /**
624
+ * @typedef {object} RefProxy
625
+ * @property {number} num
626
+ * @property {number} gen
627
+ */
628
+ /**
629
+ * Document initialization / loading parameters object.
630
+ * @typedef {object} DocumentInitParameters
631
+ * @property {string | URL} [url] - The URL of the PDF.
632
+ * @property {TypedArray | ArrayBuffer | Array<number> | string} [data] -
633
+ * Binary PDF data.
634
+ * Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is
635
+ * BASE64-encoded, use `atob()` to convert it to a binary string first.
636
+ *
637
+ * NOTE: If TypedArrays are used they will generally be transferred to the
638
+ * worker-thread. This will help reduce main-thread memory usage, however
639
+ * it will take ownership of the TypedArrays.
640
+ * @property {object} [httpHeaders] - Basic authentication headers.
641
+ * @property {boolean} [withCredentials] - Indicates whether or not
642
+ * cross-site Access-Control requests should be made using credentials such
643
+ * as cookies or authorization headers. The default is `false`.
644
+ * @property {string} [password] - For decrypting password-protected PDFs.
645
+ * @property {PDFDataRangeTransport} [range] - Allows for using a custom range
646
+ * transport implementation.
647
+ * @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched
648
+ * per range request. The default value is 65536 (= 2^16).
649
+ * @property {PDFWorker} [worker] - The worker that will be used for loading and
650
+ * parsing the PDF data.
651
+ * @property {number} [verbosity] - Controls the logging level; the constants
652
+ * from {@link VerbosityLevel} should be used.
653
+ * @property {string} [docBaseUrl] - The base URL of the document, used when
654
+ * attempting to recover valid absolute URLs for annotations, and outline
655
+ * items, that (incorrectly) only specify relative URLs.
656
+ * @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are
657
+ * located. Include the trailing slash.
658
+ * @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary
659
+ * packed or not. The default value is `true`.
660
+ * @property {string} [iccUrl] - The URL where the predefined ICC profiles are
661
+ * located. Include the trailing slash.
662
+ * @property {boolean} [useSystemFonts] - When `true`, fonts that aren't
663
+ * embedded in the PDF document will fallback to a system font.
664
+ * The default value is `true` in web environments and `false` in Node.js;
665
+ * unless `disableFontFace === true` in which case this defaults to `false`
666
+ * regardless of the environment (to prevent completely broken fonts).
667
+ * @property {string} [standardFontDataUrl] - The URL where the standard font
668
+ * files are located. Include the trailing slash.
669
+ * @property {string} [wasmUrl] - The URL where the wasm files are located.
670
+ * Include the trailing slash.
671
+ * @property {boolean} [useWorkerFetch] - Enable using the Fetch API in the
672
+ * worker-thread when reading built-in CMap files, standard font files,
673
+ * and wasm files. If `true`, the `BinaryDataFactory` option is ignored.
674
+ * The default value is `true` in web environments and `false` in Node.js.
675
+ * @property {boolean} [useWasm] - Attempt to use WebAssembly in order to
676
+ * improve e.g. image decoding performance.
677
+ * The default value is `true`.
678
+ * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.
679
+ * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated
680
+ * PDF data cannot be successfully parsed, instead of attempting to recover
681
+ * whatever possible of the data. The default value is `false`.
682
+ * @property {number} [maxImageSize] - The maximum allowed image size in total
683
+ * pixels, i.e. width * height. Images above this value will not be rendered.
684
+ * Use -1 for no limit, which is also the default value.
685
+ * @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use
686
+ * `OffscreenCanvas` in the worker. Primarily used to improve performance of
687
+ * image conversion/rendering.
688
+ * The default value is `true` in web environments and `false` in Node.js.
689
+ * @property {boolean} [isImageDecoderSupported] - Determines if we can use
690
+ * `ImageDecoder` in the worker. Primarily used to improve performance of
691
+ * image conversion/rendering.
692
+ * The default value is `true` in web environments and `false` in Node.js.
693
+ * @property {number} [canvasMaxAreaInBytes] - The integer value is used to
694
+ * know when an image must be resized (uses `OffscreenCanvas` in the worker).
695
+ * If it's -1 then a possibly slow algorithm is used to guess the max value.
696
+ * @property {boolean} [disableFontFace] - By default fonts are converted to
697
+ * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.
698
+ * If disabled, fonts will be rendered using a built-in font renderer that
699
+ * constructs the glyphs with primitive path commands.
700
+ * The default value is `false` in web environments and `true` in Node.js.
701
+ * @property {boolean} [fontExtraProperties] - Include additional properties,
702
+ * which are unused during rendering of PDF documents, when exporting the
703
+ * parsed font data from the worker-thread. This may be useful for debugging
704
+ * purposes (and backwards compatibility), but note that it will lead to
705
+ * increased memory usage. The default value is `false`.
706
+ * @property {boolean} [enableXfa] - Render Xfa forms if any.
707
+ * The default value is `false`.
708
+ * @property {HTMLDocument} [ownerDocument] - Specify an explicit document
709
+ * context to create elements with and to load resources, such as fonts,
710
+ * into. Defaults to the current document.
711
+ * @property {boolean} [disableRange] - Disable range request loading of PDF
712
+ * files. When enabled, and if the server supports partial content requests,
713
+ * then the PDF will be fetched in chunks. The default value is `false`.
714
+ * @property {boolean} [disableStream] - Disable streaming of PDF file data.
715
+ * By default PDF.js attempts to load PDF files in chunks. The default value
716
+ * is `false`.
717
+ * @property {boolean} [disableAutoFetch] - Disable pre-fetching of PDF file
718
+ * data. When range requests are enabled PDF.js will automatically keep
719
+ * fetching more data even if it isn't needed to display the current page.
720
+ * The default value is `false`.
721
+ *
722
+ * NOTE: It is also necessary to disable streaming, see above, in order for
723
+ * disabling of pre-fetching to work correctly.
724
+ * @property {boolean} [pdfBug] - Enables special hooks for debugging PDF.js
725
+ * (see `web/debugger.js`). The default value is `false`.
726
+ * @property {object} [CanvasFactory] - The factory that will be used when
727
+ * creating canvases. The default value is {DOMCanvasFactory}.
728
+ * @property {object} [FilterFactory] - The factory that will be used to
729
+ * create SVG filters when rendering some images on the main canvas.
730
+ * The default value is {DOMFilterFactory}.
731
+ * @property {object} [BinaryDataFactory] - The factory that will be used when
732
+ * falling back to reading built-in CMap files, standard font files,
733
+ * and wasm files in the main-thread.
734
+ * The default value is {DOMBinaryDataFactory}.
735
+ * @property {boolean} [enableHWA] - Enables hardware acceleration for
736
+ * rendering. The default value is `false`.
737
+ * @property {object} [pagesMapper] - The pages mapper that will be used to map
738
+ * page ids and page numbers. It's used when the page order is changed or some
739
+ * pages are removed, cloned, etc.
740
+ */
741
+ /**
742
+ * This is the main entry point for loading a PDF and interacting with it.
743
+ *
744
+ * NOTE: If a URL is used to fetch the PDF data a standard Fetch API call (or
745
+ * XHR as fallback) is used, which means it must follow same origin rules,
746
+ * e.g. no cross-domain requests without CORS.
747
+ * @param {DocumentInitParameters} src - Parameter object.
748
+ * @returns {PDFDocumentLoadingTask}
749
+ */
750
+ export function getDocument(src?: DocumentInitParameters): PDFDocumentLoadingTask;
751
+ /**
752
+ * Abstract class to support range requests file loading.
753
+ *
754
+ * NOTE: The TypedArrays passed to the constructor and relevant methods below
755
+ * will generally be transferred to the worker-thread. This will help reduce
756
+ * main-thread memory usage, however it will take ownership of the TypedArrays.
757
+ */
758
+ export class PDFDataRangeTransport {
759
+ /**
760
+ * @param {number} length
761
+ * @param {Uint8Array|null} initialData
762
+ * @param {boolean} [progressiveDone]
763
+ * @param {string} [contentDispositionFilename]
764
+ */
765
+ constructor(length: number, initialData: Uint8Array | null, progressiveDone?: boolean, contentDispositionFilename?: string);
766
+ length: number;
767
+ initialData: Uint8Array<ArrayBufferLike> | null;
768
+ progressiveDone: boolean;
769
+ contentDispositionFilename: string;
770
+ /**
771
+ * @param {number} begin
772
+ * @param {Uint8Array|null} chunk
773
+ */
774
+ onDataRange(begin: number, chunk: Uint8Array | null): void;
775
+ /**
776
+ * @param {Uint8Array|null} chunk
777
+ */
778
+ onDataProgressiveRead(chunk: Uint8Array | null): void;
779
+ onDataProgressiveDone(): void;
780
+ transportReady(listener: any): void;
781
+ /**
782
+ * @param {number} begin
783
+ * @param {number} end
784
+ */
785
+ requestDataRange(begin: number, end: number): void;
786
+ abort(): void;
787
+ #private;
788
+ }
789
+ /**
790
+ * @typedef {object} OnProgressParameters
791
+ * @property {number} loaded - Currently loaded number of bytes.
792
+ * @property {number} total - Total number of bytes in the PDF file.
793
+ * @property {number} percent - Currently loaded percentage, as an integer value
794
+ * in the [0, 100] range. If `total` is undefined, the percentage is `NaN`.
795
+ */
796
+ /**
797
+ * The loading task controls the operations required to load a PDF document
798
+ * (such as network requests) and provides a way to listen for completion,
799
+ * after which individual pages can be rendered.
800
+ */
801
+ export class PDFDocumentLoadingTask {
802
+ static #docId: number;
803
+ /**
804
+ * @private
805
+ */
806
+ private _capability;
807
+ /**
808
+ * Resolves once the load-time setup chain has settled, regardless of
809
+ * outcome; used by `destroy()` to wait until `_transport` is either set
810
+ * or definitely never going to be.
811
+ * @private
812
+ */
813
+ private _setupCapability;
814
+ /**
815
+ * @private
816
+ */
817
+ private _transport;
818
+ /**
819
+ * @private
820
+ */
821
+ private _worker;
822
+ /**
823
+ * Unique identifier for the document loading task.
824
+ * @type {string}
825
+ */
826
+ docId: string;
827
+ /**
828
+ * Whether the loading task is destroyed or not.
829
+ * @type {boolean}
830
+ */
831
+ destroyed: boolean;
832
+ /**
833
+ * Callback to request a password if a wrong or no password was provided.
834
+ * The callback receives two parameters: a function that should be called
835
+ * with the new password, and a reason (see {@link PasswordResponses}).
836
+ * @type {Function}
837
+ */
838
+ onPassword: Function;
839
+ /**
840
+ * Callback to be able to monitor the loading progress of the PDF file
841
+ * (necessary to implement e.g. a loading bar).
842
+ * The callback receives an {@link OnProgressParameters} argument.
843
+ * @type {Function}
844
+ */
845
+ onProgress: Function;
846
+ /**
847
+ * Promise for document loading task completion.
848
+ * @type {Promise<PDFDocumentProxy>}
849
+ */
850
+ get promise(): Promise<PDFDocumentProxy>;
851
+ /**
852
+ * Abort all network requests and destroy the worker.
853
+ * @returns {Promise<void>} A promise that is resolved when destruction is
854
+ * completed.
855
+ */
856
+ destroy(): Promise<void>;
857
+ /**
858
+ * Attempt to fetch the raw data of the PDF document, when e.g.
859
+ * - An exception was thrown during document initialization.
860
+ * - An `onPassword` callback is delaying initialization.
861
+ * @returns {Promise<Uint8Array>}
862
+ */
863
+ getData(): Promise<Uint8Array>;
864
+ }
865
+ /**
866
+ * Proxy to a `PDFDocument` in the worker thread.
867
+ */
868
+ export class PDFDocumentProxy {
869
+ constructor(pdfInfo: any, transport: any);
870
+ _pdfInfo: any;
871
+ _transport: any;
872
+ /**
873
+ * @type {PagesMapper} The pages mapper instance.
874
+ */
875
+ get pagesMapper(): PagesMapper;
876
+ /**
877
+ * @type {AnnotationStorage} Storage for annotation data in forms.
878
+ */
879
+ get annotationStorage(): AnnotationStorage;
880
+ /**
881
+ * @type {object} The canvas factory instance.
882
+ */
883
+ get canvasFactory(): object;
884
+ /**
885
+ * @type {object} The filter factory instance.
886
+ */
887
+ get filterFactory(): object;
888
+ /**
889
+ * @type {number} Total number of pages in the PDF file.
890
+ */
891
+ get numPages(): number;
892
+ /**
893
+ * @type {Array<string | null>} A (not guaranteed to be) unique ID to identify
894
+ * the PDF document.
895
+ * NOTE: The first element will always be defined for all PDF documents,
896
+ * whereas the second element is only defined for *modified* PDF documents.
897
+ */
898
+ get fingerprints(): Array<string | null>;
899
+ /**
900
+ * @type {boolean} True if only XFA form.
901
+ */
902
+ get isPureXfa(): boolean;
903
+ /**
904
+ * NOTE: This is (mostly) intended to support printing of XFA forms.
905
+ * @type {object | null} An object representing a HTML tree structure
906
+ * to render the XFA, or `null` when no XFA form exists.
907
+ */
908
+ get allXfaHtml(): object | null;
909
+ /**
910
+ * @param {number} pageNumber - The page number to get. The first page is 1.
911
+ * @returns {Promise<PDFPageProxy>} A promise that is resolved with
912
+ * a {@link PDFPageProxy} object.
913
+ */
914
+ getPage(pageNumber: number): Promise<PDFPageProxy>;
915
+ /**
916
+ * @param {RefProxy} ref - The page reference.
917
+ * @returns {Promise<number>} A promise that is resolved with the page index,
918
+ * starting from zero, that is associated with the reference.
919
+ */
920
+ getPageIndex(ref: RefProxy): Promise<number>;
921
+ /**
922
+ * @returns {Promise<Map<string, Array<any>>>} A promise that is resolved
923
+ * with a mapping from named destinations to references.
924
+ *
925
+ * This can be slow for large documents. Use `getDestination` instead.
926
+ */
927
+ getDestinations(): Promise<Map<string, Array<any>>>;
928
+ /**
929
+ * @param {string} id - The named destination to get.
930
+ * @returns {Promise<Array<any> | null>} A promise that is resolved with all
931
+ * information of the given named destination, or `null` when the named
932
+ * destination is not present in the PDF file.
933
+ */
934
+ getDestination(id: string): Promise<Array<any> | null>;
935
+ /**
936
+ * @returns {Promise<Array<string> | null>} A promise that is resolved with
937
+ * an {Array} containing the page labels that correspond to the page
938
+ * indexes, or `null` when no page labels are present in the PDF file.
939
+ */
940
+ getPageLabels(): Promise<Array<string> | null>;
941
+ /**
942
+ * @returns {Promise<string>} A promise that is resolved with a {string}
943
+ * containing the page layout name.
944
+ */
945
+ getPageLayout(): Promise<string>;
946
+ /**
947
+ * @returns {Promise<string>} A promise that is resolved with a {string}
948
+ * containing the page mode name.
949
+ */
950
+ getPageMode(): Promise<string>;
951
+ /**
952
+ * @returns {Promise<Map | null>} A promise that is resolved with a {Map}
953
+ * containing the viewer preferences, or `null` when no viewer preferences
954
+ * are present in the PDF file.
955
+ */
956
+ getViewerPreferences(): Promise<Map<any, any> | null>;
957
+ /**
958
+ * @returns {Promise<Map | null>} A promise that is resolved with a {Map}
959
+ * containing a destination or action, or `null` when no open action is
960
+ * present in the PDF.
961
+ */
962
+ getOpenAction(): Promise<Map<any, any> | null>;
963
+ /**
964
+ * @returns {Promise<Map<string, CatalogAttachment> | null>}
965
+ * Promise that is resolved with a lookup table for mapping named
966
+ * attachments to their content.
967
+ */
968
+ getAttachments(): Promise<Map<string, CatalogAttachment> | null>;
969
+ /**
970
+ * @param {string} id
971
+ * Unique attachment identifier (required).
972
+ * @returns {Promise<CatalogAttachmentContent>}
973
+ * Promise that resolves to attachment content.
974
+ */
975
+ getAttachmentContent(id: string): Promise<CatalogAttachmentContent>;
976
+ /**
977
+ * @param {Set<number>} types - The annotation types to retrieve.
978
+ * @param {Set<number>} pageIndexesToSkip
979
+ * @returns {Promise<Array<object>>} A promise that is resolved with a list of
980
+ * annotations data.
981
+ */
982
+ getAnnotationsByType(types: Set<number>, pageIndexesToSkip: Set<number>): Promise<Array<object>>;
983
+ /**
984
+ * @returns {Promise<Map | null>} A promise that is resolved with a {Map} with
985
+ * the JavaScript actions:
986
+ * - from the name tree.
987
+ * - from A or AA entries in the catalog dictionary.
988
+ * , or `null` if no JavaScript exists.
989
+ */
990
+ getJSActions(): Promise<Map<any, any> | null>;
991
+ /**
992
+ * @typedef {object} OutlineNode
993
+ * @property {string} title
994
+ * @property {boolean} bold
995
+ * @property {boolean} italic
996
+ * @property {Uint8ClampedArray} color - The color in RGB format to use for
997
+ * display purposes.
998
+ * @property {string | Array<any> | null} dest
999
+ * @property {string | null} url
1000
+ * @property {string | undefined} unsafeUrl
1001
+ * @property {boolean | undefined} newWindow
1002
+ * @property {number | undefined} count
1003
+ * @property {Array<OutlineNode>} items
1004
+ */
1005
+ /**
1006
+ * @returns {Promise<Array<OutlineNode>>} A promise that is resolved with an
1007
+ * {Array} that is a tree outline (if it has one) of the PDF file.
1008
+ */
1009
+ getOutline(): Promise<Array<{
1010
+ title: string;
1011
+ bold: boolean;
1012
+ italic: boolean;
1013
+ /**
1014
+ * - The color in RGB format to use for
1015
+ * display purposes.
1016
+ */
1017
+ color: Uint8ClampedArray;
1018
+ dest: string | Array<any> | null;
1019
+ url: string | null;
1020
+ unsafeUrl: string | undefined;
1021
+ newWindow: boolean | undefined;
1022
+ count: number | undefined;
1023
+ items: Array</*elided*/ any>;
1024
+ }>>;
1025
+ /**
1026
+ * @typedef {object} GetOptionalContentConfigParameters
1027
+ * @property {string} [intent] - Determines the optional content groups that
1028
+ * are visible by default; valid values are:
1029
+ * - 'display' (viewable groups).
1030
+ * - 'print' (printable groups).
1031
+ * - 'any' (all groups).
1032
+ * The default value is 'display'.
1033
+ */
1034
+ /**
1035
+ * @param {GetOptionalContentConfigParameters} [params] - Optional content
1036
+ * config parameters.
1037
+ * @returns {Promise<OptionalContentConfig>} A promise that is resolved with
1038
+ * an {@link OptionalContentConfig} that contains all the optional content
1039
+ * groups (assuming that the document has any).
1040
+ */
1041
+ getOptionalContentConfig({ intent }?: {
1042
+ /**
1043
+ * - Determines the optional content groups that
1044
+ * are visible by default; valid values are:
1045
+ * - 'display' (viewable groups).
1046
+ * - 'print' (printable groups).
1047
+ * - 'any' (all groups).
1048
+ * The default value is 'display'.
1049
+ */
1050
+ intent?: string | undefined;
1051
+ }): Promise<OptionalContentConfig>;
1052
+ /**
1053
+ * @returns {Promise<Set<number> | null>} A promise that is resolved with
1054
+ * a {Set} that contains the permission flags for the PDF document,
1055
+ * or `null` when no permissions are present in the PDF file.
1056
+ */
1057
+ getPermissions(): Promise<Set<number> | null>;
1058
+ /**
1059
+ * @returns {Promise<{info: object, metadata: Metadata}>} A promise that is
1060
+ * resolved with an {Object} that has `info` and `metadata` properties.
1061
+ * `info` is an {Object} filled with anything available in the information
1062
+ * dictionary and similarly `metadata` is a {Metadata} object with
1063
+ * information from the metadata section of the PDF.
1064
+ */
1065
+ getMetadata(): Promise<{
1066
+ info: object;
1067
+ metadata: Metadata;
1068
+ }>;
1069
+ /**
1070
+ * @typedef {object} MarkInfo
1071
+ * Properties correspond to Table 321 of the PDF 32000-1:2008 spec.
1072
+ * @property {boolean} Marked
1073
+ * @property {boolean} UserProperties
1074
+ * @property {boolean} Suspects
1075
+ */
1076
+ /**
1077
+ * @returns {Promise<MarkInfo | null>} A promise that is resolved with
1078
+ * a {MarkInfo} object that contains the MarkInfo flags for the PDF
1079
+ * document, or `null` when no MarkInfo values are present in the PDF file.
1080
+ */
1081
+ getMarkInfo(): Promise<{
1082
+ Marked: boolean;
1083
+ UserProperties: boolean;
1084
+ Suspects: boolean;
1085
+ } | null>;
1086
+ /**
1087
+ * @returns {Promise<Uint8Array>} A promise that is resolved with a
1088
+ * {Uint8Array} containing the raw data of the PDF document.
1089
+ */
1090
+ getData(): Promise<Uint8Array>;
1091
+ /**
1092
+ * @param {function(Array<object>): Promise<Uint8Array | null>} [printToPDF] -
1093
+ * Firefox-only platform appearance renderer. It receives ordered
1094
+ * `{ data }` entries and returns a PDF with one page per entry, or `null`.
1095
+ * Each page must place its appearance in
1096
+ * `[0, 0, data.width, data.height]`, with dimensions in points.
1097
+ * @returns {Promise<Uint8Array<ArrayBuffer>>} A promise that is
1098
+ * resolved with a {Uint8Array<ArrayBuffer>} containing the
1099
+ * full data of the saved document.
1100
+ */
1101
+ saveDocument(printToPDF?: (arg0: Array<object>) => Promise<Uint8Array | null>): Promise<Uint8Array<ArrayBuffer>>;
1102
+ /**
1103
+ * @typedef {object} PageInfo
1104
+ * @property {null|Uint8Array} [document]
1105
+ * @property {ImageBitmap} [image] Image to insert as a synthetic page.
1106
+ * @property {Array<Array<number>|number>} [includePages]
1107
+ * included ranges or indices.
1108
+ * @property {Array<Array<number>|number>} [excludePages]
1109
+ * excluded ranges or indices.
1110
+ * @property {Array<number>} [pageIndices] Explicit 0-based positions in the
1111
+ * final document for pages contributed by this entry. If shorter than the
1112
+ * filtered page list, the remaining pages are placed in the first free
1113
+ * slots at extraction time. Positions must not overlap with those of
1114
+ * other entries, and the union of all explicit/auto-filled positions
1115
+ * across the call must form a dense `[0, N)` range (where `N` is the
1116
+ * total page count of the final document) — sparse layouts leave empty
1117
+ * slots and are not supported. Cannot be combined with `insertAfter` on
1118
+ * the same entry, and must fully cover the filtered page list when any
1119
+ * entry in the same call specifies `insertAfter` (partial arrays are
1120
+ * rejected in that case).
1121
+ * @property {number} [insertAfter] 0-based index in the base sequential
1122
+ * sequence (the concatenation of entries that have neither `pageIndices`
1123
+ * nor `insertAfter`) after which to insert the pages. When every
1124
+ * contributing entry carries explicit `pageIndices`, this is interpreted
1125
+ * against that explicit layout instead, shifting any existing positions
1126
+ * beyond the insertion point to make room. Use `-1` to insert before
1127
+ * everything. Values beyond the current layout are clamped so the pages
1128
+ * are appended at the end. Cannot be combined with `pageIndices` on the
1129
+ * same entry.
1130
+ */
1131
+ /**
1132
+ * @param {Array<PageInfo>} pageInfos - The pages to extract.
1133
+ * @param {Int32Array} [copyLevels] - For each viewer page, its rank among the
1134
+ * extracted pages sharing the same source page, or -1 if it isn't extracted.
1135
+ * This routes editor annotations when the viewer contains multiple copies
1136
+ * of a source page.
1137
+ * @returns {Promise<Uint8Array>} A promise that is resolved with a
1138
+ * {Uint8Array} containing the full data of the saved document.
1139
+ */
1140
+ extractPages(pageInfos: Array<{
1141
+ document?: Uint8Array<ArrayBufferLike> | null | undefined;
1142
+ /**
1143
+ * Image to insert as a synthetic page.
1144
+ */
1145
+ image?: ImageBitmap | undefined;
1146
+ /**
1147
+ * included ranges or indices.
1148
+ */
1149
+ includePages?: (number | number[])[] | undefined;
1150
+ /**
1151
+ * excluded ranges or indices.
1152
+ */
1153
+ excludePages?: (number | number[])[] | undefined;
1154
+ /**
1155
+ * Explicit 0-based positions in the
1156
+ * final document for pages contributed by this entry. If shorter than the
1157
+ * filtered page list, the remaining pages are placed in the first free
1158
+ * slots at extraction time. Positions must not overlap with those of
1159
+ * other entries, and the union of all explicit/auto-filled positions
1160
+ * across the call must form a dense `[0, N)` range (where `N` is the
1161
+ * total page count of the final document) — sparse layouts leave empty
1162
+ * slots and are not supported. Cannot be combined with `insertAfter` on
1163
+ * the same entry, and must fully cover the filtered page list when any
1164
+ * entry in the same call specifies `insertAfter` (partial arrays are
1165
+ * rejected in that case).
1166
+ */
1167
+ pageIndices?: number[] | undefined;
1168
+ /**
1169
+ * 0-based index in the base sequential
1170
+ * sequence (the concatenation of entries that have neither `pageIndices`
1171
+ * nor `insertAfter`) after which to insert the pages. When every
1172
+ * contributing entry carries explicit `pageIndices`, this is interpreted
1173
+ * against that explicit layout instead, shifting any existing positions
1174
+ * beyond the insertion point to make room. Use `-1` to insert before
1175
+ * everything. Values beyond the current layout are clamped so the pages
1176
+ * are appended at the end. Cannot be combined with `pageIndices` on the
1177
+ * same entry.
1178
+ */
1179
+ insertAfter?: number | undefined;
1180
+ }>, copyLevels?: Int32Array): Promise<Uint8Array>;
1181
+ /**
1182
+ * @returns {Promise<{ length: number }>} A promise that is resolved when the
1183
+ * document's data is loaded. It is resolved with an {Object} that contains
1184
+ * the `length` property that indicates size of the PDF data in bytes.
1185
+ */
1186
+ getDownloadInfo(): Promise<{
1187
+ length: number;
1188
+ }>;
1189
+ /**
1190
+ * Cleans up resources allocated by the document on both the main and worker
1191
+ * threads.
1192
+ *
1193
+ * NOTE: Do not, under any circumstances, call this method when rendering is
1194
+ * currently ongoing since that may lead to rendering errors.
1195
+ * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.
1196
+ * NOTE: This will increase persistent memory usage, hence don't use this
1197
+ * option unless absolutely necessary. The default value is `false`.
1198
+ * @returns {Promise} A promise that is resolved when clean-up has finished.
1199
+ */
1200
+ cleanup(keepLoadedFonts?: boolean): Promise<any>;
1201
+ /**
1202
+ * @param {RefProxy} ref - The page reference.
1203
+ * @returns {number | null} The page number, if it's cached.
1204
+ */
1205
+ cachedPageNumber(ref: RefProxy): number | null;
1206
+ /**
1207
+ * @type {DocumentInitParameters} A subset of the current
1208
+ * {DocumentInitParameters}, which are needed in the viewer.
1209
+ */
1210
+ get loadingParams(): DocumentInitParameters;
1211
+ /**
1212
+ * @type {PDFDocumentLoadingTask} The loadingTask for the current document.
1213
+ */
1214
+ get loadingTask(): PDFDocumentLoadingTask;
1215
+ /**
1216
+ * @returns {Promise<Map<string, Array<object>> | null>} A promise that is
1217
+ * resolved with a {Map} containing /AcroForm field data for the JS sandbox,
1218
+ * or `null` when no field data is present in the PDF file.
1219
+ */
1220
+ getFieldObjects(): Promise<Map<string, Array<object>> | null>;
1221
+ /**
1222
+ * @returns {Promise<Array<object> | null>} A promise that is resolved
1223
+ * with an {Array} of digital signature metadata (signerName, reason,
1224
+ * signingTime, byteRange, subFilter, …), or `null` when the document
1225
+ * has no signatures. The PKCS#7 blob and signed-data byte spans
1226
+ * needed for verification are fetched separately via
1227
+ * {@link PDFDocumentProxy.getSignatureData} so they don't ride the
1228
+ * worker boundary unless verification is actually requested.
1229
+ */
1230
+ getSignatures(): Promise<Array<object> | null>;
1231
+ /**
1232
+ * @param {string} id Signature `id` from a {@link getSignatures} entry.
1233
+ * @returns {Promise<{ data: Uint8Array[], pkcs7: Uint8Array } | null>}
1234
+ * The byte payload needed to verify the signature, or `null` if the
1235
+ * id is unknown.
1236
+ */
1237
+ getSignatureData(id: string): Promise<{
1238
+ data: Uint8Array[];
1239
+ pkcs7: Uint8Array;
1240
+ } | null>;
1241
+ /**
1242
+ * @returns {Promise<boolean>} A promise that is resolved with `true`
1243
+ * if some /AcroForm fields have JavaScript actions.
1244
+ */
1245
+ hasJSActions(): Promise<boolean>;
1246
+ /**
1247
+ * @returns {Promise<Array<string> | null>} A promise that is resolved with an
1248
+ * {Array<string>} containing IDs of annotations that have a calculation
1249
+ * action, or `null` when no such annotations are present in the PDF file.
1250
+ */
1251
+ getCalculationOrderIds(): Promise<Array<string> | null>;
1252
+ }
1253
+ /**
1254
+ * Page getViewport parameters.
1255
+ * @typedef {object} GetViewportParameters
1256
+ * @property {number} scale - The desired scale of the viewport.
1257
+ * @property {number} [rotation] - The desired rotation, in degrees, of
1258
+ * the viewport. If omitted it defaults to the page rotation.
1259
+ * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.
1260
+ * The default value is `0`.
1261
+ * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.
1262
+ * The default value is `0`.
1263
+ * @property {boolean} [dontFlip] - If true, the y-axis will not be
1264
+ * flipped. The default value is `false`.
1265
+ */
1266
+ /**
1267
+ * Page getTextContent parameters.
1268
+ * @typedef {object} getTextContentParameters
1269
+ * @property {boolean} [includeMarkedContent] - When true include marked
1270
+ * content items in the items array of TextContent. The default is `false`.
1271
+ * @property {boolean} [disableNormalization] - When true the text is *not*
1272
+ * normalized in the worker-thread. The default is `false`.
1273
+ */
1274
+ /**
1275
+ * Page text content.
1276
+ * @typedef {object} TextContent
1277
+ * @property {Array<TextItem | TextMarkedContent>} items - Array of
1278
+ * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent
1279
+ * items are included when includeMarkedContent is true.
1280
+ * @property {Record<string, TextStyle>} styles - {@link TextStyle} objects,
1281
+ * indexed by font name.
1282
+ * @property {string | null} lang - The document /Lang attribute.
1283
+ */
1284
+ /**
1285
+ * Page text content part.
1286
+ * @typedef {object} TextItem
1287
+ * @property {string} str - Text content.
1288
+ * @property {string} dir - Text direction: 'ttb', 'ltr' or 'rtl'.
1289
+ * @property {Array<any>} transform - Transformation matrix.
1290
+ * @property {number} width - Width in device space.
1291
+ * @property {number} height - Height in device space.
1292
+ * @property {string} fontName - Font name used by PDF.js for converted font.
1293
+ * @property {boolean} hasEOL - Indicating if the text content is followed by a
1294
+ * line-break.
1295
+ */
1296
+ /**
1297
+ * Page text marked content part.
1298
+ * @typedef {object} TextMarkedContent
1299
+ * @property {string} type - Either 'beginMarkedContent',
1300
+ * 'beginMarkedContentProps', or 'endMarkedContent'.
1301
+ * @property {string} id - The marked content identifier. Only used for type
1302
+ * 'beginMarkedContentProps'.
1303
+ */
1304
+ /**
1305
+ * Text style.
1306
+ * @typedef {object} TextStyle
1307
+ * @property {number} ascent - Font ascent.
1308
+ * @property {number} descent - Font descent.
1309
+ * @property {boolean} vertical - Whether or not the text is in vertical mode.
1310
+ * @property {string} fontFamily - The possible font family.
1311
+ */
1312
+ /**
1313
+ * Page annotation parameters.
1314
+ * @typedef {object} GetAnnotationsParameters
1315
+ * @property {string} [intent] - Determines the annotations that are fetched,
1316
+ * can be 'display' (viewable annotations), 'print' (printable annotations),
1317
+ * or 'any' (all annotations). The default value is 'display'.
1318
+ */
1319
+ /**
1320
+ * Page render parameters.
1321
+ * @typedef {object} RenderParameters
1322
+ * @property {HTMLCanvasElement|null} canvas - A DOM Canvas object. The default
1323
+ * value is the canvas associated with the `canvasContext` parameter if no
1324
+ * value is provided explicitly.
1325
+ * @property {PageViewport} viewport - Rendering viewport obtained by calling
1326
+ * the `PDFPageProxy.getViewport` method.
1327
+ * @property {CanvasRenderingContext2D} [canvasContext] - 2D context of a DOM
1328
+ * Canvas object for backwards compatibility; it is recommended to use the
1329
+ * `canvas` parameter instead.
1330
+ * If the context must absolutely be used to render the page, the canvas must
1331
+ * be null.
1332
+ * @property {string} [intent] - Rendering intent, can be 'display', 'print',
1333
+ * or 'any'. The default value is 'display'.
1334
+ * @property {number} [annotationMode] Controls which annotations are rendered
1335
+ * onto the canvas, for annotations with appearance-data; the values from
1336
+ * {@link AnnotationMode} should be used. The following values are supported:
1337
+ * - `AnnotationMode.DISABLE`, which disables all annotations.
1338
+ * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus
1339
+ * it also depends on the `intent`-option, see above).
1340
+ * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain
1341
+ * interactive form elements (those will be rendered in the display layer).
1342
+ * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations
1343
+ * (as above) but where interactive form elements are updated with data
1344
+ * from the {@link AnnotationStorage}-instance; useful e.g. for printing.
1345
+ * The default value is `AnnotationMode.ENABLE`.
1346
+ * @property {Array<any>} [transform] - Additional transform, applied just
1347
+ * before viewport transform.
1348
+ * @property {CanvasGradient | CanvasPattern | string} [background] - Background
1349
+ * to use for the canvas.
1350
+ * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS
1351
+ * <color> value, a `CanvasGradient` object (a linear or radial gradient) or
1352
+ * a `CanvasPattern` object (a repetitive image). The default value is
1353
+ * 'rgb(255,255,255)'.
1354
+ *
1355
+ * NOTE: This option may be partially, or completely, ignored when the
1356
+ * `pageColors`-option is used.
1357
+ * @property {object} [pageColors] - Overwrites background and foreground colors
1358
+ * with user defined ones in order to improve readability in high contrast
1359
+ * mode.
1360
+ * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -
1361
+ * A promise that should resolve with an {@link OptionalContentConfig}
1362
+ * created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,
1363
+ * the configuration will be fetched automatically with the default visibility
1364
+ * states set.
1365
+ * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap] - Map some
1366
+ * annotation ids with canvases used to render them.
1367
+ * @property {PrintAnnotationStorage} [printAnnotationStorage]
1368
+ * @property {boolean} [isEditing] - Render the page in editing mode.
1369
+ * @property {boolean} [recordImages] - Record the location of images in the PDF
1370
+ * @property {boolean} [recordOperations] - Record the dependencies and bounding
1371
+ * boxes of all PDF operations that render onto the canvas.
1372
+ * @property {OperationsFilter} [operationsFilter] - If provided, only
1373
+ * run for which this function returns `true`.
1374
+ */
1375
+ /**
1376
+ * @callback OperationsFilter
1377
+ * @param {number} index - The index of the operation.
1378
+ * @param {PDFOperatorList} operatorList - The page operator list.
1379
+ * @returns {boolean} If false, the operation is ignored.
1380
+ */
1381
+ /**
1382
+ * Page getOperatorList parameters.
1383
+ * @typedef {object} GetOperatorListParameters
1384
+ * @property {string} [intent] - Rendering intent, can be 'display', 'print',
1385
+ * or 'any'. The default value is 'display'.
1386
+ * @property {number} [annotationMode] Controls which annotations are included
1387
+ * in the operatorList, for annotations with appearance-data; the values from
1388
+ * {@link AnnotationMode} should be used. The following values are supported:
1389
+ * - `AnnotationMode.DISABLE`, which disables all annotations.
1390
+ * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus
1391
+ * it also depends on the `intent`-option, see above).
1392
+ * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain
1393
+ * interactive form elements (those will be rendered in the display layer).
1394
+ * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations
1395
+ * (as above) but where interactive form elements are updated with data
1396
+ * from the {@link AnnotationStorage}-instance; useful e.g. for printing.
1397
+ * The default value is `AnnotationMode.ENABLE`.
1398
+ * @property {PrintAnnotationStorage} [printAnnotationStorage]
1399
+ * @property {boolean} [isEditing] - Render the page in editing mode.
1400
+ */
1401
+ /**
1402
+ * Structure tree node. The root node will have a role "Root".
1403
+ * @typedef {object} StructTreeNode
1404
+ * @property {Array<StructTreeNode | StructTreeContent>} children - Array of
1405
+ * {@link StructTreeNode} and {@link StructTreeContent} objects.
1406
+ * @property {string} role - element's role, already mapped if a role map exists
1407
+ * in the PDF.
1408
+ * @property {string} [structId] - A table header's structure element
1409
+ * identifier, i.e. its `ID` entry. Note that this is unrelated to the `id`
1410
+ * property of a {@link StructTreeContent} object.
1411
+ * @property {number} [rowSpan] - The number of rows spanned by a table cell.
1412
+ * @property {number} [colSpan] - The number of columns spanned by a table cell.
1413
+ * @property {Array<string>} [headers] - The `structId` values of the table
1414
+ * headers associated with a table cell.
1415
+ * @property {"Row" | "Column" | "Both"} [scope] - The cells to which a table
1416
+ * header applies.
1417
+ * @property {string} [short] - An abbreviated version of a table header's
1418
+ * content.
1419
+ * @property {string} [summary] - A summary of a table's purpose and structure.
1420
+ */
1421
+ /**
1422
+ * Structure tree content.
1423
+ * @typedef {object} StructTreeContent
1424
+ * @property {string} type - either "content" for page and stream structure
1425
+ * elements or "object" for object references.
1426
+ * @property {string} id - unique id that will map to the text layer.
1427
+ */
1428
+ /**
1429
+ * PDF page operator list.
1430
+ * @typedef {object} PDFOperatorList
1431
+ * @property {Array<number>} fnArray - Array containing the operator functions.
1432
+ * @property {Array<any>} argsArray - Array containing the arguments of the
1433
+ * functions.
1434
+ */
1435
+ /**
1436
+ * Proxy to a `PDFPage` in the worker thread.
1437
+ */
1438
+ export class PDFPageProxy {
1439
+ static #idCounter: number;
1440
+ constructor(pageIndex: any, pageInfo: any, transport: any, pagesMapper: any, pdfBug?: boolean);
1441
+ _pageIndex: any;
1442
+ _id: number;
1443
+ _pageInfo: any;
1444
+ _transport: any;
1445
+ _stats: StatTimer | null;
1446
+ _pdfBug: boolean;
1447
+ /** @type {PDFObjects} */
1448
+ commonObjs: PDFObjects;
1449
+ objs: PDFObjects;
1450
+ _intentStates: Map<any, any>;
1451
+ destroyed: boolean;
1452
+ recordedBBoxes: any;
1453
+ imageCoordinates: any;
1454
+ clone(id: any): PDFPageProxy;
1455
+ /**
1456
+ * @param {number} value - The page number to set. First page is 1.
1457
+ */
1458
+ set pageNumber(value: number);
1459
+ /**
1460
+ * @type {number} Page number of the page. First page is 1.
1461
+ */
1462
+ get pageNumber(): number;
1463
+ /**
1464
+ * @type {number} The number of degrees the page is rotated clockwise.
1465
+ */
1466
+ get rotate(): number;
1467
+ /**
1468
+ * @type {RefProxy | null} The reference that points to this page.
1469
+ */
1470
+ get ref(): RefProxy | null;
1471
+ /**
1472
+ * @type {number} The default size of units in 1/72nds of an inch.
1473
+ */
1474
+ get userUnit(): number;
1475
+ /**
1476
+ * @type {Array<number>} An array of the visible portion of the PDF page in
1477
+ * user space units [x1, y1, x2, y2].
1478
+ */
1479
+ get view(): Array<number>;
1480
+ /**
1481
+ * @param {GetViewportParameters} params - Viewport parameters.
1482
+ * @returns {PageViewport} Contains 'width' and 'height' properties
1483
+ * along with transforms required for rendering.
1484
+ */
1485
+ getViewport({ scale, rotation, offsetX, offsetY, dontFlip, }?: GetViewportParameters): PageViewport;
1486
+ /**
1487
+ * @param {GetAnnotationsParameters} [params] - Annotation parameters.
1488
+ * @returns {Promise<Array<any>>} A promise that is resolved with an
1489
+ * {Array} of the annotation objects.
1490
+ */
1491
+ getAnnotations({ intent }?: GetAnnotationsParameters): Promise<Array<any>>;
1492
+ /**
1493
+ * @returns {Promise<Map | null>} A promise that is resolved with a {Map} with
1494
+ * the JavaScript actions, or `null` if no JavaScript exists.
1495
+ */
1496
+ getJSActions(): Promise<Map<any, any> | null>;
1497
+ /**
1498
+ * @type {object} The filter factory instance.
1499
+ */
1500
+ get filterFactory(): object;
1501
+ /**
1502
+ * @type {boolean} True if only XFA form.
1503
+ */
1504
+ get isPureXfa(): boolean;
1505
+ /**
1506
+ * @returns {Promise<object | null>} A promise that is resolved with
1507
+ * an {Object} with a fake DOM object (a tree structure where elements
1508
+ * are {Object} with a name, attributes (class, style, ...), value and
1509
+ * children, very similar to a HTML DOM tree), or `null` if no XFA exists.
1510
+ */
1511
+ getXfa(): Promise<object | null>;
1512
+ /**
1513
+ * Begins the process of rendering a page to the desired context.
1514
+ * @param {RenderParameters} params - Page render parameters.
1515
+ * @returns {RenderTask} An object that contains a promise that is
1516
+ * resolved when the page finishes rendering.
1517
+ */
1518
+ render({ canvasContext, canvas, viewport, intent, annotationMode, transform, background, optionalContentConfigPromise, annotationCanvasMap, pageColors, printAnnotationStorage, isEditing, recordImages, recordOperations, operationsFilter, }: RenderParameters): RenderTask;
1519
+ /**
1520
+ * @param {GetOperatorListParameters} params - Page getOperatorList
1521
+ * parameters.
1522
+ * @returns {Promise<PDFOperatorList>} A promise resolved with an
1523
+ * {@link PDFOperatorList} object that represents the page's operator list.
1524
+ */
1525
+ getOperatorList({ intent, annotationMode, printAnnotationStorage, isEditing, }?: GetOperatorListParameters): Promise<PDFOperatorList>;
1526
+ /**
1527
+ * NOTE: All occurrences of whitespace will be replaced by
1528
+ * standard spaces (0x20).
1529
+ * @param {getTextContentParameters} params - getTextContent parameters.
1530
+ * @returns {ReadableStream} Stream for reading text content chunks.
1531
+ */
1532
+ streamTextContent({ includeMarkedContent, disableNormalization, }?: getTextContentParameters): ReadableStream;
1533
+ /**
1534
+ * NOTE: All occurrences of whitespace will be replaced by
1535
+ * standard spaces (0x20).
1536
+ * @param {getTextContentParameters} params - getTextContent parameters.
1537
+ * @returns {Promise<TextContent>} A promise that is resolved with a
1538
+ * {@link TextContent} object that represents the page's text content.
1539
+ */
1540
+ getTextContent(params?: getTextContentParameters): Promise<TextContent>;
1541
+ /**
1542
+ * @returns {Promise<StructTreeNode>} A promise that is resolved with a
1543
+ * {@link StructTreeNode} object that represents the page's structure tree,
1544
+ * or `null` when no structure tree is present for the current page.
1545
+ */
1546
+ getStructTree(): Promise<StructTreeNode>;
1547
+ /**
1548
+ * Destroys the page object.
1549
+ * @private
1550
+ */
1551
+ private _destroy;
1552
+ /**
1553
+ * Cleans up resources allocated by the page.
1554
+ * @param {boolean} [resetStats] - Reset page stats, if enabled.
1555
+ * The default value is `false`.
1556
+ * @returns {boolean} Indicates if clean-up was successfully run.
1557
+ */
1558
+ cleanup(resetStats?: boolean): boolean;
1559
+ /**
1560
+ * @private
1561
+ */
1562
+ private _startRenderPage;
1563
+ /**
1564
+ * @private
1565
+ */
1566
+ private _renderPageChunk;
1567
+ /**
1568
+ * @private
1569
+ */
1570
+ private _pumpOperatorList;
1571
+ /**
1572
+ * @private
1573
+ */
1574
+ private _abortOperatorList;
1575
+ /**
1576
+ * @type {StatTimer | null} Returns page stats, if enabled; returns `null`
1577
+ * otherwise.
1578
+ */
1579
+ get stats(): StatTimer | null;
1580
+ #private;
1581
+ }
1582
+ /**
1583
+ * @typedef {object} PDFWorkerParameters
1584
+ * @property {string} [name] - The name of the worker.
1585
+ * @property {Worker} [port] - The `workerPort` object.
1586
+ * @property {number} [verbosity] - Controls the logging level;
1587
+ * the constants from {@link VerbosityLevel} should be used.
1588
+ */
1589
+ /**
1590
+ * PDF.js web worker abstraction that controls the instantiation of PDF
1591
+ * documents. Message handlers are used to pass information from the main
1592
+ * thread to the worker thread and vice versa. If the creation of a web
1593
+ * worker is not possible, a "fake" worker will be used instead.
1594
+ * @param {PDFWorkerParameters} params - The worker initialization parameters.
1595
+ */
1596
+ export class PDFWorker {
1597
+ static #fakeWorkerId: number;
1598
+ static #isWorkerDisabled: boolean;
1599
+ static #workerPorts: WeakMap<object, any>;
1600
+ /**
1601
+ * @param {PDFWorkerParameters} params - The worker initialization parameters.
1602
+ * @returns {PDFWorker}
1603
+ */
1604
+ static create(params: PDFWorkerParameters): PDFWorker;
1605
+ /**
1606
+ * The current `workerSrc`, when it exists.
1607
+ * @type {string}
1608
+ */
1609
+ static get workerSrc(): string;
1610
+ static get #mainThreadWorkerMessageHandler(): any;
1611
+ static get _setupFakeWorkerGlobal(): any;
1612
+ constructor({ name, port, verbosity, }?: {
1613
+ name?: null | undefined;
1614
+ port?: null | undefined;
1615
+ verbosity?: number | undefined;
1616
+ });
1617
+ name: any;
1618
+ destroyed: boolean;
1619
+ verbosity: number;
1620
+ /**
1621
+ * Promise for worker initialization completion.
1622
+ * @type {Promise<void>}
1623
+ */
1624
+ get promise(): Promise<void>;
1625
+ /**
1626
+ * The current `workerPort`, when it exists.
1627
+ * @type {Worker}
1628
+ */
1629
+ get port(): Worker;
1630
+ /**
1631
+ * The current MessageHandler-instance.
1632
+ * @type {MessageHandler}
1633
+ */
1634
+ get messageHandler(): MessageHandler;
1635
+ /**
1636
+ * Destroys the worker instance.
1637
+ */
1638
+ destroy(): void;
1639
+ #private;
1640
+ }
1641
+ /**
1642
+ * Allows controlling of the rendering tasks.
1643
+ */
1644
+ export class RenderTask {
1645
+ constructor(internalRenderTask: any);
1646
+ _internalRenderTask: null;
1647
+ /**
1648
+ * Callback for incremental rendering -- a function that will be called
1649
+ * each time the rendering is paused. To continue rendering call the
1650
+ * function that is the first argument to the callback.
1651
+ * @type {Function}
1652
+ */
1653
+ onContinue: Function;
1654
+ /**
1655
+ * A function that will be synchronously called when the rendering tasks
1656
+ * finishes with an error (either because of an actual error, or because the
1657
+ * rendering is cancelled).
1658
+ * @type {Function}
1659
+ * @param {Error} error
1660
+ */
1661
+ onError: Function;
1662
+ /**
1663
+ * Promise for rendering task completion.
1664
+ * @type {Promise<void>}
1665
+ */
1666
+ get promise(): Promise<void>;
1667
+ /**
1668
+ * Cancels the rendering task. If the task is currently rendering it will
1669
+ * not be cancelled until graphics pauses with a timeout. The promise that
1670
+ * this object extends will be rejected when cancelled.
1671
+ * @param {number} [extraDelay]
1672
+ */
1673
+ cancel(extraDelay?: number): void;
1674
+ /**
1675
+ * Whether form fields are rendered separately from the main operatorList.
1676
+ * @type {boolean}
1677
+ */
1678
+ get separateAnnots(): boolean;
1679
+ get imageCoordinates(): any;
1680
+ }
1681
+ /** @type {string} */
1682
+ export const version: string;
1683
+ import { PageViewport } from "./page_viewport.js";
1684
+ import { OptionalContentConfig } from "./optional_content_config.js";
1685
+ import { PrintAnnotationStorage } from "./annotation_storage.js";
1686
+ import { PagesMapper } from "./pages_mapper.js";
1687
+ import { AnnotationStorage } from "./annotation_storage.js";
1688
+ import type { CatalogAttachment } from "../core/catalog.js";
1689
+ import type { CatalogAttachmentContent } from "../core/catalog.js";
1690
+ import { Metadata } from "./metadata.js";
1691
+ import { StatTimer } from "./display_utils.js";
1692
+ import { PDFObjects } from "./pdf_objects.js";
1693
+ import { MessageHandler } from "../shared/message_handler.js";