modern-pdf-lib 0.19.9 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +34 -5
  2. package/dist/{batchOptimize-xo6BXbGZ.cjs → batchOptimize-Ba_pWw71.cjs} +2 -2
  3. package/dist/{batchOptimize-7U_kD3_j.mjs → batchOptimize-DtRwBOqR.mjs} +5 -5
  4. package/dist/{bridge-DTH5LMAK.mjs → bridge-CcivG_Sm.mjs} +3 -3
  5. package/dist/browser.cjs +56 -12
  6. package/dist/browser.d.cts +5 -5
  7. package/dist/browser.d.mts +5 -5
  8. package/dist/browser.mjs +13 -13
  9. package/dist/cli/index.cjs +2 -2
  10. package/dist/cli/index.mjs +3 -3
  11. package/dist/{compressionAnalysis-eXYyDsrh.cjs → compressionAnalysis-B84FPXaQ.cjs} +4 -4
  12. package/dist/{compressionAnalysis-BBv4BkQP.d.mts → compressionAnalysis-DGs-MqTe.d.mts} +26 -3
  13. package/dist/compressionAnalysis-DGs-MqTe.d.mts.map +1 -0
  14. package/dist/{compressionAnalysis-CtJ2X9l2.d.cts → compressionAnalysis-VtYV9Zmq.d.cts} +26 -3
  15. package/dist/compressionAnalysis-VtYV9Zmq.d.cts.map +1 -0
  16. package/dist/{compressionAnalysis-Bw2alOxt.mjs → compressionAnalysis-odbHC7Uk.mjs} +5 -5
  17. package/dist/create.cjs +23 -4
  18. package/dist/create.d.cts +3 -3
  19. package/dist/create.d.mts +3 -3
  20. package/dist/create.mjs +4 -4
  21. package/dist/{deduplicateImages-BX3Zg8Qp.mjs → deduplicateImages-MfUDPxQz.mjs} +3 -3
  22. package/dist/{deduplicateImages-B5lmzL9j.cjs → deduplicateImages-cKsnD6Ep.cjs} +2 -2
  23. package/dist/{fflateAdapter-CBQpGTlx.mjs → fflateAdapter-PSiW_ML7.mjs} +2 -2
  24. package/dist/{fontEmbed-Dsu9fo4U.d.mts → fontEmbed-BN842wlb.d.cts} +26 -3
  25. package/dist/fontEmbed-BN842wlb.d.cts.map +1 -0
  26. package/dist/{fontEmbed-LID6yG6g.d.cts → fontEmbed-Dgq5K89o.d.mts} +26 -3
  27. package/dist/fontEmbed-Dgq5K89o.d.mts.map +1 -0
  28. package/dist/{fontSubset-DWpduoY2.mjs → fontSubset-D-vQQems.mjs} +2 -2
  29. package/dist/forms.cjs +8 -1
  30. package/dist/forms.d.cts +3 -3
  31. package/dist/forms.d.mts +3 -3
  32. package/dist/forms.mjs +2 -2
  33. package/dist/{imageExtract-B6OvUEp-.mjs → imageExtract-Dnk_Ssv7.mjs} +2 -2
  34. package/dist/{imageExtract-PxdBvpHj.cjs → imageExtract-zEb1gnkb.cjs} +2 -2
  35. package/dist/{index-BtYOx5wh.d.mts → index-DCSbmXWh.d.mts} +1088 -53
  36. package/dist/index-DCSbmXWh.d.mts.map +1 -0
  37. package/dist/{index-bpktKzCA.d.cts → index-J1W3FdL8.d.cts} +1088 -53
  38. package/dist/index-J1W3FdL8.d.cts.map +1 -0
  39. package/dist/index.cjs +56 -12
  40. package/dist/index.d.cts +5 -5
  41. package/dist/index.d.mts +5 -5
  42. package/dist/index.mjs +13 -13
  43. package/dist/{layout-BZ8tTeAk.mjs → layout-D6EUKSP8.mjs} +39 -3
  44. package/dist/{layout-Inbqegsk.cjs → layout-DH61a1iR.cjs} +56 -2
  45. package/dist/{libdeflateWasm-rLppXytE.mjs → libdeflateWasm-8b91Vmia.mjs} +3 -3
  46. package/dist/{loader-3u6Tw5T-.mjs → loader-C7B5dVCI.mjs} +2 -2
  47. package/dist/parse.cjs +6 -4
  48. package/dist/parse.d.cts +3 -3
  49. package/dist/parse.d.mts +3 -3
  50. package/dist/parse.mjs +5 -5
  51. package/dist/{pdfCatalog-IImGcMbR.mjs → pdfCatalog-3yMIhJtt.mjs} +2 -2
  52. package/dist/{pdfDocument-DOg240g9.mjs → pdfDocument-B0_XwS4X.mjs} +1810 -52
  53. package/dist/{pdfDocument-i6U5fQ91.d.mts → pdfDocument-BgvEP5Po.d.mts} +37 -4
  54. package/dist/{pdfDocument-i6U5fQ91.d.mts.map → pdfDocument-BgvEP5Po.d.mts.map} +1 -1
  55. package/dist/{pdfDocument-Duf9LelM.cjs → pdfDocument-CEbbUP9i.cjs} +1902 -42
  56. package/dist/{pdfDocument-BSiQdNZq.d.cts → pdfDocument-CbU-2TjT.d.cts} +37 -4
  57. package/dist/{pdfDocument-BSiQdNZq.d.cts.map → pdfDocument-CbU-2TjT.d.cts.map} +1 -1
  58. package/dist/{pdfPage-BacMkrLe.mjs → pdfPage-B_d9HmkG.mjs} +6 -6
  59. package/dist/{pdfPage-CirlQRzJ.cjs → pdfPage-Cd8jOJp6.cjs} +4 -4
  60. package/dist/{pngEmbed-BLj2zi-5.mjs → pngEmbed-BWAbEUKF.mjs} +3 -3
  61. package/dist/{src-BLWEEbd7.cjs → src-B1iDGLCL.cjs} +6349 -2616
  62. package/dist/{src-x0g7wiRq.mjs → src-Db6Qknoz.mjs} +6213 -2654
  63. package/dist/{streamDecode-CWN-nfPJ.mjs → streamDecode-Bj568Nc9.mjs} +1648 -39
  64. package/dist/{streamDecode-Bs0_MT_Q.cjs → streamDecode-CvgErkFu.cjs} +1648 -39
  65. package/package.json +4 -2
  66. package/dist/compressionAnalysis-BBv4BkQP.d.mts.map +0 -1
  67. package/dist/compressionAnalysis-CtJ2X9l2.d.cts.map +0 -1
  68. package/dist/fontEmbed-Dsu9fo4U.d.mts.map +0 -1
  69. package/dist/fontEmbed-LID6yG6g.d.cts.map +0 -1
  70. package/dist/index-BtYOx5wh.d.mts.map +0 -1
  71. package/dist/index-bpktKzCA.d.cts.map +0 -1
@@ -1,33 +1,11 @@
1
- import { $ as DrawLineOptions, $n as colorToComponents, $t as PdfLayerManager, A as EncryptAlgorithm, An as Angle, At as ColorStop, B as serializePdf, Bn as rotationMatrix, Bt as linearGradient, C as ViewerPreferences, Cn as BlendMode, Ct as renderMultiPageTable, D as OutlineItemOptions, Dn as ParseSpeeds, Dt as QrCodeOptions, E as OutlineDestination, En as LineJoinStyle, Et as QrCodeMatrix, F as encodePermissions, Fn as degreesToRadians, Ft as RadialGradientFill, G as buildCatalog, Gn as translate, Gt as EmbeddedPdfPage, H as DocumentMetadata, Hn as scale, Ht as tilingPattern, I as LoadPdfOptions, In as radians, It as RadialGradientOptions, J as buildPageTree, Jn as GrayscaleColor, Jt as RedactionOptions, K as buildDocumentStructure, Kn as CmykColor, Kt as embedPageAsFormXObject, L as loadPdf, Ln as radiansToDegrees, Lt as TilingPatternOptions, M as PdfEncryptionHandler, Mn as Radians, Mt as LinearGradientOptions, N as PdfPermissionFlags, Nn as concatMatrix, Nt as NormalizedStop, O as PdfOutlineItem, On as TextAlignment, Ot as encodeQrCode, P as decodePermissions, Pn as degrees, Pt as PatternFill, Q as DrawImageOptions, Qn as cmyk, Qt as PdfLayer, R as PdfSaveOptions, Rn as restoreState, Rt as buildGradientObjects, S as PdfViewerPreferences, Sn as StructureType, St as TextRun, T as parseViewerPreferences, Tn as LineCapStyle, Tt as ErrorCorrectionLevel, U as DocumentStructure, Un as setGraphicsState, Ut as DrawPageOptions, V as CatalogOptions, Vn as saveState, Vt as radialGradient, W as PageEntry, Wn as skew, Wt as EmbedPageOptions, X as DrawCircleOptions, Xn as applyFillColor, Xt as getRedactionMarks, Y as formatPdfDate, Yn as RgbColor, Yt as applyRedactions, Z as DrawEllipseOptions, Zn as applyStrokeColor, Zt as markForRedaction, _ as PdfSignatureInfo, _n as createAnnotation, _t as PageContent, a as StandardFonts, an as SvgDrawCommand, ar as setFillColorCmyk, at as FontRef, b as getSignatures, bn as PdfStructureTree, bt as TableRenderResult, c as verifySignature, cn as parseSvgColor, cr as setFillingColor, ct as PageSizes, d as addWatermark, dn as AnnotationFlags, dr as setStrokeColorGray, dt as SoftMaskRef, en as beginLayerContent, er as componentsToColor, et as DrawQrCodeOptions, f as addWatermarkToPage, fn as AnnotationOptions, fr as setStrokeColorRgb, ft as TransparencyGroupOptions, g as getAttachments, gn as buildAnnotationDict, gt as NestedTableContent, h as buildEmbeddedFilesNameTree, hn as annotationFromDict, ht as MultiPageTableResult, i as StandardFontName, in as svgToPdfOperators, ir as setFillColor, it as DrawTextOptions, j as EncryptOptions, jn as Degrees, jt as GradientFill, k as PdfOutlineTree, kn as TextRenderingMode, kt as qrCodeToOperators, l as verifySignatures, ln as parseSvgPath, lr as setStrokeColor, lt as PdfPage, m as attachFile, mn as PdfAnnotation, mr as setStrokingColor, mt as DrawTableOptions, n as PdfDocument, nn as SvgRenderOptions, nr as rgb, nt as DrawSquareOptions, o as createPdf, on as SvgElement, or as setFillColorGray, ot as ImageRef, p as EmbeddedFile, pn as AnnotationType, pr as setStrokeColorSpace, pt as CellContent, q as buildInfoDict, qn as Color, qt as RedactionMark, r as SetTitleOptions, rn as drawSvgOnPage, rr as setColorSpace, rt as DrawSvgPathOptions, s as SignatureVerificationResult, sn as parseSvg, sr as setFillColorRgb, st as PageSize, t as EmbedFontOptions, tn as endLayerContent, tr as grayscale, tt as DrawRectangleOptions, u as WatermarkOptions, un as parseSvgTransform, ur as setStrokeColorCmyk, ut as SoftMaskBuilder, v as SignOptions, vn as AccessibilityIssue, vt as TableCell, w as buildViewerPreferencesDict, wn as ImageAlignment, wt as renderTable, x as signPdf, xn as StructureElementOptions, xt as TableRow, y as VisibleSignatureOptions, yn as PdfStructureElement, yt as TableColumn, z as PdfWriter, zn as rotate, zt as buildPatternObjects } from "./pdfDocument-BSiQdNZq.cjs";
1
+ import { $ as DrawLineOptions, $n as colorToComponents, $t as PdfLayerManager, A as EncryptAlgorithm, An as Angle, At as ColorStop, B as serializePdf, Bn as rotationMatrix, Bt as linearGradient, C as ViewerPreferences, Cn as BlendMode, Ct as renderMultiPageTable, D as OutlineItemOptions, Dn as ParseSpeeds, Dt as QrCodeOptions, E as OutlineDestination, En as LineJoinStyle, Et as QrCodeMatrix, F as encodePermissions, Fn as degreesToRadians, Ft as RadialGradientFill, G as buildCatalog, Gn as translate, Gt as EmbeddedPdfPage, H as DocumentMetadata, Hn as scale, Ht as tilingPattern, I as LoadPdfOptions, In as radians, It as RadialGradientOptions, J as buildPageTree, Jn as GrayscaleColor, Jt as RedactionOptions, K as buildDocumentStructure, Kn as CmykColor, Kt as embedPageAsFormXObject, L as loadPdf, Ln as radiansToDegrees, Lt as TilingPatternOptions, M as PdfEncryptionHandler, Mn as Radians, Mt as LinearGradientOptions, N as PdfPermissionFlags, Nn as concatMatrix, Nt as NormalizedStop, O as PdfOutlineItem, On as TextAlignment, Ot as encodeQrCode, P as decodePermissions, Pn as degrees, Pt as PatternFill, Q as DrawImageOptions, Qn as cmyk, Qt as PdfLayer, R as PdfSaveOptions, Rn as restoreState, Rt as buildGradientObjects, S as PdfViewerPreferences, Sn as StructureType, St as TextRun, T as parseViewerPreferences, Tn as LineCapStyle, Tt as ErrorCorrectionLevel, U as DocumentStructure, Un as setGraphicsState, Ut as DrawPageOptions, V as CatalogOptions, Vn as saveState, Vt as radialGradient, W as PageEntry, Wn as skew, Wt as EmbedPageOptions, X as DrawCircleOptions, Xn as applyFillColor, Xt as getRedactionMarks, Y as formatPdfDate, Yn as RgbColor, Yt as applyRedactions, Z as DrawEllipseOptions, Zn as applyStrokeColor, Zt as markForRedaction, _ as PdfSignatureInfo, _n as createAnnotation, _t as PageContent, a as StandardFonts, an as SvgDrawCommand, ar as setFillColorCmyk, at as FontRef, b as getSignatures, bn as PdfStructureTree, bt as TableRenderResult, c as verifySignature, cn as parseSvgColor, cr as setFillingColor, ct as PageSizes, d as addWatermark, dn as AnnotationFlags, dr as setStrokeColorGray, dt as SoftMaskRef, en as beginLayerContent, er as componentsToColor, et as DrawQrCodeOptions, f as addWatermarkToPage, fn as AnnotationOptions, fr as setStrokeColorRgb, ft as TransparencyGroupOptions, g as getAttachments, gn as buildAnnotationDict, gt as NestedTableContent, h as buildEmbeddedFilesNameTree, hn as annotationFromDict, ht as MultiPageTableResult, i as StandardFontName, in as svgToPdfOperators, ir as setFillColor, it as DrawTextOptions, j as EncryptOptions, jn as Degrees, jt as GradientFill, k as PdfOutlineTree, kn as TextRenderingMode, kt as qrCodeToOperators, l as verifySignatures, ln as parseSvgPath, lr as setStrokeColor, lt as PdfPage, m as attachFile, mn as PdfAnnotation, mr as setStrokingColor, mt as DrawTableOptions, n as PdfDocument, nn as SvgRenderOptions, nr as rgb, nt as DrawSquareOptions, o as createPdf, on as SvgElement, or as setFillColorGray, ot as ImageRef, p as EmbeddedFile, pn as AnnotationType, pr as setStrokeColorSpace, pt as CellContent, q as buildInfoDict, qn as Color, qt as RedactionMark, r as SetTitleOptions, rn as drawSvgOnPage, rr as setColorSpace, rt as DrawSvgPathOptions, s as SignatureVerificationResult, sn as parseSvg, sr as setFillColorRgb, st as PageSize, t as EmbedFontOptions, tn as endLayerContent, tr as grayscale, tt as DrawRectangleOptions, u as WatermarkOptions, un as parseSvgTransform, ur as setStrokeColorCmyk, ut as SoftMaskBuilder, v as SignOptions, vn as AccessibilityIssue, vt as TableCell, w as buildViewerPreferencesDict, wn as ImageAlignment, wt as renderTable, x as signPdf, xn as StructureElementOptions, xt as TableRow, y as VisibleSignatureOptions, yn as PdfStructureElement, yt as TableColumn, z as PdfWriter, zn as rotate, zt as buildPatternObjects } from "./pdfDocument-CbU-2TjT.cjs";
2
2
  import { C as PdfRef, E as RegistryEntry, S as PdfObjectRegistry, T as PdfString, _ as PdfDict, a as PdfListboxField, b as PdfNumber, c as PdfCheckboxField, d as FieldType, f as PdfField, g as PdfBool, h as PdfArray, i as PdfButtonField, l as PdfTextField, m as ByteWriter, n as RefResolver, o as PdfDropdownField, p as WidgetAnnotationHost, r as PdfSignatureField, s as PdfRadioGroup, t as PdfForm, u as FieldFlags, v as PdfName, w as PdfStream, x as PdfObject, y as PdfNull } from "./pdfForm-SOXJ72LW.cjs";
3
- import { A as movePage, C as copyPages, D as cropPage, E as CropBox, F as rotateAllPages, I as rotatePage, M as removePages, N as resizePage, O as getPageSize, P as reversePages, S as PageRange, T as splitPdf, _ as LayoutSinglelineResult, a as FontEmbeddingResult, b as layoutMultilineText, c as SubsetCmap, d as extractMetrics, f as ComputeFontSizeOptions, g as LayoutSinglelineOptions, h as LayoutMultilineResult, i as FontDescriptorData, j as removePage, k as insertPage, l as SubsetResult, m as LayoutMultilineOptions, n as CIDSystemInfoData, o as Type0FontData, p as LayoutCombedOptions, r as EmbeddedFont, s as WidthEntry, t as CIDFontData, u as FontMetrics, v as computeFontSize, w as mergePdfs, x as layoutSinglelineText, y as layoutCombedText } from "./fontEmbed-LID6yG6g.cjs";
3
+ import { A as movePage, C as copyPages, D as cropPage, E as CropBox, F as rotateAllPages, I as rotatePage, L as asNumber, M as removePages, N as resizePage, O as getPageSize, P as reversePages, R as asPDFName, S as PageRange, T as splitPdf, _ as LayoutSinglelineResult, a as FontEmbeddingResult, b as layoutMultilineText, c as SubsetCmap, d as extractMetrics, f as ComputeFontSizeOptions, g as LayoutSinglelineOptions, h as LayoutMultilineResult, i as FontDescriptorData, j as removePage, k as insertPage, l as SubsetResult, m as LayoutMultilineOptions, n as CIDSystemInfoData, o as Type0FontData, p as LayoutCombedOptions, r as EmbeddedFont, s as WidthEntry, t as CIDFontData, u as FontMetrics, v as computeFontSize, w as mergePdfs, x as layoutSinglelineText, y as layoutCombedText, z as asPDFNumber } from "./fontEmbed-BN842wlb.cjs";
4
4
  import { a as ListboxAppearanceOptions, c as TextAppearanceOptions, d as generateDropdownAppearance, f as generateListboxAppearance, h as generateTextAppearance, i as DropdownAppearanceOptions, l as generateButtonAppearance, m as generateSignatureAppearance, n as ButtonAppearanceOptions, o as RadioAppearanceOptions, p as generateRadioAppearance, r as CheckboxAppearanceOptions, s as SignatureAppearanceOptions, t as AppearanceProviderFor, u as generateCheckboxAppearance } from "./fieldAppearance-CdiGFG5e.cjs";
5
- import { a as decodeImageStream, c as TextExtractionOptions, d as extractTextWithPositions, f as ContentStreamOperator, i as ImageInfo, l as TextItem, m as parseContentStream, n as ImageAnalysis, o as extractImages, p as Operand, r as analyzeImages, s as decodeStream, t as AnalysisReport, u as extractText } from "./compressionAnalysis-CtJ2X9l2.cjs";
5
+ import { _ as parseContentStream, a as ImageInfo, c as PdfParseError, d as TextExtractionOptions, f as TextItem, g as Operand, h as ContentStreamOperator, i as analyzeImages, l as formatHexContext, m as extractTextWithPositions, n as AnalyzeImagesOptions, o as decodeImageStream, p as extractText, r as ImageAnalysis, s as extractImages, t as AnalysisReport, u as decodeStream } from "./compressionAnalysis-VtYV9Zmq.cjs";
6
6
 
7
7
  //#region \0rolldown/runtime.js
8
8
  //#endregion
9
- //#region src/utils/pdfValueHelpers.d.ts
10
- /**
11
- * Create a {@link PdfName} from a string.
12
- *
13
- * @param value The name value (with or without leading `/`).
14
- */
15
- declare function asPDFName(value: string): PdfName;
16
- /**
17
- * Create a {@link PdfNumber} from a numeric value.
18
- *
19
- * @param value The number.
20
- */
21
- declare function asPDFNumber(value: number): PdfNumber;
22
- /**
23
- * Extract a numeric value from a {@link PdfObject}.
24
- *
25
- * Returns `undefined` if the object is not a PdfNumber.
26
- *
27
- * @param obj The PDF object to inspect.
28
- */
29
- declare function asNumber(obj: PdfObject): number | undefined;
30
- //#endregion
31
9
  //#region src/core/incrementalWriter.d.ts
32
10
  /**
33
11
  * Result of an incremental save operation.
@@ -1457,7 +1435,6 @@ declare class PdfPopupAnnotation extends PdfAnnotation {
1457
1435
  * Create a new popup annotation.
1458
1436
  *
1459
1437
  * @param options.open Whether the popup is initially open. Default: false.
1460
- * @param options.parent Reference to the parent annotation (set after registration).
1461
1438
  */
1462
1439
  static create(options: AnnotationOptions & {
1463
1440
  open?: boolean | undefined;
@@ -1630,29 +1607,6 @@ declare function generateInkAppearance(annot: PdfAnnotation): PdfStream;
1630
1607
  */
1631
1608
  declare function generateFreeTextAppearance(annot: PdfAnnotation): PdfStream;
1632
1609
  //#endregion
1633
- //#region src/parser/parseError.d.ts
1634
- /**
1635
- * @module parser/parseError
1636
- * Structured error class for PDF parsing failures.
1637
- * @packageDocumentation
1638
- */
1639
- declare class PdfParseError extends Error {
1640
- readonly name = "PdfParseError";
1641
- readonly offset: number;
1642
- readonly expected: string;
1643
- readonly actual: string;
1644
- readonly hexContext: string;
1645
- constructor(options: {
1646
- message: string;
1647
- offset: number;
1648
- expected?: string | undefined;
1649
- actual?: string | undefined;
1650
- data?: Uint8Array | undefined;
1651
- cause?: Error | undefined;
1652
- });
1653
- }
1654
- declare function formatHexContext(data: Uint8Array, offset: number, windowSize?: number): string;
1655
- //#endregion
1656
1610
  //#region src/signature/byteRange.d.ts
1657
1611
  /**
1658
1612
  * @module signature/byteRange
@@ -1726,7 +1680,10 @@ interface PrepareAppearanceOptions {
1726
1680
  /** Border width. Default: 1. */
1727
1681
  borderWidth?: number | undefined;
1728
1682
  }
1729
- declare function prepareForSigning(pdfBytes: Uint8Array, signatureFieldName: string, placeholderSize?: number, appearance?: PrepareAppearanceOptions | undefined): {
1683
+ declare function prepareForSigning(pdfBytes: Uint8Array, signatureFieldName: string, placeholderSize?: number, appearance?: PrepareAppearanceOptions | undefined, mdpPermission?: number | undefined, fieldLock?: {
1684
+ action: 'All' | 'Include' | 'Exclude';
1685
+ fields?: string[] | undefined;
1686
+ } | undefined): {
1730
1687
  preparedPdf: Uint8Array;
1731
1688
  byteRange: ByteRangeResult;
1732
1689
  };
@@ -1994,6 +1951,692 @@ declare function parseTimestampResponse(response: Uint8Array): TimestampResult;
1994
1951
  */
1995
1952
  declare function requestTimestamp(dataHash: Uint8Array, tsaUrl: string, hashAlgorithm?: 'SHA-256' | 'SHA-384' | 'SHA-512'): Promise<TimestampResult>;
1996
1953
  //#endregion
1954
+ //#region src/signature/incrementalSave.d.ts
1955
+ /**
1956
+ * @module signature/incrementalSave
1957
+ *
1958
+ * Incremental save with signature preservation.
1959
+ *
1960
+ * Provides the ability to perform append-only incremental updates
1961
+ * to a PDF while preserving all existing digital signatures.
1962
+ * This is essential for multi-signature workflows where each signer
1963
+ * adds their signature without invalidating previous signatures.
1964
+ *
1965
+ * Key guarantees:
1966
+ * - Original bytes are never modified (pure append)
1967
+ * - All existing signature byte ranges remain intact
1968
+ * - Each update appends objects + xref + trailer with /Prev pointer
1969
+ *
1970
+ * Reference: PDF 1.7 spec, SS7.5.6 (Incremental Updates),
1971
+ * SS12.8 (Digital Signatures).
1972
+ *
1973
+ * @packageDocumentation
1974
+ */
1975
+ /**
1976
+ * Byte range for an existing signature.
1977
+ */
1978
+ interface SignatureByteRange {
1979
+ /** The four-element byte range array [offset1, length1, offset2, length2]. */
1980
+ byteRange: [number, number, number, number];
1981
+ /** Offset of the /Contents hex string placeholder. */
1982
+ contentsOffset: number;
1983
+ /** Length of the /Contents hex string (including angle brackets). */
1984
+ contentsLength: number;
1985
+ }
1986
+ /**
1987
+ * Options for incremental save with signature preservation.
1988
+ */
1989
+ interface IncrementalSaveOptions {
1990
+ /** Apply FlateDecode compression to new stream objects. Default: true. */
1991
+ compress?: boolean | undefined;
1992
+ /** Preserve existing signatures by verifying byte ranges. Default: true. */
1993
+ preserveSignatures?: boolean | undefined;
1994
+ }
1995
+ /**
1996
+ * Options for pure append-only incremental updates.
1997
+ */
1998
+ interface AppendOptions {
1999
+ /** Apply FlateDecode compression. Default: false. */
2000
+ compress?: boolean | undefined;
2001
+ }
2002
+ /**
2003
+ * An object to be appended in an incremental update.
2004
+ */
2005
+ interface IncrementalObject {
2006
+ /** The PDF object number. */
2007
+ objectNumber: number;
2008
+ /** The generation number (usually 0). */
2009
+ generationNumber: number;
2010
+ /** The serialized object data (everything between `N G obj\n` and `\nendobj`). */
2011
+ data: Uint8Array;
2012
+ }
2013
+ /**
2014
+ * Information extracted from an existing PDF trailer.
2015
+ */
2016
+ interface TrailerInfo {
2017
+ /** The /Size value (total number of objects). */
2018
+ size: number;
2019
+ /** The /Root reference string (e.g., "1 0 R"). */
2020
+ rootRef: string;
2021
+ /** The /Info reference string (e.g., "4 0 R"), if present. */
2022
+ infoRef?: string | undefined;
2023
+ /** The byte offset of the previous cross-reference section. */
2024
+ prevXrefOffset: number;
2025
+ }
2026
+ /**
2027
+ * Scan a PDF for all /Type /Sig dictionaries and extract their byte ranges.
2028
+ *
2029
+ * @param pdf The PDF bytes to scan.
2030
+ * @returns Array of signature byte range descriptors.
2031
+ */
2032
+ declare function findExistingSignatures(pdf: Uint8Array): SignatureByteRange[];
2033
+ /**
2034
+ * Verify that no existing signature's covered bytes would overlap
2035
+ * with content appended after the current end of file.
2036
+ *
2037
+ * For a valid incremental update, all existing signature byte ranges
2038
+ * must reference bytes within the original file. Any overlap with
2039
+ * new content appended after the last %%EOF would break signatures.
2040
+ *
2041
+ * @param pdf The current PDF bytes.
2042
+ * @param signatures The signature byte ranges to validate.
2043
+ * @returns `true` if all byte ranges are valid and non-overlapping with appended content.
2044
+ */
2045
+ declare function validateByteRangeIntegrity(pdf: Uint8Array, signatures: SignatureByteRange[]): boolean;
2046
+ /**
2047
+ * Parse the existing trailer from a PDF to extract /Size, /Root, /Info,
2048
+ * and the previous xref offset.
2049
+ *
2050
+ * Scans backward from the end of the file for `startxref` and the
2051
+ * trailer dictionary.
2052
+ *
2053
+ * @param pdf The PDF bytes.
2054
+ * @returns Parsed trailer information.
2055
+ */
2056
+ declare function parseExistingTrailer(pdf: Uint8Array): TrailerInfo;
2057
+ /**
2058
+ * Perform an incremental save that preserves ALL existing signatures.
2059
+ *
2060
+ * Takes the original PDF bytes and a modified version, detects which
2061
+ * objects changed by comparing object hashes, and appends only the
2062
+ * changed/new objects after the original %%EOF. This ensures all
2063
+ * existing signature byte ranges remain intact.
2064
+ *
2065
+ * @param originalPdf The original (possibly signed) PDF bytes.
2066
+ * @param modifiedPdf The modified PDF bytes with changes.
2067
+ * @param options Options for the incremental save.
2068
+ * @returns The incrementally saved PDF bytes.
2069
+ */
2070
+ declare function saveIncrementalWithSignaturePreservation(originalPdf: Uint8Array, modifiedPdf: Uint8Array, options?: IncrementalSaveOptions): Uint8Array;
2071
+ /**
2072
+ * Append a pure incremental update to a PDF.
2073
+ *
2074
+ * This function NEVER modifies bytes before the last %%EOF.
2075
+ * It appends new/modified objects, a new xref subsection, and a
2076
+ * new trailer with a /Prev pointer to the previous xref.
2077
+ *
2078
+ * @param originalPdf The original PDF bytes.
2079
+ * @param newObjects Objects to append (new or modified).
2080
+ * @param options Options for the append operation.
2081
+ * @returns The updated PDF bytes.
2082
+ */
2083
+ declare function appendIncrementalUpdate(originalPdf: Uint8Array, newObjects: IncrementalObject[], options?: AppendOptions): Uint8Array;
2084
+ //#endregion
2085
+ //#region src/signature/multiSignatureValidator.d.ts
2086
+ /**
2087
+ * @module signature/multiSignatureValidator
2088
+ *
2089
+ * Multi-signature chain validation for PDFs with multiple signatures.
2090
+ *
2091
+ * In a multi-signature workflow, each subsequent signer adds their
2092
+ * signature via an incremental update. This module validates that:
2093
+ *
2094
+ * 1. Each signature covers the correct byte range
2095
+ * 2. Each subsequent signature covers all content including previous signatures
2096
+ * 3. No signature's covered bytes have been tampered with
2097
+ * 4. The chain is ordered correctly (chronological signing order)
2098
+ *
2099
+ * Reference: PDF 1.7 spec, SS12.8.1 (Signature Filtering).
2100
+ *
2101
+ * @packageDocumentation
2102
+ */
2103
+ /**
2104
+ * Validation status for a single signature in the chain.
2105
+ */
2106
+ interface SignatureChainEntry {
2107
+ /** The signature field name (extracted from /T). */
2108
+ fieldName: string;
2109
+ /** The signer name (extracted from /Contents PKCS#7 or dictionary). */
2110
+ signerName: string;
2111
+ /** The signing date (extracted from /M), if present. */
2112
+ signedAt?: Date | undefined;
2113
+ /** The byte range covering this signature. */
2114
+ byteRange: [number, number, number, number];
2115
+ /** Whether this signature covers the entire document up to its point. */
2116
+ coversEntireDocument: boolean;
2117
+ /** Validation status for this entry in the chain. */
2118
+ status: 'valid' | 'invalid' | 'broken_chain';
2119
+ }
2120
+ /**
2121
+ * Result of validating the entire signature chain.
2122
+ */
2123
+ interface SignatureChainResult {
2124
+ /** Ordered array of signature chain entries. */
2125
+ signatures: SignatureChainEntry[];
2126
+ /** Whether the entire chain is valid (all entries valid, no breaks). */
2127
+ isChainValid: boolean;
2128
+ /** Descriptive error messages, if any. */
2129
+ errors: string[];
2130
+ }
2131
+ /**
2132
+ * Validate the entire signature chain in a PDF.
2133
+ *
2134
+ * Finds all signatures, validates each one covers the correct byte range,
2135
+ * and verifies each subsequent signature covers all content including
2136
+ * previous signatures. Returns an ordered chain with status for each entry.
2137
+ *
2138
+ * @param pdf The PDF bytes to validate.
2139
+ * @returns The signature chain validation result.
2140
+ */
2141
+ declare function validateSignatureChain(pdf: Uint8Array): Promise<SignatureChainResult>;
2142
+ //#endregion
2143
+ //#region src/signature/mdpPolicy.d.ts
2144
+ /**
2145
+ * MDP permission levels for certification signatures.
2146
+ *
2147
+ * These correspond to the /P value in the /TransformParams dictionary
2148
+ * of a /DocMDP transform method.
2149
+ */
2150
+ declare enum MdpPermission {
2151
+ /** No changes to the document are permitted. */
2152
+ NoChanges = 1,
2153
+ /** Only form filling and signing are permitted. */
2154
+ FormFillAndSign = 2,
2155
+ /** Form filling, signing, and annotation changes are permitted. */
2156
+ FormFillSignAnnotate = 3
2157
+ }
2158
+ /**
2159
+ * Set the certification level (MDP permission) on sign options.
2160
+ *
2161
+ * When applied, the resulting signature will include a /DocMDP
2162
+ * transform method in its /TransformParams, which certifies the
2163
+ * document and restricts future modifications to the specified level.
2164
+ *
2165
+ * This should only be used for the FIRST (certification) signature
2166
+ * in a document. Subsequent approval signatures should not set MDP.
2167
+ *
2168
+ * @param options The sign options to modify (mutated in place).
2169
+ * @param level The MDP permission level to set.
2170
+ *
2171
+ * @example
2172
+ * ```ts
2173
+ * const options: SignOptions = {
2174
+ * certificate: certDer,
2175
+ * privateKey: keyDer,
2176
+ * };
2177
+ * setCertificationLevel(options, MdpPermission.FormFillAndSign);
2178
+ * const signedPdf = await signPdf(pdfBytes, 'CertSig', options);
2179
+ * ```
2180
+ */
2181
+ declare function setCertificationLevel(options: SignOptions, level: MdpPermission): void;
2182
+ /**
2183
+ * Read the certification level (MDP permission) from a PDF.
2184
+ *
2185
+ * Scans the PDF for the first /DocMDP transform method and extracts
2186
+ * the /P value from its /TransformParams. Returns `undefined` if no
2187
+ * certification signature is found.
2188
+ *
2189
+ * @param pdf The PDF bytes to scan.
2190
+ * @returns The MDP permission level, or `undefined` if not certified.
2191
+ */
2192
+ declare function getCertificationLevel(pdf: Uint8Array): MdpPermission | undefined;
2193
+ /**
2194
+ * Build a /DocMDP reference dictionary string for inclusion in
2195
+ * the signature dictionary.
2196
+ *
2197
+ * @param sigValueObjNum The object number of the signature value.
2198
+ * @param level The MDP permission level.
2199
+ * @returns The /Reference array string to include in the sig dict.
2200
+ *
2201
+ * @internal
2202
+ */
2203
+ declare function buildDocMdpReference(sigValueObjNum: number, level: MdpPermission): string;
2204
+ //#endregion
2205
+ //#region src/signature/modificationDetector.d.ts
2206
+ /**
2207
+ * Types of modifications that can be detected.
2208
+ */
2209
+ type ModificationViolationType = 'content_changed' | 'annotation_added' | 'form_filled' | 'page_added';
2210
+ /**
2211
+ * A single modification violation detected in the document.
2212
+ */
2213
+ interface ModificationViolation {
2214
+ /** The type of modification detected. */
2215
+ type: ModificationViolationType;
2216
+ /** Human-readable description of the violation. */
2217
+ description: string;
2218
+ /** Index of the signature whose coverage was violated. */
2219
+ affectedSignatureIndex: number;
2220
+ }
2221
+ /**
2222
+ * Report of modifications detected in a certified document.
2223
+ */
2224
+ interface ModificationReport {
2225
+ /** The certification level, if any. */
2226
+ certificationLevel?: MdpPermission | undefined;
2227
+ /** Whether the modifications comply with the certification level. */
2228
+ isCompliant: boolean;
2229
+ /** List of detected violations. */
2230
+ violations: ModificationViolation[];
2231
+ }
2232
+ /**
2233
+ * Detect modifications in a certified PDF document.
2234
+ *
2235
+ * Compares content at each signature's byte range against the current
2236
+ * PDF state. If an MDP (DocMDP) certification level is set, checks
2237
+ * whether the modifications comply with the permitted level.
2238
+ *
2239
+ * Modification levels:
2240
+ * - MDP 1 (NoChanges): Any change is a violation
2241
+ * - MDP 2 (FormFillAndSign): Only form fills and new signatures allowed
2242
+ * - MDP 3 (FormFillSignAnnotate): Form fills, signatures, and annotations allowed
2243
+ *
2244
+ * @param pdf The PDF bytes to analyze.
2245
+ * @returns A detailed modification report.
2246
+ */
2247
+ declare function detectModifications(pdf: Uint8Array): Promise<ModificationReport>;
2248
+ //#endregion
2249
+ //#region src/signature/fieldLock.d.ts
2250
+ /**
2251
+ * Options for locking fields when a signature is applied.
2252
+ */
2253
+ interface FieldLockOptions {
2254
+ /** Lock action: 'All', 'Include', or 'Exclude'. */
2255
+ action: 'All' | 'Include' | 'Exclude';
2256
+ /** Field names to include or exclude (required for 'Include' and 'Exclude'). */
2257
+ fields?: string[] | undefined;
2258
+ }
2259
+ /**
2260
+ * Information about a field lock on a signature field.
2261
+ */
2262
+ interface FieldLockInfo {
2263
+ /** The name of the signature field that has the lock. */
2264
+ signatureFieldName: string;
2265
+ /** The lock action: 'All', 'Include', or 'Exclude'. */
2266
+ action: 'All' | 'Include' | 'Exclude';
2267
+ /** The list of locked fields (empty for 'All' action). */
2268
+ lockedFields: string[];
2269
+ }
2270
+ /**
2271
+ * Add a field lock dictionary to sign options.
2272
+ *
2273
+ * When applied, the resulting signature field will include a /Lock
2274
+ * dictionary that specifies which form fields should be locked after
2275
+ * this signature is applied.
2276
+ *
2277
+ * @param options The sign options to modify (mutated in place).
2278
+ * @param lock The field lock configuration.
2279
+ *
2280
+ * @example
2281
+ * ```ts
2282
+ * const options: SignOptions = {
2283
+ * certificate: certDer,
2284
+ * privateKey: keyDer,
2285
+ * };
2286
+ * addFieldLock(options, {
2287
+ * action: 'Include',
2288
+ * fields: ['Name', 'Address', 'Amount'],
2289
+ * });
2290
+ * const signedPdf = await signPdf(pdfBytes, 'ApprovalSig', options);
2291
+ * ```
2292
+ */
2293
+ declare function addFieldLock(options: SignOptions, lock: FieldLockOptions): void;
2294
+ /**
2295
+ * Read all field lock dictionaries from signature fields in a PDF.
2296
+ *
2297
+ * Scans the PDF for signature field dictionaries that contain a /Lock
2298
+ * entry and extracts the lock action and field names.
2299
+ *
2300
+ * @param pdf The PDF bytes to scan.
2301
+ * @returns Array of field lock information objects.
2302
+ */
2303
+ declare function getFieldLocks(pdf: Uint8Array): FieldLockInfo[];
2304
+ /**
2305
+ * Build a /Lock dictionary string for inclusion in a signature field.
2306
+ *
2307
+ * @param lock The field lock options.
2308
+ * @returns The /Lock dictionary string.
2309
+ *
2310
+ * @internal
2311
+ */
2312
+ declare function buildFieldLockDict(lock: FieldLockOptions): string;
2313
+ //#endregion
2314
+ //#region src/signature/documentDiff.d.ts
2315
+ /**
2316
+ * @module signature/documentDiff
2317
+ *
2318
+ * Document modification detection — compares the signed version of a PDF
2319
+ * against the current version to identify what changed after signing.
2320
+ *
2321
+ * Uses the ByteRange to extract the signed content (the bytes that were
2322
+ * hashed when the signature was created), parses both versions, and
2323
+ * compares page counts, page content hashes, form field values,
2324
+ * annotation counts, and metadata.
2325
+ *
2326
+ * @packageDocumentation
2327
+ */
2328
+ /**
2329
+ * A single difference found between signed and current content.
2330
+ */
2331
+ interface DiffEntry {
2332
+ /** The category of change detected. */
2333
+ type: 'page_added' | 'page_removed' | 'page_modified' | 'form_field_changed' | 'annotation_changed' | 'metadata_changed';
2334
+ /** Zero-based page index (for page-related changes). */
2335
+ pageIndex?: number | undefined;
2336
+ /** Form field name (for form field changes). */
2337
+ fieldName?: string | undefined;
2338
+ /** Human-readable description of the change. */
2339
+ description: string;
2340
+ }
2341
+ /**
2342
+ * Result of comparing signed content against the current PDF.
2343
+ */
2344
+ interface DocumentDiff {
2345
+ /** Which signature was used as the baseline (zero-based). */
2346
+ signatureIndex: number;
2347
+ /** The signing date from the signature dictionary, if available. */
2348
+ signedAt?: Date | undefined;
2349
+ /** All detected changes between the signed and current version. */
2350
+ changes: DiffEntry[];
2351
+ /** Whether any changes were detected at all. */
2352
+ hasChanges: boolean;
2353
+ }
2354
+ /**
2355
+ * Diff the signed content of a PDF against its current state.
2356
+ *
2357
+ * Extracts the signed bytes using the ByteRange of a specific signature
2358
+ * (or the latest signature by default), parses both versions, and
2359
+ * compares page count, page content hashes, form field values,
2360
+ * annotation counts, and metadata.
2361
+ *
2362
+ * @param pdf The current PDF bytes.
2363
+ * @param signatureIndex Zero-based index of the signature to diff against.
2364
+ * If not provided, uses the last (most recent) signature.
2365
+ * @returns A DocumentDiff describing all detected changes.
2366
+ *
2367
+ * @example
2368
+ * ```ts
2369
+ * import { diffSignedContent } from 'modern-pdf-lib/signature';
2370
+ *
2371
+ * const diff = await diffSignedContent(pdfBytes);
2372
+ * if (diff.hasChanges) {
2373
+ * for (const entry of diff.changes) {
2374
+ * console.log(`${entry.type}: ${entry.description}`);
2375
+ * }
2376
+ * }
2377
+ * ```
2378
+ */
2379
+ declare function diffSignedContent(pdf: Uint8Array, signatureIndex?: number | undefined): Promise<DocumentDiff>;
2380
+ //#endregion
2381
+ //#region src/signature/counterSignature.d.ts
2382
+ /**
2383
+ * @module signature/counterSignature
2384
+ *
2385
+ * Counter-signature support — allows signing an existing signature to
2386
+ * attest that a specific signature existed at a certain time (e.g.,
2387
+ * notarization or witness signing).
2388
+ *
2389
+ * A counter-signature is a PKCS#7 unsigned attribute (OID 1.2.840.113549.1.9.6)
2390
+ * that contains a SignerInfo whose signature is computed over the existing
2391
+ * signature value. It is appended via incremental update.
2392
+ *
2393
+ * References:
2394
+ * - RFC 5652 SS 11.4 (Countersignature)
2395
+ * - PDF 2.0 spec SS 12.8 (Digital Signatures)
2396
+ *
2397
+ * @packageDocumentation
2398
+ */
2399
+ /**
2400
+ * Information about a counter-signature found on a PDF signature.
2401
+ */
2402
+ interface CounterSignatureInfo {
2403
+ /** The index of the primary signature that was counter-signed. */
2404
+ targetSignatureIndex: number;
2405
+ /** The Common Name of the counter-signer. */
2406
+ signerName: string;
2407
+ /** When the counter-signature was applied. */
2408
+ signedAt?: Date | undefined;
2409
+ /** Whether the counter-signature is structurally valid. */
2410
+ isValid: boolean;
2411
+ }
2412
+ /**
2413
+ * Add a counter-signature to an existing PDF signature.
2414
+ *
2415
+ * Finds the target signature's /Contents, computes a hash of the
2416
+ * existing signature value, creates a PKCS#7 counter-signature
2417
+ * attribute, and appends the result via incremental update.
2418
+ *
2419
+ * @param pdf The PDF bytes containing the target signature.
2420
+ * @param targetSignatureIndex Zero-based index of the signature to counter-sign.
2421
+ * @param signerInfo The counter-signer's certificate, private key, and hash algorithm.
2422
+ * @returns The PDF with the counter-signature appended.
2423
+ *
2424
+ * @example
2425
+ * ```ts
2426
+ * const counterSigned = await addCounterSignature(
2427
+ * signedPdf,
2428
+ * 0,
2429
+ * { certificate: certDer, privateKey: keyDer },
2430
+ * );
2431
+ * ```
2432
+ */
2433
+ declare function addCounterSignature(pdf: Uint8Array, targetSignatureIndex: number, signerInfo: {
2434
+ certificate: Uint8Array;
2435
+ privateKey: Uint8Array;
2436
+ hashAlgorithm?: string | undefined;
2437
+ }): Promise<Uint8Array>;
2438
+ /**
2439
+ * Extract counter-signatures from all signatures in a PDF.
2440
+ *
2441
+ * Scans each signature's PKCS#7 structure for the counter-signature
2442
+ * unsigned attribute (OID 1.2.840.113549.1.9.6).
2443
+ *
2444
+ * @param pdf The PDF bytes.
2445
+ * @returns Array of counter-signature info objects.
2446
+ *
2447
+ * @example
2448
+ * ```ts
2449
+ * const counterSigs = getCounterSignatures(pdfBytes);
2450
+ * for (const cs of counterSigs) {
2451
+ * console.log(`Signature ${cs.targetSignatureIndex} counter-signed by ${cs.signerName}`);
2452
+ * }
2453
+ * ```
2454
+ */
2455
+ declare function getCounterSignatures(pdf: Uint8Array): CounterSignatureInfo[];
2456
+ //#endregion
2457
+ //#region src/signature/ltvEmbed.d.ts
2458
+ /**
2459
+ * @module signature/ltvEmbed
2460
+ *
2461
+ * LTV (Long-Term Validation) embedding for PDF digital signatures.
2462
+ *
2463
+ * Adds a Document Security Store (/DSS) dictionary to the PDF catalog
2464
+ * containing the validation data (certificates, CRLs, OCSP responses)
2465
+ * required to verify signatures decades after signing.
2466
+ *
2467
+ * The DSS is appended via incremental update to preserve existing
2468
+ * signatures (per ISO 32000-2 SS 12.8.4.3).
2469
+ *
2470
+ * References:
2471
+ * - ISO 32000-2:2020 SS 12.8.4.3 (Document Security Store)
2472
+ * - ETSI TS 102 778-4 (PAdES Long Term Validation)
2473
+ * - RFC 6960 (OCSP)
2474
+ * - RFC 5280 (CRL)
2475
+ *
2476
+ * @packageDocumentation
2477
+ */
2478
+ /**
2479
+ * Options for LTV data embedding.
2480
+ */
2481
+ interface LtvOptions {
2482
+ /** Include OCSP responses in the DSS. Default: true. */
2483
+ includeOcsp?: boolean | undefined;
2484
+ /** Include CRL data in the DSS. Default: true. */
2485
+ includeCrl?: boolean | undefined;
2486
+ /** Include certificate chains in the DSS. Default: true. */
2487
+ includeCerts?: boolean | undefined;
2488
+ /** Pre-loaded OCSP responses (DER-encoded). */
2489
+ ocspResponses?: Uint8Array[] | undefined;
2490
+ /** Pre-loaded CRLs (DER-encoded). */
2491
+ crls?: Uint8Array[] | undefined;
2492
+ /** Additional certificates (DER-encoded) for the chain. */
2493
+ extraCertificates?: Uint8Array[] | undefined;
2494
+ }
2495
+ /**
2496
+ * Data for the Document Security Store dictionary.
2497
+ */
2498
+ interface DssData {
2499
+ /** DER-encoded certificates for the chain. */
2500
+ certs: Uint8Array[];
2501
+ /** DER-encoded OCSP responses. */
2502
+ ocsps: Uint8Array[];
2503
+ /** DER-encoded CRLs. */
2504
+ crls: Uint8Array[];
2505
+ }
2506
+ /**
2507
+ * Build a DSS (Document Security Store) dictionary string for
2508
+ * incremental append to a PDF.
2509
+ *
2510
+ * The DSS dictionary contains:
2511
+ * - /Certs: array of stream references for certificates
2512
+ * - /OCSPs: array of stream references for OCSP responses
2513
+ * - /CRLs: array of stream references for CRLs
2514
+ *
2515
+ * @param data The DSS data containing certs, OCSPs, and CRLs.
2516
+ * @returns A string representation of the DSS dictionary content.
2517
+ *
2518
+ * @example
2519
+ * ```ts
2520
+ * const dssStr = buildDssDictionary({
2521
+ * certs: [certDer1, certDer2],
2522
+ * ocsps: [ocspResponse],
2523
+ * crls: [crlDer],
2524
+ * });
2525
+ * ```
2526
+ */
2527
+ declare function buildDssDictionary(data: DssData): string;
2528
+ /**
2529
+ * Check whether a PDF already contains a Document Security Store (DSS).
2530
+ *
2531
+ * @param pdf The PDF bytes.
2532
+ * @returns `true` if the PDF contains a /DSS dictionary.
2533
+ */
2534
+ declare function hasLtvData(pdf: Uint8Array): boolean;
2535
+ /**
2536
+ * Embed LTV (Long-Term Validation) data into a PDF.
2537
+ *
2538
+ * Extracts certificates from existing signatures, then appends a
2539
+ * Document Security Store (/DSS) dictionary to the PDF catalog via
2540
+ * incremental update. The DSS contains the certificate chains,
2541
+ * OCSP responses, and CRLs needed for future verification.
2542
+ *
2543
+ * @param pdf The PDF bytes.
2544
+ * @param options LTV embedding options.
2545
+ * @returns The PDF with embedded LTV data.
2546
+ *
2547
+ * @example
2548
+ * ```ts
2549
+ * import { embedLtvData } from 'modern-pdf-lib/signature';
2550
+ *
2551
+ * const ltvPdf = await embedLtvData(signedPdf, {
2552
+ * includeOcsp: true,
2553
+ * includeCrl: true,
2554
+ * includeCerts: true,
2555
+ * });
2556
+ * ```
2557
+ */
2558
+ declare function embedLtvData(pdf: Uint8Array, options?: LtvOptions | undefined): Promise<Uint8Array>;
2559
+ //#endregion
2560
+ //#region src/signature/incrementalOptimizer.d.ts
2561
+ /**
2562
+ * @module signature/incrementalOptimizer
2563
+ *
2564
+ * Incremental save size optimization.
2565
+ *
2566
+ * When performing incremental updates on a PDF, naive implementations
2567
+ * re-emit every modified object even if the content is identical to
2568
+ * the original. This module provides object-level diffing using FNV-1a
2569
+ * hashing to detect truly-changed objects and deduplicates identical
2570
+ * updates, producing minimal incremental appendices.
2571
+ *
2572
+ * @packageDocumentation
2573
+ */
2574
+ /**
2575
+ * A single object change for an incremental update.
2576
+ */
2577
+ interface IncrementalChange {
2578
+ /** The PDF object number. */
2579
+ objectNumber: number;
2580
+ /** The generation number. */
2581
+ generationNumber: number;
2582
+ /** The new content for this object (raw bytes). */
2583
+ newContent: Uint8Array;
2584
+ }
2585
+ /**
2586
+ * FNV-1a 32-bit hash.
2587
+ *
2588
+ * A fast, non-cryptographic hash with good distribution properties.
2589
+ * Used for content comparison and deduplication.
2590
+ *
2591
+ * @param data The bytes to hash.
2592
+ * @returns A 32-bit unsigned hash as a hex string.
2593
+ */
2594
+ declare function computeObjectHash(data: Uint8Array): string;
2595
+ /**
2596
+ * Find the list of object numbers whose content actually changed
2597
+ * between two versions of a PDF.
2598
+ *
2599
+ * Extracts all objects from both versions, hashes their content
2600
+ * using FNV-1a, and returns the object numbers where the hashes
2601
+ * differ.
2602
+ *
2603
+ * @param original The original PDF bytes.
2604
+ * @param modified The modified PDF bytes.
2605
+ * @returns Array of object numbers that have different content.
2606
+ *
2607
+ * @example
2608
+ * ```ts
2609
+ * const changed = findChangedObjects(originalPdf, modifiedPdf);
2610
+ * console.log(`${changed.length} objects actually changed`);
2611
+ * ```
2612
+ */
2613
+ declare function findChangedObjects(original: Uint8Array, modified: Uint8Array): number[];
2614
+ /**
2615
+ * Optimize an incremental save by removing unchanged objects and
2616
+ * deduplicating identical updates.
2617
+ *
2618
+ * This function:
2619
+ * 1. Computes FNV-1a hashes of each change's content
2620
+ * 2. Compares against the original PDF objects to skip unchanged ones
2621
+ * 3. Deduplicates identical change entries (same content for same object)
2622
+ * 4. Builds a minimal incremental update containing only truly changed objects
2623
+ *
2624
+ * @param originalPdf The original PDF bytes.
2625
+ * @param changes The list of proposed changes.
2626
+ * @returns The optimized PDF bytes with minimal incremental update.
2627
+ *
2628
+ * @example
2629
+ * ```ts
2630
+ * import { optimizeIncrementalSave } from 'modern-pdf-lib/signature';
2631
+ *
2632
+ * const optimizedPdf = optimizeIncrementalSave(originalPdf, [
2633
+ * { objectNumber: 5, generationNumber: 0, newContent: newObj5 },
2634
+ * { objectNumber: 7, generationNumber: 0, newContent: newObj7 },
2635
+ * ]);
2636
+ * ```
2637
+ */
2638
+ declare function optimizeIncrementalSave(originalPdf: Uint8Array, changes: IncrementalChange[]): Uint8Array;
2639
+ //#endregion
1997
2640
  //#region src/core/linearization.d.ts
1998
2641
  /**
1999
2642
  * @module core/linearization
@@ -3655,6 +4298,398 @@ declare function extractJpegMetadata(jpegBytes: Uint8Array): JpegMetadata;
3655
4298
  */
3656
4299
  declare function injectJpegMetadata(jpegBytes: Uint8Array, metadata: JpegMetadata): Uint8Array;
3657
4300
  //#endregion
4301
+ //#region src/assets/image/tiffCmyk.d.ts
4302
+ /**
4303
+ * @module assets/image/tiffCmyk
4304
+ *
4305
+ * TIFF CMYK color space handling for PDF embedding.
4306
+ *
4307
+ * Provides:
4308
+ * - CMYK-to-RGB conversion for display/rendering
4309
+ * - Native CMYK embedding in PDF (no conversion needed)
4310
+ * - CMYK TIFF detection via IFD tag inspection
4311
+ *
4312
+ * No Buffer — uses Uint8Array exclusively.
4313
+ * No fs — no file system access.
4314
+ * No require() — ESM import only.
4315
+ */
4316
+ /**
4317
+ * An IFD entry from a TIFF file, containing a tag number and its value.
4318
+ */
4319
+ interface TiffIfdEntry {
4320
+ /** The TIFF tag number (e.g. 262 for PhotometricInterpretation). */
4321
+ readonly tag: number;
4322
+ /** The resolved integer value of the tag. */
4323
+ readonly value: number;
4324
+ }
4325
+ /**
4326
+ * Result of embedding CMYK TIFF data for use in a PDF image XObject.
4327
+ */
4328
+ interface TiffCmykEmbedResult {
4329
+ /** PDF color space — always `'DeviceCMYK'`. */
4330
+ readonly colorSpace: string;
4331
+ /** The raw CMYK pixel data (4 channels, 8 bits per component). */
4332
+ readonly data: Uint8Array;
4333
+ /** Bits per component — always `8`. */
4334
+ readonly bitsPerComponent: number;
4335
+ }
4336
+ /**
4337
+ * Convert CMYK pixel data to RGB.
4338
+ *
4339
+ * Uses the standard CMYK-to-RGB formula:
4340
+ * ```
4341
+ * R = 255 * (1 - C/255) * (1 - K/255)
4342
+ * G = 255 * (1 - M/255) * (1 - K/255)
4343
+ * B = 255 * (1 - Y/255) * (1 - K/255)
4344
+ * ```
4345
+ *
4346
+ * @param cmykPixels Flat array of CMYK pixel data (4 bytes per pixel: C, M, Y, K).
4347
+ * @param width Image width in pixels.
4348
+ * @param height Image height in pixels.
4349
+ * @returns Flat array of RGB pixel data (3 bytes per pixel: R, G, B).
4350
+ * @throws If the input array length does not match width * height * 4.
4351
+ */
4352
+ declare function convertTiffCmykToRgb(cmykPixels: Uint8Array, width: number, height: number): Uint8Array;
4353
+ /**
4354
+ * Prepare CMYK pixel data for native embedding in a PDF using /DeviceCMYK.
4355
+ *
4356
+ * PDF natively supports CMYK color spaces, so no RGB conversion is
4357
+ * needed — the raw CMYK data can be used directly as the image stream.
4358
+ *
4359
+ * @param pixels Flat array of CMYK pixel data (4 bytes per pixel: C, M, Y, K).
4360
+ * @param width Image width in pixels.
4361
+ * @param height Image height in pixels.
4362
+ * @returns Embedding result with colorSpace, data, and bitsPerComponent.
4363
+ * @throws If the input array length does not match width * height * 4.
4364
+ */
4365
+ declare function embedTiffCmyk(pixels: Uint8Array, width: number, height: number): TiffCmykEmbedResult;
4366
+ /**
4367
+ * Detect whether a TIFF image uses CMYK color space by inspecting IFD entries.
4368
+ *
4369
+ * A TIFF is considered CMYK when:
4370
+ * - PhotometricInterpretation (tag 262) has value 5 (Separated), AND
4371
+ * - If InkSet (tag 332) is present, its value must be 1 (CMYK inks)
4372
+ *
4373
+ * If InkSet is not present but PhotometricInterpretation is 5, the image
4374
+ * is assumed to be CMYK (per the TIFF specification default).
4375
+ *
4376
+ * @param ifdEntries Array of IFD entries with tag and value fields.
4377
+ * @returns `true` if the TIFF uses CMYK color space.
4378
+ */
4379
+ declare function isCmykTiff(ifdEntries: Array<{
4380
+ tag: number;
4381
+ value: number;
4382
+ }>): boolean;
4383
+ //#endregion
4384
+ //#region src/assets/image/formatDetect.d.ts
4385
+ /**
4386
+ * @module assets/image/formatDetect
4387
+ *
4388
+ * Image format detection from magic bytes.
4389
+ *
4390
+ * Detects the following image formats by inspecting the file header:
4391
+ * - **PNG**: `89 50 4E 47` (first 4 bytes)
4392
+ * - **JPEG**: `FF D8 FF` (first 3 bytes)
4393
+ * - **WebP**: `52 49 46 46` (RIFF) at offset 0 + `57 45 42 50` (WEBP) at offset 8
4394
+ * - **TIFF LE**: `49 49 2A 00` (II\*\0) — little-endian byte order
4395
+ * - **TIFF BE**: `4D 4D 00 2A` (MM\0\*) — big-endian byte order
4396
+ *
4397
+ * No Buffer — uses Uint8Array exclusively.
4398
+ * No fs — no file system access.
4399
+ * No require() — ESM import only.
4400
+ */
4401
+ /**
4402
+ * Supported image format identifiers.
4403
+ */
4404
+ type ImageFormat = 'png' | 'jpeg' | 'webp' | 'tiff' | 'unknown';
4405
+ /**
4406
+ * Detect the image format from the raw file bytes by inspecting magic bytes.
4407
+ *
4408
+ * @param data Raw image file bytes.
4409
+ * @returns The detected format, or `'unknown'` if unrecognized.
4410
+ */
4411
+ declare function detectImageFormat(data: Uint8Array): ImageFormat;
4412
+ /**
4413
+ * Get a human-readable name for an image format identifier.
4414
+ *
4415
+ * @param format The format identifier string.
4416
+ * @returns A human-readable format name.
4417
+ */
4418
+ declare function getImageFormatName(format: string): string;
4419
+ /**
4420
+ * Get the list of all supported image formats for embedding.
4421
+ *
4422
+ * @returns An array of format identifier strings.
4423
+ */
4424
+ declare function getSupportedFormats(): string[];
4425
+ //#endregion
4426
+ //#region src/assets/image/webpOptimize.d.ts
4427
+ /**
4428
+ * @module assets/image/webpOptimize
4429
+ *
4430
+ * WebP optimization and conversion utilities.
4431
+ *
4432
+ * Since WebP cannot be embedded directly in PDF, these utilities
4433
+ * convert decoded WebP pixel data to JPEG or PNG format for embedding.
4434
+ *
4435
+ * - `recompressWebP()` — re-encode decoded pixels as JPEG
4436
+ * - `webpToJpeg()` — decode WebP then encode as JPEG (convenience)
4437
+ * - `webpToPng()` — decode WebP then encode as PNG (lossless, convenience)
4438
+ *
4439
+ * No Buffer — uses Uint8Array exclusively.
4440
+ * No fs — no file system access.
4441
+ * No require() — ESM import only.
4442
+ */
4443
+ /**
4444
+ * Encode RGB/RGBA pixels as a PNG file.
4445
+ * @internal
4446
+ */
4447
+ declare function encodePngFromPixels(pixels: Uint8Array, width: number, height: number, channels: number): Uint8Array;
4448
+ /**
4449
+ * Re-encode decoded WebP pixels as JPEG data for PDF embedding.
4450
+ *
4451
+ * WebP cannot be embedded directly in PDF files. This function takes
4452
+ * decoded pixel data (from a WebP decoder) and produces JPEG bytes
4453
+ * suitable for PDF embedding with /DCTDecode filter.
4454
+ *
4455
+ * @param pixels Decoded pixel data (RGB or RGBA, row-major).
4456
+ * @param width Image width in pixels.
4457
+ * @param height Image height in pixels.
4458
+ * @param quality JPEG quality (1-100). Default: 85.
4459
+ * @returns JPEG-encoded bytes.
4460
+ */
4461
+ declare function recompressWebP(pixels: Uint8Array, width: number, height: number, quality?: number | undefined): Uint8Array;
4462
+ /**
4463
+ * Decode a WebP file and re-encode as JPEG.
4464
+ *
4465
+ * Convenience function that combines WebP decoding with JPEG encoding.
4466
+ * Imports the WebP decoder dynamically from the webpDecode module
4467
+ * (provided by v0.24.0).
4468
+ *
4469
+ * @param webpData Raw WebP file bytes.
4470
+ * @param quality JPEG quality (1-100). Default: 85.
4471
+ * @returns JPEG-encoded bytes.
4472
+ */
4473
+ declare function webpToJpeg(webpData: Uint8Array, quality?: number | undefined): Uint8Array;
4474
+ /**
4475
+ * Decode a WebP file and re-encode as PNG.
4476
+ *
4477
+ * Convenience function that combines WebP decoding with PNG encoding.
4478
+ * Produces lossless output suitable for images requiring transparency
4479
+ * or exact color reproduction.
4480
+ *
4481
+ * @param webpData Raw WebP file bytes.
4482
+ * @returns PNG-encoded bytes.
4483
+ */
4484
+ declare function webpToPng(webpData: Uint8Array): Uint8Array;
4485
+ //#endregion
4486
+ //#region src/assets/image/tiffDirectEmbed.d.ts
4487
+ /**
4488
+ * @module assets/image/tiffDirectEmbed
4489
+ *
4490
+ * Direct TIFF-to-PDF strip/tile mapping for efficient embedding.
4491
+ *
4492
+ * For certain TIFF compression types, the image data can be mapped
4493
+ * directly into a PDF image XObject without a full decode-re-encode
4494
+ * cycle:
4495
+ *
4496
+ * - **Uncompressed TIFF**: Raw pixel data is used directly with no filter.
4497
+ * - **Deflate-compressed TIFF**: Strips/tiles can be passed through as
4498
+ * FlateDecode streams.
4499
+ * - **JPEG-in-TIFF**: The embedded JPEG data is extracted and used
4500
+ * directly as a DCTDecode stream.
4501
+ *
4502
+ * This avoids the overhead of decompressing and recompressing image data,
4503
+ * resulting in faster processing and no quality loss.
4504
+ *
4505
+ * No Buffer — uses Uint8Array exclusively.
4506
+ * No fs — no file system access.
4507
+ * No require() — ESM import only.
4508
+ */
4509
+ /**
4510
+ * Options for direct TIFF embedding.
4511
+ */
4512
+ interface DirectEmbedOptions {
4513
+ /** Page index for multi-page TIFFs (0-based). Default: 0. */
4514
+ page?: number | undefined;
4515
+ }
4516
+ /**
4517
+ * Result of a direct TIFF embedding operation.
4518
+ */
4519
+ interface DirectEmbedResult {
4520
+ /** Image width in pixels. */
4521
+ readonly width: number;
4522
+ /** Image height in pixels. */
4523
+ readonly height: number;
4524
+ /** The image data for the PDF stream. */
4525
+ readonly data: Uint8Array;
4526
+ /** PDF color space name (e.g. 'DeviceRGB', 'DeviceGray', 'DeviceCMYK'). */
4527
+ readonly colorSpace: string;
4528
+ /** Bits per component (1, 2, 4, 8, or 16). */
4529
+ readonly bitsPerComponent: number;
4530
+ /** PDF filter to use, if any (e.g. 'FlateDecode', 'DCTDecode'). */
4531
+ readonly filter?: string | undefined;
4532
+ }
4533
+ /**
4534
+ * Check whether a TIFF file can be directly embedded in PDF without
4535
+ * a full decode-re-encode cycle.
4536
+ *
4537
+ * Direct embedding is supported for:
4538
+ * - Uncompressed TIFFs (compression = 1)
4539
+ * - Deflate-compressed TIFFs (compression = 8 or 32946)
4540
+ * - JPEG-in-TIFF (compression = 7 or 6)
4541
+ *
4542
+ * @param data Raw TIFF file bytes.
4543
+ * @returns `true` if the TIFF can be directly embedded.
4544
+ */
4545
+ declare function canDirectEmbed(data: Uint8Array): boolean;
4546
+ /**
4547
+ * Directly embed a TIFF image in a PDF image XObject.
4548
+ *
4549
+ * For supported compression types, this avoids the decode-re-encode
4550
+ * cycle by mapping TIFF strips/tiles directly to PDF stream data:
4551
+ *
4552
+ * - **Uncompressed**: Raw pixel data used with no filter.
4553
+ * - **Deflate**: Compressed data passed through as FlateDecode.
4554
+ * - **JPEG-in-TIFF**: JPEG data extracted and used as DCTDecode.
4555
+ *
4556
+ * @param data Raw TIFF file bytes.
4557
+ * @param options Optional settings (page index for multi-page TIFFs).
4558
+ * @returns The embedding result with all data needed for a PDF image XObject.
4559
+ * @throws If the TIFF format does not support direct embedding.
4560
+ */
4561
+ declare function embedTiffDirect(data: Uint8Array, options?: DirectEmbedOptions | undefined): DirectEmbedResult;
4562
+ //#endregion
4563
+ //#region src/assets/image/webpDecode.d.ts
4564
+ /**
4565
+ * @module assets/image/webpDecode
4566
+ *
4567
+ * WebP image decoder — pure TypeScript, no WASM, no Buffer.
4568
+ *
4569
+ * Supports:
4570
+ * - VP8 (lossy) bitstream decoding with macroblock processing
4571
+ * - VP8L (lossless) bitstream decoding with Huffman coding, LZ77, color cache, spatial prediction
4572
+ * - ALPH chunk (alpha channel) with filtering and compression
4573
+ * - RIFF/WebP container parsing
4574
+ *
4575
+ * Magic bytes: 52 49 46 46 (RIFF) + offset 8-11: 57 45 42 50 (WEBP)
4576
+ */
4577
+ /** Decoded WebP image data. */
4578
+ interface WebPImage {
4579
+ /** Image width in pixels. */
4580
+ readonly width: number;
4581
+ /** Image height in pixels. */
4582
+ readonly height: number;
4583
+ /** Raw pixel data (RGB or RGBA). */
4584
+ readonly pixels: Uint8Array;
4585
+ /** Number of channels (3 for RGB, 4 for RGBA). */
4586
+ readonly channels: 3 | 4;
4587
+ /** Whether the image has an alpha channel. */
4588
+ readonly hasAlpha: boolean;
4589
+ }
4590
+ /** Check if data is a WebP file by examining RIFF + WEBP magic bytes. */
4591
+ declare function isWebP(data: Uint8Array): boolean;
4592
+ /** Check if a WebP file contains a VP8L (lossless) bitstream. */
4593
+ declare function isWebPLossless(data: Uint8Array): boolean;
4594
+ /**
4595
+ * Decode a WebP image to raw pixel data.
4596
+ *
4597
+ * Supports VP8 (lossy), VP8L (lossless), and VP8+ALPH (lossy with alpha).
4598
+ * Auto-detects the format from chunk headers.
4599
+ *
4600
+ * @param data Raw WebP file bytes.
4601
+ * @returns Decoded image with width, height, and pixel data.
4602
+ */
4603
+ declare function decodeWebP(data: Uint8Array): WebPImage;
4604
+ //#endregion
4605
+ //#region src/assets/image/tiffDecode.d.ts
4606
+ /**
4607
+ * @module assets/image/tiffDecode
4608
+ *
4609
+ * TIFF image decoder — pure TypeScript, no WASM, no Buffer.
4610
+ *
4611
+ * Supports:
4612
+ * - IFD (Image File Directory) parsing with byte order detection
4613
+ * - Strip-based and tile-based image data extraction
4614
+ * - Compressions: None (1), LZW (5), JPEG-in-TIFF (6/7), Deflate (8), PackBits (32773)
4615
+ * - BitsPerSample: 1, 4, 8, 16
4616
+ * - SamplesPerPixel: 1, 3, 4
4617
+ * - PhotometricInterpretation: 0 (WhiteIsZero), 1 (BlackIsZero), 2 (RGB)
4618
+ * - Multi-page TIFF support via IFD chain
4619
+ *
4620
+ * Magic bytes: 49 49 (II, little-endian) or 4D 4D (MM, big-endian) + 42 (0x002A)
4621
+ */
4622
+ /** Decoded TIFF image data. */
4623
+ interface TiffImage {
4624
+ /** Image width in pixels. */
4625
+ readonly width: number;
4626
+ /** Image height in pixels. */
4627
+ readonly height: number;
4628
+ /** Raw pixel data (normalized to 8-bit per channel). */
4629
+ readonly pixels: Uint8Array;
4630
+ /** Number of channels. */
4631
+ readonly channels: 1 | 3 | 4;
4632
+ /** Original bits per sample. */
4633
+ readonly bitsPerSample: number;
4634
+ }
4635
+ /** Options for TIFF decoding. */
4636
+ interface TiffDecodeOptions {
4637
+ /** Page index for multi-page TIFFs (0-based). Default: 0. */
4638
+ page?: number | undefined;
4639
+ }
4640
+ /** A single IFD entry (tag). */
4641
+ interface IfdEntry {
4642
+ /** Tag ID (e.g., 256 = ImageWidth). */
4643
+ readonly tag: number;
4644
+ /** Data type (1=BYTE, 2=ASCII, 3=SHORT, 4=LONG, 5=RATIONAL, etc.). */
4645
+ readonly type: number;
4646
+ /** Number of values. */
4647
+ readonly count: number;
4648
+ /** The value(s) or offset to value data. */
4649
+ readonly values: number[];
4650
+ }
4651
+ /** Check if data is a TIFF file by examining the byte order marker and magic number. */
4652
+ declare function isTiff(data: Uint8Array): boolean;
4653
+ /**
4654
+ * Parse a single IFD from TIFF data.
4655
+ *
4656
+ * @param data Raw TIFF bytes.
4657
+ * @param offset Byte offset to the IFD.
4658
+ * @param littleEndian Whether the TIFF uses little-endian byte order.
4659
+ * @returns Array of IFD entries.
4660
+ */
4661
+ declare function parseTiffIfd(data: Uint8Array, offset: number, littleEndian: boolean): IfdEntry[];
4662
+ /**
4663
+ * Get the number of pages in a multi-page TIFF.
4664
+ *
4665
+ * @param data Raw TIFF bytes.
4666
+ * @returns Number of IFDs (pages).
4667
+ */
4668
+ declare function getTiffPageCount(data: Uint8Array): number;
4669
+ /**
4670
+ * Decode a specific page from a multi-page TIFF.
4671
+ *
4672
+ * @param data Raw TIFF bytes.
4673
+ * @param pageIndex 0-based page index.
4674
+ * @returns Decoded image.
4675
+ */
4676
+ declare function decodeTiffPage(data: Uint8Array, pageIndex: number): TiffImage;
4677
+ /**
4678
+ * Decode all pages from a multi-page TIFF.
4679
+ *
4680
+ * @param data Raw TIFF bytes.
4681
+ * @returns Array of decoded images.
4682
+ */
4683
+ declare function decodeTiffAll(data: Uint8Array): TiffImage[];
4684
+ /**
4685
+ * Decode a TIFF image.
4686
+ *
4687
+ * @param data Raw TIFF bytes.
4688
+ * @param options Decode options (page selection).
4689
+ * @returns Decoded image data.
4690
+ */
4691
+ declare function decodeTiff(data: Uint8Array, options?: TiffDecodeOptions | undefined): TiffImage;
4692
+ //#endregion
3658
4693
  //#region src/wasm/loader.d.ts
3659
4694
  /**
3660
4695
  * @module wasm/loader
@@ -4848,7 +5883,7 @@ declare class ExceededMaxLengthError extends Error {
4848
5883
  constructor(textLength: number, maxLength: number, fieldName: string, options?: ErrorOptions);
4849
5884
  }
4850
5885
  declare namespace index_d_exports {
4851
- export { AFRelationship, AccessibilityIssue, AnalysisReport, Angle, AnnotationFlags, AnnotationOptions, AnnotationType, AppearanceProviderFor, AssociatedFileOptions, AssociatedFileResult, BarcodeMatrix, BarcodeOptions, BarcodeReadResult, BatchOptimizeOptions, BlendMode, ButtonAppearanceOptions, ByteRangeResult, ByteWriter, CIDFontData, CIDSystemInfoData, CaretSymbol, CatalogOptions, CellContent, ChangeTracker, CheckboxAppearanceOptions, ChromaSubsampling, CmykColor, Code128Options, Code39Options, Color, ColorStop, CombedTextLayoutError, ComputeFontSizeOptions, ContentStreamOperator, CropBox, DataMatrixOptions, DataMatrixResult, DeduplicationReport, Degrees, DocumentMetadata, DocumentStructure, DownscaleOptions, DrawCircleOptions, DrawEllipseOptions, DrawImageOptions, DrawLineOptions, DrawPageOptions, DrawQrCodeOptions, DrawRectangleOptions, DrawSquareOptions, DrawSvgPathOptions, DrawTableOptions, DrawTextOptions, DropdownAppearanceOptions, BarcodeOptions as EanOptions, EmbedFontOptions, EmbedPageOptions, EmbeddedFile, EmbeddedFont, EmbeddedPdfPage, EncryptAlgorithm, EncryptDictValues, EncryptOptions, EncryptedPdfError, EnforcePdfAOptions, EnforcePdfAResult, EnforcementAction, ErrorCorrectionLevel, ExceededMaxLengthError, FieldAlreadyExistsError, FieldExistsAsNonTerminalError, FieldFlags, FieldType, FileAttachmentIcon, FontDescriptorData, FontEmbeddingResult, FontMetrics, FontNotEmbeddedError, FontRef, ForeignPageError, FreeTextAlignment, GradientFill, GrayscaleColor, IccProfile, ImageAlignment, ImageAnalysis, ImageDpi, ImageInfo, ImageOptimizeEntry, ImageOptimizeOptions, ImageRef, IncrementalSaveResult, InitWasmOptions, InvalidFieldNamePartError, ItfOptions, JpegDecodeResult, JpegMarkerInfo, JpegMetadata, LayoutCombedOptions, LayoutMultilineOptions, LayoutMultilineResult, LayoutSinglelineOptions, LayoutSinglelineResult, LineCapStyle, LineEndingStyle, LineJoinStyle, LinearGradientOptions, LinearizationOptions, LinkHighlightMode, ListboxAppearanceOptions, LoadPdfOptions, MarkedContentScope, MissingOnValueCheckError, MultiPageTableResult, NestedTableContent, NoSuchFieldError, NormalizedStop, Operand, OptimizationReport, OptimizeResult, OutlineDestination, OutlineItemOptions, OutputIntentOptions, OverflowMode, OverflowResult, PDFOperator, PageContent, PageEntry, PageRange, PageSize, PageSizes, ParseSpeeds, ParsedXmpMetadata, PatternFill, Pdf417Matrix, Pdf417Options, PdfAIssue, PdfALevel, PdfAProfile, PdfAValidationResult, PdfAXmpOptions, PdfAnnotation, PdfArray, PdfBool, PdfButtonField, PdfCaretAnnotation, PdfCheckboxField, PdfCircleAnnotation, PdfDict, PdfDocument, PdfDropdownField, PdfEncryptionHandler, PdfField, PdfFileAttachmentAnnotation, PdfForm, PdfFreeTextAnnotation, PdfHighlightAnnotation, PdfInkAnnotation, PdfLayer, PdfLayerManager, PdfLineAnnotation, PdfLinkAnnotation, PdfListboxField, PdfName, PdfNull, PdfNumber, PdfObject, PdfObjectRegistry, PdfOutlineItem, PdfOutlineTree, PdfPage, PdfParseError, PdfPermissionFlags, PdfPolyLineAnnotation, PdfPolygonAnnotation, PdfPopupAnnotation, PdfRadioGroup, PdfRedactAnnotation, PdfRef, PdfSaveOptions, PdfSignatureField, PdfSignatureInfo, PdfSquareAnnotation, PdfSquigglyAnnotation, PdfStampAnnotation, PdfStream, PdfStreamWriter, PdfStrikeOutAnnotation, PdfString, PdfStructureElement, PdfStructureTree, PdfTextAnnotation, PdfTextField, PdfUnderlineAnnotation, PdfViewerPreferences, PdfWorker, PdfWorkerOptions, PdfWriter, PresetName, PresetOptions, ProgressInfo, QrCodeMatrix, QrCodeOptions, RadialGradientFill, RadialGradientOptions, Radians, RadioAppearanceOptions, RawImageData, RecompressOptions, RedactionMark, RedactionOptions, RefResolver, RegistryEntry, RemovePageFromEmptyDocumentError, RgbColor, RichTextFieldReadError, RuntimeKind, SRGB_ICC_PROFILE, SetTitleOptions, SignOptions, SignatureAppearanceOptions, SignatureOptions, SignatureVerificationResult, SignerInfo, SoftMaskBuilder, SoftMaskRef, StandardFontName, StandardFonts, StandardStampName, StripOptions, StripResult, StrippedFeature, StructureElementOptions, StructureType, StyledBarcodeOptions, SubsetCmap, SubsetResult, SvgDrawCommand, SvgElement, SvgRenderOptions, TableCell, TableColumn, TablePreset, TableRenderResult, TableRow, TextAlignment, TextAnnotationIcon, TextAppearanceOptions, TextExtractionOptions, TextItem, TextRenderingMode, TextRun, TilingPatternOptions, TimestampResult, TransparencyFinding, TransparencyGroupOptions, TransparencyInfo, Type0FontData, UnexpectedFieldTypeError, BarcodeOptions as UpcOptions, ViewerPreferences, VisibleSignatureOptions, WasmLoaderConfig, WatermarkOptions, WidgetAnnotationHost, WidthEntry, XmpIssue, XmpValidationResult, addWatermark, addWatermarkToPage, aesDecryptCBC, aesEncryptCBC, analyzeImages, analyzeJpegMarkers, annotationFromDict, applyFillColor, applyOverflow, applyPreset, applyRedactions, applyStrokeColor, applyTablePreset, asNumber, asPDFName, asPDFNumber, attachFile, base64Decode, base64Encode, beginArtifact, beginArtifactWithType, beginLayerContent, beginMarkedContent, beginMarkedContentSequence, beginMarkedContentWithProperties, beginText, borderedPreset, buildAfArray, buildAnnotationDict, buildCatalog, buildDocumentStructure, buildEmbeddedFilesNameTree, buildGradientObjects, buildInfoDict, buildOutputIntent, buildPageTree, buildPatternObjects, buildPkcs7Signature, buildTimestampRequest, buildViewerPreferencesDict, buildXmpMetadata, calculateBarcodeDimensions, calculateEanCheckDigit, calculateUpcCheckDigit, checkAccessibility, circlePath, clearWasmCache, clipEvenOdd, clip as clipOp, closeAndStroke, closeFillAndStroke, closeFillEvenOddAndStroke, closePath as closePathOp, cmyk, code128ToOperators, code39ToOperators, colorToComponents, componentsToColor, computeCode39CheckDigit, computeFileEncryptionKey, computeFontSize, computeImageDpi, computeSignatureHash, computeTargetDimensions, concatMatrix, concatMatrix as concatTransformationMatrix, configureWasmLoader, convertToGrayscale, copyPages, countOccurrences, createAnnotation, createAssociatedFile, createMarkedContentScope, createPdf, createXmpStream, cropPage, curveToFinal, curveToInitial, curveTo as curveToOp, dataMatrixToOperators, decodeImageStream, decodeJpegWasm, decodePermissions, decodeStream, deduplicateImages, degrees, degreesToRadians, detectRuntime, detectTransparency, downscaleImage, drawImageWithMatrix, drawImageXObject, drawXObject as drawObject, drawSvgOnPage, drawXObject, ean13ToOperators, ean8ToOperators, ellipsePath, ellipsisText, embedIccProfile, embedPageAsFormXObject, embedSignature, encodeCode128, encodeCode128Values, encodeCode39, encodeContextTag, encodeDataMatrix, encodeEan13, encodeEan8, encodeInteger, encodeItf, encodeJpegWasm, encodeLength, encodeOID, encodeOctetString, encodePdf417, encodePermissions, encodePrintableString, encodeQrCode, encodeSequence, encodeSet, encodeUTCTime, encodeUpcA, encodeUtf8String, endArtifact, endLayerContent, endMarkedContent, endPath as endPathOp, endText, enforcePdfA, enforcePdfAFull, estimateJpegQuality, estimateTextWidth, extractIccProfile, extractImages, extractJpegMetadata, extractMetrics, extractText, extractTextWithPositions, extractXmpMetadata, fillAndStroke as fillAndStrokeOp, fillEvenOdd, fillEvenOddAndStroke, fill as fillOp, findSignatures, flattenTransparency, formatHexContext, formatPdfDate, generateButtonAppearance, generateCheckboxAppearance, generateCircleAppearance, generateDropdownAppearance, generateFreeTextAppearance, generateHighlightAppearance, generateInkAppearance, generateLineAppearance, generateListboxAppearance, generatePdfAXmp, generatePdfAXmpBytes, generateRadioAppearance, generateSignatureAppearance, generateSquareAppearance, generateSquigglyAppearance, generateSrgbIccProfile, generateStrikeOutAppearance, generateSymbolToUnicodeCmap, generateTextAppearance, generateUnderlineAppearance, generateWinAnsiToUnicodeCmap, generateZapfDingbatsToUnicodeCmap, getAttachments, getPageSize, getProfile, getRedactionMarks, getSignatures, getSupportedLevels, getToUnicodeCmap, grayscale, initJpegWasm, initWasm, injectJpegMetadata, insertPage, instantiateWasmModuleStreaming, isAccessible, isGrayscaleImage, isJpegWasmReady, isLinearized, isOpenTypeCFF, isTrueType, isValidLevel, isWasmDisabled, isWasmModuleCached, itfToOperators, layoutCombedText, layoutMultilineText, layoutSinglelineText, lineTo as lineToOp, linearGradient, linearizePdf, loadPdf, loadWasmModule, loadWasmModuleStreaming, markForRedaction, md5, mergePdfs, minimalPreset, movePage, moveText as moveTextOp, moveTextSetLeading, moveTo as moveToOp, nextLine as nextLineOp, optimizeAllImages, optimizeImage, parseContentStream, parseIccColorSpace, parseIccDescription, parseSvg, parseSvgColor, parseSvgPath, parseSvgTransform, parseTimestampResponse, parseViewerPreferences, parseXmpMetadata$1 as parseXmpMetadata, parseXmpMetadata as parseXmpPdfAMetadata, pdf417ToOperators, restoreState as popGraphicsState, prepareForSigning, professionalPreset, provideWasmBytes, saveState as pushGraphicsState, qrCodeToOperators, radialGradient, radians, radiansToDegrees, rc4, readBarcode, readCode128, readCode39, readEan13, readEan8, recompressImage, rectangle as rectangleOp, removePage, removePages, renderMultiPageTable, renderStyledBarcode, renderTable, requestTimestamp, resetWasmLoader, resizePage, restoreState, reversePages, rgb, rotateAllPages, rotate as rotateOp, rotatePage, rotationMatrix, saveDocumentIncremental, saveIncremental, saveState, scale as scaleOp, serializePdf, setCharacterSpacing as setCharacterSpacingOp, setCharacterSpacing as setCharacterSqueeze, setColorSpace, setDashPattern as setDashPatternOp, setFillColor, setFillColorCmyk, setFillColorGray, setFillColorRgb, setFillingColor, setFlatness, setFont as setFontAndSize, setFont as setFontOp, setFontSize as setFontSizeOp, setGraphicsState as setGraphicsStateOp, setLeading as setLeadingOp, setLineCap as setLineCapOp, setLeading as setLineHeight, setLineJoin as setLineJoinOp, setLineWidth as setLineWidthOp, setMiterLimit, setStrokeColor, setStrokeColorCmyk, setStrokeColorGray, setStrokeColorRgb, setStrokeColorSpace, setStrokingColor, setTextMatrix as setTextMatrixOp, setTextRenderingMode as setTextRenderingModeOp, setTextRise as setTextRiseOp, setWordSpacing as setWordSpacingOp, sha256, sha384, sha512, showTextArray, showTextHex, showTextNextLine, showText as showTextOp, showTextWithSpacing, shrinkFontSize, signPdf, skew as skewOp, splitPdf, stripProhibitedFeatures, stripedPreset, stroke as strokeOp, summarizeIssues, svgToPdfOperators, tilingPattern, translate as translateOp, truncateText, upcAToOperators, validatePdfA, validateXmpMetadata, valuesToModules, verifyOwnerPassword, verifySignature, verifySignatures, verifyUserPassword, wrapInMarkedContent, wrapText };
5886
+ export { AFRelationship, AccessibilityIssue, AnalysisReport, AnalyzeImagesOptions, Angle, AnnotationFlags, AnnotationOptions, AnnotationType, AppearanceProviderFor, AppendOptions, AssociatedFileOptions, AssociatedFileResult, BarcodeMatrix, BarcodeOptions, BarcodeReadResult, BatchOptimizeOptions, BlendMode, ButtonAppearanceOptions, ByteRangeResult, ByteWriter, CIDFontData, CIDSystemInfoData, CaretSymbol, CatalogOptions, CellContent, ChangeTracker, CheckboxAppearanceOptions, ChromaSubsampling, CmykColor, Code128Options, Code39Options, Color, ColorStop, CombedTextLayoutError, ComputeFontSizeOptions, ContentStreamOperator, CounterSignatureInfo, CropBox, DataMatrixOptions, DataMatrixResult, DeduplicationReport, Degrees, DiffEntry, DirectEmbedOptions, DirectEmbedResult, DocumentDiff, DocumentMetadata, DocumentStructure, DownscaleOptions, DrawCircleOptions, DrawEllipseOptions, DrawImageOptions, DrawLineOptions, DrawPageOptions, DrawQrCodeOptions, DrawRectangleOptions, DrawSquareOptions, DrawSvgPathOptions, DrawTableOptions, DrawTextOptions, DropdownAppearanceOptions, DssData, BarcodeOptions as EanOptions, EmbedFontOptions, EmbedPageOptions, EmbeddedFile, EmbeddedFont, EmbeddedPdfPage, EncryptAlgorithm, EncryptDictValues, EncryptOptions, EncryptedPdfError, EnforcePdfAOptions, EnforcePdfAResult, EnforcementAction, ErrorCorrectionLevel, ExceededMaxLengthError, FieldAlreadyExistsError, FieldExistsAsNonTerminalError, FieldFlags, FieldLockInfo, FieldLockOptions, FieldType, FileAttachmentIcon, FontDescriptorData, FontEmbeddingResult, FontMetrics, FontNotEmbeddedError, FontRef, ForeignPageError, FreeTextAlignment, GradientFill, GrayscaleColor, IccProfile, IfdEntry, ImageAlignment, ImageAnalysis, ImageDpi, ImageFormat, ImageInfo, ImageOptimizeEntry, ImageOptimizeOptions, ImageRef, IncrementalChange, IncrementalObject, IncrementalSaveOptions, IncrementalSaveResult, InitWasmOptions, InvalidFieldNamePartError, ItfOptions, JpegDecodeResult, JpegMarkerInfo, JpegMetadata, JpegWasmModule, LayoutCombedOptions, LayoutMultilineOptions, LayoutMultilineResult, LayoutSinglelineOptions, LayoutSinglelineResult, LineCapStyle, LineEndingStyle, LineJoinStyle, LinearGradientOptions, LinearizationOptions, LinkHighlightMode, ListboxAppearanceOptions, LoadPdfOptions, LtvOptions, MarkedContentScope, MdpPermission, MissingOnValueCheckError, ModificationReport, ModificationViolation, ModificationViolationType, MultiPageTableResult, NestedTableContent, NoSuchFieldError, NormalizedStop, Operand, OptimizationReport, OptimizeResult, OutlineDestination, OutlineItemOptions, OutputIntentOptions, OverflowMode, OverflowResult, PDFOperator, PageContent, PageEntry, PageRange, PageSize, PageSizes, ParseSpeeds, ParsedXmpMetadata, PatternFill, Pdf417Matrix, Pdf417Options, PdfAIssue, PdfALevel, PdfAProfile, PdfAValidationResult, PdfAXmpOptions, PdfAnnotation, PdfArray, PdfBool, PdfButtonField, PdfCaretAnnotation, PdfCheckboxField, PdfCircleAnnotation, PdfDict, PdfDocument, PdfDropdownField, PdfEncryptionHandler, PdfField, PdfFileAttachmentAnnotation, PdfForm, PdfFreeTextAnnotation, PdfHighlightAnnotation, PdfInkAnnotation, PdfLayer, PdfLayerManager, PdfLineAnnotation, PdfLinkAnnotation, PdfListboxField, PdfName, PdfNull, PdfNumber, PdfObject, PdfObjectRegistry, PdfOutlineItem, PdfOutlineTree, PdfPage, PdfParseError, PdfPermissionFlags, PdfPolyLineAnnotation, PdfPolygonAnnotation, PdfPopupAnnotation, PdfRadioGroup, PdfRedactAnnotation, PdfRef, PdfSaveOptions, PdfSignatureField, PdfSignatureInfo, PdfSquareAnnotation, PdfSquigglyAnnotation, PdfStampAnnotation, PdfStream, PdfStreamWriter, PdfStrikeOutAnnotation, PdfString, PdfStructureElement, PdfStructureTree, PdfTextAnnotation, PdfTextField, PdfUnderlineAnnotation, PdfViewerPreferences, PdfWorker, PdfWorkerOptions, PdfWriter, PrepareAppearanceOptions, PresetName, PresetOptions, ProgressInfo, QrCodeMatrix, QrCodeOptions, RadialGradientFill, RadialGradientOptions, Radians, RadioAppearanceOptions, RawImageData, RecompressOptions, RedactionMark, RedactionOptions, RefResolver, RegistryEntry, RemovePageFromEmptyDocumentError, RgbColor, RichTextFieldReadError, RuntimeKind, SRGB_ICC_PROFILE, SetTitleOptions, SignOptions, SignatureAppearanceOptions, SignatureByteRange, SignatureChainEntry, SignatureChainResult, SignatureOptions, SignatureVerificationResult, SignerInfo, SoftMaskBuilder, SoftMaskRef, StandardFontName, StandardFonts, StandardStampName, StripOptions, StripResult, StrippedFeature, StructureElementOptions, StructureType, StyledBarcodeOptions, SubsetCmap, SubsetResult, SvgDrawCommand, SvgElement, SvgRenderOptions, TableCell, TableColumn, TablePreset, TableRenderResult, TableRow, TextAlignment, TextAnnotationIcon, TextAppearanceOptions, TextExtractionOptions, TextItem, TextRenderingMode, TextRun, TiffCmykEmbedResult, TiffDecodeOptions, TiffIfdEntry, TiffImage, TilingPatternOptions, TimestampResult, TrailerInfo, TransparencyFinding, TransparencyGroupOptions, TransparencyInfo, Type0FontData, UnexpectedFieldTypeError, BarcodeOptions as UpcOptions, ViewerPreferences, VisibleSignatureOptions, WasmLoaderConfig, WatermarkOptions, WebPImage, WidgetAnnotationHost, WidthEntry, XmpIssue, XmpValidationResult, addCounterSignature, addFieldLock, addWatermark, addWatermarkToPage, aesDecryptCBC, aesEncryptCBC, analyzeImages, analyzeJpegMarkers, annotationFromDict, appendIncrementalUpdate, applyFillColor, applyOverflow, applyPreset, applyRedactions, applyStrokeColor, applyTablePreset, asNumber, asPDFName, asPDFNumber, attachFile, base64Decode, base64Encode, beginArtifact, beginArtifactWithType, beginLayerContent, beginMarkedContent, beginMarkedContentSequence, beginMarkedContentWithProperties, beginText, borderedPreset, buildAfArray, buildAnnotationDict, buildCatalog, buildDocMdpReference, buildDocumentStructure, buildDssDictionary, buildEmbeddedFilesNameTree, buildFieldLockDict, buildGradientObjects, buildInfoDict, buildOutputIntent, buildPageTree, buildPatternObjects, buildPkcs7Signature, buildTimestampRequest, buildViewerPreferencesDict, buildXmpMetadata, calculateBarcodeDimensions, calculateEanCheckDigit, calculateUpcCheckDigit, canDirectEmbed, checkAccessibility, circlePath, clearWasmCache, clipEvenOdd, clip as clipOp, closeAndStroke, closeFillAndStroke, closeFillEvenOddAndStroke, closePath as closePathOp, cmyk, code128ToOperators, code39ToOperators, colorToComponents, componentsToColor, computeCode39CheckDigit, computeFileEncryptionKey, computeFontSize, computeImageDpi, computeObjectHash, computeSignatureHash, computeTargetDimensions, concatMatrix, concatMatrix as concatTransformationMatrix, configureWasmLoader, convertTiffCmykToRgb, convertToGrayscale, copyPages, countOccurrences, createAnnotation, createAssociatedFile, createMarkedContentScope, createPdf, createXmpStream, cropPage, curveToFinal, curveToInitial, curveTo as curveToOp, dataMatrixToOperators, decodeImageStream, decodeJpegWasm, decodePermissions, decodeStream, decodeTiff, decodeTiffAll, decodeTiffPage, decodeWebP, deduplicateImages, degrees, degreesToRadians, detectImageFormat, detectModifications, detectRuntime, detectTransparency, diffSignedContent, downscaleImage, drawImageWithMatrix, drawImageXObject, drawXObject as drawObject, drawSvgOnPage, drawXObject, ean13ToOperators, ean8ToOperators, ellipsePath, ellipsisText, embedIccProfile, embedLtvData, embedPageAsFormXObject, embedSignature, embedTiffCmyk, embedTiffDirect, encodeCode128, encodeCode128Values, encodeCode39, encodeContextTag, encodeDataMatrix, encodeEan13, encodeEan8, encodeInteger, encodeItf, encodeJpegWasm, encodeLength, encodeOID, encodeOctetString, encodePdf417, encodePermissions, encodePngFromPixels, encodePrintableString, encodeQrCode, encodeSequence, encodeSet, encodeUTCTime, encodeUpcA, encodeUtf8String, endArtifact, endLayerContent, endMarkedContent, endPath as endPathOp, endText, enforcePdfA, enforcePdfAFull, estimateJpegQuality, estimateTextWidth, extractIccProfile, extractImages, extractJpegMetadata, extractMetrics, extractText, extractTextWithPositions, extractXmpMetadata, fillAndStroke as fillAndStrokeOp, fillEvenOdd, fillEvenOddAndStroke, fill as fillOp, findChangedObjects, findExistingSignatures, findSignatures, flattenTransparency, formatHexContext, formatPdfDate, generateButtonAppearance, generateCheckboxAppearance, generateCircleAppearance, generateDropdownAppearance, generateFreeTextAppearance, generateHighlightAppearance, generateInkAppearance, generateLineAppearance, generateListboxAppearance, generatePdfAXmp, generatePdfAXmpBytes, generateRadioAppearance, generateSignatureAppearance, generateSquareAppearance, generateSquigglyAppearance, generateSrgbIccProfile, generateStrikeOutAppearance, generateSymbolToUnicodeCmap, generateTextAppearance, generateUnderlineAppearance, generateWinAnsiToUnicodeCmap, generateZapfDingbatsToUnicodeCmap, getAttachments, getCertificationLevel, getCounterSignatures, getFieldLocks, getImageFormatName, getPageSize, getProfile, getRedactionMarks, getSignatures, getSupportedFormats, getSupportedLevels, getTiffPageCount, getToUnicodeCmap, grayscale, hasLtvData, initJpegWasm, initWasm, injectJpegMetadata, insertPage, instantiateWasmModuleStreaming, isAccessible, isCmykTiff, isGrayscaleImage, isJpegWasmReady, isLinearized, isOpenTypeCFF, isTiff, isTrueType, isValidLevel, isWasmDisabled, isWasmModuleCached, isWebP, isWebPLossless, itfToOperators, layoutCombedText, layoutMultilineText, layoutSinglelineText, lineTo as lineToOp, linearGradient, linearizePdf, loadPdf, loadWasmModule, loadWasmModuleStreaming, markForRedaction, md5, mergePdfs, minimalPreset, movePage, moveText as moveTextOp, moveTextSetLeading, moveTo as moveToOp, nextLine as nextLineOp, optimizeAllImages, optimizeImage, optimizeIncrementalSave, parseContentStream, parseExistingTrailer, parseIccColorSpace, parseIccDescription, parseSvg, parseSvgColor, parseSvgPath, parseSvgTransform, parseTiffIfd, parseTimestampResponse, parseViewerPreferences, parseXmpMetadata$1 as parseXmpMetadata, parseXmpMetadata as parseXmpPdfAMetadata, pdf417ToOperators, restoreState as popGraphicsState, prepareForSigning, professionalPreset, provideWasmBytes, saveState as pushGraphicsState, qrCodeToOperators, radialGradient, radians, radiansToDegrees, rc4, readBarcode, readCode128, readCode39, readEan13, readEan8, recompressImage, recompressWebP, rectangle as rectangleOp, removePage, removePages, renderMultiPageTable, renderStyledBarcode, renderTable, requestTimestamp, resetWasmLoader, resizePage, restoreState, reversePages, rgb, rotateAllPages, rotate as rotateOp, rotatePage, rotationMatrix, saveDocumentIncremental, saveIncremental, saveIncrementalWithSignaturePreservation, saveState, scale as scaleOp, serializePdf, setCertificationLevel, setCharacterSpacing as setCharacterSpacingOp, setCharacterSpacing as setCharacterSqueeze, setColorSpace, setDashPattern as setDashPatternOp, setFillColor, setFillColorCmyk, setFillColorGray, setFillColorRgb, setFillingColor, setFlatness, setFont as setFontAndSize, setFont as setFontOp, setFontSize as setFontSizeOp, setGraphicsState as setGraphicsStateOp, setLeading as setLeadingOp, setLineCap as setLineCapOp, setLeading as setLineHeight, setLineJoin as setLineJoinOp, setLineWidth as setLineWidthOp, setMiterLimit, setStrokeColor, setStrokeColorCmyk, setStrokeColorGray, setStrokeColorRgb, setStrokeColorSpace, setStrokingColor, setTextMatrix as setTextMatrixOp, setTextRenderingMode as setTextRenderingModeOp, setTextRise as setTextRiseOp, setWordSpacing as setWordSpacingOp, sha256, sha384, sha512, showTextArray, showTextHex, showTextNextLine, showText as showTextOp, showTextWithSpacing, shrinkFontSize, signPdf, skew as skewOp, splitPdf, stripProhibitedFeatures, stripedPreset, stroke as strokeOp, summarizeIssues, svgToPdfOperators, tilingPattern, translate as translateOp, truncateText, upcAToOperators, validateByteRangeIntegrity, validatePdfA, validateSignatureChain, validateXmpMetadata, valuesToModules, verifyOwnerPassword, verifySignature, verifySignatures, verifyUserPassword, webpToJpeg, webpToPng, wrapInMarkedContent, wrapText };
4852
5887
  }
4853
5888
  /**
4854
5889
  * Options for WASM module initialization.
@@ -4900,5 +5935,5 @@ interface InitWasmOptions {
4900
5935
  */
4901
5936
  declare function initWasm(options?: string | URL | InitWasmOptions): Promise<void>;
4902
5937
  //#endregion
4903
- export { upcAToOperators as $, setFont as $i, TransparencyFinding as $n, LineEndingStyle as $r, ImageOptimizeEntry as $t, borderedPreset as A, setDashPattern as Aa, createXmpStream as Ai, AFRelationship as An, embedSignature as Ar, isWasmModuleCached as At, StyledBarcodeOptions as B, IncrementalSaveResult as Ba, createMarkedContentScope as Bi, validateXmpMetadata as Bn, generateSquareAppearance as Br, ImageDpi as Bt, truncateText as C, fill as Ca, computeFileEncryptionKey as Ci, generatePdfAXmp as Cn, encodePrintableString as Cr, RuntimeKind as Ct, TablePreset as D, lineTo as Da, isAccessible as Di, StrippedFeature as Dn, encodeUtf8String as Dr, detectRuntime as Dt, PresetOptions as E, fillEvenOddAndStroke as Ea, checkAccessibility as Ei, StripResult as En, encodeUTCTime as Er, configureWasmLoader as Et, readBarcode as F, setMiterLimit as Fa, beginArtifact as Fi, ParsedXmpMetadata as Fn, generateCircleAppearance as Fr, JpegMetadata as Ft, encodePdf417 as G, asPDFNumber as Ga, drawImageXObject as Gi, generateSymbolToUnicodeCmap as Gn, PdfFileAttachmentAnnotation as Gr, extractIccProfile as Gt, renderStyledBarcode as H, saveIncremental as Ha, endMarkedContent as Hi, getProfile as Hn, generateStrikeOutAppearance as Hr, computeTargetDimensions as Ht, readCode128 as I, stroke as Ia, beginArtifactWithType as Ii, XmpIssue as In, generateFreeTextAppearance as Ir, extractJpegMetadata as It, DataMatrixResult as J, endText as Ji, getToUnicodeCmap as Jn, PdfPopupAnnotation as Jr, convertToGrayscale as Jt, pdf417ToOperators as K, drawXObject as Ki, generateWinAnsiToUnicodeCmap as Kn, CaretSymbol as Kr, parseIccColorSpace as Kt, readCode39 as L, isOpenTypeCFF as La, beginMarkedContent as Li, XmpValidationResult as Ln, generateHighlightAppearance as Lr, injectJpegMetadata as Lt, professionalPreset as M, setLineCap as Ma, PdfStreamWriter as Mi, AssociatedFileResult as Mn, prepareForSigning as Mr, loadWasmModuleStreaming as Mt, stripedPreset as N, setLineJoin as Na, PDFOperator as Ni, buildAfArray as Nn, PdfParseError as Nr, provideWasmBytes as Nt, applyPreset as O, moveTo as Oa, summarizeIssues as Oi, countOccurrences as On, ByteRangeResult as Or, instantiateWasmModuleStreaming as Ot, BarcodeReadResult as P, setLineWidth as Pa, MarkedContentScope as Pi, createAssociatedFile as Pn, formatHexContext as Pr, resetWasmLoader as Pt, encodeUpcA as Q, setCharacterSpacing as Qi, generateSrgbIccProfile as Qn, StandardStampName as Qr, BatchOptimizeOptions as Qt, readEan13 as R, isTrueType as Ra, beginMarkedContentSequence as Ri, extractXmpMetadata as Rn, generateInkAppearance as Rr, JpegMarkerInfo as Rt, shrinkFontSize as S, endPath as Sa, EncryptDictValues as Si, PdfAXmpOptions as Sn, encodeOctetString as Sr, PdfWorkerOptions as St, PresetName as T, fillEvenOdd as Ta, verifyUserPassword as Ti, StripOptions as Tn, encodeSet as Tr, clearWasmCache as Tt, Pdf417Matrix as U, asNumber as Ua, wrapInMarkedContent as Ui, getSupportedLevels as Un, generateUnderlineAppearance as Ur, IccProfile as Ut, calculateBarcodeDimensions as V, saveDocumentIncremental as Va, endArtifact as Vi, PdfAProfile as Vn, generateSquigglyAppearance as Vr, computeImageDpi as Vt, Pdf417Options as W, asPDFName as Wa, drawImageWithMatrix as Wi, isValidLevel as Wn, FileAttachmentIcon as Wr, embedIccProfile as Wt, encodeDataMatrix as X, moveTextSetLeading as Xi, buildOutputIntent as Xn, PdfInkAnnotation as Xr, DeduplicationReport as Xt, dataMatrixToOperators as Y, moveText as Yi, OutputIntentOptions as Yn, PdfRedactAnnotation as Yr, isGrayscaleImage as Yt, calculateUpcCheckDigit as Z, nextLine as Zi, SRGB_ICC_PROFILE as Zn, PdfStampAnnotation as Zr, deduplicateImages as Zt, OverflowMode as _, closePath as _a, sha512 as _i, isJpegWasmReady as _n, buildPkcs7Signature as _r, BarcodeMatrix as _t, EncryptedPdfError as a, setWordSpacing as aa, PdfHighlightAnnotation as ai, OptimizeResult as an, PdfAValidationResult as ar, ItfOptions as at, ellipsisText as b, curveToInitial as ba, rc4 as bi, EnforcementAction as bn, encodeLength as br, base64Encode as bt, FieldExistsAsNonTerminalError as c, showTextHex as ca, PdfUnderlineAnnotation as ci, downscaleImage as cn, LinearizationOptions as cr, Code39Options as ct, InvalidFieldNamePartError as d, circlePath as da, LinkHighlightMode as di, recompressImage as dn, TimestampResult as dr, encodeCode39 as dt, setFontSize as ea, PdfCircleAnnotation as ei, OptimizationReport as en, TransparencyInfo as er, calculateEanCheckDigit as et, MissingOnValueCheckError as f, clip as fa, PdfLinkAnnotation as fi, ChromaSubsampling as fn, buildTimestampRequest as fr, Code128Options as ft, UnexpectedFieldTypeError as g, closeFillEvenOddAndStroke as ga, sha384 as gi, initJpegWasm as gn, SignerInfo as gr, valuesToModules as gt, RichTextFieldReadError as h, closeFillAndStroke as ha, sha256 as hi, encodeJpegWasm as hn, SignatureOptions as hr, encodeCode128Values as ht, CombedTextLayoutError as i, setTextRise as ia, PdfSquareAnnotation as ii, ImageOptimizeOptions as in, PdfALevel as ir, encodeEan8 as it, minimalPreset as j, setFlatness as ja, parseXmpMetadata$1 as ji, AssociatedFileOptions as jn, findSignatures as jr, loadWasmModule as jt, applyTablePreset as k, rectangle as ka, buildXmpMetadata as ki, stripProhibitedFeatures as kn, computeSignatureHash as kr, isWasmDisabled as kt, FontNotEmbeddedError as l, showTextNextLine as la, FreeTextAlignment as li, estimateJpegQuality as ln, isLinearized as lr, code39ToOperators as lt, RemovePageFromEmptyDocumentError as m, closeAndStroke as ma, TextAnnotationIcon as mi, decodeJpegWasm as mn, requestTimestamp as mr, encodeCode128 as mt, index_d_exports as n, setTextMatrix as na, PdfPolyLineAnnotation as ni, optimizeAllImages as nn, flattenTransparency as nr, ean8ToOperators as nt, ExceededMaxLengthError as o, showText as oa, PdfSquigglyAnnotation as oi, RawImageData as on, enforcePdfA as or, encodeItf as ot, NoSuchFieldError as p, clipEvenOdd as pa, PdfTextAnnotation as pi, JpegDecodeResult as pn, parseTimestampResponse as pr, code128ToOperators as pt, DataMatrixOptions as q, beginText as qi, generateZapfDingbatsToUnicodeCmap as qn, PdfCaretAnnotation as qr, parseIccDescription as qt, initWasm as r, setTextRenderingMode as ra, PdfPolygonAnnotation as ri, DownscaleOptions as rn, PdfAIssue as rr, encodeEan13 as rt, FieldAlreadyExistsError as s, showTextArray as sa, PdfStrikeOutAnnotation as si, RecompressOptions as sn, validatePdfA as sr, itfToOperators as st, InitWasmOptions as t, setLeading as ta, PdfLineAnnotation as ti, ProgressInfo as tn, detectTransparency as tr, ean13ToOperators as tt, ForeignPageError as u, showTextWithSpacing as ua, PdfFreeTextAnnotation as ui, optimizeImage as un, linearizePdf as ur, computeCode39CheckDigit as ut, OverflowResult as v, curveTo as va, aesDecryptCBC as vi, EnforcePdfAOptions as vn, encodeContextTag as vr, BarcodeOptions as vt, wrapText as w, fillAndStroke as wa, verifyOwnerPassword as wi, generatePdfAXmpBytes as wn, encodeSequence as wr, WasmLoaderConfig as wt, estimateTextWidth as x, ellipsePath as xa, md5 as xi, enforcePdfAFull as xn, encodeOID as xr, PdfWorker as xt, applyOverflow as y, curveToFinal as ya, aesEncryptCBC as yi, EnforcePdfAResult as yn, encodeInteger as yr, base64Decode as yt, readEan8 as z, ChangeTracker as za, beginMarkedContentWithProperties as zi, parseXmpMetadata as zn, generateLineAppearance as zr, analyzeJpegMarkers as zt };
4904
- //# sourceMappingURL=index-bpktKzCA.d.cts.map
5938
+ export { upcAToOperators as $, beginArtifactWithType as $a, generateFreeTextAppearance as $i, PdfAXmpOptions as $n, stroke as $o, getCounterSignatures as $r, recompressWebP as $t, borderedPreset as A, PdfTextAnnotation as Aa, buildTimestampRequest as Ai, OptimizationReport as An, clipEvenOdd as Ao, TransparencyFinding as Ar, isWasmModuleCached as At, StyledBarcodeOptions as B, computeFileEncryptionKey as Ba, encodeOctetString as Bi, optimizeImage as Bn, fill as Bo, isLinearized as Br, decodeTiffPage as Bt, truncateText as C, PdfSquigglyAnnotation as Ca, TrailerInfo as Ci, parseIccDescription as Cn, showText as Co, generateWinAnsiToUnicodeCmap as Cr, RuntimeKind as Ct, TablePreset as D, PdfFreeTextAnnotation as Da, saveIncrementalWithSignaturePreservation as Di, deduplicateImages as Dn, showTextWithSpacing as Do, buildOutputIntent as Dr, detectRuntime as Dt, PresetOptions as E, FreeTextAlignment as Ea, parseExistingTrailer as Ei, DeduplicationReport as En, showTextNextLine as Eo, OutputIntentOptions as Er, configureWasmLoader as Et, readBarcode as F, aesDecryptCBC as Fa, buildPkcs7Signature as Fi, OptimizeResult as Fn, curveTo as Fo, PdfALevel as Fr, IfdEntry as Ft, encodePdf417 as G, summarizeIssues as Ga, encodeUtf8String as Gi, decodeJpegWasm as Gn, moveTo as Go, optimizeIncrementalSave as Gr, decodeWebP as Gt, renderStyledBarcode as H, verifyUserPassword as Ha, encodeSequence as Hi, ChromaSubsampling as Hn, fillEvenOdd as Ho, IncrementalChange as Hr, isTiff as Ht, readCode128 as I, aesEncryptCBC as Ia, encodeContextTag as Ii, RawImageData as In, curveToFinal as Io, PdfAValidationResult as Ir, TiffDecodeOptions as It, DataMatrixResult as J, parseXmpMetadata$1 as Ja, computeSignatureHash as Ji, isJpegWasmReady as Jn, setFlatness as Jo, buildDssDictionary as Jr, DirectEmbedOptions as Jt, pdf417ToOperators as K, buildXmpMetadata as Ka, ByteRangeResult as Ki, encodeJpegWasm as Kn, rectangle as Ko, DssData as Kr, isWebP as Kt, readCode39 as L, rc4 as La, encodeInteger as Li, RecompressOptions as Ln, curveToInitial as Lo, enforcePdfA as Lr, TiffImage as Lt, professionalPreset as M, sha256 as Ma, requestTimestamp as Mi, optimizeAllImages as Mn, closeFillAndStroke as Mo, detectTransparency as Mr, loadWasmModuleStreaming as Mt, stripedPreset as N, sha384 as Na, SignatureOptions as Ni, DownscaleOptions as Nn, closeFillEvenOddAndStroke as No, flattenTransparency as Nr, provideWasmBytes as Nt, applyPreset as O, LinkHighlightMode as Oa, validateByteRangeIntegrity as Oi, BatchOptimizeOptions as On, circlePath as Oo, SRGB_ICC_PROFILE as Or, instantiateWasmModuleStreaming as Ot, BarcodeReadResult as P, sha512 as Pa, SignerInfo as Pi, ImageOptimizeOptions as Pn, closePath as Po, PdfAIssue as Pr, resetWasmLoader as Pt, encodeUpcA as Q, beginArtifact as Qa, generateCircleAppearance as Qi, enforcePdfAFull as Qn, setMiterLimit as Qo, addCounterSignature as Qr, encodePngFromPixels as Qt, readEan13 as R, md5 as Ra, encodeLength as Ri, downscaleImage as Rn, ellipsePath as Ro, validatePdfA as Rr, decodeTiff as Rt, shrinkFontSize as S, PdfHighlightAnnotation as Sa, SignatureByteRange as Si, parseIccColorSpace as Sn, setWordSpacing as So, generateSymbolToUnicodeCmap as Sr, PdfWorkerOptions as St, PresetName as T, PdfUnderlineAnnotation as Ta, findExistingSignatures as Ti, isGrayscaleImage as Tn, showTextHex as To, getToUnicodeCmap as Tr, clearWasmCache as Tt, Pdf417Matrix as U, checkAccessibility as Ua, encodeSet as Ui, JpegDecodeResult as Un, fillEvenOddAndStroke as Uo, computeObjectHash as Ur, parseTiffIfd as Ut, calculateBarcodeDimensions as V, verifyOwnerPassword as Va, encodePrintableString as Vi, recompressImage as Vn, fillAndStroke as Vo, linearizePdf as Vr, getTiffPageCount as Vt, Pdf417Options as W, isAccessible as Wa, encodeUTCTime as Wi, JpegWasmModule as Wn, lineTo as Wo, findChangedObjects as Wr, WebPImage as Wt, encodeDataMatrix as X, PDFOperator as Xa, findSignatures as Xi, EnforcePdfAResult as Xn, setLineJoin as Xo, hasLtvData as Xr, canDirectEmbed as Xt, dataMatrixToOperators as Y, PdfStreamWriter as Ya, embedSignature as Yi, EnforcePdfAOptions as Yn, setLineCap as Yo, embedLtvData as Yr, DirectEmbedResult as Yt, calculateUpcCheckDigit as Z, MarkedContentScope as Za, prepareForSigning as Zi, EnforcementAction as Zn, setLineWidth as Zo, CounterSignatureInfo as Zr, embedTiffDirect as Zt, OverflowMode as _, PdfCircleAnnotation as _a, SignatureChainResult as _i, computeImageDpi as _n, setFontSize as _o, validateXmpMetadata as _r, BarcodeMatrix as _t, EncryptedPdfError as a, generateStrikeOutAppearance as aa, addFieldLock as ai, getSupportedFormats as an, endMarkedContent as ao, countOccurrences as ar, saveIncremental as as, ItfOptions as at, ellipsisText as b, PdfPolygonAnnotation as ba, IncrementalObject as bi, embedIccProfile as bn, setTextRenderingMode as bo, getSupportedLevels as br, base64Encode as bt, FieldExistsAsNonTerminalError as c, PdfFileAttachmentAnnotation as ca, ModificationReport as ci, convertTiffCmykToRgb as cn, drawImageXObject as co, AssociatedFileOptions as cr, Code39Options as ct, InvalidFieldNamePartError as d, PdfPopupAnnotation as da, detectModifications as di, JpegMetadata as dn, endText as do, createAssociatedFile as dr, encodeCode39 as dt, generateHighlightAppearance as ea, DiffEntry as ei, webpToJpeg as en, beginMarkedContent as eo, generatePdfAXmp as er, isOpenTypeCFF as es, calculateEanCheckDigit as et, MissingOnValueCheckError as f, PdfRedactAnnotation as fa, MdpPermission as fi, extractJpegMetadata as fn, moveText as fo, ParsedXmpMetadata as fr, Code128Options as ft, UnexpectedFieldTypeError as g, LineEndingStyle as ga, SignatureChainEntry as gi, ImageDpi as gn, setFont as go, parseXmpMetadata as gr, valuesToModules as gt, RichTextFieldReadError as h, StandardStampName as ha, setCertificationLevel as hi, analyzeJpegMarkers as hn, setCharacterSpacing as ho, extractXmpMetadata as hr, encodeCode128Values as ht, CombedTextLayoutError as i, generateSquigglyAppearance as ia, FieldLockOptions as ii, getImageFormatName as in, endArtifact as io, StrippedFeature as ir, saveDocumentIncremental as is, encodeEan8 as it, minimalPreset as j, TextAnnotationIcon as ja, parseTimestampResponse as ji, ProgressInfo as jn, closeAndStroke as jo, TransparencyInfo as jr, loadWasmModule as jt, applyTablePreset as k, PdfLinkAnnotation as ka, TimestampResult as ki, ImageOptimizeEntry as kn, clip as ko, generateSrgbIccProfile as kr, isWasmDisabled as kt, FontNotEmbeddedError as l, CaretSymbol as la, ModificationViolation as li, embedTiffCmyk as ln, drawXObject as lo, AssociatedFileResult as lr, code39ToOperators as lt, RemovePageFromEmptyDocumentError as m, PdfStampAnnotation as ma, getCertificationLevel as mi, JpegMarkerInfo as mn, nextLine as mo, XmpValidationResult as mr, encodeCode128 as mt, index_d_exports as n, generateLineAppearance as na, diffSignedContent as ni, ImageFormat as nn, beginMarkedContentWithProperties as no, StripOptions as nr, ChangeTracker as ns, ean8ToOperators as nt, ExceededMaxLengthError as o, generateUnderlineAppearance as oa, buildFieldLockDict as oi, TiffCmykEmbedResult as on, wrapInMarkedContent as oo, stripProhibitedFeatures as or, encodeItf as ot, NoSuchFieldError as p, PdfInkAnnotation as pa, buildDocMdpReference as pi, injectJpegMetadata as pn, moveTextSetLeading as po, XmpIssue as pr, code128ToOperators as pt, DataMatrixOptions as q, createXmpStream as qa, PrepareAppearanceOptions as qi, initJpegWasm as qn, setDashPattern as qo, LtvOptions as qr, isWebPLossless as qt, initWasm as r, generateSquareAppearance as ra, FieldLockInfo as ri, detectImageFormat as rn, createMarkedContentScope as ro, StripResult as rr, IncrementalSaveResult as rs, encodeEan13 as rt, FieldAlreadyExistsError as s, FileAttachmentIcon as sa, getFieldLocks as si, TiffIfdEntry as sn, drawImageWithMatrix as so, AFRelationship as sr, itfToOperators as st, InitWasmOptions as t, generateInkAppearance as ta, DocumentDiff as ti, webpToPng as tn, beginMarkedContentSequence as to, generatePdfAXmpBytes as tr, isTrueType as ts, ean13ToOperators as tt, ForeignPageError as u, PdfCaretAnnotation as ua, ModificationViolationType as ui, isCmykTiff as un, beginText as uo, buildAfArray as ur, computeCode39CheckDigit as ut, OverflowResult as v, PdfLineAnnotation as va, validateSignatureChain as vi, computeTargetDimensions as vn, setLeading as vo, PdfAProfile as vr, BarcodeOptions as vt, wrapText as w, PdfStrikeOutAnnotation as wa, appendIncrementalUpdate as wi, convertToGrayscale as wn, showTextArray as wo, generateZapfDingbatsToUnicodeCmap as wr, WasmLoaderConfig as wt, estimateTextWidth as x, PdfSquareAnnotation as xa, IncrementalSaveOptions as xi, extractIccProfile as xn, setTextRise as xo, isValidLevel as xr, PdfWorker as xt, applyOverflow as y, PdfPolyLineAnnotation as ya, AppendOptions as yi, IccProfile as yn, setTextMatrix as yo, getProfile as yr, base64Decode as yt, readEan8 as z, EncryptDictValues as za, encodeOID as zi, estimateJpegQuality as zn, endPath as zo, LinearizationOptions as zr, decodeTiffAll as zt };
5939
+ //# sourceMappingURL=index-J1W3FdL8.d.cts.map