/** * Low-level PDF object primitives. * * PDF is built from a small set of object types: booleans, numbers, strings, * names, arrays, dictionaries, streams, and indirect object references. * This module provides serialization for all of them. * * @see PDF Reference 1.7, Chapter 3 - Objects */ /** * Escape a string for PDF string literal (parentheses-delimited). * Escapes backslash, parentheses, and non-printable characters. */ export declare function pdfString(value: string): string; /** * Format a PDF hex string from raw bytes. */ export declare function pdfHexString(bytes: Uint8Array): string; /** * Format a PDF name object. Names are prefixed with /. * Characters outside the printable ASCII range are encoded as #XX. */ export declare function pdfName(name: string): string; /** * Format a PDF number. Integers are output without decimal point. * Floats are rounded to 4 decimal places to avoid floating-point noise. */ export declare function pdfNumber(value: number): string; /** * Format a PDF boolean. */ export declare function pdfBoolean(value: boolean): string; /** * Format a PDF array from pre-serialized elements. */ export declare function pdfArray(elements: string[]): string; /** * Format a PDF indirect object reference. */ export declare function pdfRef(objectNumber: number, generation?: number): string; /** * Format a PDF date string conforming to the PDF date format. * Format: D:YYYYMMDDHHmmSSOHH'mm */ export declare function pdfDate(date: Date): string; /** * Builds a PDF dictionary object from key-value pairs. * Values are already-serialized PDF strings. */ export declare class PdfDict { private entries; /** When set, toString() returns this raw string. set() appends/replaces entries within it. */ private _raw; /** * Create a PdfDict that wraps a pre-serialized dictionary string. * toString() returns the raw string (with any set() overrides applied). */ static fromRawString(raw: string): PdfDict; /** * Set a dictionary entry. The key should NOT include the leading /. * The value should be a pre-serialized PDF value string. */ set(key: string, value: string): this; /** * Conditionally set a dictionary entry. */ setIf(condition: boolean, key: string, value: string): this; /** * Remove a dictionary entry by key. */ delete(key: string): this; /** * Serialize to a PDF dictionary string. */ toString(): string; }