@adnsistemas/pdf-lib 2.8.1 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/cjs/api/PDFDocument.d.ts +3 -0
- package/cjs/api/PDFDocument.d.ts.map +1 -1
- package/cjs/api/PDFDocument.js +26 -21
- package/cjs/api/PDFDocument.js.map +1 -1
- package/cjs/api/PDFFont.d.ts.map +1 -1
- package/cjs/api/PDFFont.js +4 -2
- package/cjs/api/PDFFont.js.map +1 -1
- package/cjs/api/PDFPage.d.ts.map +1 -1
- package/cjs/api/PDFPage.js +5 -4
- package/cjs/api/PDFPage.js.map +1 -1
- package/cjs/api/form/PDFButton.d.ts +3 -0
- package/cjs/api/form/PDFButton.d.ts.map +1 -1
- package/cjs/api/form/PDFButton.js +6 -1
- package/cjs/api/form/PDFButton.js.map +1 -1
- package/cjs/api/form/PDFCheckBox.d.ts +3 -0
- package/cjs/api/form/PDFCheckBox.d.ts.map +1 -1
- package/cjs/api/form/PDFCheckBox.js +6 -1
- package/cjs/api/form/PDFCheckBox.js.map +1 -1
- package/cjs/api/form/PDFDropdown.d.ts +3 -0
- package/cjs/api/form/PDFDropdown.d.ts.map +1 -1
- package/cjs/api/form/PDFDropdown.js +6 -1
- package/cjs/api/form/PDFDropdown.js.map +1 -1
- package/cjs/api/form/PDFField.d.ts +3 -0
- package/cjs/api/form/PDFField.d.ts.map +1 -1
- package/cjs/api/form/PDFField.js +5 -0
- package/cjs/api/form/PDFField.js.map +1 -1
- package/cjs/api/form/PDFForm.d.ts.map +1 -1
- package/cjs/api/form/PDFForm.js +24 -22
- package/cjs/api/form/PDFForm.js.map +1 -1
- package/cjs/api/form/PDFOptionList.d.ts +3 -0
- package/cjs/api/form/PDFOptionList.d.ts.map +1 -1
- package/cjs/api/form/PDFOptionList.js +6 -1
- package/cjs/api/form/PDFOptionList.js.map +1 -1
- package/cjs/api/form/PDFRadioGroup.d.ts +3 -0
- package/cjs/api/form/PDFRadioGroup.d.ts.map +1 -1
- package/cjs/api/form/PDFRadioGroup.js +7 -2
- package/cjs/api/form/PDFRadioGroup.js.map +1 -1
- package/cjs/api/form/PDFSignature.d.ts +3 -0
- package/cjs/api/form/PDFSignature.d.ts.map +1 -1
- package/cjs/api/form/PDFSignature.js +5 -0
- package/cjs/api/form/PDFSignature.js.map +1 -1
- package/cjs/api/form/PDFTextField.d.ts +3 -0
- package/cjs/api/form/PDFTextField.d.ts.map +1 -1
- package/cjs/api/form/PDFTextField.js +6 -1
- package/cjs/api/form/PDFTextField.js.map +1 -1
- package/cjs/api/objects.d.ts +61 -0
- package/cjs/api/objects.d.ts.map +1 -1
- package/cjs/api/objects.js +97 -4
- package/cjs/api/objects.js.map +1 -1
- package/cjs/api/operators.d.ts +28 -24
- package/cjs/api/operators.d.ts.map +1 -1
- package/cjs/api/operators.js +33 -29
- package/cjs/api/operators.js.map +1 -1
- package/cjs/api/snapshot/DefaultDocumentSnapshot.d.ts +3 -0
- package/cjs/api/snapshot/DefaultDocumentSnapshot.d.ts.map +1 -1
- package/cjs/api/snapshot/DefaultDocumentSnapshot.js +5 -0
- package/cjs/api/snapshot/DefaultDocumentSnapshot.js.map +1 -1
- package/cjs/api/snapshot/DocumentSnapshot.d.ts +2 -0
- package/cjs/api/snapshot/DocumentSnapshot.d.ts.map +1 -1
- package/cjs/api/snapshot/IncrementalDocumentSnapshot.d.ts +3 -0
- package/cjs/api/snapshot/IncrementalDocumentSnapshot.d.ts.map +1 -1
- package/cjs/api/snapshot/IncrementalDocumentSnapshot.js +5 -0
- package/cjs/api/snapshot/IncrementalDocumentSnapshot.js.map +1 -1
- package/cjs/core/PDFContext.d.ts +1 -1
- package/cjs/core/PDFContext.d.ts.map +1 -1
- package/cjs/core/PDFContext.js +57 -49
- package/cjs/core/PDFContext.js.map +1 -1
- package/cjs/core/PDFObjectCopier.d.ts.map +1 -1
- package/cjs/core/PDFObjectCopier.js +6 -9
- package/cjs/core/PDFObjectCopier.js.map +1 -1
- package/cjs/core/acroform/PDFAcroButton.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroButton.js +7 -3
- package/cjs/core/acroform/PDFAcroButton.js.map +1 -1
- package/cjs/core/acroform/PDFAcroCheckBox.d.ts +3 -0
- package/cjs/core/acroform/PDFAcroCheckBox.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroCheckBox.js +6 -1
- package/cjs/core/acroform/PDFAcroCheckBox.js.map +1 -1
- package/cjs/core/acroform/PDFAcroChoice.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroChoice.js +22 -9
- package/cjs/core/acroform/PDFAcroChoice.js.map +1 -1
- package/cjs/core/acroform/PDFAcroComboBox.d.ts +3 -0
- package/cjs/core/acroform/PDFAcroComboBox.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroComboBox.js +5 -0
- package/cjs/core/acroform/PDFAcroComboBox.js.map +1 -1
- package/cjs/core/acroform/PDFAcroField.d.ts +3 -0
- package/cjs/core/acroform/PDFAcroField.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroField.js +9 -4
- package/cjs/core/acroform/PDFAcroField.js.map +1 -1
- package/cjs/core/acroform/PDFAcroForm.d.ts +3 -0
- package/cjs/core/acroform/PDFAcroForm.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroForm.js +7 -4
- package/cjs/core/acroform/PDFAcroForm.js.map +1 -1
- package/cjs/core/acroform/PDFAcroListBox.d.ts +3 -0
- package/cjs/core/acroform/PDFAcroListBox.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroListBox.js +5 -0
- package/cjs/core/acroform/PDFAcroListBox.js.map +1 -1
- package/cjs/core/acroform/PDFAcroNonTerminal.d.ts +3 -0
- package/cjs/core/acroform/PDFAcroNonTerminal.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroNonTerminal.js +5 -0
- package/cjs/core/acroform/PDFAcroNonTerminal.js.map +1 -1
- package/cjs/core/acroform/PDFAcroPushButton.d.ts +3 -0
- package/cjs/core/acroform/PDFAcroPushButton.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroPushButton.js +5 -0
- package/cjs/core/acroform/PDFAcroPushButton.js.map +1 -1
- package/cjs/core/acroform/PDFAcroRadioButton.d.ts +3 -0
- package/cjs/core/acroform/PDFAcroRadioButton.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroRadioButton.js +6 -1
- package/cjs/core/acroform/PDFAcroRadioButton.js.map +1 -1
- package/cjs/core/acroform/PDFAcroSignature.d.ts +3 -0
- package/cjs/core/acroform/PDFAcroSignature.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroSignature.js +5 -0
- package/cjs/core/acroform/PDFAcroSignature.js.map +1 -1
- package/cjs/core/acroform/PDFAcroText.d.ts +3 -0
- package/cjs/core/acroform/PDFAcroText.d.ts.map +1 -1
- package/cjs/core/acroform/PDFAcroText.js +9 -5
- package/cjs/core/acroform/PDFAcroText.js.map +1 -1
- package/cjs/core/acroform/utils.d.ts.map +1 -1
- package/cjs/core/acroform/utils.js +11 -7
- package/cjs/core/acroform/utils.js.map +1 -1
- package/cjs/core/annotation/AppearanceCharacteristics.d.ts.map +1 -1
- package/cjs/core/annotation/AppearanceCharacteristics.js +12 -11
- package/cjs/core/annotation/AppearanceCharacteristics.js.map +1 -1
- package/cjs/core/annotation/BorderStyle.d.ts.map +1 -1
- package/cjs/core/annotation/BorderStyle.js +2 -2
- package/cjs/core/annotation/BorderStyle.js.map +1 -1
- package/cjs/core/annotation/PDFAnnotation.d.ts.map +1 -1
- package/cjs/core/annotation/PDFAnnotation.js +4 -3
- package/cjs/core/annotation/PDFAnnotation.js.map +1 -1
- package/cjs/core/annotation/PDFWidgetAnnotation.d.ts.map +1 -1
- package/cjs/core/annotation/PDFWidgetAnnotation.js +8 -9
- package/cjs/core/annotation/PDFWidgetAnnotation.js.map +1 -1
- package/cjs/core/crypto.d.ts +3 -0
- package/cjs/core/crypto.d.ts.map +1 -1
- package/cjs/core/crypto.js +10 -5
- package/cjs/core/crypto.js.map +1 -1
- package/cjs/core/embedders/PDFPageEmbedder.d.ts.map +1 -1
- package/cjs/core/embedders/PDFPageEmbedder.js +3 -4
- package/cjs/core/embedders/PDFPageEmbedder.js.map +1 -1
- package/cjs/core/embedders/StandardFontEmbedder.d.ts +3 -0
- package/cjs/core/embedders/StandardFontEmbedder.d.ts.map +1 -1
- package/cjs/core/embedders/StandardFontEmbedder.js +5 -0
- package/cjs/core/embedders/StandardFontEmbedder.js.map +1 -1
- package/cjs/core/interactive/ViewerPreferences.d.ts.map +1 -1
- package/cjs/core/interactive/ViewerPreferences.js +5 -6
- package/cjs/core/interactive/ViewerPreferences.js.map +1 -1
- package/cjs/core/objects/PDFArray.d.ts +3 -0
- package/cjs/core/objects/PDFArray.d.ts.map +1 -1
- package/cjs/core/objects/PDFArray.js +6 -1
- package/cjs/core/objects/PDFArray.js.map +1 -1
- package/cjs/core/objects/PDFBool.d.ts +3 -0
- package/cjs/core/objects/PDFBool.d.ts.map +1 -1
- package/cjs/core/objects/PDFBool.js +5 -0
- package/cjs/core/objects/PDFBool.js.map +1 -1
- package/cjs/core/objects/PDFDict.d.ts +3 -0
- package/cjs/core/objects/PDFDict.d.ts.map +1 -1
- package/cjs/core/objects/PDFDict.js +24 -14
- package/cjs/core/objects/PDFDict.js.map +1 -1
- package/cjs/core/objects/PDFHexString.d.ts +3 -0
- package/cjs/core/objects/PDFHexString.d.ts.map +1 -1
- package/cjs/core/objects/PDFHexString.js +5 -0
- package/cjs/core/objects/PDFHexString.js.map +1 -1
- package/cjs/core/objects/PDFInvalidObject.d.ts +3 -0
- package/cjs/core/objects/PDFInvalidObject.d.ts.map +1 -1
- package/cjs/core/objects/PDFInvalidObject.js +5 -0
- package/cjs/core/objects/PDFInvalidObject.js.map +1 -1
- package/cjs/core/objects/PDFName.d.ts +3 -0
- package/cjs/core/objects/PDFName.d.ts.map +1 -1
- package/cjs/core/objects/PDFName.js +5 -0
- package/cjs/core/objects/PDFName.js.map +1 -1
- package/cjs/core/objects/PDFNull.d.ts +3 -0
- package/cjs/core/objects/PDFNull.d.ts.map +1 -1
- package/cjs/core/objects/PDFNull.js +5 -0
- package/cjs/core/objects/PDFNull.js.map +1 -1
- package/cjs/core/objects/PDFNumber.d.ts +3 -0
- package/cjs/core/objects/PDFNumber.d.ts.map +1 -1
- package/cjs/core/objects/PDFNumber.js +5 -0
- package/cjs/core/objects/PDFNumber.js.map +1 -1
- package/cjs/core/objects/PDFObject.d.ts +3 -0
- package/cjs/core/objects/PDFObject.d.ts.map +1 -1
- package/cjs/core/objects/PDFObject.js +5 -0
- package/cjs/core/objects/PDFObject.js.map +1 -1
- package/cjs/core/objects/PDFRawStream.d.ts +3 -0
- package/cjs/core/objects/PDFRawStream.d.ts.map +1 -1
- package/cjs/core/objects/PDFRawStream.js +5 -0
- package/cjs/core/objects/PDFRawStream.js.map +1 -1
- package/cjs/core/objects/PDFRef.d.ts +3 -0
- package/cjs/core/objects/PDFRef.d.ts.map +1 -1
- package/cjs/core/objects/PDFRef.js +5 -0
- package/cjs/core/objects/PDFRef.js.map +1 -1
- package/cjs/core/objects/PDFStream.d.ts +3 -0
- package/cjs/core/objects/PDFStream.d.ts.map +1 -1
- package/cjs/core/objects/PDFStream.js +5 -0
- package/cjs/core/objects/PDFStream.js.map +1 -1
- package/cjs/core/objects/PDFString.d.ts +3 -0
- package/cjs/core/objects/PDFString.d.ts.map +1 -1
- package/cjs/core/objects/PDFString.js +5 -0
- package/cjs/core/objects/PDFString.js.map +1 -1
- package/cjs/core/operators/PDFOperator.d.ts.map +1 -1
- package/cjs/core/operators/PDFOperator.js +9 -4
- package/cjs/core/operators/PDFOperator.js.map +1 -1
- package/cjs/core/parser/PDFObjectParser.d.ts.map +1 -1
- package/cjs/core/parser/PDFObjectParser.js +2 -1
- package/cjs/core/parser/PDFObjectParser.js.map +1 -1
- package/cjs/core/parser/PDFParser.d.ts.map +1 -1
- package/cjs/core/parser/PDFParser.js +8 -7
- package/cjs/core/parser/PDFParser.js.map +1 -1
- package/cjs/core/parser/PDFXRefStreamParser.d.ts.map +1 -1
- package/cjs/core/parser/PDFXRefStreamParser.js +8 -3
- package/cjs/core/parser/PDFXRefStreamParser.js.map +1 -1
- package/cjs/core/streams/decode.d.ts.map +1 -1
- package/cjs/core/streams/decode.js +5 -5
- package/cjs/core/streams/decode.js.map +1 -1
- package/cjs/core/structures/PDFCatalog.d.ts +3 -0
- package/cjs/core/structures/PDFCatalog.d.ts.map +1 -1
- package/cjs/core/structures/PDFCatalog.js +5 -0
- package/cjs/core/structures/PDFCatalog.js.map +1 -1
- package/cjs/core/structures/PDFContentStream.d.ts +3 -0
- package/cjs/core/structures/PDFContentStream.d.ts.map +1 -1
- package/cjs/core/structures/PDFContentStream.js +5 -0
- package/cjs/core/structures/PDFContentStream.js.map +1 -1
- package/cjs/core/structures/PDFObjectStream.d.ts +3 -0
- package/cjs/core/structures/PDFObjectStream.d.ts.map +1 -1
- package/cjs/core/structures/PDFObjectStream.js +5 -0
- package/cjs/core/structures/PDFObjectStream.js.map +1 -1
- package/cjs/core/structures/PDFPageLeaf.d.ts +3 -0
- package/cjs/core/structures/PDFPageLeaf.d.ts.map +1 -1
- package/cjs/core/structures/PDFPageLeaf.js +7 -3
- package/cjs/core/structures/PDFPageLeaf.js.map +1 -1
- package/cjs/core/structures/PDFPageTree.d.ts +3 -0
- package/cjs/core/structures/PDFPageTree.d.ts.map +1 -1
- package/cjs/core/structures/PDFPageTree.js +11 -7
- package/cjs/core/structures/PDFPageTree.js.map +1 -1
- package/cjs/core/writers/PDFStreamWriter.d.ts +3 -0
- package/cjs/core/writers/PDFStreamWriter.d.ts.map +1 -1
- package/cjs/core/writers/PDFStreamWriter.js +11 -12
- package/cjs/core/writers/PDFStreamWriter.js.map +1 -1
- package/cjs/core/writers/PDFWriter.d.ts +3 -0
- package/cjs/core/writers/PDFWriter.d.ts.map +1 -1
- package/cjs/core/writers/PDFWriter.js +13 -8
- package/cjs/core/writers/PDFWriter.js.map +1 -1
- package/cjs/utils/elements/Arc.d.ts +3 -0
- package/cjs/utils/elements/Arc.d.ts.map +1 -1
- package/cjs/utils/elements/Arc.js +6 -1
- package/cjs/utils/elements/Arc.js.map +1 -1
- package/cjs/utils/elements/Circle.d.ts +3 -0
- package/cjs/utils/elements/Circle.d.ts.map +1 -1
- package/cjs/utils/elements/Circle.js +6 -1
- package/cjs/utils/elements/Circle.js.map +1 -1
- package/cjs/utils/elements/Ellipse.d.ts +3 -0
- package/cjs/utils/elements/Ellipse.d.ts.map +1 -1
- package/cjs/utils/elements/Ellipse.js +6 -1
- package/cjs/utils/elements/Ellipse.js.map +1 -1
- package/cjs/utils/elements/GraphElement.d.ts +2 -0
- package/cjs/utils/elements/GraphElement.d.ts.map +1 -1
- package/cjs/utils/elements/GraphElement.js.map +1 -1
- package/cjs/utils/elements/Line.d.ts +3 -0
- package/cjs/utils/elements/Line.d.ts.map +1 -1
- package/cjs/utils/elements/Line.js +6 -1
- package/cjs/utils/elements/Line.js.map +1 -1
- package/cjs/utils/elements/Plot.d.ts +3 -0
- package/cjs/utils/elements/Plot.d.ts.map +1 -1
- package/cjs/utils/elements/Plot.js +9 -2
- package/cjs/utils/elements/Plot.js.map +1 -1
- package/cjs/utils/elements/Point.d.ts +3 -0
- package/cjs/utils/elements/Point.d.ts.map +1 -1
- package/cjs/utils/elements/Point.js +6 -1
- package/cjs/utils/elements/Point.js.map +1 -1
- package/cjs/utils/elements/Rectangle.d.ts +3 -0
- package/cjs/utils/elements/Rectangle.d.ts.map +1 -1
- package/cjs/utils/elements/Rectangle.js +6 -1
- package/cjs/utils/elements/Rectangle.js.map +1 -1
- package/cjs/utils/elements/Segment.d.ts +3 -0
- package/cjs/utils/elements/Segment.d.ts.map +1 -1
- package/cjs/utils/elements/Segment.js +8 -4
- package/cjs/utils/elements/Segment.js.map +1 -1
- package/cjs/utils/intersections.d.ts.map +1 -1
- package/cjs/utils/intersections.js +32 -35
- package/cjs/utils/intersections.js.map +1 -1
- package/dist/pdf-lib.esm.js +4834 -4507
- package/dist/pdf-lib.esm.js.map +1 -1
- package/dist/pdf-lib.esm.min.js +3 -3
- package/dist/pdf-lib.esm.min.js.map +1 -1
- package/dist/pdf-lib.js +4834 -4506
- package/dist/pdf-lib.js.map +1 -1
- package/dist/pdf-lib.min.js +3 -3
- package/dist/pdf-lib.min.js.map +1 -1
- package/es/api/PDFDocument.d.ts +3 -0
- package/es/api/PDFDocument.d.ts.map +1 -1
- package/es/api/PDFDocument.js +27 -22
- package/es/api/PDFDocument.js.map +1 -1
- package/es/api/PDFFont.d.ts.map +1 -1
- package/es/api/PDFFont.js +4 -2
- package/es/api/PDFFont.js.map +1 -1
- package/es/api/PDFPage.d.ts.map +1 -1
- package/es/api/PDFPage.js +6 -5
- package/es/api/PDFPage.js.map +1 -1
- package/es/api/form/PDFButton.d.ts +3 -0
- package/es/api/form/PDFButton.d.ts.map +1 -1
- package/es/api/form/PDFButton.js +7 -2
- package/es/api/form/PDFButton.js.map +1 -1
- package/es/api/form/PDFCheckBox.d.ts +3 -0
- package/es/api/form/PDFCheckBox.d.ts.map +1 -1
- package/es/api/form/PDFCheckBox.js +7 -2
- package/es/api/form/PDFCheckBox.js.map +1 -1
- package/es/api/form/PDFDropdown.d.ts +3 -0
- package/es/api/form/PDFDropdown.d.ts.map +1 -1
- package/es/api/form/PDFDropdown.js +7 -2
- package/es/api/form/PDFDropdown.js.map +1 -1
- package/es/api/form/PDFField.d.ts +3 -0
- package/es/api/form/PDFField.d.ts.map +1 -1
- package/es/api/form/PDFField.js +5 -0
- package/es/api/form/PDFField.js.map +1 -1
- package/es/api/form/PDFForm.d.ts.map +1 -1
- package/es/api/form/PDFForm.js +25 -23
- package/es/api/form/PDFForm.js.map +1 -1
- package/es/api/form/PDFOptionList.d.ts +3 -0
- package/es/api/form/PDFOptionList.d.ts.map +1 -1
- package/es/api/form/PDFOptionList.js +7 -2
- package/es/api/form/PDFOptionList.js.map +1 -1
- package/es/api/form/PDFRadioGroup.d.ts +3 -0
- package/es/api/form/PDFRadioGroup.d.ts.map +1 -1
- package/es/api/form/PDFRadioGroup.js +8 -3
- package/es/api/form/PDFRadioGroup.js.map +1 -1
- package/es/api/form/PDFSignature.d.ts +3 -0
- package/es/api/form/PDFSignature.d.ts.map +1 -1
- package/es/api/form/PDFSignature.js +5 -0
- package/es/api/form/PDFSignature.js.map +1 -1
- package/es/api/form/PDFTextField.d.ts +3 -0
- package/es/api/form/PDFTextField.d.ts.map +1 -1
- package/es/api/form/PDFTextField.js +7 -2
- package/es/api/form/PDFTextField.js.map +1 -1
- package/es/api/objects.d.ts +61 -0
- package/es/api/objects.d.ts.map +1 -1
- package/es/api/objects.js +95 -3
- package/es/api/objects.js.map +1 -1
- package/es/api/operators.d.ts +28 -24
- package/es/api/operators.d.ts.map +1 -1
- package/es/api/operators.js +32 -28
- package/es/api/operators.js.map +1 -1
- package/es/api/snapshot/DefaultDocumentSnapshot.d.ts +3 -0
- package/es/api/snapshot/DefaultDocumentSnapshot.d.ts.map +1 -1
- package/es/api/snapshot/DefaultDocumentSnapshot.js +5 -0
- package/es/api/snapshot/DefaultDocumentSnapshot.js.map +1 -1
- package/es/api/snapshot/DocumentSnapshot.d.ts +2 -0
- package/es/api/snapshot/DocumentSnapshot.d.ts.map +1 -1
- package/es/api/snapshot/IncrementalDocumentSnapshot.d.ts +3 -0
- package/es/api/snapshot/IncrementalDocumentSnapshot.d.ts.map +1 -1
- package/es/api/snapshot/IncrementalDocumentSnapshot.js +5 -0
- package/es/api/snapshot/IncrementalDocumentSnapshot.js.map +1 -1
- package/es/core/PDFContext.d.ts +1 -1
- package/es/core/PDFContext.d.ts.map +1 -1
- package/es/core/PDFContext.js +57 -49
- package/es/core/PDFContext.js.map +1 -1
- package/es/core/PDFObjectCopier.d.ts.map +1 -1
- package/es/core/PDFObjectCopier.js +6 -9
- package/es/core/PDFObjectCopier.js.map +1 -1
- package/es/core/acroform/PDFAcroButton.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroButton.js +7 -3
- package/es/core/acroform/PDFAcroButton.js.map +1 -1
- package/es/core/acroform/PDFAcroCheckBox.d.ts +3 -0
- package/es/core/acroform/PDFAcroCheckBox.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroCheckBox.js +6 -1
- package/es/core/acroform/PDFAcroCheckBox.js.map +1 -1
- package/es/core/acroform/PDFAcroChoice.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroChoice.js +22 -9
- package/es/core/acroform/PDFAcroChoice.js.map +1 -1
- package/es/core/acroform/PDFAcroComboBox.d.ts +3 -0
- package/es/core/acroform/PDFAcroComboBox.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroComboBox.js +5 -0
- package/es/core/acroform/PDFAcroComboBox.js.map +1 -1
- package/es/core/acroform/PDFAcroField.d.ts +3 -0
- package/es/core/acroform/PDFAcroField.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroField.js +9 -4
- package/es/core/acroform/PDFAcroField.js.map +1 -1
- package/es/core/acroform/PDFAcroForm.d.ts +3 -0
- package/es/core/acroform/PDFAcroForm.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroForm.js +7 -4
- package/es/core/acroform/PDFAcroForm.js.map +1 -1
- package/es/core/acroform/PDFAcroListBox.d.ts +3 -0
- package/es/core/acroform/PDFAcroListBox.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroListBox.js +5 -0
- package/es/core/acroform/PDFAcroListBox.js.map +1 -1
- package/es/core/acroform/PDFAcroNonTerminal.d.ts +3 -0
- package/es/core/acroform/PDFAcroNonTerminal.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroNonTerminal.js +5 -0
- package/es/core/acroform/PDFAcroNonTerminal.js.map +1 -1
- package/es/core/acroform/PDFAcroPushButton.d.ts +3 -0
- package/es/core/acroform/PDFAcroPushButton.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroPushButton.js +5 -0
- package/es/core/acroform/PDFAcroPushButton.js.map +1 -1
- package/es/core/acroform/PDFAcroRadioButton.d.ts +3 -0
- package/es/core/acroform/PDFAcroRadioButton.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroRadioButton.js +6 -1
- package/es/core/acroform/PDFAcroRadioButton.js.map +1 -1
- package/es/core/acroform/PDFAcroSignature.d.ts +3 -0
- package/es/core/acroform/PDFAcroSignature.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroSignature.js +5 -0
- package/es/core/acroform/PDFAcroSignature.js.map +1 -1
- package/es/core/acroform/PDFAcroText.d.ts +3 -0
- package/es/core/acroform/PDFAcroText.d.ts.map +1 -1
- package/es/core/acroform/PDFAcroText.js +9 -5
- package/es/core/acroform/PDFAcroText.js.map +1 -1
- package/es/core/acroform/utils.d.ts.map +1 -1
- package/es/core/acroform/utils.js +11 -7
- package/es/core/acroform/utils.js.map +1 -1
- package/es/core/annotation/AppearanceCharacteristics.d.ts.map +1 -1
- package/es/core/annotation/AppearanceCharacteristics.js +12 -11
- package/es/core/annotation/AppearanceCharacteristics.js.map +1 -1
- package/es/core/annotation/BorderStyle.d.ts.map +1 -1
- package/es/core/annotation/BorderStyle.js +2 -2
- package/es/core/annotation/BorderStyle.js.map +1 -1
- package/es/core/annotation/PDFAnnotation.d.ts.map +1 -1
- package/es/core/annotation/PDFAnnotation.js +4 -3
- package/es/core/annotation/PDFAnnotation.js.map +1 -1
- package/es/core/annotation/PDFWidgetAnnotation.d.ts.map +1 -1
- package/es/core/annotation/PDFWidgetAnnotation.js +8 -9
- package/es/core/annotation/PDFWidgetAnnotation.js.map +1 -1
- package/es/core/crypto.d.ts +3 -0
- package/es/core/crypto.d.ts.map +1 -1
- package/es/core/crypto.js +10 -5
- package/es/core/crypto.js.map +1 -1
- package/es/core/embedders/PDFPageEmbedder.d.ts.map +1 -1
- package/es/core/embedders/PDFPageEmbedder.js +3 -4
- package/es/core/embedders/PDFPageEmbedder.js.map +1 -1
- package/es/core/embedders/StandardFontEmbedder.d.ts +3 -0
- package/es/core/embedders/StandardFontEmbedder.d.ts.map +1 -1
- package/es/core/embedders/StandardFontEmbedder.js +5 -0
- package/es/core/embedders/StandardFontEmbedder.js.map +1 -1
- package/es/core/interactive/ViewerPreferences.d.ts.map +1 -1
- package/es/core/interactive/ViewerPreferences.js +5 -6
- package/es/core/interactive/ViewerPreferences.js.map +1 -1
- package/es/core/objects/PDFArray.d.ts +3 -0
- package/es/core/objects/PDFArray.d.ts.map +1 -1
- package/es/core/objects/PDFArray.js +6 -1
- package/es/core/objects/PDFArray.js.map +1 -1
- package/es/core/objects/PDFBool.d.ts +3 -0
- package/es/core/objects/PDFBool.d.ts.map +1 -1
- package/es/core/objects/PDFBool.js +5 -0
- package/es/core/objects/PDFBool.js.map +1 -1
- package/es/core/objects/PDFDict.d.ts +3 -0
- package/es/core/objects/PDFDict.d.ts.map +1 -1
- package/es/core/objects/PDFDict.js +24 -14
- package/es/core/objects/PDFDict.js.map +1 -1
- package/es/core/objects/PDFHexString.d.ts +3 -0
- package/es/core/objects/PDFHexString.d.ts.map +1 -1
- package/es/core/objects/PDFHexString.js +5 -0
- package/es/core/objects/PDFHexString.js.map +1 -1
- package/es/core/objects/PDFInvalidObject.d.ts +3 -0
- package/es/core/objects/PDFInvalidObject.d.ts.map +1 -1
- package/es/core/objects/PDFInvalidObject.js +5 -0
- package/es/core/objects/PDFInvalidObject.js.map +1 -1
- package/es/core/objects/PDFName.d.ts +3 -0
- package/es/core/objects/PDFName.d.ts.map +1 -1
- package/es/core/objects/PDFName.js +5 -0
- package/es/core/objects/PDFName.js.map +1 -1
- package/es/core/objects/PDFNull.d.ts +3 -0
- package/es/core/objects/PDFNull.d.ts.map +1 -1
- package/es/core/objects/PDFNull.js +5 -0
- package/es/core/objects/PDFNull.js.map +1 -1
- package/es/core/objects/PDFNumber.d.ts +3 -0
- package/es/core/objects/PDFNumber.d.ts.map +1 -1
- package/es/core/objects/PDFNumber.js +5 -0
- package/es/core/objects/PDFNumber.js.map +1 -1
- package/es/core/objects/PDFObject.d.ts +3 -0
- package/es/core/objects/PDFObject.d.ts.map +1 -1
- package/es/core/objects/PDFObject.js +5 -0
- package/es/core/objects/PDFObject.js.map +1 -1
- package/es/core/objects/PDFRawStream.d.ts +3 -0
- package/es/core/objects/PDFRawStream.d.ts.map +1 -1
- package/es/core/objects/PDFRawStream.js +5 -0
- package/es/core/objects/PDFRawStream.js.map +1 -1
- package/es/core/objects/PDFRef.d.ts +3 -0
- package/es/core/objects/PDFRef.d.ts.map +1 -1
- package/es/core/objects/PDFRef.js +5 -0
- package/es/core/objects/PDFRef.js.map +1 -1
- package/es/core/objects/PDFStream.d.ts +3 -0
- package/es/core/objects/PDFStream.d.ts.map +1 -1
- package/es/core/objects/PDFStream.js +5 -0
- package/es/core/objects/PDFStream.js.map +1 -1
- package/es/core/objects/PDFString.d.ts +3 -0
- package/es/core/objects/PDFString.d.ts.map +1 -1
- package/es/core/objects/PDFString.js +5 -0
- package/es/core/objects/PDFString.js.map +1 -1
- package/es/core/operators/PDFOperator.d.ts.map +1 -1
- package/es/core/operators/PDFOperator.js +9 -4
- package/es/core/operators/PDFOperator.js.map +1 -1
- package/es/core/parser/PDFObjectParser.d.ts.map +1 -1
- package/es/core/parser/PDFObjectParser.js +2 -1
- package/es/core/parser/PDFObjectParser.js.map +1 -1
- package/es/core/parser/PDFParser.d.ts.map +1 -1
- package/es/core/parser/PDFParser.js +8 -7
- package/es/core/parser/PDFParser.js.map +1 -1
- package/es/core/parser/PDFXRefStreamParser.d.ts.map +1 -1
- package/es/core/parser/PDFXRefStreamParser.js +8 -3
- package/es/core/parser/PDFXRefStreamParser.js.map +1 -1
- package/es/core/streams/decode.d.ts.map +1 -1
- package/es/core/streams/decode.js +5 -5
- package/es/core/streams/decode.js.map +1 -1
- package/es/core/structures/PDFCatalog.d.ts +3 -0
- package/es/core/structures/PDFCatalog.d.ts.map +1 -1
- package/es/core/structures/PDFCatalog.js +5 -0
- package/es/core/structures/PDFCatalog.js.map +1 -1
- package/es/core/structures/PDFContentStream.d.ts +3 -0
- package/es/core/structures/PDFContentStream.d.ts.map +1 -1
- package/es/core/structures/PDFContentStream.js +5 -0
- package/es/core/structures/PDFContentStream.js.map +1 -1
- package/es/core/structures/PDFObjectStream.d.ts +3 -0
- package/es/core/structures/PDFObjectStream.d.ts.map +1 -1
- package/es/core/structures/PDFObjectStream.js +5 -0
- package/es/core/structures/PDFObjectStream.js.map +1 -1
- package/es/core/structures/PDFPageLeaf.d.ts +3 -0
- package/es/core/structures/PDFPageLeaf.d.ts.map +1 -1
- package/es/core/structures/PDFPageLeaf.js +7 -3
- package/es/core/structures/PDFPageLeaf.js.map +1 -1
- package/es/core/structures/PDFPageTree.d.ts +3 -0
- package/es/core/structures/PDFPageTree.d.ts.map +1 -1
- package/es/core/structures/PDFPageTree.js +11 -7
- package/es/core/structures/PDFPageTree.js.map +1 -1
- package/es/core/writers/PDFStreamWriter.d.ts +3 -0
- package/es/core/writers/PDFStreamWriter.d.ts.map +1 -1
- package/es/core/writers/PDFStreamWriter.js +11 -12
- package/es/core/writers/PDFStreamWriter.js.map +1 -1
- package/es/core/writers/PDFWriter.d.ts +3 -0
- package/es/core/writers/PDFWriter.d.ts.map +1 -1
- package/es/core/writers/PDFWriter.js +14 -9
- package/es/core/writers/PDFWriter.js.map +1 -1
- package/es/utils/elements/Arc.d.ts +3 -0
- package/es/utils/elements/Arc.d.ts.map +1 -1
- package/es/utils/elements/Arc.js +6 -1
- package/es/utils/elements/Arc.js.map +1 -1
- package/es/utils/elements/Circle.d.ts +3 -0
- package/es/utils/elements/Circle.d.ts.map +1 -1
- package/es/utils/elements/Circle.js +6 -1
- package/es/utils/elements/Circle.js.map +1 -1
- package/es/utils/elements/Ellipse.d.ts +3 -0
- package/es/utils/elements/Ellipse.d.ts.map +1 -1
- package/es/utils/elements/Ellipse.js +6 -1
- package/es/utils/elements/Ellipse.js.map +1 -1
- package/es/utils/elements/GraphElement.d.ts +2 -0
- package/es/utils/elements/GraphElement.d.ts.map +1 -1
- package/es/utils/elements/GraphElement.js.map +1 -1
- package/es/utils/elements/Line.d.ts +3 -0
- package/es/utils/elements/Line.d.ts.map +1 -1
- package/es/utils/elements/Line.js +6 -1
- package/es/utils/elements/Line.js.map +1 -1
- package/es/utils/elements/Plot.d.ts +3 -0
- package/es/utils/elements/Plot.d.ts.map +1 -1
- package/es/utils/elements/Plot.js +9 -2
- package/es/utils/elements/Plot.js.map +1 -1
- package/es/utils/elements/Point.d.ts +3 -0
- package/es/utils/elements/Point.d.ts.map +1 -1
- package/es/utils/elements/Point.js +6 -1
- package/es/utils/elements/Point.js.map +1 -1
- package/es/utils/elements/Rectangle.d.ts +3 -0
- package/es/utils/elements/Rectangle.d.ts.map +1 -1
- package/es/utils/elements/Rectangle.js +6 -1
- package/es/utils/elements/Rectangle.js.map +1 -1
- package/es/utils/elements/Segment.d.ts +3 -0
- package/es/utils/elements/Segment.d.ts.map +1 -1
- package/es/utils/elements/Segment.js +8 -4
- package/es/utils/elements/Segment.js.map +1 -1
- package/es/utils/intersections.d.ts.map +1 -1
- package/es/utils/intersections.js +32 -35
- package/es/utils/intersections.js.map +1 -1
- package/package.json +1 -1
- package/src/api/PDFDocument.ts +48 -44
- package/src/api/PDFFont.ts +5 -3
- package/src/api/PDFPage.ts +10 -6
- package/src/api/form/PDFButton.ts +10 -8
- package/src/api/form/PDFCheckBox.ts +7 -2
- package/src/api/form/PDFDropdown.ts +9 -3
- package/src/api/form/PDFField.ts +5 -0
- package/src/api/form/PDFForm.ts +53 -34
- package/src/api/form/PDFOptionList.ts +9 -3
- package/src/api/form/PDFRadioGroup.ts +8 -3
- package/src/api/form/PDFSignature.ts +5 -0
- package/src/api/form/PDFTextField.ts +9 -3
- package/src/api/objects.ts +90 -3
- package/src/api/operators.ts +32 -28
- package/src/api/snapshot/DefaultDocumentSnapshot.ts +6 -0
- package/src/api/snapshot/DocumentSnapshot.ts +3 -0
- package/src/api/snapshot/IncrementalDocumentSnapshot.ts +6 -0
- package/src/core/PDFContext.ts +77 -56
- package/src/core/PDFObjectCopier.ts +6 -5
- package/src/core/acroform/PDFAcroButton.ts +20 -10
- package/src/core/acroform/PDFAcroCheckBox.ts +6 -1
- package/src/core/acroform/PDFAcroChoice.ts +43 -17
- package/src/core/acroform/PDFAcroComboBox.ts +5 -0
- package/src/core/acroform/PDFAcroField.ts +14 -5
- package/src/core/acroform/PDFAcroForm.ts +7 -3
- package/src/core/acroform/PDFAcroListBox.ts +5 -0
- package/src/core/acroform/PDFAcroNonTerminal.ts +5 -0
- package/src/core/acroform/PDFAcroPushButton.ts +5 -0
- package/src/core/acroform/PDFAcroRadioButton.ts +6 -1
- package/src/core/acroform/PDFAcroSignature.ts +5 -0
- package/src/core/acroform/PDFAcroText.ts +12 -3
- package/src/core/acroform/utils.ts +16 -7
- package/src/core/annotation/AppearanceCharacteristics.ts +23 -8
- package/src/core/annotation/BorderStyle.ts +2 -1
- package/src/core/annotation/PDFAnnotation.ts +7 -2
- package/src/core/annotation/PDFWidgetAnnotation.ts +13 -8
- package/src/core/crypto.ts +13 -5
- package/src/core/embedders/PDFPageEmbedder.ts +5 -4
- package/src/core/embedders/StandardFontEmbedder.ts +5 -0
- package/src/core/interactive/ViewerPreferences.ts +9 -4
- package/src/core/objects/PDFArray.ts +7 -2
- package/src/core/objects/PDFBool.ts +5 -0
- package/src/core/objects/PDFDict.ts +32 -15
- package/src/core/objects/PDFHexString.ts +5 -0
- package/src/core/objects/PDFInvalidObject.ts +5 -0
- package/src/core/objects/PDFName.ts +5 -0
- package/src/core/objects/PDFNull.ts +5 -0
- package/src/core/objects/PDFNumber.ts +5 -0
- package/src/core/objects/PDFObject.ts +6 -0
- package/src/core/objects/PDFRawStream.ts +5 -0
- package/src/core/objects/PDFRef.ts +5 -0
- package/src/core/objects/PDFStream.ts +5 -0
- package/src/core/objects/PDFString.ts +5 -0
- package/src/core/operators/PDFOperator.ts +11 -5
- package/src/core/parser/PDFObjectParser.ts +3 -2
- package/src/core/parser/PDFParser.ts +13 -8
- package/src/core/parser/PDFXRefStreamParser.ts +9 -4
- package/src/core/streams/decode.ts +10 -9
- package/src/core/structures/PDFCatalog.ts +5 -0
- package/src/core/structures/PDFContentStream.ts +5 -0
- package/src/core/structures/PDFObjectStream.ts +5 -0
- package/src/core/structures/PDFPageLeaf.ts +9 -4
- package/src/core/structures/PDFPageTree.ts +28 -13
- package/src/core/writers/PDFStreamWriter.ts +11 -11
- package/src/core/writers/PDFWriter.ts +19 -12
- package/src/utils/elements/Arc.ts +9 -4
- package/src/utils/elements/Circle.ts +8 -3
- package/src/utils/elements/Ellipse.ts +9 -4
- package/src/utils/elements/GraphElement.ts +3 -0
- package/src/utils/elements/Line.ts +12 -4
- package/src/utils/elements/Plot.ts +9 -2
- package/src/utils/elements/Point.ts +7 -2
- package/src/utils/elements/Rectangle.ts +8 -3
- package/src/utils/elements/Segment.ts +10 -6
- package/src/utils/intersections.ts +81 -51
- package/ts3.4/cjs/api/PDFDocument.d.ts +3 -0
- package/ts3.4/cjs/api/form/PDFButton.d.ts +3 -0
- package/ts3.4/cjs/api/form/PDFCheckBox.d.ts +3 -0
- package/ts3.4/cjs/api/form/PDFDropdown.d.ts +3 -0
- package/ts3.4/cjs/api/form/PDFField.d.ts +3 -0
- package/ts3.4/cjs/api/form/PDFOptionList.d.ts +3 -0
- package/ts3.4/cjs/api/form/PDFRadioGroup.d.ts +3 -0
- package/ts3.4/cjs/api/form/PDFSignature.d.ts +3 -0
- package/ts3.4/cjs/api/form/PDFTextField.d.ts +3 -0
- package/ts3.4/cjs/api/objects.d.ts +61 -0
- package/ts3.4/cjs/api/operators.d.ts +28 -24
- package/ts3.4/cjs/api/snapshot/DefaultDocumentSnapshot.d.ts +3 -0
- package/ts3.4/cjs/api/snapshot/DocumentSnapshot.d.ts +2 -0
- package/ts3.4/cjs/api/snapshot/IncrementalDocumentSnapshot.d.ts +3 -0
- package/ts3.4/cjs/core/PDFContext.d.ts +1 -1
- package/ts3.4/cjs/core/acroform/PDFAcroCheckBox.d.ts +3 -0
- package/ts3.4/cjs/core/acroform/PDFAcroComboBox.d.ts +3 -0
- package/ts3.4/cjs/core/acroform/PDFAcroField.d.ts +3 -0
- package/ts3.4/cjs/core/acroform/PDFAcroForm.d.ts +3 -0
- package/ts3.4/cjs/core/acroform/PDFAcroListBox.d.ts +3 -0
- package/ts3.4/cjs/core/acroform/PDFAcroNonTerminal.d.ts +3 -0
- package/ts3.4/cjs/core/acroform/PDFAcroPushButton.d.ts +3 -0
- package/ts3.4/cjs/core/acroform/PDFAcroRadioButton.d.ts +3 -0
- package/ts3.4/cjs/core/acroform/PDFAcroSignature.d.ts +3 -0
- package/ts3.4/cjs/core/acroform/PDFAcroText.d.ts +3 -0
- package/ts3.4/cjs/core/crypto.d.ts +3 -0
- package/ts3.4/cjs/core/embedders/StandardFontEmbedder.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFArray.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFBool.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFDict.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFHexString.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFInvalidObject.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFName.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFNull.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFNumber.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFObject.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFRawStream.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFRef.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFStream.d.ts +3 -0
- package/ts3.4/cjs/core/objects/PDFString.d.ts +3 -0
- package/ts3.4/cjs/core/structures/PDFCatalog.d.ts +3 -0
- package/ts3.4/cjs/core/structures/PDFContentStream.d.ts +3 -0
- package/ts3.4/cjs/core/structures/PDFObjectStream.d.ts +3 -0
- package/ts3.4/cjs/core/structures/PDFPageLeaf.d.ts +3 -0
- package/ts3.4/cjs/core/structures/PDFPageTree.d.ts +3 -0
- package/ts3.4/cjs/core/writers/PDFStreamWriter.d.ts +3 -0
- package/ts3.4/cjs/core/writers/PDFWriter.d.ts +3 -0
- package/ts3.4/cjs/utils/elements/Arc.d.ts +3 -0
- package/ts3.4/cjs/utils/elements/Circle.d.ts +3 -0
- package/ts3.4/cjs/utils/elements/Ellipse.d.ts +3 -0
- package/ts3.4/cjs/utils/elements/GraphElement.d.ts +2 -0
- package/ts3.4/cjs/utils/elements/Line.d.ts +3 -0
- package/ts3.4/cjs/utils/elements/Plot.d.ts +3 -0
- package/ts3.4/cjs/utils/elements/Point.d.ts +3 -0
- package/ts3.4/cjs/utils/elements/Rectangle.d.ts +3 -0
- package/ts3.4/cjs/utils/elements/Segment.d.ts +3 -0
- package/ts3.4/es/api/PDFDocument.d.ts +3 -0
- package/ts3.4/es/api/form/PDFButton.d.ts +3 -0
- package/ts3.4/es/api/form/PDFCheckBox.d.ts +3 -0
- package/ts3.4/es/api/form/PDFDropdown.d.ts +3 -0
- package/ts3.4/es/api/form/PDFField.d.ts +3 -0
- package/ts3.4/es/api/form/PDFOptionList.d.ts +3 -0
- package/ts3.4/es/api/form/PDFRadioGroup.d.ts +3 -0
- package/ts3.4/es/api/form/PDFSignature.d.ts +3 -0
- package/ts3.4/es/api/form/PDFTextField.d.ts +3 -0
- package/ts3.4/es/api/objects.d.ts +61 -0
- package/ts3.4/es/api/operators.d.ts +28 -24
- package/ts3.4/es/api/snapshot/DefaultDocumentSnapshot.d.ts +3 -0
- package/ts3.4/es/api/snapshot/DocumentSnapshot.d.ts +2 -0
- package/ts3.4/es/api/snapshot/IncrementalDocumentSnapshot.d.ts +3 -0
- package/ts3.4/es/core/PDFContext.d.ts +1 -1
- package/ts3.4/es/core/acroform/PDFAcroCheckBox.d.ts +3 -0
- package/ts3.4/es/core/acroform/PDFAcroComboBox.d.ts +3 -0
- package/ts3.4/es/core/acroform/PDFAcroField.d.ts +3 -0
- package/ts3.4/es/core/acroform/PDFAcroForm.d.ts +3 -0
- package/ts3.4/es/core/acroform/PDFAcroListBox.d.ts +3 -0
- package/ts3.4/es/core/acroform/PDFAcroNonTerminal.d.ts +3 -0
- package/ts3.4/es/core/acroform/PDFAcroPushButton.d.ts +3 -0
- package/ts3.4/es/core/acroform/PDFAcroRadioButton.d.ts +3 -0
- package/ts3.4/es/core/acroform/PDFAcroSignature.d.ts +3 -0
- package/ts3.4/es/core/acroform/PDFAcroText.d.ts +3 -0
- package/ts3.4/es/core/crypto.d.ts +3 -0
- package/ts3.4/es/core/embedders/StandardFontEmbedder.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFArray.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFBool.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFDict.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFHexString.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFInvalidObject.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFName.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFNull.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFNumber.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFObject.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFRawStream.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFRef.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFStream.d.ts +3 -0
- package/ts3.4/es/core/objects/PDFString.d.ts +3 -0
- package/ts3.4/es/core/structures/PDFCatalog.d.ts +3 -0
- package/ts3.4/es/core/structures/PDFContentStream.d.ts +3 -0
- package/ts3.4/es/core/structures/PDFObjectStream.d.ts +3 -0
- package/ts3.4/es/core/structures/PDFPageLeaf.d.ts +3 -0
- package/ts3.4/es/core/structures/PDFPageTree.d.ts +3 -0
- package/ts3.4/es/core/writers/PDFStreamWriter.d.ts +3 -0
- package/ts3.4/es/core/writers/PDFWriter.d.ts +3 -0
- package/ts3.4/es/utils/elements/Arc.d.ts +3 -0
- package/ts3.4/es/utils/elements/Circle.d.ts +3 -0
- package/ts3.4/es/utils/elements/Ellipse.d.ts +3 -0
- package/ts3.4/es/utils/elements/GraphElement.d.ts +2 -0
- package/ts3.4/es/utils/elements/Line.d.ts +3 -0
- package/ts3.4/es/utils/elements/Plot.d.ts +3 -0
- package/ts3.4/es/utils/elements/Point.d.ts +3 -0
- package/ts3.4/es/utils/elements/Rectangle.d.ts +3 -0
- package/ts3.4/es/utils/elements/Segment.d.ts +3 -0
|
@@ -6,8 +6,13 @@ import PDFHexString from '../objects/PDFHexString';
|
|
|
6
6
|
import PDFName from '../objects/PDFName';
|
|
7
7
|
import PDFRef from '../objects/PDFRef';
|
|
8
8
|
import PDFAcroTerminal from './PDFAcroTerminal';
|
|
9
|
+
import { isPDFInstance, PDFClasses } from '../../api/objects';
|
|
9
10
|
|
|
10
11
|
class PDFAcroText extends PDFAcroTerminal {
|
|
12
|
+
static className = () => PDFClasses.PDFAcroText;
|
|
13
|
+
myClass(): PDFClasses {
|
|
14
|
+
return PDFClasses.PDFAcroText;
|
|
15
|
+
}
|
|
11
16
|
static fromDict = (dict: PDFDict, ref: PDFRef) => new PDFAcroText(dict, ref);
|
|
12
17
|
|
|
13
18
|
static create = (context: PDFContext) => {
|
|
@@ -21,13 +26,13 @@ class PDFAcroText extends PDFAcroTerminal {
|
|
|
21
26
|
|
|
22
27
|
MaxLen(): PDFNumber | undefined {
|
|
23
28
|
const maxLen = this.dict.lookup(PDFName.of('MaxLen'));
|
|
24
|
-
if (maxLen
|
|
29
|
+
if (isPDFInstance(maxLen, PDFClasses.PDFNumber)) return maxLen as PDFNumber;
|
|
25
30
|
return undefined;
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
Q(): PDFNumber | undefined {
|
|
29
34
|
const q = this.dict.lookup(PDFName.of('Q'));
|
|
30
|
-
if (q
|
|
35
|
+
if (isPDFInstance(q, PDFClasses.PDFNumber)) return q as PDFNumber;
|
|
31
36
|
return undefined;
|
|
32
37
|
}
|
|
33
38
|
|
|
@@ -68,7 +73,11 @@ class PDFAcroText extends PDFAcroTerminal {
|
|
|
68
73
|
|
|
69
74
|
getValue(): PDFString | PDFHexString | undefined {
|
|
70
75
|
const v = this.V();
|
|
71
|
-
if (
|
|
76
|
+
if (
|
|
77
|
+
isPDFInstance(v, PDFClasses.PDFString) ||
|
|
78
|
+
isPDFInstance(v, PDFClasses.PDFHexString)
|
|
79
|
+
)
|
|
80
|
+
return v as PDFString | PDFHexString;
|
|
72
81
|
return undefined;
|
|
73
82
|
}
|
|
74
83
|
}
|
|
@@ -18,6 +18,7 @@ import PDFAcroCheckBox from './PDFAcroCheckBox';
|
|
|
18
18
|
import PDFAcroComboBox from './PDFAcroComboBox';
|
|
19
19
|
import PDFAcroListBox from './PDFAcroListBox';
|
|
20
20
|
import { AcroButtonFlags, AcroChoiceFlags } from './flags';
|
|
21
|
+
import { isPDFInstance, PDFClasses } from '../../api/objects';
|
|
21
22
|
|
|
22
23
|
export const createPDFAcroFields = (
|
|
23
24
|
kidDicts?: PDFArray,
|
|
@@ -28,9 +29,15 @@ export const createPDFAcroFields = (
|
|
|
28
29
|
for (let idx = 0, len = kidDicts.size(); idx < len; idx++) {
|
|
29
30
|
const ref = kidDicts.get(idx);
|
|
30
31
|
const dict = kidDicts.lookup(idx);
|
|
31
|
-
// if (dict
|
|
32
|
-
if (
|
|
33
|
-
|
|
32
|
+
// if (isPDFInstance(dict, PDFClasses.PDFDict)) kids.push(PDFAcroField.fromDict(dict));
|
|
33
|
+
if (
|
|
34
|
+
isPDFInstance(ref, PDFClasses.PDFRef) &&
|
|
35
|
+
isPDFInstance(dict, PDFClasses.PDFDict)
|
|
36
|
+
) {
|
|
37
|
+
kids.push([
|
|
38
|
+
createPDFAcroField(dict as PDFDict, ref as PDFRef),
|
|
39
|
+
ref as PDFRef,
|
|
40
|
+
]);
|
|
34
41
|
}
|
|
35
42
|
}
|
|
36
43
|
|
|
@@ -65,10 +72,12 @@ export const createPDFAcroField = (
|
|
|
65
72
|
const isNonTerminalAcroField = (dict: PDFDict): boolean => {
|
|
66
73
|
const kids = dict.lookup(PDFName.of('Kids'));
|
|
67
74
|
|
|
68
|
-
if (kids
|
|
69
|
-
for (let idx = 0, len = kids.size(); idx < len; idx++) {
|
|
70
|
-
const kid = kids.lookup(idx);
|
|
71
|
-
const kidIsField =
|
|
75
|
+
if (isPDFInstance(kids, PDFClasses.PDFArray)) {
|
|
76
|
+
for (let idx = 0, len = (kids as PDFArray).size(); idx < len; idx++) {
|
|
77
|
+
const kid = (kids as PDFArray).lookup(idx);
|
|
78
|
+
const kidIsField =
|
|
79
|
+
isPDFInstance(kid, PDFClasses.PDFDict) &&
|
|
80
|
+
(kid as PDFDict).has(PDFName.of('T'));
|
|
72
81
|
if (kidIsField) return true;
|
|
73
82
|
}
|
|
74
83
|
}
|
|
@@ -4,6 +4,7 @@ import PDFNumber from '../objects/PDFNumber';
|
|
|
4
4
|
import PDFArray from '../objects/PDFArray';
|
|
5
5
|
import PDFHexString from '../objects/PDFHexString';
|
|
6
6
|
import PDFString from '../objects/PDFString';
|
|
7
|
+
import { isPDFInstance, PDFClasses } from '../../api/objects';
|
|
7
8
|
|
|
8
9
|
class AppearanceCharacteristics {
|
|
9
10
|
readonly dict: PDFDict;
|
|
@@ -17,37 +18,49 @@ class AppearanceCharacteristics {
|
|
|
17
18
|
|
|
18
19
|
R(): PDFNumber | undefined {
|
|
19
20
|
const R = this.dict.lookup(PDFName.of('R'));
|
|
20
|
-
if (R
|
|
21
|
+
if (isPDFInstance(R, PDFClasses.PDFNumber)) return R as PDFNumber;
|
|
21
22
|
return undefined;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
BC(): PDFArray | undefined {
|
|
25
26
|
const BC = this.dict.lookup(PDFName.of('BC'));
|
|
26
|
-
if (BC
|
|
27
|
+
if (isPDFInstance(BC, PDFClasses.PDFArray)) return BC as PDFArray;
|
|
27
28
|
return undefined;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
BG(): PDFArray | undefined {
|
|
31
32
|
const BG = this.dict.lookup(PDFName.of('BG'));
|
|
32
|
-
if (BG
|
|
33
|
+
if (isPDFInstance(BG, PDFClasses.PDFArray)) return BG as PDFArray;
|
|
33
34
|
return undefined;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
CA(): PDFHexString | PDFString | undefined {
|
|
37
38
|
const CA = this.dict.lookup(PDFName.of('CA'));
|
|
38
|
-
if (
|
|
39
|
+
if (
|
|
40
|
+
isPDFInstance(CA, PDFClasses.PDFHexString) ||
|
|
41
|
+
isPDFInstance(CA, PDFClasses.PDFString)
|
|
42
|
+
)
|
|
43
|
+
return CA as PDFString | PDFHexString;
|
|
39
44
|
return undefined;
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
RC(): PDFHexString | PDFString | undefined {
|
|
43
48
|
const RC = this.dict.lookup(PDFName.of('RC'));
|
|
44
|
-
if (
|
|
49
|
+
if (
|
|
50
|
+
isPDFInstance(RC, PDFClasses.PDFHexString) ||
|
|
51
|
+
isPDFInstance(RC, PDFClasses.PDFString)
|
|
52
|
+
)
|
|
53
|
+
return RC as PDFString | PDFHexString;
|
|
45
54
|
return undefined;
|
|
46
55
|
}
|
|
47
56
|
|
|
48
57
|
AC(): PDFHexString | PDFString | undefined {
|
|
49
58
|
const AC = this.dict.lookup(PDFName.of('AC'));
|
|
50
|
-
if (
|
|
59
|
+
if (
|
|
60
|
+
isPDFInstance(AC, PDFClasses.PDFHexString) ||
|
|
61
|
+
isPDFInstance(AC, PDFClasses.PDFString)
|
|
62
|
+
)
|
|
63
|
+
return AC as PDFString | PDFHexString;
|
|
51
64
|
return undefined;
|
|
52
65
|
}
|
|
53
66
|
|
|
@@ -63,7 +76,8 @@ class AppearanceCharacteristics {
|
|
|
63
76
|
const components: number[] = [];
|
|
64
77
|
for (let idx = 0, len = BC?.size(); idx < len; idx++) {
|
|
65
78
|
const component = BC.get(idx);
|
|
66
|
-
if (component
|
|
79
|
+
if (isPDFInstance(component, PDFClasses.PDFNumber))
|
|
80
|
+
components.push((component as PDFNumber).asNumber());
|
|
67
81
|
}
|
|
68
82
|
|
|
69
83
|
return components;
|
|
@@ -77,7 +91,8 @@ class AppearanceCharacteristics {
|
|
|
77
91
|
const components: number[] = [];
|
|
78
92
|
for (let idx = 0, len = BG?.size(); idx < len; idx++) {
|
|
79
93
|
const component = BG.get(idx);
|
|
80
|
-
if (component
|
|
94
|
+
if (isPDFInstance(component, PDFClasses.PDFNumber))
|
|
95
|
+
components.push((component as PDFNumber).asNumber());
|
|
81
96
|
}
|
|
82
97
|
|
|
83
98
|
return components;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isPDFInstance, PDFClasses } from '../../api/objects';
|
|
1
2
|
import PDFDict from '../objects/PDFDict';
|
|
2
3
|
import PDFName from '../objects/PDFName';
|
|
3
4
|
import PDFNumber from '../objects/PDFNumber';
|
|
@@ -14,7 +15,7 @@ class BorderStyle {
|
|
|
14
15
|
|
|
15
16
|
W(): PDFNumber | undefined {
|
|
16
17
|
const W = this.dict.lookup(PDFName.of('W'));
|
|
17
|
-
if (W
|
|
18
|
+
if (isPDFInstance(W, PDFClasses.PDFNumber)) return W as PDFNumber;
|
|
18
19
|
return undefined;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -4,6 +4,7 @@ import PDFStream from '../objects/PDFStream';
|
|
|
4
4
|
import PDFArray from '../objects/PDFArray';
|
|
5
5
|
import PDFRef from '../objects/PDFRef';
|
|
6
6
|
import PDFNumber from '../objects/PDFNumber';
|
|
7
|
+
import { isPDFInstance, PDFClasses } from '../../api/objects';
|
|
7
8
|
|
|
8
9
|
class PDFAnnotation {
|
|
9
10
|
readonly dict: PDFDict;
|
|
@@ -41,7 +42,7 @@ class PDFAnnotation {
|
|
|
41
42
|
|
|
42
43
|
getAppearanceState(): PDFName | undefined {
|
|
43
44
|
const AS = this.dict.lookup(PDFName.of('AS'));
|
|
44
|
-
if (AS
|
|
45
|
+
if (isPDFInstance(AS, PDFClasses.PDFName)) return AS as PDFName;
|
|
45
46
|
return undefined;
|
|
46
47
|
}
|
|
47
48
|
|
|
@@ -65,7 +66,11 @@ class PDFAnnotation {
|
|
|
65
66
|
getNormalAppearance(): PDFRef | PDFDict {
|
|
66
67
|
const AP = this.ensureAP();
|
|
67
68
|
const N = AP.get(PDFName.of('N'));
|
|
68
|
-
if (
|
|
69
|
+
if (
|
|
70
|
+
isPDFInstance(N, PDFClasses.PDFRef) ||
|
|
71
|
+
isPDFInstance(N, PDFClasses.PDFDict)
|
|
72
|
+
)
|
|
73
|
+
return N as PDFRef | PDFDict;
|
|
69
74
|
|
|
70
75
|
throw new Error(`Unexpected N type: ${N?.constructor.name}`);
|
|
71
76
|
}
|
|
@@ -7,6 +7,7 @@ import PDFContext from '../PDFContext';
|
|
|
7
7
|
import BorderStyle from './BorderStyle';
|
|
8
8
|
import PDFAnnotation from './PDFAnnotation';
|
|
9
9
|
import AppearanceCharacteristics from './AppearanceCharacteristics';
|
|
10
|
+
import { isPDFInstance, PDFClasses } from '../../api/objects';
|
|
10
11
|
|
|
11
12
|
class PDFWidgetAnnotation extends PDFAnnotation {
|
|
12
13
|
static fromDict = (dict: PDFDict): PDFWidgetAnnotation =>
|
|
@@ -24,25 +25,29 @@ class PDFWidgetAnnotation extends PDFAnnotation {
|
|
|
24
25
|
|
|
25
26
|
MK(): PDFDict | undefined {
|
|
26
27
|
const MK = this.dict.lookup(PDFName.of('MK'));
|
|
27
|
-
if (MK
|
|
28
|
+
if (isPDFInstance(MK, PDFClasses.PDFDict)) return MK as PDFDict;
|
|
28
29
|
return undefined;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
BS(): PDFDict | undefined {
|
|
32
33
|
const BS = this.dict.lookup(PDFName.of('BS'));
|
|
33
|
-
if (BS
|
|
34
|
+
if (isPDFInstance(BS, PDFClasses.PDFDict)) return BS as PDFDict;
|
|
34
35
|
return undefined;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
DA(): PDFString | PDFHexString | undefined {
|
|
38
39
|
const da = this.dict.lookup(PDFName.of('DA'));
|
|
39
|
-
if (
|
|
40
|
+
if (
|
|
41
|
+
isPDFInstance(da, PDFClasses.PDFString) ||
|
|
42
|
+
isPDFInstance(da, PDFClasses.PDFHexString)
|
|
43
|
+
)
|
|
44
|
+
return da as PDFString | PDFHexString;
|
|
40
45
|
return undefined;
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
P(): PDFRef | undefined {
|
|
44
49
|
const P = this.dict.get(PDFName.of('P'));
|
|
45
|
-
if (P
|
|
50
|
+
if (isPDFInstance(P, PDFClasses.PDFRef)) return P as PDFRef;
|
|
46
51
|
return undefined;
|
|
47
52
|
}
|
|
48
53
|
|
|
@@ -57,8 +62,8 @@ class PDFWidgetAnnotation extends PDFAnnotation {
|
|
|
57
62
|
getDefaultAppearance(): string | undefined {
|
|
58
63
|
const DA = this.DA();
|
|
59
64
|
|
|
60
|
-
if (DA
|
|
61
|
-
return DA.decodeText();
|
|
65
|
+
if (isPDFInstance(DA, PDFClasses.PDFHexString)) {
|
|
66
|
+
return (DA as PDFHexString).decodeText();
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
return DA?.asString();
|
|
@@ -97,8 +102,8 @@ class PDFWidgetAnnotation extends PDFAnnotation {
|
|
|
97
102
|
getOnValue(): PDFName | undefined {
|
|
98
103
|
const normal = this.getAppearances()?.normal;
|
|
99
104
|
|
|
100
|
-
if (normal
|
|
101
|
-
const keys = normal.keys();
|
|
105
|
+
if (isPDFInstance(normal, PDFClasses.PDFDict)) {
|
|
106
|
+
const keys = (normal as PDFDict).keys();
|
|
102
107
|
for (let idx = 0, len = keys.length; idx < len; idx++) {
|
|
103
108
|
const key = keys[idx];
|
|
104
109
|
if (key !== PDFName.of('Off')) return key;
|
package/src/core/crypto.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
/* tslint:disable */
|
|
16
16
|
|
|
17
|
+
import { isPDFInstance, PDFClasses } from '../api/objects';
|
|
17
18
|
import { arrayAsString, isArrayEqual } from '../utils/arrays';
|
|
18
19
|
import { stringAsByteArray } from '../utils/strings';
|
|
19
20
|
import PDFBool from './objects/PDFBool';
|
|
@@ -701,6 +702,10 @@ class NullCipher {
|
|
|
701
702
|
}
|
|
702
703
|
|
|
703
704
|
class AESBaseCipher {
|
|
705
|
+
static className = () => PDFClasses.AESBaseCipher;
|
|
706
|
+
myClass(): PDFClasses {
|
|
707
|
+
return PDFClasses.AESBaseCipher;
|
|
708
|
+
}
|
|
704
709
|
protected _s: Uint8Array;
|
|
705
710
|
protected _keySize!: number;
|
|
706
711
|
protected _key!: Uint8Array;
|
|
@@ -1475,7 +1480,7 @@ class CipherTransform {
|
|
|
1475
1480
|
|
|
1476
1481
|
encryptString(s: string) {
|
|
1477
1482
|
const cipher = this.StringCipherConstructor();
|
|
1478
|
-
if (cipher
|
|
1483
|
+
if (isPDFInstance(cipher, PDFClasses.AESBaseCipher)) {
|
|
1479
1484
|
// Append some chars equal to "16 - (M mod 16)"
|
|
1480
1485
|
// where M is the string length (see section 7.6.2 in PDF specification)
|
|
1481
1486
|
// to have a final string where the length is a multiple of 16.
|
|
@@ -1507,7 +1512,7 @@ class CipherTransform {
|
|
|
1507
1512
|
}
|
|
1508
1513
|
|
|
1509
1514
|
let data = stringAsByteArray(s);
|
|
1510
|
-
data = cipher.encrypt(data);
|
|
1515
|
+
data = (cipher as NullCipher).encrypt(data);
|
|
1511
1516
|
return arrayAsString(data);
|
|
1512
1517
|
}
|
|
1513
1518
|
}
|
|
@@ -1559,7 +1564,10 @@ class CipherTransformFactory {
|
|
|
1559
1564
|
// Trying to find default handler -- it usually has Length.
|
|
1560
1565
|
const cfDict = dict.get(PDFName.of('CF')) as PDFDict;
|
|
1561
1566
|
const streamCryptoName = dict.get(PDFName.of('StmF')) as PDFName;
|
|
1562
|
-
if (
|
|
1567
|
+
if (
|
|
1568
|
+
isPDFInstance(cfDict, PDFClasses.PDFDict) &&
|
|
1569
|
+
isPDFInstance(streamCryptoName, PDFClasses.PDFName)
|
|
1570
|
+
) {
|
|
1563
1571
|
cfDict.suppressEncryption = true;
|
|
1564
1572
|
const handlerDict = cfDict.get(
|
|
1565
1573
|
PDFName.of(streamCryptoName.asString()),
|
|
@@ -1686,7 +1694,7 @@ class CipherTransformFactory {
|
|
|
1686
1694
|
|
|
1687
1695
|
if (algorithm >= 4) {
|
|
1688
1696
|
const cf = dict.get(PDFName.of('CF')) as PDFDict;
|
|
1689
|
-
if (cf
|
|
1697
|
+
if (isPDFInstance(cf, PDFClasses.PDFDict)) {
|
|
1690
1698
|
// The 'CF' dictionary itself should not be encrypted, and by setting
|
|
1691
1699
|
// `suppressEncryption` we can prevent an infinite loop inside of
|
|
1692
1700
|
// `XRef_fetchUncompressed` if the dictionary contains indirect
|
|
@@ -1948,7 +1956,7 @@ class CipherTransformFactory {
|
|
|
1948
1956
|
gen: number,
|
|
1949
1957
|
key: Uint8Array,
|
|
1950
1958
|
) {
|
|
1951
|
-
if (!(name
|
|
1959
|
+
if (!isPDFInstance(name, PDFClasses.PDFName)) {
|
|
1952
1960
|
throw new Error('Invalid crypt filter name.');
|
|
1953
1961
|
}
|
|
1954
1962
|
const cryptFilter = cf.get(
|
|
@@ -14,6 +14,7 @@ import PDFPageLeaf from '../structures/PDFPageLeaf';
|
|
|
14
14
|
import CharCodes from '../syntax/CharCodes';
|
|
15
15
|
import { TransformationMatrix } from '../../types/matrix';
|
|
16
16
|
import { mergeIntoTypedArray } from '../../utils';
|
|
17
|
+
import { isPDFInstance, PDFClasses } from '../../api/objects';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Represents a page bounding box.
|
|
@@ -125,10 +126,10 @@ class PDFPageEmbedder {
|
|
|
125
126
|
const stream = contents.lookup(idx, PDFStream);
|
|
126
127
|
|
|
127
128
|
let content: Uint8Array;
|
|
128
|
-
if (stream
|
|
129
|
-
content = decodePDFRawStream(stream).decode();
|
|
130
|
-
} else if (stream
|
|
131
|
-
content = stream.getUnencodedContents();
|
|
129
|
+
if (isPDFInstance(stream, PDFClasses.PDFRawStream)) {
|
|
130
|
+
content = decodePDFRawStream(stream as PDFRawStream).decode();
|
|
131
|
+
} else if (isPDFInstance(stream, PDFClasses.PDFContentStream)) {
|
|
132
|
+
content = (stream as PDFContentStream).getUnencodedContents();
|
|
132
133
|
} else {
|
|
133
134
|
throw new UnrecognizedStreamTypeError(stream);
|
|
134
135
|
}
|
|
@@ -9,6 +9,7 @@ import PDFHexString from '../objects/PDFHexString';
|
|
|
9
9
|
import PDFRef from '../objects/PDFRef';
|
|
10
10
|
import PDFContext from '../PDFContext';
|
|
11
11
|
import { toCodePoint, toHexString } from '../../utils';
|
|
12
|
+
import { PDFClasses } from '../../api/objects';
|
|
12
13
|
|
|
13
14
|
export interface Glyph {
|
|
14
15
|
code: number;
|
|
@@ -21,6 +22,10 @@ export interface Glyph {
|
|
|
21
22
|
* https://github.com/foliojs/pdfkit/blob/f91bdd61c164a72ea06be1a43dc0a412afc3925f/lib/font/afm.coffee
|
|
22
23
|
*/
|
|
23
24
|
class StandardFontEmbedder {
|
|
25
|
+
static className = () => PDFClasses.StandardFontEmbedder;
|
|
26
|
+
myClass(): PDFClasses {
|
|
27
|
+
return PDFClasses.StandardFontEmbedder;
|
|
28
|
+
}
|
|
24
29
|
static for = (fontName: FontNames, customName?: string) =>
|
|
25
30
|
new StandardFontEmbedder(fontName, customName);
|
|
26
31
|
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
assertIsOneOf,
|
|
11
11
|
assertRange,
|
|
12
12
|
} from '../../utils';
|
|
13
|
+
import { isPDFInstance, PDFClasses } from '../../api/objects';
|
|
13
14
|
|
|
14
15
|
const asEnum = <T extends string | number, U extends { [key: string]: T }>(
|
|
15
16
|
rawValue: T | undefined,
|
|
@@ -115,13 +116,15 @@ class ViewerPreferences {
|
|
|
115
116
|
|
|
116
117
|
protected lookupBool(key: BoolViewerPrefKey): PDFBool | undefined {
|
|
117
118
|
const returnObj = this.dict.lookup(PDFName.of(key));
|
|
118
|
-
if (returnObj
|
|
119
|
+
if (isPDFInstance(returnObj, PDFClasses.PDFBool))
|
|
120
|
+
return returnObj as PDFBool;
|
|
119
121
|
return undefined;
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
protected lookupName(key: NameViewerPrefKey): PDFName | undefined {
|
|
123
125
|
const returnObj = this.dict.lookup(PDFName.of(key));
|
|
124
|
-
if (returnObj
|
|
126
|
+
if (isPDFInstance(returnObj, PDFClasses.PDFName))
|
|
127
|
+
return returnObj as PDFName;
|
|
125
128
|
return undefined;
|
|
126
129
|
}
|
|
127
130
|
|
|
@@ -183,14 +186,16 @@ class ViewerPreferences {
|
|
|
183
186
|
/** @ignore */
|
|
184
187
|
PrintPageRange(): PDFArray | undefined {
|
|
185
188
|
const PrintPageRange = this.dict.lookup(PDFName.of('PrintPageRange'));
|
|
186
|
-
if (PrintPageRange
|
|
189
|
+
if (isPDFInstance(PrintPageRange, PDFClasses.PDFArray))
|
|
190
|
+
return PrintPageRange as PDFArray;
|
|
187
191
|
return undefined;
|
|
188
192
|
}
|
|
189
193
|
|
|
190
194
|
/** @ignore */
|
|
191
195
|
NumCopies(): PDFNumber | undefined {
|
|
192
196
|
const NumCopies = this.dict.lookup(PDFName.of('NumCopies'));
|
|
193
|
-
if (NumCopies
|
|
197
|
+
if (isPDFInstance(NumCopies, PDFClasses.PDFNumber))
|
|
198
|
+
return NumCopies as PDFNumber;
|
|
194
199
|
return undefined;
|
|
195
200
|
}
|
|
196
201
|
|
|
@@ -12,8 +12,13 @@ import PDFContext from '../PDFContext';
|
|
|
12
12
|
import CharCodes from '../syntax/CharCodes';
|
|
13
13
|
import { PDFArrayIsNotRectangleError } from '../errors';
|
|
14
14
|
import PDFRawStream from './PDFRawStream';
|
|
15
|
+
import { isPDFInstance, PDFClasses } from '../../api/objects';
|
|
15
16
|
|
|
16
17
|
class PDFArray extends PDFObject {
|
|
18
|
+
static className = () => PDFClasses.PDFArray;
|
|
19
|
+
myClass(): PDFClasses {
|
|
20
|
+
return PDFClasses.PDFArray;
|
|
21
|
+
}
|
|
17
22
|
static withContext = (context: PDFContext) => new PDFArray(context);
|
|
18
23
|
|
|
19
24
|
private readonly array: PDFObject[];
|
|
@@ -178,9 +183,9 @@ class PDFArray extends PDFObject {
|
|
|
178
183
|
scalePDFNumbers(x: number, y: number): void {
|
|
179
184
|
for (let idx = 0, len = this.size(); idx < len; idx++) {
|
|
180
185
|
const el = this.lookup(idx);
|
|
181
|
-
if (el
|
|
186
|
+
if (isPDFInstance(el, PDFClasses.PDFNumber)) {
|
|
182
187
|
const factor = idx % 2 === 0 ? x : y;
|
|
183
|
-
this.set(idx, PDFNumber.of(el.asNumber() * factor));
|
|
188
|
+
this.set(idx, PDFNumber.of((el as PDFNumber).asNumber() * factor));
|
|
184
189
|
}
|
|
185
190
|
}
|
|
186
191
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { PrivateConstructorError } from '../errors';
|
|
2
2
|
import PDFObject from './PDFObject';
|
|
3
3
|
import CharCodes from '../syntax/CharCodes';
|
|
4
|
+
import { PDFClasses } from '../../api/objects';
|
|
4
5
|
|
|
5
6
|
const ENFORCER = {};
|
|
6
7
|
|
|
7
8
|
class PDFBool extends PDFObject {
|
|
9
|
+
static className = () => PDFClasses.PDFBool;
|
|
10
|
+
myClass(): PDFClasses {
|
|
11
|
+
return PDFClasses.PDFBool;
|
|
12
|
+
}
|
|
8
13
|
static readonly True = new PDFBool(ENFORCER, true);
|
|
9
14
|
static readonly False = new PDFBool(ENFORCER, false);
|
|
10
15
|
|
|
@@ -10,10 +10,17 @@ import PDFStream from './PDFStream';
|
|
|
10
10
|
import PDFString from './PDFString';
|
|
11
11
|
import PDFContext from '../PDFContext';
|
|
12
12
|
import CharCodes from '../syntax/CharCodes';
|
|
13
|
+
import { isPDFInstance, PDFClasses } from '../../api/objects';
|
|
13
14
|
|
|
14
15
|
export type DictMap = Map<PDFName, PDFObject>;
|
|
16
|
+
// dictionary keys must be unique, using PDFName does not guarantee that
|
|
17
|
+
type InternalDictMap = Map<string, [PDFName, PDFObject]>;
|
|
15
18
|
|
|
16
19
|
class PDFDict extends PDFObject {
|
|
20
|
+
static className = () => PDFClasses.PDFDict;
|
|
21
|
+
myClass(): PDFClasses {
|
|
22
|
+
return PDFClasses.PDFDict;
|
|
23
|
+
}
|
|
17
24
|
static withContext = (context: PDFContext) => new PDFDict(new Map(), context);
|
|
18
25
|
|
|
19
26
|
static fromMapWithContext = (map: DictMap, context: PDFContext) =>
|
|
@@ -21,31 +28,33 @@ class PDFDict extends PDFObject {
|
|
|
21
28
|
|
|
22
29
|
readonly context: PDFContext;
|
|
23
30
|
|
|
24
|
-
private readonly dict:
|
|
31
|
+
private readonly dict: InternalDictMap;
|
|
25
32
|
|
|
26
33
|
suppressEncryption: boolean = false;
|
|
27
34
|
|
|
28
35
|
protected constructor(map: DictMap, context: PDFContext) {
|
|
29
36
|
super();
|
|
30
|
-
this.dict =
|
|
37
|
+
this.dict = new Map(
|
|
38
|
+
Array.from(map.entries()).map((entry) => [entry[0].toString(), entry]),
|
|
39
|
+
);
|
|
31
40
|
this.context = context;
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
keys(): PDFName[] {
|
|
35
|
-
return Array.from(this.dict.
|
|
44
|
+
return Array.from(this.dict.values()).map((value) => value[0]);
|
|
36
45
|
}
|
|
37
46
|
|
|
38
47
|
values(): PDFObject[] {
|
|
39
|
-
return Array.from(this.dict.values());
|
|
48
|
+
return Array.from(this.dict.values()).map((value) => value[1]);
|
|
40
49
|
}
|
|
41
50
|
|
|
42
51
|
entries(): [PDFName, PDFObject][] {
|
|
43
|
-
return Array.from(this.dict.
|
|
52
|
+
return Array.from(this.dict.values());
|
|
44
53
|
}
|
|
45
54
|
|
|
46
55
|
set(key: PDFName, value: PDFObject): void {
|
|
47
56
|
this.registerChange();
|
|
48
|
-
this.dict.set(key, value);
|
|
57
|
+
this.dict.set(key.asString(), [key, value]);
|
|
49
58
|
}
|
|
50
59
|
|
|
51
60
|
get(
|
|
@@ -54,14 +63,20 @@ class PDFDict extends PDFObject {
|
|
|
54
63
|
// removed in next breaking API change.
|
|
55
64
|
preservePDFNull = false,
|
|
56
65
|
): PDFObject | undefined {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
if (!key.asString) return undefined;
|
|
67
|
+
const value = this.dict.get(key.asString());
|
|
68
|
+
if (
|
|
69
|
+
!value ||
|
|
70
|
+
(isPDFInstance(value[1], PDFClasses.PDFNull) && !preservePDFNull)
|
|
71
|
+
)
|
|
72
|
+
return undefined;
|
|
73
|
+
return value[1];
|
|
60
74
|
}
|
|
61
75
|
|
|
62
76
|
has(key: PDFName): boolean {
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
if (!key.asString) return false;
|
|
78
|
+
const value = this.dict.get(key.asString());
|
|
79
|
+
return value !== undefined && !isPDFInstance(value[1], PDFClasses.PDFNull);
|
|
65
80
|
}
|
|
66
81
|
|
|
67
82
|
lookupMaybe(key: PDFName, type: typeof PDFArray): PDFArray | undefined;
|
|
@@ -105,7 +120,8 @@ class PDFDict extends PDFObject {
|
|
|
105
120
|
...types,
|
|
106
121
|
) as any;
|
|
107
122
|
|
|
108
|
-
if (value
|
|
123
|
+
if (isPDFInstance(value, PDFClasses.PDFNull) && !preservePDFNull)
|
|
124
|
+
return undefined;
|
|
109
125
|
|
|
110
126
|
return value;
|
|
111
127
|
}
|
|
@@ -149,18 +165,19 @@ class PDFDict extends PDFObject {
|
|
|
149
165
|
...types,
|
|
150
166
|
) as any;
|
|
151
167
|
|
|
152
|
-
if (value
|
|
168
|
+
if (isPDFInstance(value, PDFClasses.PDFNull) && !preservePDFNull)
|
|
169
|
+
return undefined;
|
|
153
170
|
|
|
154
171
|
return value;
|
|
155
172
|
}
|
|
156
173
|
|
|
157
174
|
delete(key: PDFName): boolean {
|
|
158
175
|
this.registerChange();
|
|
159
|
-
return this.dict.delete(key);
|
|
176
|
+
return this.dict.delete(key.asString());
|
|
160
177
|
}
|
|
161
178
|
|
|
162
179
|
asMap(): Map<PDFName, PDFObject> {
|
|
163
|
-
return new Map(this.dict);
|
|
180
|
+
return new Map(this.dict.values());
|
|
164
181
|
}
|
|
165
182
|
|
|
166
183
|
/** Generate a random key that doesn't exist in current key set */
|
|
@@ -11,8 +11,13 @@ import {
|
|
|
11
11
|
byteArrayToHexString,
|
|
12
12
|
} from '../../utils';
|
|
13
13
|
import { InvalidPDFDateStringError } from '../errors';
|
|
14
|
+
import { PDFClasses } from '../../api/objects';
|
|
14
15
|
|
|
15
16
|
class PDFHexString extends PDFObject {
|
|
17
|
+
static className = () => PDFClasses.PDFHexString;
|
|
18
|
+
myClass(): PDFClasses {
|
|
19
|
+
return PDFClasses.PDFHexString;
|
|
20
|
+
}
|
|
16
21
|
static of = (value: string) => new PDFHexString(value);
|
|
17
22
|
|
|
18
23
|
static fromText = (value: string) => {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { PDFClasses } from '../../api/objects';
|
|
1
2
|
import PDFObject from './PDFObject';
|
|
2
3
|
|
|
3
4
|
class PDFInvalidObject extends PDFObject {
|
|
5
|
+
static className = () => PDFClasses.PDFInvalidObject;
|
|
6
|
+
myClass(): PDFClasses {
|
|
7
|
+
return PDFClasses.PDFInvalidObject;
|
|
8
|
+
}
|
|
4
9
|
static of = (data: Uint8Array) => new PDFInvalidObject(data);
|
|
5
10
|
|
|
6
11
|
private readonly data: Uint8Array;
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
toCharCode,
|
|
9
9
|
toHexString,
|
|
10
10
|
} from '../../utils';
|
|
11
|
+
import { PDFClasses } from '../../api/objects';
|
|
11
12
|
|
|
12
13
|
const decodeName = (name: string) =>
|
|
13
14
|
name.replace(/#([\dABCDEF]{2})/g, (_, hex) => charFromHexCode(hex));
|
|
@@ -21,6 +22,10 @@ const ENFORCER = {};
|
|
|
21
22
|
const pool = new Map<string, PDFName>();
|
|
22
23
|
|
|
23
24
|
class PDFName extends PDFObject {
|
|
25
|
+
static className = () => PDFClasses.PDFName;
|
|
26
|
+
myClass(): PDFClasses {
|
|
27
|
+
return PDFClasses.PDFName;
|
|
28
|
+
}
|
|
24
29
|
static of = (name: string): PDFName => {
|
|
25
30
|
const decodedValue = decodeName(name);
|
|
26
31
|
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import PDFObject from './PDFObject';
|
|
2
2
|
import CharCodes from '../syntax/CharCodes';
|
|
3
|
+
import { PDFClasses } from '../../api/objects';
|
|
3
4
|
|
|
4
5
|
class PDFNull extends PDFObject {
|
|
6
|
+
static className = () => PDFClasses.PDFNull;
|
|
7
|
+
myClass(): PDFClasses {
|
|
8
|
+
return PDFClasses.PDFNull;
|
|
9
|
+
}
|
|
5
10
|
asNull(): null {
|
|
6
11
|
return null;
|
|
7
12
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { PDFClasses } from '../../api/objects';
|
|
1
2
|
import { copyStringIntoBuffer, numberToString } from '../../utils/index';
|
|
2
3
|
|
|
3
4
|
import PDFObject from './PDFObject';
|
|
4
5
|
|
|
5
6
|
class PDFNumber extends PDFObject {
|
|
7
|
+
static className = () => PDFClasses.PDFNumber;
|
|
8
|
+
myClass(): PDFClasses {
|
|
9
|
+
return PDFClasses.PDFNumber;
|
|
10
|
+
}
|
|
6
11
|
static of = (value: number) => new PDFNumber(value);
|
|
7
12
|
|
|
8
13
|
private readonly numberValue: number;
|