import { PDFObject } from './pdf-object.ts'; import type { PDFWriter } from './pdf-writer.ts'; /** * Represents a PDF string object, which can be either a literal string or a hex string. */ export declare class PDFString extends PDFObject { /** The string value of the PDFString. */ readonly string: string; /** Whether the PDFString is hex-encoded. */ readonly isHex: boolean; /** * Creates a PDFString from a byte string (each character must be 0-255). * For Unicode text, use `PDFString.unicode()` instead. */ static of(value: string): PDFString; /** * Creates a hex-encoded PDFString from a byte string (each character must be 0-255). * For Unicode text, use `PDFString.unicode()` instead. */ static hex(value: string): PDFString; /** * Creates a hex-encoded PDFString from the given bytes. * Useful for binary data like file IDs or encrypted content. */ static ofBytes(bytes: readonly number[] | Uint8Array): PDFString; /** * Creates a PDFString from a Unicode string using UTF-16BE encoding with BOM. * This is the standard way to encode Unicode text in PDF for metadata, * bookmarks, form fields, etc. */ static unicode(value: string): PDFString; private constructor(); /** * Writes the PDF string to the given PDFWriter. */ write(writer: PDFWriter): void; private writeHexString; private writeLiteralString; }