@libpdf/core 0.2.7 → 0.2.8

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/dist/index.d.mts CHANGED
@@ -182,6 +182,8 @@ declare class PdfName implements PdfPrimitive {
182
182
  static readonly Length: PdfName;
183
183
  static readonly Filter: PdfName;
184
184
  static readonly FlateDecode: PdfName;
185
+ /** Cached serialized form (e.g. "/Type"). Computed lazily on first toBytes(). */
186
+ private cachedBytes;
185
187
  private constructor();
186
188
  /**
187
189
  * Get or create an interned PdfName for the given string.
@@ -4966,6 +4968,8 @@ interface ExtractedChar {
4966
4968
  fontName: string;
4967
4969
  /** Y coordinate of the text baseline */
4968
4970
  baseline: number;
4971
+ /** Index in the content stream extraction order (0-based) */
4972
+ sequenceIndex?: number;
4969
4973
  }
4970
4974
  /**
4971
4975
  * A span of text with the same font and size on the same line.
@@ -8727,6 +8731,24 @@ interface SaveOptions {
8727
8731
  * @default false
8728
8732
  */
8729
8733
  subsetFonts?: boolean;
8734
+ /**
8735
+ * Compress uncompressed streams with FlateDecode (default: true).
8736
+ *
8737
+ * When enabled, streams without a /Filter entry will be compressed
8738
+ * before writing. Streams that already have filters (including image
8739
+ * formats like DCTDecode/JPXDecode) are left unchanged.
8740
+ */
8741
+ compressStreams?: boolean;
8742
+ /**
8743
+ * Minimum stream size in bytes to attempt compression (default: 512).
8744
+ *
8745
+ * Streams smaller than this threshold are written uncompressed.
8746
+ * Deflate initialization has a fixed overhead that dominates for small
8747
+ * payloads, and tiny streams rarely achieve meaningful compression.
8748
+ *
8749
+ * Set to 0 to compress all streams regardless of size.
8750
+ */
8751
+ compressionThreshold?: number;
8730
8752
  }
8731
8753
  /**
8732
8754
  * Options for adding a new page.