@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,33 @@
1
+ export class RenderableView {
2
+ /**
3
+ * Unique ID for rendering queue.
4
+ * @type {string}
5
+ */
6
+ renderingId: string;
7
+ /**
8
+ * @type {import("../src/display/api").RenderTask | null}
9
+ */
10
+ renderTask: import("../src/display/api").RenderTask | null;
11
+ /**
12
+ * @type {Function | null}
13
+ */
14
+ resume: Function | null;
15
+ /**
16
+ * @param {number} state
17
+ */
18
+ set renderingState(state: number);
19
+ /**
20
+ * @type {number}
21
+ */
22
+ get renderingState(): number;
23
+ /**
24
+ * @returns {Promise} Resolved on draw completion.
25
+ */
26
+ draw(): Promise<any>;
27
+ }
28
+ export namespace RenderingStates {
29
+ let INITIAL: number;
30
+ let RUNNING: number;
31
+ let PAUSED: number;
32
+ let FINISHED: number;
33
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Viewer control to display a sidebar with resizer functionality.
3
+ */
4
+ export class Sidebar {
5
+ /**
6
+ * @typedef {object} SidebarElements
7
+ * @property {HTMLElement} sidebar - The sidebar element.
8
+ * @property {HTMLElement} resizer - The sidebar resizer element.
9
+ * @property {HTMLElement} toggleButton - The button used to toggle the
10
+ * sidebar.
11
+ */
12
+ /**
13
+ * Create a sidebar with resizer functionality.
14
+ * @param {SidebarElements} sidebarElements
15
+ * @param {boolean} ltr
16
+ * @param {boolean} isResizerOnTheLeft
17
+ */
18
+ constructor({ sidebar, resizer, toggleButton }: {
19
+ /**
20
+ * - The sidebar element.
21
+ */
22
+ sidebar: HTMLElement;
23
+ /**
24
+ * - The sidebar resizer element.
25
+ */
26
+ resizer: HTMLElement;
27
+ /**
28
+ * - The button used to toggle the
29
+ * sidebar.
30
+ */
31
+ toggleButton: HTMLElement;
32
+ }, ltr: boolean, isResizerOnTheLeft: boolean, globalAbortSignal: any);
33
+ _sidebar: HTMLElement;
34
+ _isOpen: boolean;
35
+ /**
36
+ * Set the width of the sidebar in pixels.
37
+ * @param {number} newWidth
38
+ */
39
+ set width(newWidth: number);
40
+ /**
41
+ * Get the current width of the sidebar in pixels.
42
+ * @returns {number}
43
+ */
44
+ get width(): number;
45
+ /**
46
+ * Callback to be executed when the user starts resizing the sidebar.
47
+ */
48
+ onStartResizing(): void;
49
+ /**
50
+ * Callback to be executed when the user stops resizing the sidebar.
51
+ */
52
+ onStopResizing(): void;
53
+ /**
54
+ * Callback to be executed when the sidebar is being resized.
55
+ * @param {number} _newWidth - The new width of the sidebar in pixels.
56
+ */
57
+ onResizing(_newWidth: number): void;
58
+ /**
59
+ * Toggle the sidebar's visibility.
60
+ * @param {boolean} [visibility] - The visibility state to set.
61
+ */
62
+ toggle(visibility?: boolean): void;
63
+ destroy(): void;
64
+ #private;
65
+ }
@@ -0,0 +1,39 @@
1
+ export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
2
+ export type StructTreeLayerBuilderOptions = {
3
+ pdfPage: PDFPageProxy;
4
+ rawDims: object;
5
+ };
6
+ /**
7
+ * @typedef {object} StructTreeLayerBuilderOptions
8
+ * @property {PDFPageProxy} pdfPage
9
+ * @property {object} rawDims
10
+ */
11
+ export class StructTreeLayerBuilder {
12
+ /**
13
+ * @param {PDFPageProxy} pdfPage
14
+ * @param {object} rawDims
15
+ */
16
+ constructor(pdfPage: PDFPageProxy, rawDims: object);
17
+ /**
18
+ * @returns {Promise<void>}
19
+ */
20
+ render(): Promise<void>;
21
+ /**
22
+ * @param {string} annotationId
23
+ * @param {object} [options]
24
+ * @param {boolean} [options.enableLinkOwnership]
25
+ * @returns {Promise<Map<string, string>|null|undefined>}
26
+ */
27
+ getAriaAttributes(annotationId: string, { enableLinkOwnership }?: {
28
+ enableLinkOwnership?: boolean | undefined;
29
+ }): Promise<Map<string, string> | null | undefined>;
30
+ /**
31
+ * Get the ids of annotations owned by the structure tree.
32
+ * @returns {Promise<Set<string>|null>}
33
+ */
34
+ getAnnotationIds(): Promise<Set<string> | null>;
35
+ hide(): void;
36
+ show(): void;
37
+ updateTextLayer(): void;
38
+ #private;
39
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * This class aims to provide some methods:
3
+ * - to reorder elements in the DOM with respect to the visual order;
4
+ * - to create a link, using aria-owns, between spans in the textLayer and
5
+ * annotations in the annotationLayer. The goal is to help to know
6
+ * where the annotations are in the text flow.
7
+ */
8
+ export class TextAccessibilityManager {
9
+ /**
10
+ * Compare the positions of two elements, it must correspond to
11
+ * the visual ordering.
12
+ * @param {HTMLElement} e1
13
+ * @param {HTMLElement} e2
14
+ * @returns {number}
15
+ */
16
+ static #compareElementPositions(e1: HTMLElement, e2: HTMLElement): number;
17
+ setTextMapping(textDivs: any): void;
18
+ /**
19
+ * Function called when the text layer has finished rendering.
20
+ */
21
+ enable(): void;
22
+ disable(): void;
23
+ /**
24
+ * Remove an aria-owns id from a node in the text layer.
25
+ * @param {HTMLElement} element
26
+ */
27
+ removePointerInTextLayer(element: HTMLElement): void;
28
+ /**
29
+ * Find the text node which is the nearest and add an aria-owns attribute
30
+ * in order to correctly position this editor in the text flow.
31
+ * @param {HTMLElement} element
32
+ * @param {boolean} isRemovable
33
+ * @returns {string|null} The id in the struct tree if any.
34
+ */
35
+ addPointerInTextLayer(element: HTMLElement, isRemovable: boolean): string | null;
36
+ /**
37
+ * Move a div in the DOM in order to respect the visual order.
38
+ * @param {HTMLElement} container
39
+ * @param {HTMLDivElement} element
40
+ * @param {HTMLElement} contentElement
41
+ * @param {boolean} isRemovable
42
+ * @returns {string|null} The id in the struct tree if any.
43
+ */
44
+ moveElementInDOM(container: HTMLElement, element: HTMLDivElement, contentElement: HTMLElement, isRemovable: boolean): string | null;
45
+ #private;
46
+ }
@@ -0,0 +1,62 @@
1
+ export type EventBus = import("./event_utils").EventBus;
2
+ export type PDFFindController = import("./pdf_find_controller").PDFFindController;
3
+ export type TextHighlighterOptions = {
4
+ findController: PDFFindController;
5
+ /**
6
+ * - The application event bus.
7
+ */
8
+ eventBus: EventBus;
9
+ /**
10
+ * - The page index.
11
+ */
12
+ pageIndex: number;
13
+ };
14
+ /** @typedef {import("./event_utils").EventBus} EventBus */
15
+ /** @typedef {import("./pdf_find_controller").PDFFindController} PDFFindController */
16
+ /**
17
+ * @typedef {object} TextHighlighterOptions
18
+ * @property {PDFFindController} findController
19
+ * @property {EventBus} eventBus - The application event bus.
20
+ * @property {number} pageIndex - The page index.
21
+ */
22
+ /**
23
+ * TextHighlighter handles highlighting matches from the FindController in
24
+ * either the text layer or XFA layer depending on the type of document.
25
+ */
26
+ export class TextHighlighter {
27
+ /**
28
+ * @param {TextHighlighterOptions} options
29
+ */
30
+ constructor({ findController, eventBus, pageIndex }: TextHighlighterOptions);
31
+ findController: import("./pdf_find_controller").PDFFindController;
32
+ matches: any[];
33
+ eventBus: import("./event_utils").EventBus;
34
+ pageIdx: number;
35
+ textDivs: Node[] | null;
36
+ textContentItemsStr: string[] | null;
37
+ enabled: boolean;
38
+ /**
39
+ * Store two arrays that will map DOM nodes to text they should contain.
40
+ * The arrays should be of equal length and the array element at each index
41
+ * should correspond to the other. e.g.
42
+ * `items[0] = "<span>Item 0</span>" and texts[0] = "Item 0";
43
+ * @param {Array<Node>} divs
44
+ * @param {Array<string>} texts
45
+ */
46
+ setTextMapping(divs: Array<Node>, texts: Array<string>): void;
47
+ /**
48
+ * Start listening for events to update the highlighter and check if there are
49
+ * any current matches that need be highlighted.
50
+ */
51
+ enable(): void;
52
+ disable(): void;
53
+ _convertMatches(matches: any, matchesLength: any): {
54
+ begin: {
55
+ divIdx: number;
56
+ offset: number;
57
+ };
58
+ }[];
59
+ _renderMatches(matches: any): void;
60
+ _updateMatches(reset?: boolean): void;
61
+ #private;
62
+ }
@@ -0,0 +1,70 @@
1
+ export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
2
+ export type PageViewport = import("../src/display/page_viewport").PageViewport;
3
+ export type TextLayerImages = import("../src/display/text_layer_images.js").TextLayerImages;
4
+ export type TextHighlighter = import("./text_highlighter").TextHighlighter;
5
+ export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
6
+ export type TextLayerBuilderOptions = {
7
+ pdfPage: PDFPageProxy;
8
+ /**
9
+ * - Optional object that will handle
10
+ * highlighting text from the find controller.
11
+ */
12
+ highlighter?: import("./text_highlighter").TextHighlighter | undefined;
13
+ accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
14
+ enablePermissions?: boolean | undefined;
15
+ onAppend?: Function | undefined;
16
+ abortSignal?: AbortSignal | undefined;
17
+ };
18
+ export type TextLayerBuilderRenderOptions = {
19
+ viewport: PageViewport;
20
+ images: TextLayerImages;
21
+ textContentParams?: object | undefined;
22
+ };
23
+ /**
24
+ * @typedef {object} TextLayerBuilderOptions
25
+ * @property {PDFPageProxy} pdfPage
26
+ * @property {TextHighlighter} [highlighter] - Optional object that will handle
27
+ * highlighting text from the find controller.
28
+ * @property {TextAccessibilityManager} [accessibilityManager]
29
+ * @property {boolean} [enablePermissions]
30
+ * @property {Function} [onAppend]
31
+ * @property {AbortSignal} [abortSignal]
32
+ */
33
+ /**
34
+ * @typedef {object} TextLayerBuilderRenderOptions
35
+ * @property {PageViewport} viewport
36
+ * @property {TextLayerImages} images
37
+ * @property {object} [textContentParams]
38
+ */
39
+ /**
40
+ * The text layer builder provides text selection functionality for the PDF.
41
+ * It does this by creating overlay divs over the PDF's text. These divs
42
+ * contain text that matches the PDF text they are overlaying.
43
+ */
44
+ export class TextLayerBuilder {
45
+ static #textLayers: Map<any, any>;
46
+ static #selectionChangeAC: null;
47
+ static #removeGlobalSelectionListener(textLayerDiv: any): void;
48
+ static #enableGlobalSelectionListener(globalAbortSignal: any): void;
49
+ /**
50
+ * @param {TextLayerBuilderOptions} options
51
+ */
52
+ constructor({ pdfPage, highlighter, accessibilityManager, enablePermissions, onAppend, abortSignal, }: TextLayerBuilderOptions);
53
+ pdfPage: import("../src/display/api").PDFPageProxy;
54
+ highlighter: import("./text_highlighter").TextHighlighter;
55
+ accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager;
56
+ div: HTMLDivElement;
57
+ /**
58
+ * Renders the text layer.
59
+ * @param {TextLayerBuilderRenderOptions} options
60
+ * @returns {Promise<void>}
61
+ */
62
+ render({ viewport, images, textContentParams }: TextLayerBuilderRenderOptions): Promise<void>;
63
+ hide(): void;
64
+ show(): void;
65
+ /**
66
+ * Cancel rendering of the text layer.
67
+ */
68
+ cancel(): void;
69
+ #private;
70
+ }
@@ -0,0 +1,260 @@
1
+ export type GetPageSizeInchesParameters = {
2
+ view: number[];
3
+ userUnit: number;
4
+ rotate: number;
5
+ };
6
+ export type PageSize = {
7
+ /**
8
+ * - In inches.
9
+ */
10
+ width: number;
11
+ /**
12
+ * - In inches.
13
+ */
14
+ height: number;
15
+ };
16
+ export type GetVisibleElementsParameters = {
17
+ /**
18
+ * - A container that can possibly scroll.
19
+ */
20
+ scrollEl: HTMLElement;
21
+ /**
22
+ * - Objects with a `div` property that contains an
23
+ * HTMLElement, which should all be descendants of `scrollEl` satisfying the
24
+ * relevant layout assumptions.
25
+ */
26
+ views: any[];
27
+ /**
28
+ * - If `true`, the returned elements are
29
+ * sorted in descending order of the percent of their padding box that is
30
+ * visible. The default value is `false`.
31
+ */
32
+ sortByVisibility: boolean;
33
+ /**
34
+ * - If `true`, the elements are assumed to be
35
+ * laid out horizontally instead of vertically. The default value is `false`.
36
+ */
37
+ horizontal: boolean;
38
+ /**
39
+ * - If `true`, the `scrollEl` container is assumed to
40
+ * be in right-to-left mode. The default value is `false`.
41
+ */
42
+ rtl: boolean;
43
+ };
44
+ /**
45
+ * Promise that is resolved when DOM window becomes visible.
46
+ */
47
+ export const animationStarted: Promise<any>;
48
+ /**
49
+ * Converts API PageLayout values to the format used by `BaseViewer`.
50
+ * @param {string} layout - The API PageLayout value.
51
+ * @returns {object}
52
+ */
53
+ export function apiPageLayoutToViewerModes(layout: string): object;
54
+ /**
55
+ * Converts API PageMode values to the format used by `PDFSidebar`.
56
+ * NOTE: There's also a "FullScreen" parameter which is not possible to support,
57
+ * since the Fullscreen API used in browsers requires that entering
58
+ * fullscreen mode only occurs as a result of a user-initiated event.
59
+ * @param {string} mode - The API PageMode value.
60
+ * @returns {number} A value from {SidebarView}.
61
+ */
62
+ export function apiPageModeToSidebarView(mode: string): number;
63
+ /**
64
+ * Approximates float number as a fraction using Farey sequence (max order
65
+ * of 8).
66
+ * @param {number} x - Positive float number.
67
+ * @returns {Array} Estimated fraction: the first array item is a numerator,
68
+ * the second one is a denominator.
69
+ * They are both natural numbers.
70
+ */
71
+ export function approximateFraction(x: number): any[];
72
+ export const AutoPrintRegExp: RegExp;
73
+ /**
74
+ * Helper function for getVisibleElements.
75
+ * @param {number} index - initial guess at the first visible element
76
+ * @param {Array} views - array of pages, into which `index` is an index
77
+ * @param {number} top - the top of the scroll pane
78
+ * @returns {number} less than or equal to `index` that is definitely at or
79
+ * before the first visible element in `views`, but not by too much. (Usually,
80
+ * this will be the first element in the first partially visible row in
81
+ * `views`, although sometimes it goes back one row further.)
82
+ */
83
+ export function backtrackBeforeAllVisibleElements(index: number, views: any[], top: number): number;
84
+ /**
85
+ * Use binary search to find the index of the first item in a given array which
86
+ * passes a given condition. The items are expected to be sorted in the sense
87
+ * that if the condition is true for one item in the array, then it is also true
88
+ * for all following items.
89
+ * @returns {number} Index of the first array element to pass the test,
90
+ * or |items.length| if no such element exists.
91
+ */
92
+ export function binarySearchFirstItem(items: any, condition: any, start?: number): number;
93
+ export const calcRound: ((x: number) => number) | ((x: any) => any);
94
+ export namespace CursorTool {
95
+ let SELECT: number;
96
+ let HAND: number;
97
+ let ZOOM: number;
98
+ }
99
+ export const DEFAULT_SCALE: 1;
100
+ export const DEFAULT_SCALE_DELTA: 1.1;
101
+ export const DEFAULT_SCALE_VALUE: "auto";
102
+ export const docStyle: CSSStyleDeclaration | null;
103
+ /**
104
+ * @param {number} x - A positive number to round to a multiple of `div`.
105
+ * @param {number} div - A natural number.
106
+ */
107
+ export function floorToDivide(x: number, div: number): number;
108
+ /**
109
+ * Get the active or focused element in current DOM.
110
+ *
111
+ * Recursively search for the truly active or focused element in case there are
112
+ * shadow DOMs.
113
+ * @returns {Element} the truly active or focused element.
114
+ */
115
+ export function getActiveOrFocusedElement(): Element;
116
+ /**
117
+ * @typedef {object} GetPageSizeInchesParameters
118
+ * @property {number[]} view
119
+ * @property {number} userUnit
120
+ * @property {number} rotate
121
+ */
122
+ /**
123
+ * @typedef {object} PageSize
124
+ * @property {number} width - In inches.
125
+ * @property {number} height - In inches.
126
+ */
127
+ /**
128
+ * Gets the size of the specified page, converted from PDF units to inches.
129
+ * @param {GetPageSizeInchesParameters} params
130
+ * @returns {PageSize}
131
+ */
132
+ export function getPageSizeInches({ view, userUnit, rotate }: GetPageSizeInchesParameters): PageSize;
133
+ /**
134
+ * @typedef {object} GetVisibleElementsParameters
135
+ * @property {HTMLElement} scrollEl - A container that can possibly scroll.
136
+ * @property {Array} views - Objects with a `div` property that contains an
137
+ * HTMLElement, which should all be descendants of `scrollEl` satisfying the
138
+ * relevant layout assumptions.
139
+ * @property {boolean} sortByVisibility - If `true`, the returned elements are
140
+ * sorted in descending order of the percent of their padding box that is
141
+ * visible. The default value is `false`.
142
+ * @property {boolean} horizontal - If `true`, the elements are assumed to be
143
+ * laid out horizontally instead of vertically. The default value is `false`.
144
+ * @property {boolean} rtl - If `true`, the `scrollEl` container is assumed to
145
+ * be in right-to-left mode. The default value is `false`.
146
+ */
147
+ /**
148
+ * Generic helper to find out what elements are visible within a scroll pane.
149
+ *
150
+ * Well, pretty generic. There are some assumptions placed on the elements
151
+ * referenced by `views`:
152
+ * - If `horizontal`, no left of any earlier element is to the right of the
153
+ * left of any later element.
154
+ * - Otherwise, `views` can be split into contiguous rows where, within a row,
155
+ * no top of any element is below the bottom of any other element, and
156
+ * between rows, no bottom of any element in an earlier row is below the
157
+ * top of any element in a later row.
158
+ *
159
+ * (Here, top, left, etc. all refer to the padding edge of the element in
160
+ * question. For pages, that ends up being equivalent to the bounding box of the
161
+ * rendering canvas. Earlier and later refer to index in `views`, not page
162
+ * layout.)
163
+ * @param {GetVisibleElementsParameters} params
164
+ * @returns {object} `{ first, last, views: [{ id, x, y, view, percent }] }`
165
+ */
166
+ export function getVisibleElements({ scrollEl, views, sortByVisibility, horizontal, rtl, }: GetVisibleElementsParameters): object;
167
+ export function isPortraitOrientation(size: any): boolean;
168
+ export function isValidRotation(angle: any): boolean;
169
+ export function isValidScrollMode(mode: any): boolean;
170
+ export function isValidSpreadMode(mode: any): boolean;
171
+ export const MAX_AUTO_SCALE: 1.25;
172
+ export const MAX_SCALE: 25;
173
+ export const MIN_SCALE: 0.1;
174
+ export function normalizeWheelEventDelta(evt: any): number;
175
+ export function normalizeWheelEventDirection(evt: any): number;
176
+ /**
177
+ * Helper function to parse query string (e.g. ?param1=value&param2=...).
178
+ * @param {string} query
179
+ * @returns {Map}
180
+ */
181
+ export function parseQueryString(query: string): Map<any, any>;
182
+ export namespace PresentationModeState {
183
+ let UNKNOWN: number;
184
+ let NORMAL: number;
185
+ let CHANGING: number;
186
+ let FULLSCREEN: number;
187
+ }
188
+ export class ProgressBar {
189
+ constructor(bar: any);
190
+ set percent(val: number);
191
+ get percent(): number;
192
+ setWidth(viewer: any): void;
193
+ setDisableAutoFetch(delay?: number): void;
194
+ hide(): void;
195
+ show(): void;
196
+ #private;
197
+ }
198
+ /**
199
+ * @param {string} str
200
+ * @param {boolean} [replaceInvisible]
201
+ */
202
+ export function removeNullCharacters(str: string, replaceInvisible?: boolean): string;
203
+ export const SCROLLBAR_PADDING: 40;
204
+ /**
205
+ * Scrolls specified element into view of its parent.
206
+ * @param {HTMLElement} element - The element to be visible.
207
+ * @param {object} [spot] - An object with optional top and left properties,
208
+ * specifying the offset from the top left edge.
209
+ * @param {number} [spot.left]
210
+ * @param {number} [spot.top]
211
+ */
212
+ export function scrollIntoView(element: HTMLElement, spot?: {
213
+ left?: number | undefined;
214
+ top?: number | undefined;
215
+ }): void;
216
+ export namespace ScrollMode {
217
+ let UNKNOWN_1: number;
218
+ export { UNKNOWN_1 as UNKNOWN };
219
+ export let VERTICAL: number;
220
+ export let HORIZONTAL: number;
221
+ export let WRAPPED: number;
222
+ export let PAGE: number;
223
+ }
224
+ export namespace SidebarView {
225
+ let UNKNOWN_2: number;
226
+ export { UNKNOWN_2 as UNKNOWN };
227
+ export let NONE: number;
228
+ export let THUMBS: number;
229
+ export let OUTLINE: number;
230
+ export let ATTACHMENTS: number;
231
+ export let LAYERS: number;
232
+ }
233
+ export namespace SpreadMode {
234
+ let UNKNOWN_3: number;
235
+ export { UNKNOWN_3 as UNKNOWN };
236
+ let NONE_1: number;
237
+ export { NONE_1 as NONE };
238
+ export let ODD: number;
239
+ export let EVEN: number;
240
+ }
241
+ export namespace TextLayerMode {
242
+ let DISABLE: number;
243
+ let ENABLE: number;
244
+ let ENABLE_PERMISSIONS: number;
245
+ }
246
+ export function toggleCheckedBtn(button: any, toggle: any, view?: null): void;
247
+ export function toggleExpandedBtn(button: any, toggle: any, view?: null): void;
248
+ export function toggleSelectedBtn(button: any, toggle: any, view?: null): void;
249
+ export const UNKNOWN_SCALE: 0;
250
+ export const VERTICAL_PADDING: 5;
251
+ /**
252
+ * Helper function to start monitoring the scroll event and converting them into
253
+ * PDF.js friendly one: with scroll debounce and scroll direction.
254
+ */
255
+ export function watchScroll(viewAreaElement: any, callback: any, abortSignal?: undefined): {
256
+ right: boolean;
257
+ down: boolean;
258
+ lastX: any;
259
+ lastY: any;
260
+ };
@@ -0,0 +1,50 @@
1
+ export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
2
+ export type AnnotationStorage = import("../src/display/annotation_storage").AnnotationStorage;
3
+ export type PageViewport = import("../src/display/page_viewport").PageViewport;
4
+ export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
5
+ export type XfaLayerBuilderOptions = {
6
+ pdfPage: PDFPageProxy;
7
+ annotationStorage?: import("../src/display/annotation_storage").AnnotationStorage | undefined;
8
+ linkService: PDFLinkService;
9
+ xfaHtml?: object | undefined;
10
+ };
11
+ export type XfaLayerBuilderRenderOptions = {
12
+ viewport: PageViewport;
13
+ /**
14
+ * - The default value is "display".
15
+ */
16
+ intent?: string | undefined;
17
+ };
18
+ /**
19
+ * @typedef {object} XfaLayerBuilderOptions
20
+ * @property {PDFPageProxy} pdfPage
21
+ * @property {AnnotationStorage} [annotationStorage]
22
+ * @property {PDFLinkService} linkService
23
+ * @property {object} [xfaHtml]
24
+ */
25
+ /**
26
+ * @typedef {object} XfaLayerBuilderRenderOptions
27
+ * @property {PageViewport} viewport
28
+ * @property {string} [intent] - The default value is "display".
29
+ */
30
+ export class XfaLayerBuilder {
31
+ /**
32
+ * @param {XfaLayerBuilderOptions} options
33
+ */
34
+ constructor({ pdfPage, annotationStorage, linkService, xfaHtml, }: XfaLayerBuilderOptions);
35
+ div: null;
36
+ pdfPage: import("../src/display/api").PDFPageProxy;
37
+ annotationStorage: import("../src/display/annotation_storage").AnnotationStorage;
38
+ linkService: import("./pdf_link_service.js").PDFLinkService;
39
+ xfaHtml: object;
40
+ /**
41
+ * @param {XfaLayerBuilderRenderOptions} viewport
42
+ * @returns {Promise<object | void>} A promise that is resolved when rendering
43
+ * of the XFA layer is complete. The first rendering will return an object
44
+ * with a `textDivs` property that can be used with the TextHighlighter.
45
+ */
46
+ render({ viewport, intent }: XfaLayerBuilderRenderOptions): Promise<object | void>;
47
+ cancel(): void;
48
+ hide(): void;
49
+ #private;
50
+ }