pdf-lite 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/EXAMPLES.md +51 -70
  2. package/README.md +1 -1
  3. package/dist/acroform/appearance/index.d.ts +4 -4
  4. package/dist/acroform/appearance/index.js +4 -4
  5. package/dist/acroform/appearance/{PdfAppearanceStream.d.ts → pdf-appearance-stream.d.ts} +9 -3
  6. package/dist/acroform/appearance/{PdfAppearanceStream.js → pdf-appearance-stream.js} +14 -5
  7. package/dist/acroform/appearance/{PdfButtonAppearanceStream.d.ts → pdf-button-appearance-stream.d.ts} +3 -2
  8. package/dist/acroform/appearance/pdf-button-appearance-stream.js +58 -0
  9. package/dist/acroform/appearance/pdf-choice-appearance-stream.d.ts +22 -0
  10. package/dist/acroform/appearance/pdf-choice-appearance-stream.js +75 -0
  11. package/dist/acroform/appearance/pdf-graphics.d.ts +51 -0
  12. package/dist/acroform/appearance/pdf-graphics.js +239 -0
  13. package/dist/acroform/appearance/{PdfTextAppearanceStream.d.ts → pdf-text-appearance-stream.d.ts} +7 -2
  14. package/dist/acroform/appearance/pdf-text-appearance-stream.js +104 -0
  15. package/dist/acroform/fields/index.d.ts +7 -7
  16. package/dist/acroform/fields/index.js +7 -7
  17. package/dist/acroform/fields/pdf-button-form-field.d.ts +14 -0
  18. package/dist/acroform/fields/pdf-button-form-field.js +70 -0
  19. package/dist/acroform/fields/pdf-choice-form-field.d.ts +19 -0
  20. package/dist/acroform/fields/pdf-choice-form-field.js +112 -0
  21. package/dist/acroform/fields/{PdfFormFieldFlags.d.ts → pdf-form-field-flags.d.ts} +5 -6
  22. package/dist/acroform/fields/{PdfFormFieldFlags.js → pdf-form-field-flags.js} +12 -18
  23. package/dist/acroform/fields/{PdfFormField.d.ts → pdf-form-field.d.ts} +37 -38
  24. package/dist/acroform/fields/pdf-form-field.js +519 -0
  25. package/dist/acroform/fields/{PdfSignatureFormField.d.ts → pdf-signature-form-field.d.ts} +1 -1
  26. package/dist/acroform/fields/{PdfSignatureFormField.js → pdf-signature-form-field.js} +1 -1
  27. package/dist/acroform/fields/{PdfTextFormField.d.ts → pdf-text-form-field.d.ts} +1 -1
  28. package/dist/acroform/fields/{PdfTextFormField.js → pdf-text-form-field.js} +11 -13
  29. package/dist/acroform/fields/types.d.ts +6 -1
  30. package/dist/acroform/index.d.ts +1 -3
  31. package/dist/acroform/index.js +1 -3
  32. package/dist/acroform/pdf-acro-form.d.ts +45 -0
  33. package/dist/acroform/pdf-acro-form.js +203 -0
  34. package/dist/acroform/xfa/index.d.ts +3 -3
  35. package/dist/acroform/xfa/index.js +2 -2
  36. package/dist/acroform/xfa/{PdfXfaData.d.ts → pdf-xfa-data.d.ts} +4 -3
  37. package/dist/acroform/xfa/{PdfXfaData.js → pdf-xfa-data.js} +16 -12
  38. package/dist/acroform/xfa/pdf-xfa-form.d.ts +16 -0
  39. package/dist/acroform/xfa/pdf-xfa-form.js +34 -0
  40. package/dist/annotations/index.d.ts +3 -4
  41. package/dist/annotations/index.js +3 -4
  42. package/dist/annotations/{PdfAnnotationFlags.d.ts → pdf-annotation-flags.d.ts} +3 -4
  43. package/dist/annotations/{PdfAnnotationFlags.js → pdf-annotation-flags.js} +5 -6
  44. package/dist/annotations/{PdfAnnotation.d.ts → pdf-annotation.d.ts} +31 -5
  45. package/dist/annotations/{PdfAnnotation.js → pdf-annotation.js} +31 -19
  46. package/dist/annotations/pdf-default-resources.d.ts +11 -0
  47. package/dist/annotations/pdf-default-resources.js +3 -0
  48. package/dist/annotations/{PdfWidgetAnnotation.d.ts → pdf-widget-annotation.d.ts} +1 -1
  49. package/dist/annotations/{PdfWidgetAnnotation.js → pdf-widget-annotation.js} +1 -1
  50. package/dist/core/decoder.js +1 -1
  51. package/dist/core/objects/pdf-array.d.ts +8 -1
  52. package/dist/core/objects/pdf-array.js +31 -0
  53. package/dist/core/objects/pdf-dictionary.d.ts +2 -0
  54. package/dist/core/objects/pdf-dictionary.js +14 -7
  55. package/dist/core/objects/pdf-hexadecimal.d.ts +1 -0
  56. package/dist/core/objects/pdf-hexadecimal.js +3 -3
  57. package/dist/core/objects/pdf-indirect-object.d.ts +18 -9
  58. package/dist/core/objects/pdf-indirect-object.js +75 -16
  59. package/dist/core/objects/pdf-number.d.ts +1 -0
  60. package/dist/core/objects/pdf-number.js +5 -4
  61. package/dist/core/objects/pdf-object-reference.d.ts +8 -1
  62. package/dist/core/objects/pdf-object-reference.js +14 -0
  63. package/dist/core/objects/pdf-object.d.ts +14 -0
  64. package/dist/core/objects/pdf-object.js +36 -0
  65. package/dist/core/objects/pdf-start-xref.d.ts +1 -0
  66. package/dist/core/objects/pdf-start-xref.js +4 -0
  67. package/dist/core/objects/pdf-stream.d.ts +44 -7
  68. package/dist/core/objects/pdf-stream.js +284 -26
  69. package/dist/core/objects/pdf-string.d.ts +1 -0
  70. package/dist/core/objects/pdf-string.js +3 -6
  71. package/dist/core/objects/pdf-trailer.d.ts +1 -0
  72. package/dist/core/objects/pdf-trailer.js +6 -3
  73. package/dist/core/objects/pdf-xref-table.js +1 -1
  74. package/dist/core/parser/incremental-parser.d.ts +0 -13
  75. package/dist/core/parser/incremental-parser.js +1 -18
  76. package/dist/core/ref.d.ts +3 -1
  77. package/dist/core/ref.js +8 -5
  78. package/dist/core/streams/object-stream.d.ts +1 -1
  79. package/dist/core/streams/object-stream.js +1 -1
  80. package/dist/core/tokens/token.d.ts +2 -1
  81. package/dist/core/tokens/token.js +3 -0
  82. package/dist/errors.d.ts +22 -0
  83. package/dist/errors.js +24 -0
  84. package/dist/fonts/index.d.ts +0 -1
  85. package/dist/fonts/index.js +0 -1
  86. package/dist/fonts/pdf-font.d.ts +94 -32
  87. package/dist/fonts/pdf-font.js +301 -83
  88. package/dist/index.d.ts +1 -0
  89. package/dist/index.js +1 -0
  90. package/dist/pdf/index.d.ts +2 -1
  91. package/dist/pdf/index.js +2 -1
  92. package/dist/pdf/pdf-document.d.ts +61 -36
  93. package/dist/pdf/pdf-document.js +315 -117
  94. package/dist/pdf/pdf-page.d.ts +50 -0
  95. package/dist/pdf/pdf-page.js +144 -0
  96. package/dist/pdf/pdf-pages.d.ts +28 -0
  97. package/dist/pdf/pdf-pages.js +94 -0
  98. package/dist/pdf/pdf-reader.d.ts +5 -1
  99. package/dist/pdf/pdf-reader.js +36 -2
  100. package/dist/pdf/pdf-revision.d.ts +3 -3
  101. package/dist/pdf/pdf-revision.js +7 -7
  102. package/dist/pdf/pdf-xref-lookup.js +34 -14
  103. package/dist/signing/document-security-store.d.ts +14 -17
  104. package/dist/signing/document-security-store.js +19 -34
  105. package/dist/signing/signer.d.ts +23 -8
  106. package/dist/signing/signer.js +51 -17
  107. package/dist/utils/encodePdfText.d.ts +17 -0
  108. package/dist/utils/encodePdfText.js +61 -0
  109. package/dist/utils/index.d.ts +1 -2
  110. package/dist/utils/index.js +1 -2
  111. package/dist/utils/needsCentralWhitespace.d.ts +10 -0
  112. package/dist/utils/needsCentralWhitespace.js +34 -0
  113. package/package.json +3 -3
  114. package/dist/acroform/PdfAcroForm.d.ts +0 -63
  115. package/dist/acroform/PdfAcroForm.js +0 -279
  116. package/dist/acroform/PdfFontEncodingCache.d.ts +0 -16
  117. package/dist/acroform/PdfFontEncodingCache.js +0 -75
  118. package/dist/acroform/acroform.d.ts +0 -9
  119. package/dist/acroform/acroform.js +0 -7
  120. package/dist/acroform/appearance/PdfButtonAppearanceStream.js +0 -54
  121. package/dist/acroform/appearance/PdfChoiceAppearanceStream.d.ts +0 -15
  122. package/dist/acroform/appearance/PdfChoiceAppearanceStream.js +0 -48
  123. package/dist/acroform/appearance/PdfTextAppearanceStream.js +0 -75
  124. package/dist/acroform/fields/PdfButtonFormField.d.ts +0 -9
  125. package/dist/acroform/fields/PdfButtonFormField.js +0 -35
  126. package/dist/acroform/fields/PdfChoiceFormField.d.ts +0 -9
  127. package/dist/acroform/fields/PdfChoiceFormField.js +0 -46
  128. package/dist/acroform/fields/PdfFormField.js +0 -499
  129. package/dist/acroform/manager.d.ts +0 -33
  130. package/dist/acroform/manager.js +0 -51
  131. package/dist/acroform/xfa/PdfXfaForm.d.ts +0 -12
  132. package/dist/acroform/xfa/PdfXfaForm.js +0 -64
  133. package/dist/annotations/PdfAnnotationWriter.d.ts +0 -20
  134. package/dist/annotations/PdfAnnotationWriter.js +0 -76
  135. package/dist/fonts/font-manager.d.ts +0 -127
  136. package/dist/fonts/font-manager.js +0 -378
  137. package/dist/pdf/errors.d.ts +0 -6
  138. package/dist/pdf/errors.js +0 -6
  139. package/dist/utils/predictors.d.ts +0 -113
  140. package/dist/utils/predictors.js +0 -279
  141. /package/dist/acroform/fields/{PdfDefaultAppearance.d.ts → pdf-default-appearance.d.ts} +0 -0
  142. /package/dist/acroform/fields/{PdfDefaultAppearance.js → pdf-default-appearance.js} +0 -0
  143. /package/dist/utils/{IterableReadableStream.d.ts → iterable-readable-stream.d.ts} +0 -0
  144. /package/dist/utils/{IterableReadableStream.js → iterable-readable-stream.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { PdfObject } from '../objects/pdf-object.js';
2
2
  import { ByteArray } from '../../types.js';
3
- import { IterableReadableStream } from '../../utils/IterableReadableStream.js';
3
+ import { IterableReadableStream } from '../../utils/iterable-readable-stream.js';
4
4
  export declare class PdfObjectStream extends IterableReadableStream<PdfObject> {
5
5
  constructor(input: AsyncIterable<ByteArray> | Iterable<ByteArray>);
6
6
  }
@@ -1,4 +1,4 @@
1
- import { IterableReadableStream } from '../../utils/IterableReadableStream.js';
1
+ import { IterableReadableStream } from '../../utils/iterable-readable-stream.js';
2
2
  import { pdfDecoderAsync } from '../generators.js';
3
3
  export class PdfObjectStream extends IterableReadableStream {
4
4
  constructor(input) {
@@ -1,5 +1,5 @@
1
1
  import { ByteArray } from '../../types.js';
2
- export declare abstract class PdfToken {
2
+ export declare class PdfToken {
3
3
  protected rawBytes: ByteArray;
4
4
  constructor(bytes?: ByteArray);
5
5
  toBytes(): ByteArray;
@@ -7,4 +7,5 @@ export declare abstract class PdfToken {
7
7
  get type(): string;
8
8
  get byteLength(): number;
9
9
  equals(other: PdfToken): boolean;
10
+ clone(): PdfToken;
10
11
  }
@@ -29,4 +29,7 @@ export class PdfToken {
29
29
  }
30
30
  return true;
31
31
  }
32
+ clone() {
33
+ return new PdfToken(this.toBytes());
34
+ }
32
35
  }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Error thrown when the parser needs more input to continue parsing.
3
+ */
4
+ export declare class NoMoreTokensError extends Error {
5
+ }
6
+ /**
7
+ * Error thrown when the end of file has been reached and no more input is available.
8
+ */
9
+ export declare class EofReachedError extends Error {
10
+ }
11
+ /**
12
+ * Error thrown when an unexpected token is encountered during parsing.
13
+ */
14
+ export declare class UnexpectedTokenError extends Error {
15
+ constructor(expected: string, actual: string | null);
16
+ }
17
+ /**
18
+ * Error thrown when attempting to access a compressed object
19
+ * that requires decompression from an object stream.
20
+ */
21
+ export declare class FoundCompressedObjectError extends Error {
22
+ }
package/dist/errors.js ADDED
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Error thrown when the parser needs more input to continue parsing.
3
+ */
4
+ export class NoMoreTokensError extends Error {
5
+ }
6
+ /**
7
+ * Error thrown when the end of file has been reached and no more input is available.
8
+ */
9
+ export class EofReachedError extends Error {
10
+ }
11
+ /**
12
+ * Error thrown when an unexpected token is encountered during parsing.
13
+ */
14
+ export class UnexpectedTokenError extends Error {
15
+ constructor(expected, actual) {
16
+ super(`Unexpected token: expected ${expected}, but got ${actual === null ? 'EOF' : actual}`);
17
+ }
18
+ }
19
+ /**
20
+ * Error thrown when attempting to access a compressed object
21
+ * that requires decompression from an object stream.
22
+ */
23
+ export class FoundCompressedObjectError extends Error {
24
+ }
@@ -1,4 +1,3 @@
1
1
  export * from './types.js';
2
- export * from './font-manager.js';
3
2
  export * from './pdf-font.js';
4
3
  export * from './parsers/index.js';
@@ -1,4 +1,3 @@
1
1
  export * from './types.js';
2
- export * from './font-manager.js';
3
2
  export * from './pdf-font.js';
4
3
  export * from './parsers/index.js';
@@ -4,14 +4,9 @@ import { PdfName } from '../core/objects/pdf-name.js';
4
4
  import { PdfNumber } from '../core/objects/pdf-number.js';
5
5
  import { PdfArray } from '../core/objects/pdf-array.js';
6
6
  import { PdfObjectReference } from '../core/objects/pdf-object-reference.js';
7
- import type { PdfFontManager } from './font-manager.js';
8
7
  import type { FontDescriptor, UnicodeFontDescriptor, FontParser } from './types.js';
9
8
  import type { ByteArray } from '../types.js';
10
- /**
11
- * Represents an embedded font in a PDF document.
12
- * Extends PdfDictionary to provide both font metadata and PDF dictionary structure.
13
- */
14
- export declare class PdfFont extends PdfDictionary<{
9
+ type PdfFontDictionary = PdfDictionary<{
15
10
  Type: PdfName<'Font'>;
16
11
  Subtype: PdfName<'Type1' | 'TrueType' | 'Type0'>;
17
12
  BaseFont: PdfName;
@@ -22,27 +17,20 @@ export declare class PdfFont extends PdfDictionary<{
22
17
  Widths?: PdfArray<PdfNumber>;
23
18
  DescendantFonts?: PdfArray<PdfObjectReference>;
24
19
  ToUnicode?: PdfObjectReference;
25
- }> {
20
+ }>;
21
+ type PdfStandardFontName = 'Helvetica' | 'Helvetica-Bold' | 'Helvetica-Oblique' | 'Helvetica-BoldOblique' | 'Times-Roman' | 'Times-Bold' | 'Times-Italic' | 'Times-BoldItalic' | 'Courier' | 'Courier-Bold' | 'Courier-Oblique' | 'Courier-BoldOblique' | 'Symbol' | 'ZapfDingbats';
22
+ /**
23
+ * Represents an embedded font in a PDF document.
24
+ * Extends PdfIndirectObject with a PdfDictionary content for the font dict.
25
+ */
26
+ export declare class PdfFont extends PdfIndirectObject<PdfFontDictionary> {
26
27
  /**
27
28
  * The PDF resource name used in content streams (e.g., 'F1', 'F2').
28
29
  * This is the identifier used in PDF operators like `/F1 12 Tf`.
29
30
  */
30
31
  resourceName: string;
31
- /**
32
- * Reference to the container indirect object that wraps this font dict.
33
- * Set by FontManager.write() when the font is committed to the PDF.
34
- */
35
- container?: PdfIndirectObject;
36
- /**
37
- * Auxiliary objects that must be committed along with the font dict.
38
- * Includes FontDescriptor, FontFile2, CIDFont, ToUnicode, etc.
39
- */
40
- protected auxiliaryObjects: PdfIndirectObject[];
41
- /**
42
- * @internal
43
- * Reference to the font manager that created this font.
44
- */
45
- private manager?;
32
+ private static _resourceCounter;
33
+ private static nextResourceName;
46
34
  /**
47
35
  * @internal
48
36
  * Font descriptor with metrics and properties.
@@ -53,20 +41,34 @@ export declare class PdfFont extends PdfDictionary<{
53
41
  * Original font file bytes.
54
42
  */
55
43
  private _fontData?;
44
+ constructor(font: PdfIndirectObject);
45
+ constructor(fontName: string);
56
46
  constructor(options: {
57
- dict?: PdfDictionary;
58
47
  fontName?: string;
59
48
  resourceName?: string;
60
49
  encoding?: string;
61
- manager?: PdfFontManager;
62
- container?: PdfIndirectObject;
63
50
  descriptor?: FontDescriptor | UnicodeFontDescriptor;
64
51
  fontData?: ByteArray;
65
52
  });
53
+ get dict(): PdfFontDictionary;
66
54
  get fontName(): string | undefined;
67
55
  set fontName(name: string | undefined);
68
56
  get encoding(): string | undefined;
69
57
  set encoding(enc: string | undefined);
58
+ /**
59
+ * Gets the encoding map from the font's Encoding dictionary's Differences array.
60
+ * Maps byte codes to Unicode characters for custom-encoded fonts.
61
+ */
62
+ get encodingMap(): Map<number, string> | null;
63
+ /**
64
+ * Gets the reverse encoding map (Unicode character → byte code).
65
+ * Useful for encoding text back into the font's custom encoding.
66
+ */
67
+ get reverseEncodingMap(): Map<string, number> | undefined;
68
+ /**
69
+ * Whether this font uses Unicode (Type0/composite) encoding.
70
+ */
71
+ get isUnicode(): boolean;
70
72
  /**
71
73
  * Gets the font descriptor with metrics and properties.
72
74
  * Available for embedded fonts, undefined for standard fonts or loaded fonts without descriptor.
@@ -109,6 +111,39 @@ export declare class PdfFont extends PdfDictionary<{
109
111
  * Sets the character widths array.
110
112
  */
111
113
  set widths(values: number[] | undefined);
114
+ /**
115
+ * Gets the raw character width (in 1000-unit em square) for a character code.
116
+ * Returns null if the character is not in the font's width table.
117
+ *
118
+ * @param charCode - The character code to get the width for
119
+ * @returns The raw character width or null if not found
120
+ */
121
+ getRawCharacterWidth(charCode: number): number | null;
122
+ /**
123
+ * Gets the character width scaled to the specified font size.
124
+ * Returns null if the character is not in the font's width table.
125
+ *
126
+ * @param charCode - The character code to get the width for
127
+ * @param fontSize - The font size to scale to
128
+ * @returns The scaled character width or null if not found
129
+ */
130
+ getCharacterWidth(charCode: number, fontSize: number): number | null;
131
+ /**
132
+ * Checks if the font has width data for a character code.
133
+ *
134
+ * @param charCode - The character code to check
135
+ * @returns True if width data is available, false otherwise
136
+ */
137
+ hasCharacterWidth(charCode: number): boolean;
138
+ /**
139
+ * Gets character widths for all characters in a string.
140
+ * Returns null for characters not in the font's width table.
141
+ *
142
+ * @param text - The text to get character widths for
143
+ * @param fontSize - The font size to scale to
144
+ * @returns Array of character widths (null for missing characters)
145
+ */
146
+ getCharacterWidthsForString(text: string, fontSize: number): (number | null)[];
112
147
  /**
113
148
  * Returns the resource name for string coercion.
114
149
  * This enables using PdfFont objects in template literals like:
@@ -117,15 +152,10 @@ export declare class PdfFont extends PdfDictionary<{
117
152
  * ```
118
153
  */
119
154
  toString(): string;
120
- /**
121
- * Returns all objects that need to be committed to the PDF.
122
- * Includes auxiliary objects (descriptors, streams) and the container.
123
- */
124
- getObjectsToCommit(): PdfIndirectObject[];
125
155
  /**
126
156
  * @internal
127
157
  * Legacy property for backward compatibility with code that accesses fontRef.
128
- * Returns the container object if available.
158
+ * Returns this font's reference since PdfFont IS the indirect object.
129
159
  */
130
160
  get fontRef(): PdfObjectReference;
131
161
  /**
@@ -150,9 +180,35 @@ export declare class PdfFont extends PdfDictionary<{
150
180
  * These fonts don't require font data as they're built into PDF viewers.
151
181
  *
152
182
  * @param fontName - One of the 14 standard PDF fonts
183
+ * @param widths - Optional AFM widths array (1/1000 em units) for chars 32–126
153
184
  * @returns A PdfFont instance ready to be written to the PDF
154
185
  */
155
- static fromStandardFont(fontName: 'Helvetica' | 'Helvetica-Bold' | 'Helvetica-Oblique' | 'Helvetica-BoldOblique' | 'Times-Roman' | 'Times-Bold' | 'Times-Italic' | 'Times-BoldItalic' | 'Courier' | 'Courier-Bold' | 'Courier-Oblique' | 'Courier-BoldOblique' | 'Symbol' | 'ZapfDingbats'): PdfFont;
186
+ static fromStandardFont(fontName: PdfStandardFontName, widths?: number[]): PdfFont;
187
+ private static readonly _HELVETICA_WIDTHS;
188
+ private static readonly _HELVETICA_BOLD_WIDTHS;
189
+ private static readonly _TIMES_ROMAN_WIDTHS;
190
+ private static readonly _TIMES_BOLD_WIDTHS;
191
+ private static readonly _TIMES_ITALIC_WIDTHS;
192
+ private static readonly _TIMES_BOLD_ITALIC_WIDTHS;
193
+ static readonly HELVETICA: PdfFont;
194
+ static readonly HELVETICA_BOLD: PdfFont;
195
+ static readonly HELVETICA_OBLIQUE: PdfFont;
196
+ static readonly HELVETICA_BOLD_OBLIQUE: PdfFont;
197
+ static readonly TIMES_ROMAN: PdfFont;
198
+ static readonly TIMES_BOLD: PdfFont;
199
+ static readonly TIMES_ITALIC: PdfFont;
200
+ static readonly TIMES_BOLD_ITALIC: PdfFont;
201
+ static readonly COURIER: PdfFont;
202
+ static readonly COURIER_BOLD: PdfFont;
203
+ static readonly COURIER_OBLIQUE: PdfFont;
204
+ static readonly COURIER_BOLD_OBLIQUE: PdfFont;
205
+ static readonly SYMBOL: PdfFont;
206
+ static readonly ZAPF_DINGBATS: PdfFont;
207
+ private static readonly BY_BASE_FONT;
208
+ /**
209
+ * Returns the static PdfFont instance for a standard font name, or null if not found.
210
+ */
211
+ static getStandardFont(fontName: string): PdfFont | null;
156
212
  /**
157
213
  * Creates a TrueType font from font file data.
158
214
  * Uses WinAnsiEncoding for standard 8-bit character support.
@@ -174,6 +230,11 @@ export declare class PdfFont extends PdfDictionary<{
174
230
  * @returns A PdfFont instance ready to be written to the PDF
175
231
  */
176
232
  static fromType0Data(fontData: ByteArray, fontName: string, descriptor: UnicodeFontDescriptor, unicodeMappings?: Map<number, number>): PdfFont;
233
+ static fromFile(fontData: ByteArray, options?: {
234
+ fontName?: string;
235
+ unicode?: boolean;
236
+ unicodeMappings?: Map<number, number>;
237
+ }): PdfFont;
177
238
  /**
178
239
  * Generates a ToUnicode CMap for mapping CIDs to Unicode code points.
179
240
  */
@@ -183,3 +244,4 @@ export declare class PdfFont extends PdfDictionary<{
183
244
  */
184
245
  private static buildCIDWidthArray;
185
246
  }
247
+ export {};