pdf-lite 1.0.4 → 1.0.6
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/EXAMPLES.md +37 -87
- package/README.md +104 -144
- package/dist/acroform/acroform-manager.d.ts +49 -0
- package/dist/acroform/acroform-manager.js +215 -0
- package/dist/acroform/index.d.ts +1 -0
- package/dist/acroform/index.js +1 -0
- package/dist/core/generators.d.ts +2 -2
- package/dist/core/generators.js +3 -3
- package/dist/core/incremental-parser.d.ts +1 -1
- package/dist/core/incremental-parser.js +1 -1
- package/dist/core/objects/pdf-array.d.ts +3 -3
- package/dist/core/objects/pdf-array.js +4 -4
- package/dist/core/objects/pdf-boolean.d.ts +2 -2
- package/dist/core/objects/pdf-boolean.js +2 -2
- package/dist/core/objects/pdf-comment.d.ts +3 -3
- package/dist/core/objects/pdf-comment.js +4 -4
- package/dist/core/objects/pdf-date.d.ts +1 -1
- package/dist/core/objects/pdf-date.js +1 -1
- package/dist/core/objects/pdf-dictionary.d.ts +3 -3
- package/dist/core/objects/pdf-dictionary.js +5 -5
- package/dist/core/objects/pdf-hexadecimal.d.ts +3 -3
- package/dist/core/objects/pdf-hexadecimal.js +6 -6
- package/dist/core/objects/pdf-indirect-object.d.ts +5 -5
- package/dist/core/objects/pdf-indirect-object.js +9 -9
- package/dist/core/objects/pdf-name.d.ts +2 -2
- package/dist/core/objects/pdf-name.js +2 -2
- package/dist/core/objects/pdf-null.d.ts +2 -2
- package/dist/core/objects/pdf-null.js +2 -2
- package/dist/core/objects/pdf-number.d.ts +3 -3
- package/dist/core/objects/pdf-number.js +3 -3
- package/dist/core/objects/pdf-object-reference.d.ts +2 -2
- package/dist/core/objects/pdf-object-reference.js +2 -2
- package/dist/core/objects/pdf-start-xref.d.ts +4 -4
- package/dist/core/objects/pdf-start-xref.js +4 -4
- package/dist/core/objects/pdf-stream.d.ts +9 -8
- package/dist/core/objects/pdf-stream.js +39 -26
- package/dist/core/objects/pdf-string.d.ts +3 -3
- package/dist/core/objects/pdf-string.js +4 -4
- package/dist/core/objects/pdf-trailer.d.ts +8 -8
- package/dist/core/objects/pdf-trailer.js +6 -6
- package/dist/core/objects/pdf-xref-table.d.ts +7 -7
- package/dist/core/objects/pdf-xref-table.js +8 -8
- package/dist/core/serializer.d.ts +3 -3
- package/dist/core/serializer.js +2 -2
- package/dist/core/streams/object-stream.d.ts +3 -3
- package/dist/core/streams/object-stream.js +2 -2
- package/dist/core/tokens/boolean-token.d.ts +1 -1
- package/dist/core/tokens/boolean-token.js +1 -1
- package/dist/core/tokens/byte-offset-token.d.ts +2 -2
- package/dist/core/tokens/byte-offset-token.js +2 -2
- package/dist/core/tokens/comment-token.d.ts +2 -2
- package/dist/core/tokens/comment-token.js +4 -4
- package/dist/core/tokens/end-array-token.d.ts +1 -1
- package/dist/core/tokens/end-array-token.js +2 -2
- package/dist/core/tokens/end-dictionary-token.d.ts +1 -1
- package/dist/core/tokens/end-dictionary-token.js +2 -2
- package/dist/core/tokens/end-object-token.d.ts +1 -1
- package/dist/core/tokens/end-object-token.js +2 -2
- package/dist/core/tokens/end-stream-token.d.ts +2 -2
- package/dist/core/tokens/end-stream-token.js +2 -2
- package/dist/core/tokens/hexadecimal-token.d.ts +2 -2
- package/dist/core/tokens/hexadecimal-token.js +2 -2
- package/dist/core/tokens/name-token.d.ts +1 -1
- package/dist/core/tokens/name-token.js +2 -2
- package/dist/core/tokens/null-token.d.ts +1 -1
- package/dist/core/tokens/null-token.js +2 -2
- package/dist/core/tokens/number-token.d.ts +3 -3
- package/dist/core/tokens/number-token.js +3 -3
- package/dist/core/tokens/object-reference-token.d.ts +1 -1
- package/dist/core/tokens/object-reference-token.js +2 -2
- package/dist/core/tokens/start-array-token.d.ts +1 -1
- package/dist/core/tokens/start-array-token.js +2 -2
- package/dist/core/tokens/start-dictionary-token.d.ts +1 -1
- package/dist/core/tokens/start-dictionary-token.js +2 -2
- package/dist/core/tokens/start-object-token.d.ts +1 -1
- package/dist/core/tokens/start-object-token.js +2 -2
- package/dist/core/tokens/start-stream-token.d.ts +3 -3
- package/dist/core/tokens/start-stream-token.js +3 -3
- package/dist/core/tokens/start-xref-token.d.ts +1 -1
- package/dist/core/tokens/start-xref-token.js +2 -2
- package/dist/core/tokens/stream-chunk-token.d.ts +2 -2
- package/dist/core/tokens/stream-chunk-token.js +1 -1
- package/dist/core/tokens/string-token.d.ts +2 -2
- package/dist/core/tokens/string-token.js +3 -3
- package/dist/core/tokens/token.d.ts +1 -1
- package/dist/core/tokens/token.js +1 -1
- package/dist/core/tokens/trailer-token.d.ts +1 -1
- package/dist/core/tokens/trailer-token.js +2 -2
- package/dist/core/tokens/whitespace-token.d.ts +2 -2
- package/dist/core/tokens/whitespace-token.js +1 -1
- package/dist/core/tokens/xref-table-entry-token.d.ts +3 -3
- package/dist/core/tokens/xref-table-entry-token.js +2 -2
- package/dist/core/tokens/xref-table-section-start-token.d.ts +2 -2
- package/dist/core/tokens/xref-table-section-start-token.js +3 -3
- package/dist/core/tokens/xref-table-start-token.d.ts +1 -1
- package/dist/core/tokens/xref-table-start-token.js +2 -2
- package/dist/crypto/key-derivation/key-derivation-aes256.d.ts +1 -1
- package/dist/crypto/key-derivation/key-derivation-aes256.js +2 -2
- package/dist/crypto/key-gen/key-gen-rc4-128.d.ts +1 -1
- package/dist/crypto/key-gen/key-gen-rc4-128.js +5 -5
- package/dist/crypto/types.d.ts +1 -1
- package/dist/filters/asciihex.d.ts +1 -1
- package/dist/filters/asciihex.js +2 -2
- package/dist/filters/lzw.d.ts +1 -1
- package/dist/filters/types.d.ts +1 -1
- package/dist/pdf/pdf-document.d.ts +28 -14
- package/dist/pdf/pdf-document.js +60 -21
- package/dist/pdf/pdf-reader.d.ts +3 -3
- package/dist/pdf/pdf-reader.js +2 -2
- package/dist/pdf/pdf-revision.d.ts +5 -5
- package/dist/pdf/pdf-revision.js +4 -4
- package/dist/pdf/pdf-xref-lookup.d.ts +7 -7
- package/dist/pdf/pdf-xref-lookup.js +11 -10
- package/dist/security/crypt-filters/aesv2.d.ts +2 -2
- package/dist/security/crypt-filters/aesv2.js +2 -2
- package/dist/security/crypt-filters/aesv3.d.ts +2 -2
- package/dist/security/crypt-filters/aesv3.js +2 -2
- package/dist/security/crypt-filters/base.d.ts +4 -4
- package/dist/security/crypt-filters/base.js +3 -3
- package/dist/security/crypt-filters/identity.d.ts +2 -2
- package/dist/security/crypt-filters/identity.js +1 -1
- package/dist/security/crypt-filters/v2.d.ts +1 -1
- package/dist/security/crypt-filters/v2.js +1 -1
- package/dist/security/handlers/base.d.ts +4 -4
- package/dist/security/handlers/base.js +12 -12
- package/dist/security/handlers/pubSec.d.ts +3 -3
- package/dist/security/handlers/pubSec.js +10 -10
- package/dist/security/handlers/utils.d.ts +4 -4
- package/dist/security/handlers/utils.js +12 -12
- package/dist/security/handlers/v1.d.ts +4 -4
- package/dist/security/handlers/v1.js +7 -7
- package/dist/security/handlers/v2.d.ts +3 -3
- package/dist/security/handlers/v2.js +5 -5
- package/dist/security/handlers/v4.d.ts +6 -6
- package/dist/security/handlers/v4.js +11 -11
- package/dist/security/handlers/v5.d.ts +5 -5
- package/dist/security/handlers/v5.js +9 -9
- package/dist/security/types.d.ts +9 -9
- package/dist/signing/document-security-store.d.ts +11 -11
- package/dist/signing/document-security-store.js +4 -4
- package/dist/signing/signatures/adbe-pkcs7-detached.d.ts +4 -4
- package/dist/signing/signatures/adbe-pkcs7-detached.js +11 -11
- package/dist/signing/signatures/adbe-pkcs7-sha1.d.ts +4 -4
- package/dist/signing/signatures/adbe-pkcs7-sha1.js +12 -12
- package/dist/signing/signatures/adbe-x509-rsa-sha1.d.ts +4 -4
- package/dist/signing/signatures/adbe-x509-rsa-sha1.js +8 -8
- package/dist/signing/signatures/base.d.ts +5 -5
- package/dist/signing/signatures/base.js +11 -11
- package/dist/signing/signatures/etsi-cades-detached.d.ts +4 -4
- package/dist/signing/signatures/etsi-cades-detached.js +17 -17
- package/dist/signing/signatures/etsi-rfc3161.d.ts +2 -2
- package/dist/signing/signatures/etsi-rfc3161.js +9 -9
- package/dist/signing/signatures/index.d.ts +6 -6
- package/dist/signing/signatures/index.js +6 -6
- package/dist/signing/signer.d.ts +3 -3
- package/dist/signing/signer.js +10 -10
- package/dist/signing/types.d.ts +7 -7
- package/dist/signing/utils.d.ts +2 -2
- package/dist/signing/utils.js +1 -1
- package/dist/utils/algos.js +1 -1
- package/dist/utils/bytesToHex.d.ts +1 -1
- package/dist/utils/bytesToHex.js +2 -2
- package/dist/utils/bytesToHexBytes.d.ts +1 -1
- package/dist/utils/bytesToString.d.ts +1 -1
- package/dist/utils/concatUint8Arrays.d.ts +1 -1
- package/dist/utils/escapeString.d.ts +1 -1
- package/dist/utils/escapeString.js +1 -1
- package/dist/utils/hexBytesToBytes.d.ts +1 -1
- package/dist/utils/hexBytesToString.d.ts +1 -1
- package/dist/utils/hexToBytes.d.ts +1 -1
- package/dist/utils/hexToBytes.js +2 -2
- package/dist/utils/padBytes.d.ts +1 -1
- package/dist/utils/replaceInBuffer.d.ts +1 -1
- package/dist/utils/stringToBytes.d.ts +1 -1
- package/dist/utils/stringToHexBytes.d.ts +1 -1
- package/dist/utils/unescapeString.d.ts +1 -1
- package/dist/xfa/index.d.ts +1 -0
- package/dist/xfa/index.js +1 -0
- package/dist/xfa/xfa-manager.d.ts +44 -0
- package/dist/xfa/xfa-manager.js +138 -0
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ByteArray } from '../../types';
|
|
2
|
-
import { PdfToken } from './token';
|
|
1
|
+
import { ByteArray } from '../../types.js';
|
|
2
|
+
import { PdfToken } from './token.js';
|
|
3
3
|
export declare class PdfWhitespaceToken extends PdfToken {
|
|
4
4
|
static NEWLINE: PdfWhitespaceToken;
|
|
5
5
|
static SPACE: PdfWhitespaceToken;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ByteArray } from '../../types';
|
|
2
|
-
import { Ref } from '../ref';
|
|
3
|
-
import { PdfNumberToken } from './number-token';
|
|
1
|
+
import { ByteArray } from '../../types.js';
|
|
2
|
+
import { Ref } from '../ref.js';
|
|
3
|
+
import { PdfNumberToken } from './number-token.js';
|
|
4
4
|
import { PdfToken } from './token.js';
|
|
5
5
|
export declare class PdfXRefTableEntryToken extends PdfToken {
|
|
6
6
|
objectNumber: PdfNumberToken;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { stringToBytes } from '../../utils/stringToBytes';
|
|
2
|
-
import { PdfNumberToken } from './number-token';
|
|
1
|
+
import { stringToBytes } from '../../utils/stringToBytes.js';
|
|
2
|
+
import { PdfNumberToken } from './number-token.js';
|
|
3
3
|
import { PdfToken } from './token.js';
|
|
4
4
|
export class PdfXRefTableEntryToken extends PdfToken {
|
|
5
5
|
objectNumber;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PdfNumberToken } from './number-token';
|
|
2
|
-
import { PdfToken } from './token';
|
|
1
|
+
import { PdfNumberToken } from './number-token.js';
|
|
2
|
+
import { PdfToken } from './token.js';
|
|
3
3
|
export declare class PdfXRefTableSectionStartToken extends PdfToken {
|
|
4
4
|
start: PdfNumberToken;
|
|
5
5
|
count: PdfNumberToken;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { stringToBytes } from '../../utils/stringToBytes';
|
|
2
|
-
import { PdfNumberToken } from './number-token';
|
|
3
|
-
import { PdfToken } from './token';
|
|
1
|
+
import { stringToBytes } from '../../utils/stringToBytes.js';
|
|
2
|
+
import { PdfNumberToken } from './number-token.js';
|
|
3
|
+
import { PdfToken } from './token.js';
|
|
4
4
|
export class PdfXRefTableSectionStartToken extends PdfToken {
|
|
5
5
|
start;
|
|
6
6
|
count;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { stringToBytes } from '../../utils/stringToBytes';
|
|
2
|
-
import { PdfToken } from './token';
|
|
1
|
+
import { stringToBytes } from '../../utils/stringToBytes.js';
|
|
2
|
+
import { PdfToken } from './token.js';
|
|
3
3
|
const XREF = stringToBytes('xref');
|
|
4
4
|
export class PdfXRefTableStartToken extends PdfToken {
|
|
5
5
|
byteOffset;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { aes128CbcNoPaddingEncrypt, aes256CbcNoPaddingDecrypt, sha256, sha384, sha512, } from '../../utils/algos';
|
|
2
|
-
import { assert } from '../../utils/assert';
|
|
1
|
+
import { aes128CbcNoPaddingEncrypt, aes256CbcNoPaddingDecrypt, sha256, sha384, sha512, } from '../../utils/algos.js';
|
|
2
|
+
import { assert } from '../../utils/assert.js';
|
|
3
3
|
/**
|
|
4
4
|
* Converts the first 16 bytes of input to a big-endian bigint.
|
|
5
5
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { md5 } from '../../utils/algos';
|
|
2
|
-
import { concatUint8Arrays } from '../../utils/concatUint8Arrays';
|
|
3
|
-
import { rc4 } from '../ciphers/rc4';
|
|
4
|
-
import { DEFAULT_PADDING } from '../constants';
|
|
5
|
-
import { int32ToLittleEndianBytes, padPassword, removePdfPasswordPadding, } from '../utils';
|
|
1
|
+
import { md5 } from '../../utils/algos.js';
|
|
2
|
+
import { concatUint8Arrays } from '../../utils/concatUint8Arrays.js';
|
|
3
|
+
import { rc4 } from '../ciphers/rc4.js';
|
|
4
|
+
import { DEFAULT_PADDING } from '../constants.js';
|
|
5
|
+
import { int32ToLittleEndianBytes, padPassword, removePdfPasswordPadding, } from '../utils.js';
|
|
6
6
|
/**
|
|
7
7
|
* Encrypts data with RC4 using the provided key.
|
|
8
8
|
*
|
package/dist/crypto/types.d.ts
CHANGED
package/dist/filters/asciihex.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bytesToString } from '../utils/bytesToString';
|
|
2
|
-
import { stringToBytes } from '../utils/stringToBytes';
|
|
1
|
+
import { bytesToString } from '../utils/bytesToString.js';
|
|
2
|
+
import { stringToBytes } from '../utils/stringToBytes.js';
|
|
3
3
|
/**
|
|
4
4
|
* Creates an ASCIIHex filter for encoding and decoding PDF stream data.
|
|
5
5
|
* ASCIIHex encodes binary data as pairs of hexadecimal digits,
|
package/dist/filters/lzw.d.ts
CHANGED
package/dist/filters/types.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { PdfObject } from '../core/objects/pdf-object';
|
|
2
|
-
import { PdfSecurityHandler } from '../security/handlers/base';
|
|
3
|
-
import { PdfIndirectObject } from '../core/objects/pdf-indirect-object';
|
|
4
|
-
import { PdfComment } from '../core/objects/pdf-comment';
|
|
5
|
-
import { PdfToken } from '../core/tokens/token';
|
|
6
|
-
import { PdfDictionary } from '../core/objects/pdf-dictionary';
|
|
7
|
-
import { PdfObjectReference } from '../core/objects/pdf-object-reference';
|
|
8
|
-
import { PdfXrefLookup } from './pdf-xref-lookup';
|
|
9
|
-
import { PdfRevision } from './pdf-revision';
|
|
10
|
-
import { PdfEncryptionDictionaryObject } from '../security/types';
|
|
11
|
-
import { PdfTrailerEntries } from '../core/objects/pdf-trailer';
|
|
12
|
-
import { PdfDocumentSecurityStoreObject } from '../signing/document-security-store';
|
|
13
|
-
import { ByteArray } from '../types';
|
|
14
|
-
import { PdfDocumentVerificationResult, PdfSigner } from '../signing/signer';
|
|
1
|
+
import { PdfObject } from '../core/objects/pdf-object.js';
|
|
2
|
+
import { PdfSecurityHandler } from '../security/handlers/base.js';
|
|
3
|
+
import { PdfIndirectObject } from '../core/objects/pdf-indirect-object.js';
|
|
4
|
+
import { PdfComment } from '../core/objects/pdf-comment.js';
|
|
5
|
+
import { PdfToken } from '../core/tokens/token.js';
|
|
6
|
+
import { PdfDictionary } from '../core/objects/pdf-dictionary.js';
|
|
7
|
+
import { PdfObjectReference } from '../core/objects/pdf-object-reference.js';
|
|
8
|
+
import { PdfXrefLookup } from './pdf-xref-lookup.js';
|
|
9
|
+
import { PdfRevision } from './pdf-revision.js';
|
|
10
|
+
import { PdfEncryptionDictionaryObject } from '../security/types.js';
|
|
11
|
+
import { PdfTrailerEntries } from '../core/objects/pdf-trailer.js';
|
|
12
|
+
import { PdfDocumentSecurityStoreObject } from '../signing/document-security-store.js';
|
|
13
|
+
import { ByteArray } from '../types.js';
|
|
14
|
+
import { PdfDocumentVerificationResult, PdfSigner } from '../signing/signer.js';
|
|
15
|
+
import { PdfXfaManager } from '../xfa/xfa-manager.js';
|
|
16
|
+
import { PdfAcroFormManager } from '../acroform/acroform-manager.js';
|
|
15
17
|
/**
|
|
16
18
|
* Represents a PDF document with support for reading, writing, and modifying PDF files.
|
|
17
19
|
* Handles document structure, revisions, encryption, and digital signatures.
|
|
@@ -38,8 +40,14 @@ export declare class PdfDocument extends PdfObject {
|
|
|
38
40
|
signer: PdfSigner;
|
|
39
41
|
/** Security handler for encryption/decryption operations */
|
|
40
42
|
securityHandler?: PdfSecurityHandler;
|
|
43
|
+
private _xfa?;
|
|
44
|
+
private _acroForm?;
|
|
41
45
|
private hasEncryptionDictionary?;
|
|
42
46
|
private toBeCommitted;
|
|
47
|
+
/** XFA manager for handling XFA forms */
|
|
48
|
+
get xfa(): PdfXfaManager;
|
|
49
|
+
/** AcroForm manager for handling form fields */
|
|
50
|
+
get acroForm(): PdfAcroFormManager;
|
|
43
51
|
/**
|
|
44
52
|
* Creates a new PDF document instance.
|
|
45
53
|
*
|
|
@@ -260,6 +268,12 @@ export declare class PdfDocument extends PdfObject {
|
|
|
260
268
|
* @returns The PDF document as a Uint8Array
|
|
261
269
|
*/
|
|
262
270
|
toBytes(): ByteArray;
|
|
271
|
+
/**
|
|
272
|
+
* Serializes the document to a Base64-encoded string.
|
|
273
|
+
*
|
|
274
|
+
* @returns A promise that resolves to the PDF document as a Base64 string
|
|
275
|
+
*/
|
|
276
|
+
toBase64(): string;
|
|
263
277
|
/**
|
|
264
278
|
* Creates a deep copy of the document.
|
|
265
279
|
*
|
package/dist/pdf/pdf-document.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { PdfObject } from '../core/objects/pdf-object';
|
|
2
|
-
import { PdfStandardSecurityHandler, } from '../security/handlers/base';
|
|
3
|
-
import { createFromDictionary } from '../security/handlers/utils';
|
|
4
|
-
import { PdfIndirectObject } from '../core/objects/pdf-indirect-object';
|
|
5
|
-
import { PdfComment } from '../core/objects/pdf-comment';
|
|
6
|
-
import { PdfWhitespaceToken } from '../core/tokens/whitespace-token';
|
|
7
|
-
import { PdfObjStream, PdfStream, PdfXRefStreamCompressedEntry, } from '../core/objects/pdf-stream';
|
|
8
|
-
import { PdfDictionary } from '../core/objects/pdf-dictionary';
|
|
9
|
-
import { PdfObjectReference } from '../core/objects/pdf-object-reference';
|
|
10
|
-
import { PdfTokenSerializer } from '../core/serializer';
|
|
11
|
-
import { PdfRevision } from './pdf-revision';
|
|
12
|
-
import { PdfV5SecurityHandler } from '../security/handlers/v5';
|
|
13
|
-
import { PdfByteOffsetToken } from '../core/tokens/byte-offset-token';
|
|
14
|
-
import { PdfNumberToken } from '../core/tokens/number-token';
|
|
15
|
-
import { PdfXRefTableEntryToken } from '../core/tokens/xref-table-entry-token';
|
|
16
|
-
import { PdfStartXRef } from '../core/objects/pdf-start-xref';
|
|
17
|
-
import { FoundCompressedObjectError } from './errors';
|
|
18
|
-
import { PdfReader } from './pdf-reader';
|
|
19
|
-
import { PdfSigner } from '../signing/signer';
|
|
1
|
+
import { PdfObject } from '../core/objects/pdf-object.js';
|
|
2
|
+
import { PdfStandardSecurityHandler, } from '../security/handlers/base.js';
|
|
3
|
+
import { createFromDictionary } from '../security/handlers/utils.js';
|
|
4
|
+
import { PdfIndirectObject } from '../core/objects/pdf-indirect-object.js';
|
|
5
|
+
import { PdfComment } from '../core/objects/pdf-comment.js';
|
|
6
|
+
import { PdfWhitespaceToken } from '../core/tokens/whitespace-token.js';
|
|
7
|
+
import { PdfObjStream, PdfStream, PdfXRefStreamCompressedEntry, } from '../core/objects/pdf-stream.js';
|
|
8
|
+
import { PdfDictionary } from '../core/objects/pdf-dictionary.js';
|
|
9
|
+
import { PdfObjectReference } from '../core/objects/pdf-object-reference.js';
|
|
10
|
+
import { PdfTokenSerializer } from '../core/serializer.js';
|
|
11
|
+
import { PdfRevision } from './pdf-revision.js';
|
|
12
|
+
import { PdfV5SecurityHandler } from '../security/handlers/v5.js';
|
|
13
|
+
import { PdfByteOffsetToken } from '../core/tokens/byte-offset-token.js';
|
|
14
|
+
import { PdfNumberToken } from '../core/tokens/number-token.js';
|
|
15
|
+
import { PdfXRefTableEntryToken } from '../core/tokens/xref-table-entry-token.js';
|
|
16
|
+
import { PdfStartXRef } from '../core/objects/pdf-start-xref.js';
|
|
17
|
+
import { FoundCompressedObjectError } from './errors.js';
|
|
18
|
+
import { PdfReader } from './pdf-reader.js';
|
|
19
|
+
import { PdfSigner } from '../signing/signer.js';
|
|
20
|
+
import { PdfXfaManager } from '../xfa/xfa-manager.js';
|
|
21
|
+
import { PdfAcroFormManager } from '../acroform/acroform-manager.js';
|
|
20
22
|
/**
|
|
21
23
|
* Represents a PDF document with support for reading, writing, and modifying PDF files.
|
|
22
24
|
* Handles document structure, revisions, encryption, and digital signatures.
|
|
@@ -43,8 +45,24 @@ export class PdfDocument extends PdfObject {
|
|
|
43
45
|
signer;
|
|
44
46
|
/** Security handler for encryption/decryption operations */
|
|
45
47
|
securityHandler;
|
|
48
|
+
_xfa;
|
|
49
|
+
_acroForm;
|
|
46
50
|
hasEncryptionDictionary = false;
|
|
47
51
|
toBeCommitted = [];
|
|
52
|
+
/** XFA manager for handling XFA forms */
|
|
53
|
+
get xfa() {
|
|
54
|
+
if (!this._xfa) {
|
|
55
|
+
this._xfa = new PdfXfaManager(this);
|
|
56
|
+
}
|
|
57
|
+
return this._xfa;
|
|
58
|
+
}
|
|
59
|
+
/** AcroForm manager for handling form fields */
|
|
60
|
+
get acroForm() {
|
|
61
|
+
if (!this._acroForm) {
|
|
62
|
+
this._acroForm = new PdfAcroFormManager(this);
|
|
63
|
+
}
|
|
64
|
+
return this._acroForm;
|
|
65
|
+
}
|
|
48
66
|
/**
|
|
49
67
|
* Creates a new PDF document instance.
|
|
50
68
|
*
|
|
@@ -212,6 +230,9 @@ export class PdfDocument extends PdfObject {
|
|
|
212
230
|
return undefined;
|
|
213
231
|
}
|
|
214
232
|
const rootObject = this.findUncompressedObject(rootRef);
|
|
233
|
+
if (!rootObject) {
|
|
234
|
+
throw new Error('Root object not found');
|
|
235
|
+
}
|
|
215
236
|
if (!(rootObject?.content instanceof PdfDictionary)) {
|
|
216
237
|
throw new Error(`Root object ${rootRef.objectNumber} ${rootRef.generationNumber} is not a dictionary, it is a ${rootObject?.content.objectType}`);
|
|
217
238
|
}
|
|
@@ -392,7 +413,7 @@ export class PdfDocument extends PdfObject {
|
|
|
392
413
|
}
|
|
393
414
|
const objectStreamIndirect = this.findUncompressedObject({
|
|
394
415
|
objectNumber: xrefEntry.objectStreamNumber.value,
|
|
395
|
-
});
|
|
416
|
+
})?.clone();
|
|
396
417
|
if (!objectStreamIndirect) {
|
|
397
418
|
throw new Error(`Cannot find object stream ${xrefEntry.objectStreamNumber.value} for object ${options.objectNumber}`);
|
|
398
419
|
}
|
|
@@ -418,7 +439,7 @@ export class PdfDocument extends PdfObject {
|
|
|
418
439
|
findUncompressedObject(options) {
|
|
419
440
|
const xrefEntry = this.xrefLookup.getObject(options.objectNumber);
|
|
420
441
|
if (xrefEntry instanceof PdfXRefStreamCompressedEntry) {
|
|
421
|
-
throw new FoundCompressedObjectError(`
|
|
442
|
+
throw new FoundCompressedObjectError(`Cannot find object ${options.objectNumber} inside object stream via PdfDocument.findObject`);
|
|
422
443
|
}
|
|
423
444
|
if (!xrefEntry ||
|
|
424
445
|
(options.generationNumber !== undefined &&
|
|
@@ -504,9 +525,13 @@ export class PdfDocument extends PdfObject {
|
|
|
504
525
|
* @param value - True to enable incremental mode, false to disable. Defaults to true.
|
|
505
526
|
*/
|
|
506
527
|
setIncremental(value = true) {
|
|
528
|
+
if (value === this.isIncremental()) {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
507
531
|
for (const revision of this.revisions) {
|
|
508
532
|
revision.locked = value;
|
|
509
533
|
}
|
|
534
|
+
this.startNewRevision();
|
|
510
535
|
}
|
|
511
536
|
/**
|
|
512
537
|
* Checks if the document is in incremental mode.
|
|
@@ -664,6 +689,20 @@ export class PdfDocument extends PdfObject {
|
|
|
664
689
|
serializer.feed(...this.toTokens());
|
|
665
690
|
return serializer.toBytes();
|
|
666
691
|
}
|
|
692
|
+
/**
|
|
693
|
+
* Serializes the document to a Base64-encoded string.
|
|
694
|
+
*
|
|
695
|
+
* @returns A promise that resolves to the PDF document as a Base64 string
|
|
696
|
+
*/
|
|
697
|
+
toBase64() {
|
|
698
|
+
const bytes = this.toBytes();
|
|
699
|
+
let binary = '';
|
|
700
|
+
const len = bytes.byteLength;
|
|
701
|
+
for (let i = 0; i < len; i++) {
|
|
702
|
+
binary += String.fromCharCode(bytes[i]);
|
|
703
|
+
}
|
|
704
|
+
return btoa(binary);
|
|
705
|
+
}
|
|
667
706
|
/**
|
|
668
707
|
* Creates a deep copy of the document.
|
|
669
708
|
*
|
package/dist/pdf/pdf-reader.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PdfObject } from '../core/objects/pdf-object';
|
|
2
|
-
import { ByteArray } from '../types';
|
|
3
|
-
import { PdfDocument } from './pdf-document';
|
|
1
|
+
import { PdfObject } from '../core/objects/pdf-object.js';
|
|
2
|
+
import { ByteArray } from '../types.js';
|
|
3
|
+
import { PdfDocument } from './pdf-document.js';
|
|
4
4
|
/**
|
|
5
5
|
* A reader for parsing PDF data into PdfDocument instances.
|
|
6
6
|
* Processes streams of PDF objects and constructs documents from them.
|
package/dist/pdf/pdf-reader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PdfObjectStream } from '../core/streams/object-stream';
|
|
2
|
-
import { PdfDocument } from './pdf-document';
|
|
1
|
+
import { PdfObjectStream } from '../core/streams/object-stream.js';
|
|
2
|
+
import { PdfDocument } from './pdf-document.js';
|
|
3
3
|
/**
|
|
4
4
|
* A reader for parsing PDF data into PdfDocument instances.
|
|
5
5
|
* Processes streams of PDF objects and constructs documents from them.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PdfDictionary } from '../core/objects/pdf-dictionary';
|
|
2
|
-
import { PdfObject } from '../core/objects/pdf-object';
|
|
3
|
-
import { PdfTrailerEntries } from '../core/objects/pdf-trailer';
|
|
4
|
-
import { PdfToken } from '../core/tokens/token';
|
|
5
|
-
import { PdfXrefLookup } from './pdf-xref-lookup';
|
|
1
|
+
import { PdfDictionary } from '../core/objects/pdf-dictionary.js';
|
|
2
|
+
import { PdfObject } from '../core/objects/pdf-object.js';
|
|
3
|
+
import { PdfTrailerEntries } from '../core/objects/pdf-trailer.js';
|
|
4
|
+
import { PdfToken } from '../core/tokens/token.js';
|
|
5
|
+
import { PdfXrefLookup } from './pdf-xref-lookup.js';
|
|
6
6
|
/**
|
|
7
7
|
* Represents a single revision of a PDF document.
|
|
8
8
|
* PDF documents can have multiple revisions for incremental updates,
|
package/dist/pdf/pdf-revision.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PdfIndirectObject } from '../core/objects/pdf-indirect-object';
|
|
2
|
-
import { PdfObject } from '../core/objects/pdf-object';
|
|
3
|
-
import { PdfWhitespaceToken } from '../core/tokens/whitespace-token';
|
|
4
|
-
import { PdfXrefLookup } from './pdf-xref-lookup';
|
|
1
|
+
import { PdfIndirectObject } from '../core/objects/pdf-indirect-object.js';
|
|
2
|
+
import { PdfObject } from '../core/objects/pdf-object.js';
|
|
3
|
+
import { PdfWhitespaceToken } from '../core/tokens/whitespace-token.js';
|
|
4
|
+
import { PdfXrefLookup } from './pdf-xref-lookup.js';
|
|
5
5
|
/**
|
|
6
6
|
* Represents a single revision of a PDF document.
|
|
7
7
|
* PDF documents can have multiple revisions for incremental updates,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { PdfObject } from '../core/objects/pdf-object';
|
|
2
|
-
import { PdfIndirectObject } from '../core/objects/pdf-indirect-object';
|
|
3
|
-
import { PdfXRefTable } from '../core/objects/pdf-xref-table';
|
|
4
|
-
import { PdfTrailer, PdfTrailerEntries } from '../core/objects/pdf-trailer';
|
|
5
|
-
import { PdfStream, PdfXRefStream, PdfXRefStreamEntry } from '../core/objects/pdf-stream';
|
|
6
|
-
import { PdfDictionary } from '../core/objects/pdf-dictionary';
|
|
7
|
-
import { Ref } from '../core/ref';
|
|
1
|
+
import { PdfObject } from '../core/objects/pdf-object.js';
|
|
2
|
+
import { PdfIndirectObject } from '../core/objects/pdf-indirect-object.js';
|
|
3
|
+
import { PdfXRefTable } from '../core/objects/pdf-xref-table.js';
|
|
4
|
+
import { PdfTrailer, PdfTrailerEntries } from '../core/objects/pdf-trailer.js';
|
|
5
|
+
import { PdfStream, PdfXRefStream, PdfXRefStreamEntry } from '../core/objects/pdf-stream.js';
|
|
6
|
+
import { PdfDictionary } from '../core/objects/pdf-dictionary.js';
|
|
7
|
+
import { Ref } from '../core/ref.js';
|
|
8
8
|
/**
|
|
9
9
|
* Manages cross-reference (xref) lookup for PDF objects.
|
|
10
10
|
* Handles both traditional xref tables and xref streams, including hybrid documents.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PdfIndirectObject } from '../core/objects/pdf-indirect-object';
|
|
2
|
-
import { PdfXRefTable, PdfXRefTableEntry } from '../core/objects/pdf-xref-table';
|
|
3
|
-
import { PdfStartXRef } from '../core/objects/pdf-start-xref';
|
|
4
|
-
import { PdfTrailer } from '../core/objects/pdf-trailer';
|
|
5
|
-
import { PdfNumber } from '../core/objects/pdf-number';
|
|
6
|
-
import { PdfComment } from '../core/objects/pdf-comment';
|
|
7
|
-
import { PdfObjStream, PdfStream, PdfXRefStream, PdfXRefStreamCompressedEntry, } from '../core/objects/pdf-stream';
|
|
8
|
-
import { PdfDictionary } from '../core/objects/pdf-dictionary';
|
|
9
|
-
import { PdfObjectReference } from '../core/objects/pdf-object-reference';
|
|
1
|
+
import { PdfIndirectObject } from '../core/objects/pdf-indirect-object.js';
|
|
2
|
+
import { PdfXRefTable, PdfXRefTableEntry, } from '../core/objects/pdf-xref-table.js';
|
|
3
|
+
import { PdfStartXRef } from '../core/objects/pdf-start-xref.js';
|
|
4
|
+
import { PdfTrailer } from '../core/objects/pdf-trailer.js';
|
|
5
|
+
import { PdfNumber } from '../core/objects/pdf-number.js';
|
|
6
|
+
import { PdfComment } from '../core/objects/pdf-comment.js';
|
|
7
|
+
import { PdfObjStream, PdfStream, PdfXRefStream, PdfXRefStreamCompressedEntry, } from '../core/objects/pdf-stream.js';
|
|
8
|
+
import { PdfDictionary } from '../core/objects/pdf-dictionary.js';
|
|
9
|
+
import { PdfObjectReference } from '../core/objects/pdf-object-reference.js';
|
|
10
10
|
/**
|
|
11
11
|
* Manages cross-reference (xref) lookup for PDF objects.
|
|
12
12
|
* Handles both traditional xref tables and xref streams, including hybrid documents.
|
|
@@ -204,7 +204,8 @@ export class PdfXrefLookup {
|
|
|
204
204
|
this.trailerDict.set('Size', new PdfNumber(prevSize));
|
|
205
205
|
}
|
|
206
206
|
const size = Math.max(trailerSize, prevSize);
|
|
207
|
-
|
|
207
|
+
if (size !== trailerSize)
|
|
208
|
+
this.trailerDict.set('Size', new PdfNumber(size));
|
|
208
209
|
return size;
|
|
209
210
|
}
|
|
210
211
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PdfCryptFilter, CryptFilterOptions } from './base';
|
|
2
|
-
import { Cipher } from '../../crypto/types';
|
|
1
|
+
import { PdfCryptFilter, CryptFilterOptions } from './base.js';
|
|
2
|
+
import { Cipher } from '../../crypto/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* AESV2 crypt filter using AES-128-CBC encryption.
|
|
5
5
|
* Implements 128-bit AES encryption in CBC mode for PDF content.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PdfCryptFilter } from './base';
|
|
2
|
-
import { aes128 } from '../../crypto/ciphers/aes128';
|
|
1
|
+
import { PdfCryptFilter } from './base.js';
|
|
2
|
+
import { aes128 } from '../../crypto/ciphers/aes128.js';
|
|
3
3
|
/**
|
|
4
4
|
* AESV2 crypt filter using AES-128-CBC encryption.
|
|
5
5
|
* Implements 128-bit AES encryption in CBC mode for PDF content.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Cipher } from '../../crypto/types';
|
|
2
|
-
import { PdfCryptFilter, CryptFilterOptions } from './base';
|
|
1
|
+
import { Cipher } from '../../crypto/types.js';
|
|
2
|
+
import { PdfCryptFilter, CryptFilterOptions } from './base.js';
|
|
3
3
|
/**
|
|
4
4
|
* AESV3 crypt filter using AES-256-CBC encryption.
|
|
5
5
|
* Implements 256-bit AES encryption in CBC mode for PDF content.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { aes256 } from '../../crypto/ciphers/aes256';
|
|
2
|
-
import { PdfCryptFilter } from './base';
|
|
1
|
+
import { aes256 } from '../../crypto/ciphers/aes256.js';
|
|
2
|
+
import { PdfCryptFilter } from './base.js';
|
|
3
3
|
/**
|
|
4
4
|
* AESV3 crypt filter using AES-256-CBC encryption.
|
|
5
5
|
* Implements 256-bit AES encryption in CBC mode for PDF content.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Cipher } from '../../crypto/types';
|
|
2
|
-
import { ByteArray } from '../../types';
|
|
3
|
-
import { PdfSecurityHandler } from '../handlers/base';
|
|
4
|
-
import { PdfCryptFilterDictionary } from '../types';
|
|
1
|
+
import { Cipher } from '../../crypto/types.js';
|
|
2
|
+
import { ByteArray } from '../../types.js';
|
|
3
|
+
import { PdfSecurityHandler } from '../handlers/base.js';
|
|
4
|
+
import { PdfCryptFilterDictionary } from '../types.js';
|
|
5
5
|
/**
|
|
6
6
|
* Configuration options for creating a crypt filter.
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PdfDictionary } from '../../core/objects/pdf-dictionary';
|
|
2
|
-
import { PdfName } from '../../core/objects/pdf-name';
|
|
3
|
-
import { PdfNumber } from '../../core/objects/pdf-number';
|
|
1
|
+
import { PdfDictionary } from '../../core/objects/pdf-dictionary.js';
|
|
2
|
+
import { PdfName } from '../../core/objects/pdf-name.js';
|
|
3
|
+
import { PdfNumber } from '../../core/objects/pdf-number.js';
|
|
4
4
|
/**
|
|
5
5
|
* Abstract base class for PDF crypt filters.
|
|
6
6
|
* Crypt filters define how specific types of data (strings, streams, files) are encrypted.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Cipher } from '../../crypto/types';
|
|
2
|
-
import { PdfCryptFilter, CryptFilterOptions } from './base';
|
|
1
|
+
import { Cipher } from '../../crypto/types.js';
|
|
2
|
+
import { PdfCryptFilter, CryptFilterOptions } from './base.js';
|
|
3
3
|
/**
|
|
4
4
|
* Identity crypt filter that passes data through without encryption.
|
|
5
5
|
* Used when no encryption is needed for specific content types.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cipher } from '../../crypto/types.js';
|
|
2
|
-
import { PdfCryptFilter, CryptFilterOptions } from './base';
|
|
2
|
+
import { PdfCryptFilter, CryptFilterOptions } from './base.js';
|
|
3
3
|
/**
|
|
4
4
|
* V2 crypt filter using RC4 encryption.
|
|
5
5
|
* Implements the legacy RC4 stream cipher for PDF encryption.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PdfIndirectObject } from '../../core/objects/pdf-indirect-object';
|
|
2
|
-
import { Cipher } from '../../crypto/types';
|
|
3
|
-
import { ByteArray, PdfPermissions } from '../../types';
|
|
4
|
-
import { PdfEncryptionAlgorithmType, PdfEncryptionDictionary, PdfId } from '../types';
|
|
1
|
+
import { PdfIndirectObject } from '../../core/objects/pdf-indirect-object.js';
|
|
2
|
+
import { Cipher } from '../../crypto/types.js';
|
|
3
|
+
import { ByteArray, PdfPermissions } from '../../types.js';
|
|
4
|
+
import { PdfEncryptionAlgorithmType, PdfEncryptionDictionary, PdfId } from '../types.js';
|
|
5
5
|
/**
|
|
6
6
|
* Base options for creating a security handler.
|
|
7
7
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { PdfArray } from '../../core/objects/pdf-array';
|
|
2
|
-
import { PdfBoolean } from '../../core/objects/pdf-boolean';
|
|
3
|
-
import { PdfDictionary } from '../../core/objects/pdf-dictionary';
|
|
4
|
-
import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal';
|
|
5
|
-
import { PdfIndirectObject } from '../../core/objects/pdf-indirect-object';
|
|
6
|
-
import { PdfName } from '../../core/objects/pdf-name';
|
|
7
|
-
import { PdfNumber } from '../../core/objects/pdf-number';
|
|
8
|
-
import { PdfStream } from '../../core/objects/pdf-stream';
|
|
9
|
-
import { PdfString } from '../../core/objects/pdf-string';
|
|
10
|
-
import { PERMISSION_FLAGS } from '../../types';
|
|
11
|
-
import { assert, assertIfDefined } from '../../utils/assert';
|
|
12
|
-
import { stringToBytes } from '../../utils/stringToBytes';
|
|
1
|
+
import { PdfArray } from '../../core/objects/pdf-array.js';
|
|
2
|
+
import { PdfBoolean } from '../../core/objects/pdf-boolean.js';
|
|
3
|
+
import { PdfDictionary } from '../../core/objects/pdf-dictionary.js';
|
|
4
|
+
import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal.js';
|
|
5
|
+
import { PdfIndirectObject } from '../../core/objects/pdf-indirect-object.js';
|
|
6
|
+
import { PdfName } from '../../core/objects/pdf-name.js';
|
|
7
|
+
import { PdfNumber } from '../../core/objects/pdf-number.js';
|
|
8
|
+
import { PdfStream } from '../../core/objects/pdf-stream.js';
|
|
9
|
+
import { PdfString } from '../../core/objects/pdf-string.js';
|
|
10
|
+
import { PERMISSION_FLAGS } from '../../types.js';
|
|
11
|
+
import { assert, assertIfDefined } from '../../utils/assert.js';
|
|
12
|
+
import { stringToBytes } from '../../utils/stringToBytes.js';
|
|
13
13
|
/**
|
|
14
14
|
* Abstract base class for PDF security handlers.
|
|
15
15
|
* Security handlers manage encryption, decryption, and access permissions for PDF documents.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ByteArray, PdfPermissions } from '../../types';
|
|
2
|
-
import { PdfEncryptionDictionary, PdfEncryptionRecipient, PdfId } from '../types';
|
|
3
|
-
import { PdfSecurityHandler, PdfStandardSecurityHandler } from './base';
|
|
1
|
+
import { ByteArray, PdfPermissions } from '../../types.js';
|
|
2
|
+
import { PdfEncryptionDictionary, PdfEncryptionRecipient, PdfId } from '../types.js';
|
|
3
|
+
import { PdfSecurityHandler, PdfStandardSecurityHandler } from './base.js';
|
|
4
4
|
/**
|
|
5
5
|
* Public key security handler implementing certificate-based encryption.
|
|
6
6
|
* Uses PKCS#7 enveloped data to encrypt the file key for each recipient.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Certificate } from 'pki-lite/x509/Certificate';
|
|
2
|
-
import { EnvelopedData } from 'pki-lite/pkcs7/EnvelopedData';
|
|
3
|
-
import { PrivateKeyInfo } from 'pki-lite/keys/PrivateKeyInfo';
|
|
4
|
-
import { getRandomBytes, sha1, sha256 } from '../../utils/algos';
|
|
5
|
-
import { PdfV5SecurityHandler } from './v5';
|
|
6
|
-
import { PdfSecurityHandler } from './base';
|
|
7
|
-
import { createStandardSecurityHandlerFromDictionary } from './utils';
|
|
8
|
-
import { PdfName } from '../../core/objects/pdf-name';
|
|
9
|
-
import { PdfArray } from '../../core/objects/pdf-array';
|
|
10
|
-
import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal';
|
|
1
|
+
import { Certificate } from 'pki-lite/x509/Certificate.js';
|
|
2
|
+
import { EnvelopedData } from 'pki-lite/pkcs7/EnvelopedData.js';
|
|
3
|
+
import { PrivateKeyInfo } from 'pki-lite/keys/PrivateKeyInfo.js';
|
|
4
|
+
import { getRandomBytes, sha1, sha256 } from '../../utils/algos.js';
|
|
5
|
+
import { PdfV5SecurityHandler } from './v5.js';
|
|
6
|
+
import { PdfSecurityHandler } from './base.js';
|
|
7
|
+
import { createStandardSecurityHandlerFromDictionary } from './utils.js';
|
|
8
|
+
import { PdfName } from '../../core/objects/pdf-name.js';
|
|
9
|
+
import { PdfArray } from '../../core/objects/pdf-array.js';
|
|
10
|
+
import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal.js';
|
|
11
11
|
/**
|
|
12
12
|
* Public key security handler implementing certificate-based encryption.
|
|
13
13
|
* Uses PKCS#7 enveloped data to encrypt the file key for each recipient.
|