--- url: 'https://zeropdf.criston.dev/guide/getting-started.md' --- # Getting Started The package is published to a private registry. Point the `@criston` scope at it once, in your project's `.npmrc` (public npm stays untouched for every other package): ```ini @criston:registry=https://nodeproxy.criston.dev ``` Then install in a TypeScript project: ```sh npm i @criston/zeropdf ``` Create a document, add a page, write content, and serialize the result: ```ts import { createDocument, rgb } from "@criston/zeropdf"; const doc = createDocument({ title: "Hello PDF", info: { author: "zeropdf" } }); const page = doc.addPage({ size: "A4" }); page.text("Hello from TypeScript", { x: 56, y: 780, fontSize: 18, color: rgb(0.13, 0.2, 0.34) }); page.textBlock("Wrapped copy with predictable line breaks.", { x: 56, y: 740, width: 240, fontSize: 12, lineHeight: 16, align: "center" }); const bytes = doc.toUint8Array(); ``` The library returns standard binary data, so you can write the bytes in Node.js, upload them, or create a `Blob` in the browser. ## Convenience helpers A few options keep call sites short: ```ts import { createDocument, mm, rgb } from "@criston/zeropdf"; // Document-wide text defaults: fill in font/size/color so calls stay terse. const doc = createDocument({ defaults: { font: "Helvetica", fontSize: 12, color: rgb(0.1, 0.1, 0.1) } }); // Author in physical units (mm/cm/inch) instead of raw points. // Page builder methods are chainable. doc.addPage({ size: "A4" }) .text("Title", { x: mm(20), y: mm(270), fontSize: 18, bold: true }) .text("Body copy uses the document defaults.", { x: mm(20), y: mm(258) }); // Node.js shortcut for writing to disk (alias of writeToFile). await doc.save("out.pdf"); ``` * **Units** — `mm()`, `cm()`, `inch()`, and `pt()` convert to PDF points. * **`bold` / `italic`** — resolve to the right font face. See [Text and Fonts](./text-and-fonts). * **`defaults`** — document-wide `font`, `fontSize`, `color`, `kerning`, `direction`, overridden per call. * **Chaining** — page builder methods return the page, so calls compose. * **`doc.save(path)`** — Node-only; in the browser use `toUint8Array()` or `toBlob()`. * **Top-left origin** — see [Coordinate system](#coordinate-system) below. ## Coordinate system All positions and sizes are in **points** (1 pt = 1/72 inch). By default the origin is the **bottom-left** corner and `y` grows **upward** — the native PDF convention. So on an A4 page (842 pt tall) `y: 800` is near the top and `y: 40` is near the bottom. If you prefer the screen/CSS convention where `y` grows **downward** from the top, pass `origin: "top-left"` when creating the page: ```ts const page = doc.addPage({ size: "A4", origin: "top-left" }); page.text("Near the top", { x: 56, y: 56 }); // 56 pt down from the top edge page.rect(56, 100, 200, 80, { stroke: "navy" }); // y is the box's top edge ``` With `origin: "top-left"`: * For text, `y` is the baseline distance from the top. * For boxes and images (`rect`, `image`, `path` rectangles), `y` is the **top** edge. * Lines, circles, and ellipses flip their `y`/`cy` coordinates accordingly. This applies to the page drawing methods (`text`, `textBlock`, `richText`, `rect`, `line`, `circle`, `ellipse`, `image`, `path`) **and** the annotation and form-field methods (`link`, `highlight`, `note`, `freeText`, `textField`, `checkBox`, `choiceField`, `radioGroup`, `pushButton`, `signatureField`). The flow/template layout APIs always use bottom-left coordinates. Use the [unit helpers](#convenience-helpers) (`mm`/`cm`/`inch`) with either origin. ## Common imports ```ts import { appendPages, createDocument, editDocument, extractPages, mergeDocuments, parseDocument, rgb, splitDocument } from "@criston/zeropdf"; ``` ## Local examples This repo includes executable examples: ```sh npm run example:hello npm run example:image npm run example:png npm run example:tagged npm run example:web ``` The browser demo runs at `http://localhost:4173/` after `npm run example:web`. --- --- url: 'https://zeropdf.criston.dev/guide/choosing-an-api.md' --- # Choosing an API zeropdf offers a few layers, from absolute drawing to automatic multi-page layout. This page maps common goals to the right tool so you don't have to scan the whole reference. ## Text | Goal | Use | |------|-----| | Draw one line at an exact spot | [`page.text(text, options)`](./text-and-fonts) | | Wrap a paragraph to a width | [`page.textBlock(text, options)`](./text-and-fonts#wrapped-text-blocks) | | Mixed fonts/sizes/colors/links on the same line | [`page.richText(runs, options)`](./text-and-fonts#inline-rich-text-mixed-styles-on-one-line) | | Inline link/highlight over a substring of a uniform paragraph | `paragraph` + `annotations` (see [Forms and Annotations](./forms-and-annotations)) | | Flowing content with auto-pagination, headers/footers | [`renderTemplate()`](./report-templates) or the [`PdfFlow`](./report-templates) cursor | | Know a size before drawing | [`doc.measureText` / `measureTextBlock` / `measureRichText`](./text-and-fonts#measuring-text) | | Draw and stack manually using the consumed height | `page.placeText` / `page.placeTextBlock` (return `endY`) | ### Manual vertical stacking `text`/`textBlock`/`richText` return the page (for chaining) and don't tell you where the text ended. When you're laying out by hand and need the next `y`, use the `place*` variants, which draw **and** return metrics: ```ts let y = 760; y = page.placeTextBlock("Intro paragraph…", { x: 56, y, width: 480 }).endY - 8; y = page.placeTextBlock("Next paragraph…", { x: 56, y, width: 480 }).endY - 8; ``` For anything beyond a few blocks, prefer the flow/template APIs — they track the cursor, wrap, and paginate for you. ## Graphics and images | Goal | Use | |------|-----| | Rectangle / line / circle / ellipse | [`page.rect` / `line` / `circle` / `ellipse`](./vector-graphics#shape-helpers) | | Arbitrary vector geometry | [`page.path(commands, style)`](./vector-graphics#path-commands) | | Embed an image, format known | `page.png` / `page.jpeg` / … (see [Images](./images)) | | Embed an image, format unknown | [`page.image(data, options)`](./images#auto-detecting-the-format) | | SVG | `page.svg(data, options)` | | Default stroke/fill for many shapes | `createDocument({ shapeDefaults })` | ## Color, fonts, units, coordinates | Goal | Use | |------|-----| | Color | `rgb()`, `cmyk()`, `gray()`, `hex()`, or a [named color](./vector-graphics#colors) string / `color()` | | Bold/italic, font families | [`registerFontFamily()`](./text-and-fonts#embedded-fonts-font-families) + `bold`/`italic` flags | | Underline / strike-through | `underline` / `strike` text options | | Physical units | `mm()`, `cm()`, `inch()`, `pt()` | | Document-wide text defaults | `createDocument({ defaults })` | | `y` grows downward from the top | `addPage({ origin: "top-left" })` (see [Coordinate system](./getting-started#coordinate-system)) | ## Structure, forms, and assembly | Goal | Use | |------|-----| | Tables | `page.table(rows, options)` or a `table` template block | | Lists | `page.list(items, options)` | | Form fields | `page.textField` / `checkBox` / `choiceField` / `radioGroup` / `pushButton` / `signatureField` (see [Forms and Annotations](./forms-and-annotations)) | | Tagged structure for accessibility | `page.container()` / `page.structure()` (see [Accessibility](./accessibility-and-compliance)) | | Edit an existing PDF | [`editDocument()` / `parseDocument()`](./edit-existing-pdfs) | | Merge / split / extract / append pages | [Page Assembly](./page-assembly) helpers | ## Page vs. flow vs. template — which layout model? * **Page methods** (`page.text`, `page.rect`, …) — you place everything at explicit coordinates. Most control; you manage layout. * **Flow** (`page.flow()`) — a cursor that advances as you add blocks; wraps and (with an overflow handler) continues across columns/pages. Good for one-off flowing sections. * **Template** (`doc.renderTemplate()`) — declarative blocks with stylesheets, headers/footers, page numbers, and automatic pagination. Best for reports and documents. Start with templates for documents, drop to flow for a flowing region inside a hand-laid page, and use page methods for pixel-precise placement. --- --- url: 'https://zeropdf.criston.dev/guide/browser-usage.md' --- # Browser Usage The package works with browser-friendly binary values. You can generate a PDF, wrap it in a `Blob`, and preview or download it. ```ts import { createDocument } from "@criston/zeropdf"; const doc = createDocument(); const page = doc.addPage(); page.text("Preview me", { x: 56, y: 760, fontSize: 16 }); const blob = doc.toBlob(); const url = URL.createObjectURL(blob); iframe.src = url; ``` ## Streaming to a Response Use `WebStreamSink` with a `TransformStream` to stream a PDF straight to the browser without buffering the whole document: ```ts import { WebStreamSink } from "@criston/zeropdf"; const { readable, writable } = new TransformStream(); const sink = new WebStreamSink(writable); void doc.writeTo(sink).then(() => sink.close()); const response = new Response(readable, { headers: { "Content-Type": "application/pdf" } }); ``` `BufferSink` also works in the browser when you just need the bytes. ## Browser limitations The core engine — generation, parsing, editing, fonts, images, tables, templates, annotations, and tagged PDF — runs in the browser with no Node dependencies. Two areas are Node-only: * **Disk-backed output.** `TempFileSink`, `NodeStreamSink`, and `writeToFile` rely on `node:fs` and are not available in the browser. Use `toBlob()`, `toArrayBuffer()`, `toUint8Array()`, `BufferSink`, or `WebStreamSink` instead. * **AES encryption.** AES-encrypting a document requires Node's `node:crypto`; in the browser it throws `"AES PDF encryption requires Node.js crypto support in this build."` Generate unencrypted PDFs client-side and encrypt server-side if you need protection. (Secure random bytes fall back to the Web Crypto API where available.) The Node-only sinks load `node:fs` through a lazy dynamic `import()`, so bundlers building for the browser will not pull them into the core path. ## Playground The repo includes a browser playground in `examples/website`: write template code on the left and see the rendered PDF on the right, all in-browser. ```sh npm run example:web ``` Open `http://localhost:4173/`, edit the code, and press Run (or ⌘/Ctrl+Enter). Every `zeropdf` export is in scope; your code just needs to build a document and `return` it. --- --- url: 'https://zeropdf.criston.dev/guide/streaming-and-output.md' --- # Streaming and Output PDFs serialize to `Uint8Array` by default. For large documents, write directly to a sink so memory stays bounded. ## In-memory bytes ```ts const bytes = doc.toUint8Array(); ``` ## Browser blob ```ts const blob = doc.toBlob(); const url = URL.createObjectURL(blob); ``` ## Node writable streams ```ts import { NodeStreamSink } from "@criston/zeropdf"; import { createWriteStream } from "node:fs"; await doc.writeTo(new NodeStreamSink(createWriteStream("out.pdf"))); ``` ## Web streams `WebStreamSink` wraps a `WritableStream`. Pair it with a `TransformStream` to stream straight into a `Response`: ```ts import { WebStreamSink } from "@criston/zeropdf"; const { readable, writable } = new TransformStream(); const sink = new WebStreamSink(writable); void doc.writeTo(sink).then(() => sink.close()); const response = new Response(readable, { headers: { "Content-Type": "application/pdf" } }); ``` ## Memory sink `BufferSink` collects chunks for later assembly when you need bytes but not a single large allocation up front: ```ts import { BufferSink } from "@criston/zeropdf"; const sink = new BufferSink(); await doc.writeTo(sink); const bytes = sink.collect(); ``` ## BufferSink Size Limits Guard against memory blowout with `maxSize`: ```ts const sink = new BufferSink({ maxSize: 50 * 1024 * 1024 }); // 50 MB await doc.writeTo(sink); const bytes = sink.collect(); ``` Throws if the accumulated data exceeds the limit. ## TempFileSink Spill large documents to disk automatically with a temporary file sink: ```ts import { TempFileSink } from "@criston/zeropdf"; const sink = new TempFileSink(); await doc.writeTo(sink); const bytes = await sink.getBytes(); await sink.close(); // deletes the temp file ``` Keeps memory bounded regardless of document size. ## Progressive Page Streaming Build large documents page-by-page without holding everything in memory: ```ts const doc = createDocument(); for (const pageData of hugeDataset) { const page = doc.addPage(); page.text(pageData.title); // ... fill page ... await doc.writeNextPage(sink); } await doc.finalize(sink); ``` Each page's objects are serialized and released before the next page begins. ## Async Write Consistency All `writeTo()` and `writeNextPage()` calls are automatically serialized to prevent concurrent writes from corrupting the output stream. ## Document Finalization A document becomes immutable after its first serialization. Calling `addPage()`, `textField()`, or other mutating methods after `toUint8Array()` or `writeTo()` will throw. ## Custom sinks Implement `ByteSink`: ```ts import type { ByteSink } from "@criston/zeropdf"; class CountingSink implements ByteSink { bytesWritten = 0; async write(chunk: Uint8Array) { this.bytesWritten += chunk.length; } async close() {} } ``` ## Object streams for smaller files PDF 1.5 object streams compress indirect objects together. Enable on the document: ```ts const doc = createDocument({ objectStreams: true }); ``` The encoder still falls back to classic xref where required (encrypted catalogs, signature dictionaries). ## Linearized output Linearized output emits the initial Fast Web View metadata at the start of the file: ```ts const doc = createDocument({ linearize: true }); ``` The current linearized writer uses classic xref tables, supports single-page generated documents, and is intentionally separate from object streams, encryption, and detached signatures. ## Deterministic output Serialization is deterministic when input is deterministic: stable IDs, no timestamps inserted automatically. Provide `info.creationDate` and XMP dates explicitly to keep snapshots reproducible. --- --- url: 'https://zeropdf.criston.dev/guide/performance.md' --- # Performance Guide How to choose the right output mode, minimize file size, and avoid memory pressure for PDFs of any scale. ## Decision tree ``` Document size → ┬─ < 1 MB ──────► toUint8Array() (simplest) │ ├─ 1–50 MB ─────► toUint8Array() or BufferSink │ ├─ 50–200 MB ───► NodeStreamSink / WebStreamSink │ └─ > 200 MB ────► Stream + object streams + linearize if web ``` ## Streaming vs in-memory ### `toUint8Array()` Returns the entire PDF as one allocation. Suitable for nearly all generated documents. The serializer writes sequentially to a growing buffer. ```ts const bytes = doc.toUint8Array(); // bytes occupies ~file_size bytes of memory ``` **Use when:** document fits in memory comfortably, you need a `Uint8Array` for upload, or you're running in a serverless function with low concurrency. ### `NodeStreamSink` Writes directly to a Node.js writable stream. Only one chunk is buffered at a time. ```ts import { NodeStreamSink } from "@criston/zeropdf"; import { createWriteStream } from "node:fs"; await doc.writeTo(new NodeStreamSink(createWriteStream("large.pdf"))); ``` **Use when:** generating files larger than available memory, serving HTTP responses with `res.writeHead`, or writing to cloud storage. ### `WebStreamSink` Streams to a browser `WritableStream` (pair with a `TransformStream` to feed a `Response`). ```ts import { WebStreamSink } from "@criston/zeropdf"; const { readable, writable } = new TransformStream(); const sink = new WebStreamSink(writable); void doc.writeTo(sink).then(() => sink.close()); const response = new Response(readable, { headers: { "Content-Type": "application/pdf" } }); ``` **Use when:** browser-side generation for large documents, progressive download. ### `BufferSink` Collects chunks into a buffer array, then assembles at the end. Avoids a single large allocation during serialization, but the final `collect()` step still creates one contiguous `Uint8Array`. ```ts const sink = new BufferSink(); await doc.writeTo(sink); const bytes = sink.collect(); ``` **Use when:** you need bytes at the end but want bounded memory during serialization. ## Object streams Object streams compress multiple indirect objects into a single compressed stream. Enable with: ```ts const doc = createDocument({ objectStreams: true }); ``` ### Size impact Object streams reduce file size by roughly 20–30% for typical documents by consolidating small dictionaries and arrays into a single deflate-compressed block. The margin is larger for documents with many small objects (form fields, annotations, structure elements). ### Trade-offs | Aspect | Classic xref (default) | Object streams | |--------|----------------------|----------------| | PDF version | 1.4 | 1.5 | | File size | Larger | Smaller (≈20–30%) | | Encryption compatibility | All modes | rc4-128, aes-128, aes-256 only | | Detached signatures | Supported | Supported | | Linearized output | Supported | Not supported | | Parse/edit compatibility | Broad | Requires xref-stream capable reader | | Memory during generation | Same | Same (streamed inline) | ### When to enable Enable object streams for: * Documents with many small indirect objects (>500 objects) * Internal archival formats where file size matters * PDFs targeting PDF 1.5+ viewers Skip object streams for: * Documents that must be PDF 1.4 compatible * Linearized output (`linearize: true`) * Environments where classic xref compatibility is required ## Font subsetting costs Every embedded TrueType font is subsetted automatically: only glyphs actually used in the document are included, and unused OpenType tables (GPOS, GSUB, apple, meta) are stripped. ### Storage savings | Scenario | Full TTF | Subsetted | Savings | |----------|----------|-----------|---------| | Latin-only body (Source Sans 3) | 88 KB | 8 KB | 91% | | Latin + Greek + Cyrillic body | 88 KB | 18 KB | 80% | | CJK (Noto Sans CJK SC) | 16 MB | 120 KB (used chars) | 99%+ | ### Performance cost Subsetting runs once per embedded font during serialization (not during page authoring). For a typical Latin font with <100 glyphs used, subsetting takes <2ms. For CJK fonts with thousands of glyphs, it can take 20–50ms. ### Disabling subsetting Not currently supported. The subsetter always runs for embedded TrueType fonts. If you need the full font embedded (e.g., editable PDFs), this is a limitation to be aware of. ## Encryption overhead | Algorithm | Encryption cost | File size overhead | |-----------|----------------|-------------------| | `rc4-40` | Negligible | ~50 bytes (enc dict) | | `rc4-128` | Negligible | ~50 bytes | | `aes-128` | <1ms per page of content | ~50 bytes | | `aes-256` | <2ms per page of content | ~50 bytes | | `aes-256-r6` (PDF 2.0) | <2ms per page | ~100 bytes | Encryption adds per-stream overhead (16 bytes per AES block), but this is trivial compared to stream content. ## Linearized output Linearized output emits Fast Web View metadata at the start of the file, enabling progressive rendering in compatible viewers: ```ts const doc = createDocument({ linearize: true }); ``` ### Trade-offs | Aspect | Standard output | Linearized | |--------|----------------|------------| | Byte-for-byte changes | Rearranged object order | Document catalog + hint table at front | | Compatible with object streams | — | No | | Compatible with encryption | — | No | | Compatible with detached signatures | — | No | | Page count | Any | Single-page (current limitation) | **Use when:** single-page generated PDFs served over HTTP where progressive rendering is desired. ## Memory profile by page count Estimated memory for a document with 24 lines of text per page, one embedded Latin TTF (subsetted to 8 KB), no images: | Pages | In-memory (toUint8Array) | Streaming (NodeStreamSink) | |-------|--------------------------|---------------------------| | 1 | ~14 KB | ~2 KB peak | | 100 | ~1.1 MB | ~2 KB peak | | 10,000 | ~110 MB | ~2 KB peak | | 100,000 | ~1.1 GB | ~2 KB peak | These are estimates; actual numbers depend on content density. Images and embedded fonts increase memory proportionally. ## Parallel execution The serializer is synchronous. For bulk generation, run multiple `createDocument`/`toUint8Array` calls in parallel using `Promise.all` or worker threads: ```ts const documents = await Promise.all( records.map((record) => { const doc = createDocument({ /* ... */ }); doc.addPage().text(record.summary, { x: 56, y: 760 }); return doc.toUint8Array(); }) ); ``` Each document is independent and does not share mutable state. ## Spill-to-Disk Strategy When a document exceeds available RAM, use `TempFileSink` to spill serialized data directly to a temporary file. This avoids holding the entire PDF in memory: ```ts import { TempFileSink } from "@criston/zeropdf"; const sink = new TempFileSink(); // manages its own temp file await doc.writeTo(sink); const bytes = await sink.getBytes(); // read back when needed await sink.close(); // deletes the temp file ``` ### writeToFile convenience For the common case, the `writeToFile` shorthand writes directly to a path: ```ts await doc.writeToFile("/tmp/report.pdf"); ``` Internally, this uses a `TempFileSink` under the hood for documents over a threshold size, and a `BufferSink` for small documents. ## Progressive Page Generation For documents with thousands of pages, use `writeNextPage()` to generate and flush pages one at a time. This avoids holding all page objects in the serializer's working set simultaneously: ```ts const doc = createDocument({ objectStreams: true }); const sink = new NodeStreamSink(createWriteStream("report.pdf")); for (let i = 0; i < 5000; i++) { const page = doc.addPage(); page.text(`Page ${i + 1}`, { x: 56, y: 760 }); await doc.writeNextPage(sink); } await doc.finish(sink); ``` * `writeNextPage()` serializes the most recently added page and releases its resources * After the loop, `finish()` writes the cross-reference table and trailer * Compatible with streaming sinks (`NodeStreamSink`, `WebStreamSink`, `TempFileSink`) ## Lazy Object Loading When parsing an existing PDF, stream content (page descriptions, images, embedded fonts) is not decompressed until first access. This defers CPU and memory costs to the point of use: ```ts const srcDoc = await parseDocument(inputBytes); const page = srcDoc.getPage(0); // Page stream decompressed lazily on first text/image extraction const text = await page.extractText(); ``` Objects that are never accessed during the editing session are never decompressed, reducing parse-time overhead for large documents where only a subset of pages is modified. ## Document Clone `clone()` creates a deep copy of a document without re-rendering, ideal for template-based generation where many variations share the same base content: ```ts const template = createDocument({ objectStreams: true }); template.addPage().text("Header", { x: 56, y: 760 }); for (const record of records) { const doc = template.clone(); doc.getPage(0).text(record.body, { x: 56, y: 720 }); await doc.writeToFile(`output/${record.id}.pdf`); } ``` * Clone copies all objects, fonts, and cross-reference tables * Font data is shared by reference where possible (no re-subsetting) * Cloned documents are independent—mutating one does not affect the original or other clones ## Cross-Document Caching When generating multiple documents that share fonts or images, the library automatically caches and reuses resources across documents: ```ts const fontBytes = await readFile("fonts/SourceSans3-Regular.ttf"); const imageBytes = await readFile("logo.png"); for (const record of records) { const doc = createDocument(); // Font subsetted once, reused on subsequent embeds const font = doc.embedTrueTypeFont(fontBytes, { family: "SS3" }); const page = doc.addPage(); page.png(imageBytes, { x: 56, y: 700, width: 64 }); // Image data reused page.text(record.caption, { x: 56, y: 680, font }); await doc.writeToFile(`out/${record.id}.pdf`); } ``` * Font byte arrays with identical content share a single parsed font representation * Image byte arrays with identical content are encoded once and referenced by subsequent embeds * Cache keys are content-hash based, not reference based—two identical byte arrays from different sources benefit from caching ## See also * [Streaming and Output](./streaming-and-output) — sink API reference * [Text and Fonts](./text-and-fonts) — font embedding * [Encryption and Signatures](./encryption-and-signatures) — password protection --- --- url: 'https://zeropdf.criston.dev/guide/text-and-fonts.md' --- # Text and Fonts The library supports the standard 14 fonts out of the box and embedded TrueType fonts for Unicode, kerning, ligatures, and complex scripts. ## Built-in fonts Use any of the standard 14 PostScript names without loading font data: ```ts page.text("Helvetica sample", { x: 56, y: 760, font: "Helvetica" }); page.text("Times sample", { x: 56, y: 740, font: "Times-Roman" }); page.text("Courier sample", { x: 56, y: 720, font: "Courier" }); ``` Available names: `Helvetica`, `Helvetica-Bold`, `Helvetica-Oblique`, `Helvetica-BoldOblique`, `Times-Roman`, `Times-Bold`, `Times-Italic`, `Times-BoldItalic`, `Courier`, `Courier-Bold`, `Courier-Oblique`, `Courier-BoldOblique`, `Symbol`, `ZapfDingbats`. ## Embedded TrueType fonts Embed any `.ttf` for Unicode coverage and PDF/UA conformance: ```ts import { readFile } from "node:fs/promises"; const fontBytes = await readFile("fonts/SourceSans3-Regular.ttf"); const font = doc.embedTrueTypeFont(fontBytes, { family: "SourceSans3" }); page.text("Hello Ω 漢", { x: 56, y: 700, font, fontSize: 14 }); ``` The embedder subsets glyphs, computes widths, and writes a `ToUnicode` CMap so extracted text round-trips. ## Font weights and styles (bold & italic) The library does not synthesize bold or italic with a faux transform — each weight is a real font face for correct glyph metrics. But you don't have to juggle face names by hand: the `bold` and `italic` options on `text()` and `textBlock()` resolve to the right face. ### Built-in fonts Set `bold` and/or `italic` against a base family name: ```ts page.text("Regular", { x: 56, y: 760, font: "Helvetica" }); page.text("Bold", { x: 56, y: 740, font: "Helvetica", bold: true }); page.text("Italic", { x: 56, y: 720, font: "Helvetica", italic: true }); page.text("Bold Italic", { x: 56, y: 700, font: "Helvetica", bold: true, italic: true }); ``` The base name resolves to the matching standard-14 variant: | Family | Regular | Bold | Italic | Bold + Italic | |--------|---------|------|--------|---------------| | Helvetica | `Helvetica` | `Helvetica-Bold` | `Helvetica-Oblique` | `Helvetica-BoldOblique` | | Times | `Times-Roman` | `Times-Bold` | `Times-Italic` | `Times-BoldItalic` | | Courier | `Courier` | `Courier-Bold` | `Courier-Oblique` | `Courier-BoldOblique` | You can still pass an explicit variant name (e.g. `font: "Helvetica-Bold"`) directly. `Symbol` and `ZapfDingbats` have no weight variants. The `bold`/`italic` flags only resolve against the three base families above; on an already-styled name or an embedded handle they are ignored. ### Embedded fonts: font families Register the weights as a **font family** so the `bold`/`italic` flags work the same way as for built-ins. Pass raw font bytes per face — they are embedded automatically under the family name: ```ts const inter = doc.registerFontFamily("Inter", { regular: await readFile("fonts/Inter-Regular.ttf"), bold: await readFile("fonts/Inter-Bold.ttf"), italic: await readFile("fonts/Inter-Italic.ttf"), boldItalic: await readFile("fonts/Inter-BoldItalic.ttf"), }); page.text("Regular", { x: 56, y: 700, font: inter, fontSize: 14 }); page.text("Bold", { x: 56, y: 680, font: inter, fontSize: 14, bold: true }); page.text("Italic", { x: 56, y: 660, font: inter, fontSize: 14, italic: true }); ``` `registerFontFamily()` returns the family name, so you can use it inline as the `font` value. Each face may be raw font **bytes** (embedded for you), a handle from `embedTrueTypeFont()`, or a built-in name. Only `regular` is required; a missing face falls back to the closest available one (bold italic → bold → italic → regular). The `bold`/`italic` flags and registered families resolve the same way across `page.text()`, `page.textBlock()`, the `PdfFlow` cursor API (`flow.paragraph()`, `flow.heading()`), and `renderTemplate()` blocks. Document-wide [text defaults](./getting-started#convenience-helpers) (`createDocument({ defaults })`) also apply to all of these; per-call options always win, and a font configured on a flow takes precedence over document defaults. If you prefer to manage handles yourself, you can still pass an embedded-font handle directly as `font` and skip the registry entirely. Variable fonts are embedded at their default instance; embed a separate file per named instance to ship multiple weights. ## Inline rich text (mixed styles on one line) `page.text()` and `textBlock()` apply one style to the whole string. To mix fonts, weights, sizes, colors, or links **within a line** — and have them wrap together as one paragraph — use `page.richText()` with an array of `InlineTextRun`s: ```ts import { rgb } from "@criston/zeropdf"; page.richText( [ { text: "Read the " }, { text: "terms", bold: true, link: "https://example.com/terms" }, { text: " and " }, { text: "privacy policy", italic: true, color: rgb(0.1, 0.3, 0.8) }, { text: " before continuing." }, ], { x: 56, y: 700, width: 280, fontSize: 12 } ); ``` Each run carries its own `font`, `bold`, `italic`, `fontSize`, `color`, `kerning`, and `characterSpacing`; anything omitted inherits from the block `options`, then the document defaults. A run with a `link` becomes a clickable URI annotation covering exactly that span (contiguous linked runs on a line merge into one rectangle). Include spaces in the run `text` where you want them between adjacent runs. In the flow/template layout, the same thing is `flow.richParagraph(runs, options)`, or a `richParagraph` template block: ```ts flow.richParagraph([ { text: "Status: " }, { text: "PASSED", bold: true, color: rgb(0, 0.5, 0) }, ]); // As a template block: doc.renderTemplate({ blocks: [ { type: "richParagraph", runs: [ { text: "See the " }, { text: "report", link: "https://example.com/report" }, { text: " for details." }, ], }, ], }); ``` `align` supports `"left" | "center" | "right" | "justify"`, and `direction` accepts `"ltr" | "rtl" | "auto"` (line-level direction — runs are laid out from the right edge, not full mixed-direction bidi). Set `writingMode: "vertical"` to stack the runs in a single column. In flow and template layouts a `richParagraph` wraps and **splits across columns and pages** like a normal paragraph (vertical rich text stays in one column). > For inline **links, highlights, underlines, or notes** over a substring of an *otherwise uniform* paragraph, you can also keep using `paragraph(text, options, annotations)` with `{ type: "link", match, url }` annotations — no need to split the text into runs. Reach for `richText`/`richParagraph` when you need differing **fonts/sizes/colors** on the same line. ## Underline and strike-through Set `underline` and/or `strike` on any text call. They draw a line beneath or through the text (as a decorative artifact), and work per-run in `richText`: ```ts page.text("Important", { x: 56, y: 700, underline: true }); page.text("Removed", { x: 56, y: 684, strike: true, color: "red" }); page.richText( [{ text: "See " }, { text: "the link", underline: true, link: "https://example.com" }], { x: 56, y: 660, width: 200 } ); ``` ## Measuring text Measure text without drawing it — useful for fitting, dynamic box sizing, or manual layout. The document's registered fonts and defaults are applied. ```ts const { width, height } = doc.measureText("Heading", { fontSize: 24, bold: true }); const block = doc.measureTextBlock("Long copy…", { width: 200, fontSize: 12 }); // block => { width, height, lineCount } const rich = doc.measureRichText([{ text: "A " }, { text: "B", bold: true }], { width: 200 }); ``` `measureText` returns the single-line `{ width, height }`; `measureTextBlock` and `measureRichText` return `{ width, height, lineCount }` after wrapping to the given `width`. Measurements use the same engine that draws the text, so they account for the resolved font, `bold`/`italic`, kerning, and registered families. A common use is sizing a box to its content — for example a right-aligned label or a background that hugs the text: ```ts const label = "Total: $1,240.00"; const { width } = doc.measureText(label, { fontSize: 12, bold: true }); const x = pageRight - width; // right-align without a text block page.rect(x - 6, y - 4, width + 12, 20, { fill: "silver" }); page.text(label, { x, y, fontSize: 12, bold: true }); ``` ## Kerning and ligatures Embedded fonts emit kerning-aware `TJ` strings and apply common GSUB ligatures by default. Toggle with `kerning`: ```ts page.text("office", { x: 56, y: 676, font, fontSize: 16, kerning: true }); page.text("office", { x: 56, y: 656, font, fontSize: 16, kerning: false }); ``` ## Wrapped text blocks `textBlock()` lays out paragraphs with width, alignment, and line height: ```ts page.textBlock("Wrapped copy with predictable line breaks.", { x: 56, y: 740, width: 240, fontSize: 12, lineHeight: 16, align: "center" }); ``` Alignment: `"left" | "center" | "right" | "justify"`. ## Vertical alignment Horizontal `align` positions lines across the width. To position content *vertically* within a box of known height, give the box a `height` and a `verticalAlign` of `"top"` (default), `"middle"`, or `"bottom"`. The text is laid out as usual, then shifted down within the box. Works on `textBlock()` and `page.richText()`: ```ts // Vertically centered within a 120pt-tall box starting at y page.textBlock("Centered label", { x: 56, y: 700, width: 200, height: 120, verticalAlign: "middle" }); page.richText( [{ text: "Card " }, { text: "title", bold: true }], { x: 56, y: 560, width: 200, height: 100, verticalAlign: "bottom" } ); ``` `height`/`verticalAlign` apply to horizontal writing mode; without `verticalAlign` the box `height` has no effect (text still starts at `y`). ### Table cells Tables accept `verticalAlign` for the whole table and per cell. In a row where one cell wraps to several lines, shorter cells align within the row height: ```ts page.table( [[ { text: "A long cell that wraps across several lines in its column." }, { text: "Top", verticalAlign: "top" }, { text: "Middle", verticalAlign: "middle" }, { text: "Bottom", verticalAlign: "bottom" }, ]], { x: 56, y: 760, width: 460, columnWidths: [160, 100, 100, 100], verticalAlign: "middle" } ); ``` Per-cell `verticalAlign` overrides the table default; the table default overrides the built-in `"top"`. ## Font fallback Mix built-in and embedded fonts to cover scripts the primary font lacks: ```ts const unicode = doc.embedTrueTypeFont(fallbackBytes, { family: "Fallback" }); page.text("Hello Ω", { x: 56, y: 700, font: "Helvetica", fallbackFonts: [unicode], fontSize: 14 }); ``` Each glyph is resolved against the primary font, then each fallback in order. ## RTL and Arabic shaping Set `direction` to `"rtl"` or `"auto"` to reverse glyph order. Arabic text receives contextual joining forms; `‌` (ZWNJ) and `‍` (ZWJ) override default joining. ```ts page.text("שלום עולם", { x: 56, y: 620, font: hebrewFont, fontSize: 14, direction: "auto" }); page.text("سلام", { x: 240, y: 620, font: arabicFont, fontSize: 18, direction: "auto" }); ``` `textBlock()` with `direction: "rtl"` right-aligns by default. ## Complex Script Shaping Scripts requiring reordering, mark positioning, or syllable clustering—Devanagari, Khmer, Myanmar, Thai—are shaped by the default shaper built into the text engine. The shaper handles: * **Devanagari** — conjuncts, half-forms, repha, and nukta * **Khmer** — subjoined consonants and coeng clusters * **Myanmar** — medial consonants, kinzi, and asat * **Thai** — tone marks, upper/lower vowel positioning, no reordering needed (left-to-right) ```ts const devaFont = doc.embedTrueTypeFont(devaBytes, { family: "NotoDeva" }); page.text("देवनागरी", { x: 56, y: 600, font: devaFont, fontSize: 14 }); ``` ### Custom shapers If your script requires engine-specific shaping logic, implement the `TextShaper` interface: ```ts interface TextShaper { shape(text: string, font: EmbeddedFont): ShapedGlyph[]; } ``` The shaper is document-wide, not per-font. Set it at construction or with `setTextShaper()`: ```ts const doc = new PdfDocument({ textShaper: myShaper }); // or, later: doc.setTextShaper(myShaper); ``` External shapers such as harfbuzzjs or fontkit can be plugged in here to enable full complex-script shaping. ## Vertical Writing Mode Set `writingMode: "vertical"` for CJK vertical text. Glyphs are stacked top-to-bottom: ```ts page.text("縦書きのテキスト", { x: 56, y: 600, font: cjkFont, fontSize: 14, writingMode: "vertical" }); ``` ### Tate-chu-yoko Horizontal-in-vertical digits trigger tate-chu-yoko (horizontal within vertical). Two-digit numbers and short runs of Latin characters are automatically rendered horizontally within a single vertical glyph cell: ```ts page.text("令和5年", { x: 56, y: 600, font: cjkFont, fontSize: 14, writingMode: "vertical" }); // "5" rendered horizontally inline ``` ## Soft Hyphens The soft hyphen character (`\xAD`, U+00AD) inserts an invisible break opportunity. When a line wraps at a soft hyphen, a visible hyphen glyph is rendered at the break point: ```ts page.textBlock("super­cali­fragilistic­expi­ali­docious", { x: 56, y: 720, width: 120, fontSize: 12, lineHeight: 16, font }); // Wraps with visible hyphens at each \xAD position ``` Use soft hyphens to control line-breaking in narrow columns without hard-coding line endings. ## Unicode Supplementary Plane Characters beyond the Basic Multilingual Plane (U+10000–U+10FFFF) occupy 4-byte code points in UTF-16 and map to surrogate pairs. The library handles: * **Emoji** (U+1F600–U+1F9FF) — rendered via embedded color-capable fonts or monochrome fallback glyphs * **CJK Extension B and beyond** (U+20000–U+2FFFF) — mapped through `ToUnicode` CMap entries for text extraction ```ts page.text("Hello 😊🌍", { x: 56, y: 580, font: emojiFont, fontSize: 16 }); ``` Glyphs without a corresponding font table entry are silently omitted; use a font with full supplementary-plane coverage to avoid missing characters. ## Bi-Directional Embedding Explicit directional marks control embedding levels within a single text run: | Character | Code | Effect | |-----------|------|--------| | LRE (Left-to-Right Embedding) | `\u202A` | Starts a left-to-right embedding | | RLE (Right-to-Left Embedding) | `\u202B` | Starts a right-to-left embedding | | PDF (Pop Directional Formatting) | `\u202C` | Terminates the most recent embedding | | LRM (Left-to-Right Mark) | `\u200E` | Invisible LTR marker | | RLM (Right-to-Left Mark) | `\u200F` | Invisible RTL marker | ```ts page.text("\u202Bשלום\u202C world", { x: 56, y: 560, font, fontSize: 14, direction: "auto" }); // "שלום" rendered RTL inside an otherwise LTR run ``` These control characters work alongside the `direction` option for mixed-direction text blocks. ## Built-in Font Encoding The standard 14 fonts support three encodings via the `encoding` option: | Encoding | Character set | Use case | |----------|--------------|----------| | `"WinAnsiEncoding"` | Windows-1252 (default) | Latin-1 + common symbols | | `"MacRomanEncoding"` | Mac OS Roman | Legacy Mac documents | | `"PDFDocEncoding"` | PDFDocEncoding glyph set | ISO Latin-1 with additional characters (Euro, florin, dagger) | ```ts page.text("Åççèñtèd téxt", { x: 56, y: 540, font: "Helvetica", encoding: "WinAnsiEncoding" }); ``` Embedded TrueType fonts always use the font's native cmap and are not affected by the `encoding` option. ## Font Format Support The font embedder accepts TrueType-based formats via `embedTrueTypeFont()`: | Format | Extension | Notes | |--------|-----------|-------| | **TrueType** | `.ttf` | Quadratic Bézier outlines, full Unicode cmap | | **OpenType CFF** | `.otf` | PostScript outlines (Type 2 charstrings), compact file size | | **OpenType CFF2** | `.otf` | Variable-font version of CFF, reduced charstring overhead | | **Type 1** | `.pfb` / `.pfa` | PostScript Type 1 format. PFA (ASCII) and PFB (binary) both supported. Limited to 256 glyphs; no Unicode cmap—use only for legacy compatibility | | **TrueType Collection** | `.ttc` | Multi-font archive. Pass the collection file and specify a `ttcIndex` to select a face | ```ts // OpenType CFF const otfBytes = await readFile("fonts/SourceSerif4-Regular.otf"); const otfFont = doc.embedTrueTypeFont(otfBytes, { family: "SourceSerif4" }); // TTC collection, second face const ttcBytes = await readFile("fonts/Cambria.ttc"); const cambria = doc.embedTrueTypeFont(ttcBytes, { family: "Cambria", ttcIndex: 1 }); ``` Type 1 fonts are supported for compatibility with legacy documents but should be avoided in new documents due to the 256-glyph limit and lack of Unicode mapping. --- --- url: 'https://zeropdf.criston.dev/guide/images.md' --- # Images Embed images directly from byte arrays. JPEG and PNG are the primary raster paths, with additional helpers for BMP, GIF, JPEG2000, JBIG2, TIFF, WebP, and SVG. PNG transparency masks and alpha-channel soft masks are preserved. ## Auto-detecting the format `page.image()` sniffs the raster format from the data's magic bytes (PNG, JPEG, GIF, BMP, TIFF, WebP, JPEG 2000) and dispatches to the right decoder — handy when the format isn't known ahead of time: ```ts import { readFile } from "node:fs/promises"; page.image(await readFile("logo"), { x: 56, y: 600, width: 120, height: 60, altText: "Logo" }); ``` It throws `UNSUPPORTED_IMAGE_FORMAT` if the bytes match no known raster format. For SVG (text, not raster) use `page.svg()`. Use the format-specific methods below when you want a specific decoder or format-only options. ## JPEG ```ts import { readFile } from "node:fs/promises"; const jpegBytes = await readFile("photo.jpg"); page.jpeg(jpegBytes, { x: 56, y: 500, width: 200, height: 150 }); ``` The encoder reads dimensions from the JPEG SOF marker, so width/height default to the native size when omitted. ## PNG ```ts const pngBytes = await readFile("logo.png"); page.png(pngBytes, { x: 56, y: 700, width: 64, height: 64 }); ``` 8-bit grayscale, RGB, indexed, and RGBA PNGs are supported. tRNS palette transparency and full alpha channels are written as image soft masks. ## Aspect ratio Pass only `width` or `height` to scale proportionally: ```ts page.png(pngBytes, { x: 56, y: 700, width: 64 }); ``` ## Additional Image Formats Beyond JPEG and PNG, the library supports several other image formats through dedicated methods: * **BMP** (24-bit and 32-bit) — Windows bitmap format. 32-bit masks are written as image soft masks. * **JPEG2000** (JPXDecode) — Available via `page.jpeg2000()`. Decoder reads the JP2 header for dimensions. * **JBIG2** — Bi-level (black-and-white) compression ideal for scanned documents. Use `page.jbig2()` with monochrome data. * **TIFF** (LZW) — Baseline TIFF with LZW compression. Multi-page TIFFs extract the first page only. * **WebP** (VP8L lossless) — Lossless WebP via `page.webp()`. **WebP lossy is not supported; use lossless only.** * **GIF** — First frame only, with transparency preserved when a transparent color index is present. * **SVG** — Vector conversion via `page.svg()`. Rasterized to a page-relative coordinate space; text elements may be outlined. ### CMYK JPEG JPEG images in the CMYK color space are written with a `DeviceCMYK` color space instead of `DeviceRGB`: ```ts page.jpeg(cmykJpegBytes, { x: 56, y: 500, width: 200 }); // Written as /ColorSpace /DeviceCMYK, /Decode [0 1 0 1 0 1 0 1] ``` ### Indexed PNG palette expansion Indexed (palette-based) PNGs are automatically expanded to direct-color RGB before embedding. The palette entries are written inline in the PDF, and no transparency from the palette table is lost—`tRNS` chunks expand into a full alpha soft mask. ### EXIF orientation JPEG and PNG images with EXIF orientation metadata are automatically rotated to the correct display orientation before embedding. The encoder reads the `Orientation` tag (TIFF/EXIF IFD0) and applies the corresponding transform, so the image appears upright without manual rotation. ## Tagged figures and alt text For PDF/UA output, supply `altText` so screen readers can announce the image: ```ts page.flow({ font }) .png(logoBytes, { width: 32, altText: "Company logo" }); ``` Low-level `page.png()` and `page.jpeg()` accept `altText` and `structure.boundingBox` when used inside a tagged document. Decorative images should be marked as artifacts via `structure: { tag: "Artifact" }`. --- --- url: 'https://zeropdf.criston.dev/guide/vector-graphics.md' --- # Vector Graphics Draw paths, apply transforms, and control the graphics state directly on pages. ## Shape helpers For common shapes, the chainable `rect`, `line`, `circle`, and `ellipse` helpers wrap `path()` with a simplified `ShapeStyle`. The paint mode is inferred: a `fill` and `stroke` together paint both; `fill` alone fills; otherwise the shape is stroked. ```ts page .rect(56, 700, 200, 80, { fill: "yellow", stroke: "red", lineWidth: 1 }) .line(56, 690, 256, 690, { stroke: "blue", lineWidth: 2 }) .circle(150, 600, 40, { fill: rgb(0.1, 0.5, 0.2) }) .ellipse(150, 500, 60, 30, { stroke: "purple" }); ``` `ShapeStyle` fields: | Field | Type | Description | |-------|------|-------------| | `fill` | color | Fill color. Its presence enables fill painting. | | `stroke` | color | Stroke color. Defaults to black when only `lineWidth` is set. | | `lineWidth` | `number` | Stroke width in points. | | `lineCap` | `"butt" \| "round" \| "square"` | Line cap for stroked shapes. | | `lineJoin` | `"miter" \| "round" \| "bevel"` | Line join for stroked shapes. | | `dashArray` | `number[]` | Dash pattern for stroked shapes. | | `tag` | `"Artifact"` | Mark a purely decorative shape so it is excluded from the structure tree. | Paint mode is inferred: `fill` + `stroke` → both, `fill` only → fill, otherwise stroke. The helper signatures are `rect(x, y, width, height, style?)`, `line(x1, y1, x2, y2, style?)`, `circle(cx, cy, radius, style?)`, and `ellipse(cx, cy, rx, ry, style?)`. For arbitrary geometry or per-subpath control, use `path()` directly. These helpers are available on `PdfPage` and `PdfStructureContainer` (absolute coordinates), and on the `PdfFlow` cursor (`rect`/`circle`/`ellipse` position relative to the cursor and advance it; `line` takes absolute points). All builder methods return the builder, so calls chain. ## Colors Color options accept structured colors — `rgb()`, `gray()`, `cmyk()`, `hex()`, `separation()`, `deviceN()` — or a **named color** string resolved to RGB: ```ts page.text("Alert", { x: 56, y: 760, color: "red" }); page.rect(56, 700, 80, 24, { fill: "navy" }); const c = color("teal"); // or color("#0a7") for hex ``` Named colors: `black white gray grey silver red green blue yellow cyan magenta orange purple pink brown navy teal lime maroon olive`. The `color()` helper also parses `#RGB`/`#RRGGBB`. ## Path commands Use `page.path()` with an array of path commands and a paint style. Commands execute in order; the current point carries across commands. ```ts page.path( [ { type: "moveTo", x: 56, y: 750 }, { type: "lineTo", x: 200, y: 750 }, { type: "lineTo", x: 200, y: 700 }, { type: "closePath" } ], { paint: "stroke", stroke: { width: 2, color: rgb(0.13, 0.2, 0.34) } } ); ``` | Command | Required fields | Description | |---------|----------------|-------------| | `moveTo` | `x`, `y` | Move current point without drawing | | `lineTo` | `x`, `y` | Straight line to point | | `rect` | `x`, `y`, `width`, `height` | Rectangle as a closed subpath | | `curveTo` | `x1`, `y1`, `x2`, `y2`, `x3`, `y3` | Cubic Bézier with two control points | | `closePath` | *(none)* | Close current subpath with a straight line | Bézier example: ```ts page.path( [ { type: "moveTo", x: 56, y: 660 }, { type: "curveTo", x1: 100, y1: 600, x2: 180, y2: 720, x3: 240, y3: 660 } ], { paint: "stroke", stroke: { width: 1.5, color: hex("#1565c0") } } ); ``` ## Painting The `paint` option controls how the path is rendered: ```ts page.path(cmds, { paint: "fill", fill: { color: hex("#e3f2fd") } }); page.path(cmds, { paint: "stroke", stroke: { color: hex("#c62828") } }); page.path(cmds, { paint: "fillStroke", fill: { color: hex("#bbdefb") }, stroke: { width: 2, color: hex("#1565c0") } }); ``` ## Stroke styles ```ts page.path(cmds, { paint: "stroke", stroke: { width: 3, color: hex("#2e7d32"), lineCap: "round", // "butt" | "round" | "square" lineJoin: "bevel", // "miter" | "round" | "bevel" miterLimit: 10, dashArray: [6, 3], // dash-gap pattern dashPhase: 0 } }); ``` ## Fill styles Fill colors accept `rgb()`, `cmyk()`, `hex()`, and `gray()`: ```ts page.path(cmds, { paint: "fill", fill: { color: cmyk(0.1, 0.2, 0, 0.85) } }); ``` ## Transforms Transforms compose cumulatively. Wrap in `saveState()`/`restoreState()` to isolate. ### translate, scale, rotate ```ts page.saveState(); page.translate(100, 0); page.path([{ type: "rect", x: 56, y: 630, width: 80, height: 20 }], { paint: "fill", fill: { color: hex("#e3f2fd") } }); page.restoreState(); page.saveState(); page.scale(1.5, 1.5); page.text("SCALED", { x: 56, y: 400, fontSize: 14 }); page.restoreState(); page.saveState(); page.rotate(15); // degrees, counter-clockwise page.text("Rotated 15°", { x: 56, y: 530, fontSize: 14, color: hex("#2e7d32") }); page.restoreState(); ``` ### transform (arbitrary matrix) Pass `{ a, b, c, d, e, f }` for the affine matrix `[a b c d e f]`: ```ts page.saveState(); page.transform({ a: 1, b: 0, c: 0.3, d: 1, e: 0, f: 0 }); page.path([{ type: "rect", x: 56, y: 320, width: 120, height: 25 }], { paint: "fill", fill: { color: hex("#7b1fa2") } }); page.restoreState(); ``` ## Graphics state Stack transforms and style changes inside `saveState()`/`restoreState()` blocks: ```ts page.saveState(); page.translate(50, 0); page.path(cmds, { paint: "stroke", stroke: { color: hex("#1565c0") } }); page.restoreState(); // back to original transform and style ``` ### Transparency and blend modes Use `setExtGState()` for alpha values, blend modes, and soft masks: ```ts page.saveState(); page.setExtGState({ fillAlpha: 0.3 }); page.path([{ type: "rect", x: 56, y: 460, width: 100, height: 30 }], { paint: "fill", fill: { color: hex("#ff5722") } }); page.restoreState(); ``` Blend modes: `"Normal"`, `"Multiply"`, `"Screen"`, `"Overlay"`, `"Darken"`, `"Lighten"`, `"ColorDodge"`, `"ColorBurn"`, `"HardLight"`, `"SoftLight"`, `"Difference"`, `"Exclusion"`, `"Hue"`, `"Saturation"`, `"Color"`, `"Luminosity"`. ### Luminosity soft masks Create a mask form, then apply via `setExtGState`: ```ts const mask = doc.createLuminositySoftMask({ width: 200, height: 40 }); mask.path([{ type: "rect", x: 0, y: 0, width: 200, height: 40 }], { paint: "fill", fill: { color: gray(0.5) } }); page.saveState(); page.setExtGState({ softMask: mask }); page.path([{ type: "rect", x: 56, y: 500, width: 200, height: 40 }], { paint: "fill", fill: { color: hex("#1565c0") } }); page.setExtGState({ softMask: null }); // clear mask page.restoreState(); ``` ## Tagged paths For PDF/UA output, mark decorative vector paths as artifacts: ```ts page.path(cmds, { paint: "fill", fill: { color: hex("#e8e8e8") }, tag: "Artifact" }); ``` --- --- url: 'https://zeropdf.criston.dev/guide/forms-and-annotations.md' --- # Forms and Annotations Generated PDFs can carry interactive AcroForm fields and annotations. Parsed PDFs expose the same fields for inspection and incremental updates. ## Text fields ```ts const page = doc.addPage({ size: "Letter" }); page.textField("email", { x: 48, y: 620, width: 220, height: 24, value: "ada@example.com", required: true }); ``` ## Hierarchical Field Naming Dotted field names like `"address.street"` auto-create parent-child field groups in the PDF's hierarchical field tree: ```ts page.textField("address.street", { x: 48, y: 620, width: 220, height: 24, value: "123 Main" }); page.textField("address.city", { x: 48, y: 590, width: 220, height: 24, value: "Springfield" }); ``` The library creates a parent `address` group node automatically. ## Rich Text Values Store formatted rich-text content alongside the plaintext `value`: ```ts page.textField("notes", { x: 48, y: 560, width: 220, height: 48, richValue: '

Important: Review required

' }); ``` ## Check boxes, radio groups, choices ```ts page.checkBox("subscribe", { x: 48, y: 580, width: 16, height: 16, checked: true }); page.radioGroup("contactMethod", { items: [ { value: "email", x: 48, y: 500, width: 16, height: 16 }, { value: "phone", x: 48, y: 472, width: 16, height: 16 } ], value: "phone" }); page.choiceField("department", { x: 48, y: 540, width: 180, height: 24, options: ["Engineering", "Design", "Sales"], value: "Design", mode: "combo" }); ``` `mode` accepts `"combo"` (dropdown) or `"list"` (visible list). ## Combo Box Editable Mode Set `editable: true` on a combo box to let users type custom values: ```ts page.choiceField("department", { x: 48, y: 540, width: 180, height: 24, options: ["Engineering", "Design", "Sales"], mode: "combo", editable: true }); ``` ## Custom Appearance Streams Supply raw PDF content operators for full control over field rendering: ```ts page.textField("branded", { x: 48, y: 500, width: 200, height: 24, appearance: "/Tx BMC q 0 0 1 rg BT /F1 12 Tf (Blue Text) Tj ET Q EMC" }); ``` The string is written directly into the field's `/AP` dictionary. ## Calculation Order Declare the order in which calculated fields are evaluated: ```ts doc.setCalculationOrder(["subtotal", "tax", "total"]); ``` Fields are recalculated in this sequence when an upstream value changes. ## Field-Level Encryption Exclude sensitive fields from encryption so they remain readable without a password: ```ts page.textField("ssn", { x: 48, y: 440, width: 180, height: 24, encrypt: false }); ``` ## JavaScript Actions Attach keystroke, format, validation, and calculation scripts to form fields: ```ts page.textField("age", { x: 48, y: 410, width: 80, height: 24, actions: { keystroke: 'AFNumber_Keystroke(0, 0, 0, 0, "", true);', validate: 'event.rc = (event.value >= 0 && event.value <= 150);', calculate: 'event.value = 42;', format: 'AFNumber_Format(0, 0, 0, 0, "", true);' } }); ``` ## Tab Order Set tab-navigation order on a page via `tabOrder`: ```ts const page = doc.addPage({ size: "Letter", tabOrder: "R" }); // R = row order, C = column order, S = structure order ``` ## Buttons and signatures ```ts page.pushButton("submit", { x: 48, y: 604, width: 96, height: 24, label: "Submit" }); page.signatureField("signHere", { x: 48, y: 560, width: 180, height: 36 }); ``` For detached digital signing, see [Encryption and Signatures](./encryption-and-signatures). ## Forms in Templates Form blocks can be placed directly in `renderTemplate` block trees. They auto-position within the flow: ```ts doc.renderTemplate({ page: { size: "A4", font, margin: 56 }, blocks: [ { type: "heading", text: "Contact Form" }, { type: "textField", name: "email", value: "", width: 220, height: 24 }, { type: "choiceField", name: "dept", options: ["Eng", "Design", "Sales"], mode: "combo", width: 180, height: 24 }, { type: "checkBox", name: "subscribe", checked: false, width: 16, height: 16 }, { type: "pushButton", name: "submit", label: "Submit", width: 96, height: 24 } ] }); ``` ## Annotations ```ts import { rgb } from "@criston/zeropdf"; page.highlight({ x: 48, y: 700, width: 120, height: 14, color: rgb(1, 1, 0) }); page.note({ x: 180, y: 698, contents: "Review this paragraph" }); page.freeText({ x: 48, y: 652, width: 180, height: 32, text: "Inline annotation" }); page.link({ x: 48, y: 632, width: 96, height: 14, url: "https://example.com" }); page.pageLink({ x: 48, y: 612, width: 96, height: 14, destination: "intro" }); ``` ## Editing form values Use `editDocument` to update field values incrementally: ```ts import { editDocument } from "@criston/zeropdf"; const editable = editDocument(existingBytes); editable.setFieldValue("customerName", "Grace Hopper"); editable.setFieldValue("subscribe", true); editable.setFieldValue("department", "Engineering"); editable.setFieldValue("contactMethod", "phone"); const updatedBytes = editable.toUint8Array(); ``` ## Flattening forms Bake field appearances into page content and drop the AcroForm tree: ```ts const editable = editDocument(existingBytes); editable.flattenForms(); const flat = editable.toUint8Array(); ``` ## Inspecting fields ```ts import { parseDocument } from "@criston/zeropdf"; const parsed = parseDocument(existingBytes); for (const field of parsed.listFormFields()) { console.log(field.name, field.fieldType, field.value); } ``` --- --- url: 'https://zeropdf.criston.dev/guide/metadata-and-navigation.md' --- # Metadata and Navigation Documents can carry Info/XMP metadata, named destinations, outlines, page labels, and embedded file attachments. ## Document Info and XMP Use `title` when the Info dictionary title and XMP title should match. It writes the classic title, creates structured XMP title metadata, and sets the viewer preference that tells PDF readers to display the document title. Info dictionary entries map directly for the remaining classic metadata fields. ```ts const doc = createDocument({ title: "Hello PDF", info: { author: "zeropdf", subject: "Demonstration", keywords: "pdf,typescript", creationDate: "D:20260413210000Z" }, xmpMetadata: { creator: "zeropdf", createDate: "2026-04-13T21:00:00Z", modifyDate: "2026-04-13T21:00:00Z", metadataDate: "2026-04-13T21:00:00Z" } }); ``` Update existing PDFs incrementally: ```ts const editable = editDocument(bytes); editable.updateInfo({ title: "Revised", modificationDate: "D:20260414091500Z" }); editable.setXmpMetadata({ title: "Revised", metadataDate: "2026-04-14T09:15:00Z" }); ``` ## Named destinations and outlines ```ts const intro = doc.addPage(); doc.addNamedDestination("intro", intro); doc.addOutline("Introduction", "intro"); const chapter = doc.addOutline("Chapter 1"); chapter.addChild("Section 1.1", "intro"); ``` Outlines accept a destination name or a `PdfPage` reference. ## Page labels ```ts doc.setPageLabel(intro, { style: "decimal", prefix: "Intro-" }); doc.setPageLabel(chapter, { style: "upper-roman", start: 1 }); ``` Styles: `"decimal" | "upper-roman" | "lower-roman" | "upper-letter" | "lower-letter"`. ## File attachments ```ts doc.attachFile("notes.txt", new TextEncoder().encode("hello"), { description: "Build notes", mimeType: "text/plain" }); ``` The attachment is exposed under the document's `/Names → /EmbeddedFiles` tree and listed in PDF readers' attachments panel. ## Inspecting parsed metadata ```ts import { parseDocument } from "@criston/zeropdf"; const parsed = parseDocument(bytes); console.log(parsed.getMetadata().title); console.log(parsed.listNamedDestinations()); console.log(parsed.listOutlines()); console.log(parsed.listPageLabels()); console.log(parsed.listAttachments()); ``` --- --- url: 'https://zeropdf.criston.dev/guide/report-templates.md' --- # Report Templates `renderTemplate()` is the recommended path for multi-page reports. It paginates a block tree, applies semantic spacing, runs headers/footers after pagination, and emits proper structure tags when the document is tagged. ```ts doc.renderTemplate({ title: "Quarterly Report", info: { author: "Finance" }, page: { size: "A4", font, margin: 56, spacing: { paragraphAfter: 8, headingBefore: { 2: 18, 3: 14 }, headingAfter: { 1: 14, 2: 10, 3: 8 }, tableBefore: 6, tableAfter: 14 } }, blocks: [ { type: "heading", text: "Quarterly Report" }, { type: "paragraph", text: "Summary and scope." }, { type: "table", rows: [ [{ text: "Metric", header: true }, { text: "Result", header: true }], ["Revenue", "$2.6M"] ], options: { headerRows: 1 } }, { type: "pageBreak" }, { type: "heading", text: "References", options: { level: 2 } }, { type: "link", text: "WCAG 2.2", url: "https://www.w3.org/TR/WCAG22/" } ], header: ({ title, pageNumber, totalPages }) => [ { type: "paragraph", text: `${title} - page ${pageNumber} of ${totalPages}`, options: { fontSize: 8, tag: "Artifact" } } ], pageNumber: { region: "footer", align: "center" } }); ``` ## Multi-Column Flow Set `columns: { count, gap }` on `page` for newspaper-style body flow. Paragraphs fill the current column and continue at the top of the next column on the same page; tables and other blocks advance to the next column before a new page. Short multi-column pages are balanced automatically so the final column set does not leave all content in the first column. ```ts doc.renderTemplate({ page: { size: "A4", margin: 56, columns: { count: 2, gap: 24 } }, blocks: [ { type: "heading", text: "Research Brief" }, { type: "paragraph", text: longBodyCopy }, { type: "paragraph", text: "Closing notes balance with the previous column." } ] }); ``` ## Block types | Type | Purpose | |------|---------| | `paragraph` | Body text with wrapping | | `richParagraph` | Inline runs with mixed fonts/sizes/colors/links on one line ([Inline rich text](./text-and-fonts#inline-rich-text-mixed-styles-on-one-line)) | | `heading` | H1–H6 with semantic spacing | | `table` | Grid with header rows/columns | | `image` | Embedded JPEG/PNG with alt text | | `link` | URI link with paragraph spacing | | `list` | Ordered/unordered/nested | | `pageBreak` | Force next block to a new page | | `section` | Logical grouping in structure tree | | `textField` | Single-line text input | | `checkBox` | Boolean checkbox | | `choiceField` | Dropdown or list selection | | `radioGroup` | Mutually exclusive radio buttons | | `pushButton` | Clickable push button | | `signatureField` | Digital signature placeholder | | `highlight` | Text highlight annotation | | `note` | Sticky note annotation | | `freeText` | Free-text annotation box | | `pageLink` | Internal page link | | `rect` | Rectangle vector shape | | `path` | Custom path vector shape | | `custom` | User-defined block with render/estimate | ## Form Fields Form blocks auto-position within the flow---no manual x/y coordinates needed. ```ts { type: "textField", name: "email", value: "ada@example.com", width: 220, height: 24 }, { type: "checkBox", name: "subscribe", checked: true, width: 16, height: 16 }, { type: "choiceField", name: "dept", options: ["Eng", "Design", "Sales"], value: "Design", mode: "combo", width: 180, height: 24 }, { type: "radioGroup", name: "method", items: [{ value: "email" }, { value: "phone" }], value: "phone" }, { type: "pushButton", name: "submit", label: "Submit", width: 96, height: 24 }, { type: "signatureField", name: "signHere", width: 180, height: 36 } ``` ## Annotations ```ts { type: "highlight", width: 120, height: 14, color: rgb(1, 1, 0) }, { type: "note", contents: "Review this paragraph", width: 24, height: 24 }, { type: "freeText", text: "Inline annotation", width: 180, height: 32 }, { type: "pageLink", destination: "intro", width: 96, height: 14 } ``` ## Vector Graphics `rect` and `path` blocks require an explicit `height` so the paginator can allocate space. ```ts { type: "rect", width: 200, height: 4, options: { color: rgb(0.2, 0.2, 0.2), fill: rgb(0.9, 0.9, 0.9) } }, { type: "path", commands: "M0 0 L100 0 L50 50 Z", height: 50, options: { color: rgb(0, 0, 0), fill: rgb(0.8, 0.8, 0.8) } } ``` ## Lists Each item follows the `ListItem` format: `{ text: string, children?: ListItem[] }`. Use `options.ordered` for numbered lists or `options.bullet` for custom markers. ```ts { type: "list", items: [ { text: "First item" }, { text: "Second item", children: [{ text: "Nested" }] } ], options: { ordered: true, bullet: "disc" } } ``` ## Custom Blocks When built-in block types don't cover your needs, use the `custom` type with `render` and `estimate` callbacks. ```ts { type: "custom", height: 12, render(ctx) { ctx.graphics() .moveTo(ctx.x, ctx.y + 1) .lineTo(ctx.x + ctx.width, ctx.y + 1) .stroke({ color: rgb(0.6, 0.6, 0.6) }); }, estimate() { return 12; } } ``` * `render(ctx)` --- draws the block. `ctx` provides `x`, `y`, `width`, and drawing helpers. * `estimate()` --- returns the vertical space (points) needed during pagination. Ideal for horizontal rules, separators, watermarks, or any drawing that doesn't fit existing block types. See [Custom Blocks](./custom-blocks) for a deeper guide. ## Spacing model Spacing is semantic, not a single fixed gap: * paragraphs: compact rhythm after the text * headings: stronger before-space, smaller after-space, no leading space at top of page * tables and figures: object spacing before and after * links: paragraph-like spacing after Override per block with `marginTop` / `marginBottom`. Override globally with `page.spacing`. ## Stylesheets Define reusable typography and spacing once with `styles`, then apply them by block type or via a `class` on each block, instead of repeating `options` everywhere. See [Template Stylesheets](./template-stylesheets) for the full selector and cascade rules. ```ts doc.renderTemplate({ styles: { paragraph: { fontSize: 11, lineHeight: 16 }, heading1: { fontSize: 28, color: rgb(0.1, 0.2, 0.5) }, callout: { color: rgb(0.8, 0, 0), marginTop: 12 } }, blocks: [ { type: "heading", text: "Title", options: { level: 1 } }, { type: "paragraph", text: "Inherits the shared paragraph style." }, { type: "paragraph", text: "Important.", class: "callout" } ] }); ``` ## Headers, footers, page numbers Header/footer callbacks run after body pagination, so `pageNumber` and `totalPages` are accurate. Use `pageNumber` for standard running labels: ```ts pageNumber: { region: "footer", align: "right" } ``` `region`: `"header" | "footer"`. `align`: `"left" | "center" | "right"`. ## Page breaks `{ type: "pageBreak" }` forces the next block onto a fresh page. A break before any body content on the current page is ignored, so defensive breaks never produce blank pages. ## Auto outlines Headings are added to the document outline automatically when `autoOutline` is enabled: ```ts autoOutline: { maxLevel: 3 } ``` --- --- url: 'https://zeropdf.criston.dev/guide/template-stylesheets.md' --- # Template Stylesheets Stylesheets let you define reusable typography and spacing once and apply them across many template blocks, instead of repeating the same `options` on every block. They slot into `renderTemplate()` via the `styles` map and an optional `class` on each block. ```ts doc.renderTemplate({ styles: { paragraph: { fontSize: 11, lineHeight: 16 }, heading1: { fontSize: 28, color: rgb(0.1, 0.2, 0.5) }, callout: { color: rgb(0.8, 0, 0), marginTop: 12 } }, blocks: [ { type: "heading", text: "Quarterly Report", options: { level: 1 } }, { type: "paragraph", text: "Every paragraph inherits the shared style." }, { type: "paragraph", text: "Important note.", class: "callout" } ] }); ``` ## Selectors A stylesheet is a flat map of selector → style. A selector is either a **type selector** (matches a block's `type`) or a **class name** (referenced by a block's `class` field). | Selector | Matches | |----------|---------| | `paragraph`, `table`, `link`, `list` | All blocks of that type | | `image` | All image blocks (any format) | | `png`, `jpeg`, `bmp`, `tiff`, `jp2`, `jbig2`, `webp`, `gif`, `svg` | One image format | | `heading` | All headings | | `heading1` … `heading6` | One heading level | | *anything else* | A class name, applied only to blocks that list it in `class` | Type selector names are reserved---avoid using them as class names. `class` accepts a single name or an ordered array: ```ts { type: "paragraph", text: "...", class: "callout" } { type: "paragraph", text: "...", class: ["callout", "danger"] } ``` `class` is supported on `heading`, `paragraph`, `table`, `image`, `link`, and `list` blocks. ## Cascade For each block, styles merge from lowest to highest priority: 1. **Page defaults** --- `page.font`, `page.fontSize`, `page.spacing`, etc. 2. **Type selectors** --- generic before specific (`heading` then `heading2`, `image` then `png`). 3. **Classes** --- each name in `class`, in array order (later wins). 4. **Inline `options`** --- always wins. Merging is **shallow**: a nested object such as `margin` replaces the lower layer's value rather than merging key-by-key. ```ts styles: { heading: { color: gray(0.3) }, // all headings grey heading1: { fontSize: 28 }, // H1 also 28pt, still grey big: { fontSize: 40 } }, blocks: [ // 28pt grey (heading1 over heading) { type: "heading", text: "Title", options: { level: 1 } }, // 40pt grey (class over type selector) { type: "heading", text: "Big", options: { level: 1 }, class: "big" }, // 18pt grey (inline over everything) { type: "heading", text: "Override", options: { level: 1, fontSize: 18 } } ] ``` ## Style properties A `TemplateStyle` carries cross-cutting typography and spacing: `font`, `fallbackFonts`, `fontSize`, `color`, `lineHeight`, `align`, `kerning`, `direction`, `writingMode`, `margin`, `marginTop`, `marginRight`, `marginBottom`, `marginLeft`. `align` accepts the full alignment union; image and link blocks ignore `"justify"` and treat it as `"left"`. ## Scope Stylesheets also apply to blocks rendered inside `section` blocks and in `header`/`footer` callbacks, so nested and running-region content stays consistent with the body. Block-specific options that are not part of `TemplateStyle` (table column widths, list markers, image dimensions) stay on the block's inline `options`. Everything is optional and backward compatible: omit `styles` and `class` and rendering behaves exactly as before. --- --- url: 'https://zeropdf.criston.dev/guide/custom-blocks.md' --- # Custom Blocks The `custom` block type lets you extend `renderTemplate` with arbitrary drawing when built-in block types don't fit your use case. ## The custom block type Each custom block must provide two callbacks: * **`estimate()`** — returns the vertical space (in points) the block needs. Called during pagination to determine where page breaks fall. * **`render(ctx)`** — draws the block onto the page. `ctx` exposes `x`, `y`, `width`, and drawing helpers like `graphics()`. ```ts { type: "custom", height: 12, estimate() { return this.height; }, render(ctx) { ctx.graphics() .moveTo(ctx.x, ctx.y + ctx.height / 2) .lineTo(ctx.x + ctx.width, ctx.y + ctx.height / 2) .stroke({ color: rgb(0.6, 0.6, 0.6) }); } } ``` `height` is the block's declared height; `estimate()` can return a different value if the content doesn't fill the full height. ## Horizontal rule A common reusable pattern: ```ts function hr(height = 2, color = rgb(0.7, 0.7, 0.7)) { return { type: "custom" as const, height, estimate() { return height; }, render(ctx) { ctx.graphics() .rect(ctx.x, ctx.y, ctx.width, height) .fill({ color }); } }; } // Usage doc.renderTemplate({ blocks: [ { type: "heading", text: "Section One" }, { type: "paragraph", text: "Content..." }, hr(), { type: "heading", text: "Section Two", options: { level: 2 } } ] }); ``` ## Page break with custom text Combine a page break with a decorative separator: ```ts function sectionBreak(label: string) { return { type: "custom" as const, height: 28, estimate() { return 28; }, render(ctx) { const midY = ctx.y + ctx.height / 2; ctx.graphics() .moveTo(ctx.x, midY) .lineTo(ctx.x + ctx.width, midY) .stroke({ color: rgb(0.5, 0.5, 0.5) }); // Draw label using the page's current font context } }; } ``` ## Watermark Draw a watermark behind content on every page using the header callback: ```ts doc.renderTemplate({ blocks: [ /* body content */ ], header: ({ pageNumber, totalPages }) => [{ type: "custom", height: 0, estimate() { return 0; }, render(ctx) { // Only on page 1; render under body by drawing in header pass } }] }); ``` ## Limitations * **No paging context during `render`.** `pageNumber` and `totalPages` are not available in body-level custom blocks. Use the header/footer callbacks if you need page-aware drawing. * **No automatic height inference.** You must supply `estimate()` explicitly. * **No structure tagging.** Custom blocks do not create entries in the tagged structure tree. Use `section` blocks with a `role` if you need semantic structure. --- --- url: 'https://zeropdf.criston.dev/guide/pixel-perfect-invoices.md' --- # Pixel-Perfect Invoices Designer invoice templates need two layers of protection: 1. strict layout checks while generating the PDF 2. optional visual regression checks during development The published `zeropdf` package stays dependency-free. Visual regression uses Node built-ins plus a dev-only Poppler renderer when you choose to run the visual scripts. Library consumers do not install Poppler or any rendering dependency. ## Strict layout mode Use `strictLayout` when a template has fixed designer-approved bounds: ```ts doc.renderTemplate({ strictLayout: { maxPages: 1 }, page: { size: "A4", margin: 48, font: "Helvetica", fontSize: 10, lineHeight: 13 }, blocks: [ { type: "heading", text: "INVOICE" }, { type: "table", rows: invoiceRows, options: { width: 499.28, columnWidths: [259.28, 50, 95, 95], headerRows: 1, cellPadding: 6, rowGap: 2 } } ] }); ``` When strict layout is enabled, `renderTemplate()` throws `PdfEngineError` with `code === PdfErrorCode.LAYOUT_OVERFLOW` if content cannot fit in a fresh page or column. Error details include the block index, block type, page number, available height, and estimated height. Oversized table-row errors also include `rowIndex`. Set `strictLayout: { oversizedContent: "allow" }` only when you want `maxPages` enforcement without oversized-content failures. ## Template discipline For stable invoice output: * use fixed page size and margins * use explicit fonts and font sizes * set deterministic `info` dates and XMP dates * provide explicit table `width` and `columnWidths` * keep tax, rounding, discounts, and currency formatting outside the PDF layer * fixture-test edge cases such as long customer names, long line items, zero tax, discounts, missing optional fields, and multi-page invoices ## Visual regression The optional scripts render PDFs to PPM images through Poppler and compare them against approved baselines. The repository includes `pdf-poppler` as a dev dependency for contributors, and the scripts also use a working system `pdftoppm` when one is available. On macOS, a current Homebrew Poppler install is the most reliable renderer: ```sh brew install poppler # or sudo apt-get install poppler-utils ``` Create or update baselines: ```sh npm run visual:update ``` Compare current output against baselines: ```sh npm run visual:compare ``` The default comparison renders at 144 DPI and fails when more than 0.1% of pixels differ or any color channel differs by more than 2. Preview templates locally: ```sh npm run visual:preview ``` The preview app lives in `examples/visual-preview`. It lets developers and designers choose a fixture, choose fixture data, regenerate the PDF, inspect actual and baseline renders side by side, and switch to a diff overlay. ## Fixtures Visual fixtures live in `examples/visual-fixtures`. Each fixture exports a stable name and a render function: ```js export const name = "invoice"; export function render() { const doc = createDocument({ /* deterministic metadata */ }); doc.renderTemplate({ strictLayout: { maxPages: 1 }, blocks }); return doc.toUint8Array(); } ``` The scripts write actual renders to `.visual-output` and approved baselines to `test/visual-baselines`. --- --- url: 'https://zeropdf.criston.dev/guide/cookbook-invoice.md' --- # Cookbook: Invoice Generate a professional invoice with company header, customer details, line items, and tax calculations using `renderTemplate()`. ## Quick start ```ts import { createDocument, hex } from "@criston/zeropdf"; import { readFileSync } from "node:fs"; const fontData = readFileSync("fonts/SourceSans3-Regular.ttf"); const doc = createDocument({ title: "Invoice #INV-2026-0042", info: { author: "ACME Corp", creationDate: "D:20260508093000Z" }, xmpMetadata: { creator: "ACME Corp", createDate: "2026-05-08T09:30:00Z", modifyDate: "2026-05-08T09:30:00Z", metadataDate: "2026-05-08T09:30:00Z" } }); const font = doc.embedTrueTypeFont(fontData, { family: "SourceSans3" }); const BOLD = hex("#1a1a2e"); const GRAY = hex("#4a4a5e"); const LIGHT = hex("#9a9aae"); const ACCENT = hex("#16213e"); ``` ## Building the invoice ### Line items as a function Extract repeating line-item blocks so your invoice can be data-driven: ```ts interface LineItem { description: string; quantity: number; unitPrice: number; } function lineItemRow(item: LineItem): string[] { const total = (item.quantity * item.unitPrice).toFixed(2); return [ item.description, item.quantity.toString(), `$${item.unitPrice.toFixed(2)}`, `$${total}` ]; } ``` ### Render the document ```ts const items: LineItem[] = [ { description: "Consulting — Q1 strategy review", quantity: 12.5, unitPrice: 180.0 }, { description: "Infrastructure audit", quantity: 1, unitPrice: 2400.0 }, { description: "On-site training (3 days)", quantity: 3, unitPrice: 950.0 }, { description: "Monthly retainer — April", quantity: 1, unitPrice: 1500.0 } ]; const subtotal = items.reduce((s, i) => s + i.quantity * i.unitPrice, 0); const taxRate = 0.0825; const tax = subtotal * taxRate; const total = subtotal + tax; doc.renderTemplate({ title: "Invoice #INV-2026-0042", info: { author: "ACME Corp" }, xmpMetadata: { creator: "ACME Corp", createDate: "2026-05-08T09:30:00Z", modifyDate: "2026-05-08T09:30:00Z", metadataDate: "2026-05-08T09:30:00Z" }, page: { size: "A4", font, margin: 48 }, autoOutline: { maxLevel: 1, expanded: false }, blocks: [ // ── Company header ────────────────────────────── { type: "heading", text: "ACME Corp", options: { level: 1, color: ACCENT, marginBottom: 4 } }, { type: "paragraph", text: "123 Business Park Drive · Suite 400 · San Francisco, CA 94105", options: { fontSize: 9, color: LIGHT, marginBottom: 2 } }, { type: "paragraph", text: "Phone: (415) 555-0192 · Email: billing@acme.example.com", options: { fontSize: 9, color: LIGHT, marginBottom: 24 } }, // ── Invoice title ─────────────────────────────── { type: "heading", text: "INVOICE", options: { level: 1, color: ACCENT } }, { type: "table", rows: [ ["Invoice #", "INV-2026-0042"], ["Date", "May 8, 2026"], ["Due date", "June 7, 2026"], ["Payment terms", "Net 30"] ], options: { headerColumns: 1, fontSize: 10, cellPadding: 6, rowGap: 2, marginBottom: 28 } }, // ── Bill to / Ship to ─────────────────────────── { type: "heading", text: "Bill To", options: { level: 2, color: BOLD, marginBottom: 6 } }, { type: "paragraph", text: [ "Globex Corporation", "456 Innovation Way", "Palo Alto, CA 94301", "Attn: Accounts Payable" ].join("\n"), options: { fontSize: 10, lineHeight: 14, blockWidth: 250, marginBottom: 28 } }, // ── Line items table ──────────────────────────── { type: "heading", text: "Line Items", options: { level: 2, color: BOLD, marginBottom: 6 } }, { type: "table", rows: [ [ { text: "Description", header: true }, { text: "Qty", header: true }, { text: "Unit Price", header: true }, { text: "Amount", header: true } ], ...items.map(lineItemRow) ], options: { headerRows: 1, fontSize: 10, cellPadding: 8, rowGap: 3, marginBottom: 28 } }, // ── Totals summary ────────────────────────────── { type: "table", rows: [ ["Subtotal", `$${subtotal.toFixed(2)}`], [`Tax (${(taxRate * 100).toFixed(2)}%)`, `$${tax.toFixed(2)}`], [ { text: "Total", header: true }, { text: `$${total.toFixed(2)}`, header: true } ] ], options: { headerColumns: 1, fontSize: 11, cellPadding: 8, rowGap: 4, marginBottom: 36 } }, // ── Payment instructions ──────────────────────── { type: "paragraph", text: [ "Please remit payment to: ACME Corp, Account # 123456789,", "Routing # 021000021. Include invoice number on all payments." ].join(" "), options: { fontSize: 9, color: GRAY, align: "justify", marginBottom: 8 } }, { type: "paragraph", text: "Thank you for your business.", options: { fontSize: 10, color: GRAY, align: "center" } } ], header: ({ title, pageNumber, totalPages }) => [ { type: "paragraph", text: `${title ?? "Invoice"} — Page ${pageNumber} of ${totalPages}`, options: { fontSize: 8, color: LIGHT, tag: "Artifact" } } ], pageNumber: { region: "footer", align: "center" } }); await doc.writeTo(/* your sink */); ``` ## Key techniques | Technique | Purpose | |-----------|---------| | `headerColumns: 1` | Creates a label/value layout for metadata and totals | | `headerRows: 1` | Marks the first row of line items as column headers | | Data-driven `rows` | Map your invoice items array to table rows | | `spread: last item` | A `pageBreak` before the totals section keeps summary on a fresh page for multi-page invoices | | Color palette | Use `hex()` for brand colors; keep body text at `#4a4a5e` for readability | ## Designer-locked invoices For invoice templates that must match approved designs, make the layout deterministic: * set fixed page margins, font names, font sizes, line heights, table widths, and `columnWidths` * provide deterministic `info` and `xmpMetadata` dates * keep tax, currency, rounding, discounts, and payment-status logic outside the PDF layer * enable `strictLayout` so oversized content fails instead of silently overflowing ```ts doc.renderTemplate({ strictLayout: { maxPages: 1 }, page: { size: "A4", margin: 48, font, fontSize: 10, lineHeight: 13 }, blocks: [ { type: "table", rows: invoiceRows, options: { width: 499.28, columnWidths: [259.28, 50, 95, 95], headerRows: 1 } } ] }); ``` Use the optional visual regression scripts described in [Pixel-Perfect Invoices](./pixel-perfect-invoices) to compare generated PDFs against approved baselines. These scripts use dev-only Poppler tooling; the published library remains dependency-free. ## Multi-page invoices For invoices that span multiple pages, the template engine paginates automatically. Add a `pageBreak` before the totals section to keep the summary together: ```ts // After line items block: { type: "pageBreak" }, // Then totals summary ``` ## Encrypting invoices Wrap the serialized bytes with password protection when sending invoices via email: ```ts const doc = createDocument({ encryption: { algorithm: "aes-256", userPassword: "inv-2026-0042-secure", permissions: { printing: true, copying: false, modifying: false } } }); ``` ## See also * [Report Templates](./report-templates) — template block reference * [Pixel-Perfect Invoices](./pixel-perfect-invoices) — strict layout and optional visual QA * [Encryption and Signatures](./encryption-and-signatures) — protect sensitive documents * [Text and Fonts](./text-and-fonts) — font APIs --- --- url: 'https://zeropdf.criston.dev/guide/cookbook-ticket.md' --- # Cookbook: Event Ticket Generate a printable event ticket with venue details, QR placeholder, and tear-off stub using `renderTemplate()`. ## Quick start ```ts import { createDocument, hex, rgb } from "@criston/zeropdf"; import { readFileSync } from "node:fs"; const fontData = readFileSync("fonts/SourceSans3-Regular.ttf"); const doc = createDocument({ title: "Summer Jazz Night — Admission Ticket", info: { author: "City Arts Council" } }); const font = doc.embedTrueTypeFont(fontData, { family: "SourceSans3" }); const DARK = hex("#1a1a2e"); const ACCENT = hex("#c0392b"); const MUTED = hex("#6b6b80"); ``` ## Single ticket layout ```ts doc.renderTemplate({ title: "Summer Jazz Night — Admission Ticket", info: { author: "City Arts Council" }, xmpMetadata: { creator: "City Arts Council", createDate: "2026-05-08T10:00:00Z", modifyDate: "2026-05-08T10:00:00Z", metadataDate: "2026-05-08T10:00:00Z" }, page: { size: "A5", font, margin: 36 }, blocks: [ // ── Event branding ────────────────────────────── { type: "heading", text: "SUMMER JAZZ NIGHT", options: { level: 1, color: ACCENT, align: "center", marginBottom: 4 } }, { type: "paragraph", text: "Presented by the City Arts Council", options: { fontSize: 10, color: MUTED, align: "center", marginBottom: 28 } }, // ── Divider ───────────────────────────────────── { type: "paragraph", text: "-".repeat(48), options: { fontSize: 6, color: MUTED, align: "center", marginBottom: 20 } }, // ── Event details table ───────────────────────── { type: "table", rows: [ ["Date", "Saturday, June 21, 2026"], ["Time", "7:30 PM — 10:00 PM"], ["Venue", "Riverside Amphitheater"], ["Address", "200 River Rd, Portland, OR 97201"], ["Section", "Orchestra Center"], ["Seat", "Row G, Seat 14"], ["Ticket #", "JAZZ-2026-0814"] ], options: { headerColumns: 1, fontSize: 11, cellPadding: 8, rowGap: 3, marginBottom: 24 } }, // ── Ticket holder ─────────────────────────────── { type: "heading", text: "Ticket Holder", options: { level: 3, color: DARK, marginBottom: 6 } }, { type: "paragraph", text: "Jordan Ellis", options: { fontSize: 14, color: DARK, marginBottom: 4 } }, { type: "paragraph", text: "Order #ORD-4291 · Purchased May 1, 2026", options: { fontSize: 8, color: MUTED, marginBottom: 28 } }, // ── Divider ───────────────────────────────────── { type: "paragraph", text: "-".repeat(48), options: { fontSize: 6, color: MUTED, align: "center", marginBottom: 20 } }, // ── QR code placeholder ───────────────────────── { type: "paragraph", text: "[ QR Code: JAZZ-2026-0814 ]", options: { fontSize: 10, color: MUTED, align: "center", marginBottom: 8 } }, { type: "paragraph", text: "Scan at gate for entry", options: { fontSize: 8, color: MUTED, align: "center", marginBottom: 28 } }, // ── Terms ─────────────────────────────────────── { type: "paragraph", text: [ "This ticket is non-transferable and non-refundable.", "Doors open at 7:00 PM. Late seating at discretion of house manager.", "No photography or recording during the performance.", "Valid government ID required for alcohol purchases." ].join(" "), options: { fontSize: 7, color: MUTED, align: "justify", marginBottom: 4 } } ], header: ({ title }) => [ { type: "paragraph", text: title ?? "Admission Ticket", options: { fontSize: 7, color: MUTED, align: "right", tag: "Artifact" } } ] }); ``` ## Ticket with tear-off stub For events that collect a stub at entry, use two `renderTemplate()` calls on separate pages — one for the main ticket and one for the stub: ```ts const mainPage = doc.renderTemplate({ page: { size: "A5", font, margin: 36 }, blocks: [ /* ... main ticket content ... */ ], footer: ({ pageNumber }) => [ { type: "paragraph", text: "- - - - - - - - - - - - - - - - - - TEAR HERE - - - - - - - - - - - - - - - - - -", options: { fontSize: 9, color: MUTED, align: "center", tag: "Artifact" } } ] }); const stubPage = doc.renderTemplate({ page: { size: "A5", font, margin: 36 }, blocks: [ { type: "heading", text: "STUB — RETAIN FOR RECORDS", options: { level: 2, color: ACCENT, align: "center", marginBottom: 16 } }, { type: "paragraph", text: [ "Jordan Ellis", "Row G, Seat 14", "Order #ORD-4291" ].join("\n"), options: { fontSize: 11, color: DARK, align: "center", marginBottom: 12 } }, { type: "paragraph", text: "JAZZ-2026-0814", options: { fontSize: 10, color: MUTED, align: "center" } } ] }); ``` ## Batch ticket generation Generate multiple tickets from a data array: ```ts interface Ticket { holder: string; seat: string; section: string; ticketNumber: string; } const attendees: Ticket[] = [ { holder: "Jordan Ellis", seat: "G-14", section: "Orchestra Center", ticketNumber: "0814" }, { holder: "Morgan Chen", seat: "G-15", section: "Orchestra Center", ticketNumber: "0815" } ]; for (const attendee of attendees) { doc.renderTemplate({ page: { size: "A5", font, margin: 36 }, blocks: [ { type: "heading", text: "SUMMER JAZZ NIGHT", options: { level: 1, color: ACCENT, align: "center" } }, { type: "table", rows: [ ["Holder", attendee.holder], ["Seat", `${attendee.section}, Row ${attendee.seat}`], ["Ticket #", `JAZZ-2026-${attendee.ticketNumber}`] ], options: { headerColumns: 1, fontSize: 11, cellPadding: 8 } } ] }); } ``` ## Adding a barcode or QR image Replace the text placeholder with a PNG image generated by your barcode/QR library: ```ts import QRCode from "qrcode"; const qrData = `JAZZ-2026-${attendee.ticketNumber}`; const qrPng = await QRCode.toBuffer(qrData, { width: 120, margin: 2 }); doc.renderTemplate({ page: { size: "A5", font, margin: 36 }, blocks: [ // ... event details ... { type: "png", data: new Uint8Array(qrPng), options: { maxWidth: 80, align: "center", altText: `QR code for ticket JAZZ-2026-${attendee.ticketNumber}`, marginBottom: 8 } } ] }); ``` ## See also * [Report Templates](./report-templates) — template block reference * [Images](./images) — embedding PNGs and QR codes * [Streaming and Output](./streaming-and-output) — writing tickets to disk or HTTP response --- --- url: 'https://zeropdf.criston.dev/guide/cookbook-certificate.md' --- # Cookbook: Certificate Generate an achievement certificate with decorative borders, recipient name, issuing authority, and signature block using `renderTemplate()`. ## Quick start ```ts import { createDocument, hex, rgb } from "@criston/zeropdf"; import { readFileSync } from "node:fs"; const fontData = readFileSync("fonts/SourceSans3-Regular.ttf"); const doc = createDocument({ title: "Certificate of Completion", info: { author: "Training Academy" } }); const font = doc.embedTrueTypeFont(fontData, { family: "SourceSans3" }); const GOLD = hex("#8b6914"); const DARK = hex("#2c2c3e"); const BODY = hex("#4a4a5e"); ``` ## Certificate layout ```ts doc.renderTemplate({ title: "Certificate of Completion", info: { author: "Training Academy" }, xmpMetadata: { creator: "Training Academy", createDate: "2026-05-08T12:00:00Z", modifyDate: "2026-05-08T12:00:00Z", metadataDate: "2026-05-08T12:00:00Z" }, page: { size: "Letter", font, margin: 64 }, blocks: [ // ── Top decorative border ─────────────────────── { type: "paragraph", text: "*".repeat(42), options: { fontSize: 8, color: GOLD, align: "center", marginBottom: 32 } }, // ── Issuing authority ────────────────────────── { type: "paragraph", text: "Training Academy", options: { fontSize: 12, color: GOLD, align: "center", marginBottom: 4, letterSpacing: 2 } }, { type: "paragraph", text: "— Certifies that —", options: { fontSize: 10, color: BODY, align: "center", marginBottom: 24 } }, // ── Recipient name ────────────────────────────── { type: "heading", text: "Jordan Ellis", options: { level: 1, fontSize: 28, color: DARK, align: "center", marginBottom: 24 } }, // ── Achievement description ───────────────────── { type: "paragraph", text: [ "has successfully completed the course requirements for" ].join(" "), options: { fontSize: 12, color: BODY, align: "center", marginBottom: 8 } }, { type: "heading", text: "Advanced TypeScript Development", options: { level: 2, color: GOLD, align: "center", marginBottom: 16 } }, { type: "paragraph", text: [ "covering type-level programming, advanced generics, conditional types,", "mapped types, template literal types, and production patterns" ].join(" "), options: { fontSize: 11, color: BODY, align: "center", blockWidth: 400, marginBottom: 32 } }, // ── Date ──────────────────────────────────────── { type: "paragraph", text: "Awarded this 8th day of May, 2026", options: { fontSize: 11, color: BODY, align: "center", marginBottom: 48 } }, // ── Signature blocks ──────────────────────────── { type: "table", rows: [ [ { text: "—".repeat(20), header: false }, { text: "—".repeat(20), header: false } ], [ { text: "Dr. Maria Santos, Dean of Engineering", header: false }, { text: "Alex Wong, Program Director", header: false } ] ], options: { fontSize: 10, cellPadding: 6, borderWidth: 0, marginBottom: 48 } }, // ── Bottom decorative border ──────────────────── { type: "paragraph", text: "*".repeat(42), options: { fontSize: 8, color: GOLD, align: "center", marginBottom: 16 } }, // ── Footer details ────────────────────────────── { type: "paragraph", text: [ "Certificate ID: CERT-2026-0814 · Training Academy is an", "accredited continuing education provider." ].join(" "), options: { fontSize: 7, color: BODY, align: "center" } } ] }); ``` ## Certificate with page border For a more formal presentation, draw a custom border on each page using the `page` constructor callback: ```ts const page = doc.addPage({ size: "Letter" }); // Outer border page.path().rect({ x: 28, y: 28, width: 556, height: 736 }) .stroke({ color: GOLD, width: 2 }); // Inner border page.path().rect({ x: 36, y: 36, width: 540, height: 720 }) .stroke({ color: GOLD, width: 0.5 }); ``` Then use `doc.renderTemplate()` and the rendered body stays inside the inner border when the margin matches. ## Data-driven certificates ```ts interface CertificateData { recipient: string; course: string; description: string; certificateId: string; } function generateCertificate(data: CertificateData, doc: PdfDocument): void { doc.renderTemplate({ title: `Certificate — ${data.course}`, info: { author: "Training Academy" }, xmpMetadata: { creator: "Training Academy", createDate: "2026-05-08T12:00:00Z", modifyDate: "2026-05-08T12:00:00Z", metadataDate: "2026-05-08T12:00:00Z" }, page: { size: "Letter", font, margin: 64 }, blocks: [ { type: "paragraph", text: "*".repeat(42), options: { fontSize: 8, color: GOLD, align: "center", marginBottom: 32 } }, { type: "paragraph", text: "Training Academy", options: { fontSize: 12, color: GOLD, align: "center", marginBottom: 4 } }, { type: "heading", text: data.recipient, options: { level: 1, fontSize: 26, color: DARK, align: "center", marginBottom: 20 } }, { type: "heading", text: data.course, options: { level: 2, color: GOLD, align: "center", marginBottom: 12 } }, { type: "paragraph", text: data.description, options: { fontSize: 11, color: BODY, align: "center", blockWidth: 400, marginBottom: 36 } }, { type: "paragraph", text: `Certificate ID: ${data.certificateId}`, options: { fontSize: 8, color: BODY, align: "center" } } ] }); } const recipients = [ { recipient: "Jordan Ellis", course: "Advanced TypeScript", description: "Completed 40 hours of training.", certificateId: "CERT-2026-0814" }, { recipient: "Morgan Chen", course: "Systems Design", description: "Completed 32 hours of training.", certificateId: "CERT-2026-0815" } ]; for (const cert of recipients) { generateCertificate(cert, doc); } ``` ## Adding a signature PNG Replace text signature lines with real signature images: ```ts const signaturePng = readFileSync("signatures/dean-signature.png"); // In your block array: { type: "png", data: new Uint8Array(signaturePng), options: { maxWidth: 120, align: "center", altText: "Dean's signature", marginBottom: 4 } } ``` ## See also * [Report Templates](./report-templates) — template block reference * [Text and Fonts](./text-and-fonts) — font APIs * [Images](./images) — embedding PNG signatures and logos --- --- url: 'https://zeropdf.criston.dev/guide/cookbook-multi-column-report.md' --- # Cookbook: Multi-Column Report Build a multi-page report with metric dashboards, revenue tables, and per-section navigation using `renderTemplate()`. ## Choosing an approach There are three strategies for multi-column layouts in `zeropdf`: | Strategy | Best for | API | |----------|----------|-----| | Coordinate-based | Exact placement, decorative layouts | `page.text()`, `page.textBlock()`, `page.path()` | | Flow-based | Newspaper-style columns on one page | `page.flow({ columns: { count, gap } })` | | Template-based | Multi-page reports with repeating blocks, headers, footers, and balanced columns | `doc.renderTemplate()` | The example below uses `renderTemplate()` with `page.columns` — the recommended path for structured, paginated reports that should fill column 1, continue at the top of column 2, and only create a new page after the last column. ## Setup ```ts import { createDocument, hex } from "@criston/zeropdf"; import { readFileSync } from "node:fs"; const fontData = readFileSync("fonts/SourceSans3-Regular.ttf"); const doc = createDocument({ title: "Monthly Performance Report", info: { author: "Analytics Team" } }); const font = doc.embedTrueTypeFont(fontData, { family: "SourceSans3" }); const DARK = hex("#1a1a2e"); const GRAY = hex("#555566"); const ACCENT = hex("#2c6fce"); const LIGHT = hex("#9a9aae"); ``` ## Full report with `renderTemplate()` ```ts doc.renderTemplate({ title: "Monthly Performance Report", info: { author: "Analytics Team" }, page: { size: "A4", font, margin: 48, columns: { count: 2, gap: 24 }, spacing: { paragraphAfter: 8, headingBefore: { 2: 16, 3: 12 }, headingAfter: { 1: 12, 2: 8, 3: 6 }, tableBefore: 6, tableAfter: 12 } }, blocks: [ // ── Metric dashboard tiles ───────────────────── { type: "table", rows: [ [ { text: "$2.67M", header: true }, { text: "1,842", header: true }, { text: "72", header: true } ], [ { text: "Revenue", header: true }, { text: "Customers", header: true }, { text: "NPS", header: true } ], [ { text: "+12.3%", header: true }, { text: "+8.1%", header: true }, { text: "+4 pts", header: true } ] ], options: { headerRows: 1, fontSize: 9, cellPadding: 8, marginBottom: 28 } }, // ── Executive summary ────────────────────────── { type: "heading", text: "Executive Summary", options: { level: 1, color: DARK } }, { type: "paragraph", text: [ "Summary of key metrics and performance indicators for April 2026. ", "Overall performance was strong across all segments, with revenue ", "growth accelerating and customer satisfaction metrics trending positively." ].join(""), options: { color: GRAY } }, // ── Revenue analysis ─────────────────────────── { type: "heading", text: "Revenue Analysis", options: { level: 2, color: ACCENT } }, { type: "paragraph", text: [ "Total revenue grew 12.3% quarter-over-quarter, driven by enterprise ", "subscription upgrades and the launch of the analytics add-on. ", "All three segments posted double-digit growth." ].join("") }, { type: "table", rows: [ [ { text: "Category", header: true }, { text: "Q1", header: true }, { text: "Q2", header: true }, { text: "Change", header: true } ], ["Enterprise", "$1.2M", "$1.4M", "+16.7%"], ["SMB", "$800K", "$890K", "+11.3%"], ["Self-Serve", "$340K", "$380K", "+11.8%"] ], options: { headerRows: 1, fontSize: 10, cellPadding: 6, rowGap: 2, marginBottom: 12 } }, // ── Customer metrics ─────────────────────────── { type: "heading", text: "Customer Metrics", options: { level: 2, color: ACCENT } }, { type: "paragraph", text: [ "Net revenue retention improved to 128%, indicating strong expansion ", "within existing accounts. Churn decreased to 2.1% (from 2.8% in Q1), ", "the lowest rate in company history." ].join("") }, // ── Remaining sections continue in the next column ───────── { type: "heading", text: "Risk Assessment", options: { level: 2, color: ACCENT } }, { type: "paragraph", text: "Supply chain dependencies remain the top operational risk." }, { type: "heading", text: "Recommendations", options: { level: 2, color: ACCENT } }, { type: "paragraph", text: [ "1. Expand the analytics add-on to mid-market tiers by Q3.\n", "2. Invest in onboarding automation to sustain churn reduction.\n", "3. Pilot usage-based pricing for the self-serve segment." ].join("") } ], header: ({ title, pageNumber, totalPages }) => [ { type: "paragraph", text: `${title ?? "Monthly Performance Report"} \u2014 Page ${pageNumber} of ${totalPages}`, options: { fontSize: 8, color: LIGHT, tag: "Artifact" } }, { type: "paragraph", text: [ "Sections: Executive Summary \u00b7 Revenue Analysis \u00b7 ", "Customer Metrics \u00b7 Risk Assessment \u00b7 Recommendations" ].join(""), options: { fontSize: 7, color: LIGHT, tag: "Artifact" } } ], pageNumber: { region: "footer", align: "center" } }); ``` ## Metric dashboard as a table The metric tiles at the top of the report are rendered as a `table` block. Each column represents a KPI with a large value, a label, and a change indicator: ```ts { type: "table", rows: [ [ { text: "$2.67M", header: true }, { text: "1,842", header: true }, { text: "72", header: true } ], [ { text: "Revenue", header: true }, { text: "Customers", header: true }, { text: "NPS", header: true } ], [ { text: "+12.3%", header: true }, { text: "+8.1%", header: true }, { text: "+4 pts", header: true } ] ], options: { headerRows: 1, fontSize: 9, cellPadding: 8, marginBottom: 28 } } ``` Use `headerRows: 1` so the top row of values renders as bold column headers, creating a dashboard-like visual. ## Newspaper-style body columns The `page.columns` option controls the body flow area, separate from table columns: ```ts page: { size: "A4", margin: 48, columns: { count: 2, gap: 24 } } ``` Template blocks fill the first column until they run out of vertical space, then continue at the top of the second column. If a final page has enough content to fit in one column set, `renderTemplate()` balances the columns automatically. ## Section navigation in headers The `header` callback renders on every page. Use it to display a section breadcrumb so readers can navigate: ```ts header: ({ title, pageNumber, totalPages }) => [ { type: "paragraph", text: `${title ?? "Report"} \u2014 Page ${pageNumber} of ${totalPages}`, options: { fontSize: 8, color: LIGHT, tag: "Artifact" } }, { type: "paragraph", text: [ "Sections: Executive Summary \u00b7 Revenue Analysis \u00b7 ", "Customer Metrics \u00b7 Risk Assessment \u00b7 Recommendations" ].join(""), options: { fontSize: 7, color: LIGHT, tag: "Artifact" } } ] ``` Tag header blocks as `"Artifact"` so they are excluded from the document structure tree in tagged PDFs. ## Key techniques | Technique | Purpose | |-----------|---------| | `renderTemplate()` | Multi-page paginated reports with automatic headers/footers | | `page.columns` | Flow report body through balanced newspaper-style columns | | Table as dashboard | Render KPI tiles in a table block with `headerRows: 1` | | `header` callback | Section breadcrumb and page labels on every page | | `{ type: "pageBreak" }` | Force a section onto a fresh page when columns are not desired | | Semantic spacing | `headingBefore`/`headingAfter` for report-appropriate heading rhythm | | `tag: "Artifact"` | Exclude header/footer text from tagged PDF structure tree | ## See also * [Report Templates](./report-templates) — template block reference * [Accessibility and Compliance](./accessibility-and-compliance) — tagged PDF and PDF/UA-1 * [Streaming and Output](./streaming-and-output) — write large reports directly to disk --- --- url: 'https://zeropdf.criston.dev/guide/edit-existing-pdfs.md' --- # Edit Existing PDFs Use `parseDocument` when you need to inspect a PDF and `editDocument` when you need to produce an incremental update. ```ts import { editDocument, parseDocument } from "@criston/zeropdf"; const parsed = parseDocument(existingBytes); console.log(parsed.version); console.log(parsed.listPages().length); console.log(parsed.listFormFields()); const editable = editDocument(existingBytes); editable.updateInfo({ title: "Updated document" }); editable.setFieldValue("status", "approved"); const updatedBytes = editable.toUint8Array(); ``` ## Page workflows The page transfer helpers cover common document assembly tasks: ```ts import { appendPages, extractPages, mergeDocuments, splitDocument } from "@criston/zeropdf"; const firstPageOnly = extractPages(sourceBytes, [0]); const combined = mergeDocuments([coverBytes, bodyBytes, appendixBytes]); const perPage = splitDocument(sourceBytes); // one single-page PDF per page const withAppendix = appendPages(sourceBytes, appendixBytes); ``` ## Encrypted PDFs Generated PDFs can be password protected, and parser/editing workflows can accept a password when reading protected input. ```ts import { createDocument, parseDocument } from "@criston/zeropdf"; const protectedDoc = createDocument({ encryption: { algorithm: "rc4-128", userPassword: "reader", ownerPassword: "owner-secret", permissions: { printing: false, modifying: false, copying: false, annotating: false } } }); const bytes = protectedDoc.toUint8Array(); const parsed = parseDocument(bytes, { password: "reader" }); ``` ## Content Stream Overlay `writePageContent()` lets you inject raw content stream operators onto an existing page without altering the original objects. The mode controls placement: ```ts const editable = editDocument(sourceBytes); editable.writePageContent(0, "1 0 0 rg 72 72 100 100 re f", "append"); editable.writePageContent(0, "q BT /F1 12 Tf 72 700 Td (Overlay) Tj ET Q", "prepend"); ``` | Mode | Behavior | |------|----------| | `"append"` | Add operators after the existing page content (default) | | `"prepend"` | Insert operators before the existing page content | | `"replace"` | Replace the entire content stream with the provided content | ## Xref Recovery When `parseDocument` encounters a damaged or missing cross-reference table, it automatically attempts reconstruction by scanning the file for object markers. This handles cases where the `startxref` pointer is invalid or xref entries point to wrong offsets. No additional API call is needed — the recovery runs transparently during `parseDocument()`. ## Repair Warnings Call `getRepairWarnings()` after parsing to inspect what the xref recovery fixed: ```ts const parsed = parseDocument(bytes); const warnings = parsed.getRepairWarnings(); for (const w of warnings) { console.log(`[${w.objectNumber}] ${w.message}`); } ``` Each warning includes the affected object number and a description of the repair. ## Encrypted PDF without Permissions If an encrypted PDF omits the permissions (`/P`) entry, the parser defaults to granting all permissions (print, modify, copy, annotate, etc.). This ensures the document is editable without needing an owner password. --- --- url: 'https://zeropdf.criston.dev/guide/text-extraction.md' --- # Text Extraction Extract text and positioned glyph runs from parsed PDF pages. The extraction engine decodes content streams, tracks the text-state machine, and resolves glyph codes via per-font `ToUnicode` CMaps. ## extractText() Call `extractText()` on a `ParsedPdfDocument` to get per-page extraction results: ```ts import { parseDocument } from "@criston/zeropdf"; const pdf = await parseDocument(bytes); const extractions = pdf.extractText(); for (const page of extractions) { console.log(`Page ${page.pageIndex}: ${page.text}`); } ``` ### Reading order The `readingOrder` option controls run ordering: | Value | Behavior | |-------|----------| | `"stream"` (default) | Runs appear in content-stream operator order | | `"structure"` | Runs reordered to match structure tree traversal via MCID markers; runs without MCID appended at the end | ```ts // Stream order (default) — resembles PDF "copy-paste" text const streamText = pdf.extractText({ readingOrder: "stream" }); // Structure order — follows tagged logical reading order const structuredText = pdf.extractText({ readingOrder: "structure" }); ``` ## PageTextExtraction Each element in the return array has the shape: ```ts interface PageTextExtraction { /** Zero-based page index. */ readonly pageIndex: number; /** Concatenated text in stream order. */ readonly text: string; /** Positioned runs in stream order. */ readonly runs: readonly PositionedTextRun[]; } ``` ## PositionedTextRun Individual text runs carry geometry and markup metadata: ```ts interface PositionedTextRun { /** Decoded Unicode text. */ readonly text: string; /** Origin x in user space (PDF points). */ readonly x: number; /** Origin y in user space (PDF points). */ readonly y: number; /** Width of the run in user-space points (sum of glyph advances). */ readonly width: number; /** Active font size at the time of emission. */ readonly fontSize: number; /** Active font resource name (e.g. "F1"); undefined when no font is set. */ readonly fontName?: string | undefined; /** Marked-content MCID covering this run, if any. */ readonly mcid?: number | undefined; /** Marked-content tag (e.g. "P", "Span", "Artifact") covering this run. */ readonly mcTag?: string | undefined; } ``` Use runs to locate text on the page, group content by structure tag, or correlate with layout: ```ts for (const run of page.runs) { if (run.mcTag === "H1") { console.log(`Heading at (${run.x}, ${run.y}): ${run.text}`); } } ``` ## MCID tracking through BDC / EMC markers Tagged PDFs wrap marked content with `BDC` / `EMC` operator pairs that carry an `MCID` (marked-content identifier). The extraction engine tracks the current BDC/EMC nesting level and associates each subsequent text run with the most recent MCID and tag. | Marker | Meaning | |--------|---------| | `/Tag << /MCID 0 >> BDC` | Begin marked content with MCID 0 | | `EMC` | End marked content | The `mcid` and `mcTag` fields on `PositionedTextRun` reflect the innermost BDC/EMC block active when the text was emitted. Runs without any surrounding BDC/EMC have `mcid` and `mcTag` as `undefined`. ## Tagged vs untagged PDFs ### Tagged PDFs Tagged documents contain a structure tree (`StructTreeRoot`) with BDC/EMC markers throughout the content stream. Use `readingOrder: "structure"` to reorder runs by the structure tree's logical traversal order. This produces the same reading order that a screen reader would follow. ```ts const pdf = parseDocument(taggedBytes); const pages = pdf.extractText({ readingOrder: "structure" }); for (const page of pages) { for (const run of page.runs) { console.log(`[${run.mcTag}] ${run.text.trim()}`); } // [H1] Quarterly Report // [P] Revenue, support volume, and accessibility work completed during Q1. // [P] Deliverables } ``` ### Untagged PDFs Untagged PDFs have no structure tree or BDC/EMC markers. All runs have `mcid` and `mcTag` as `undefined`. `readingOrder: "structure"` falls back to stream order for untagged content. ```ts const pdf = parseDocument(untaggedBytes); const pages = pdf.extractText(); // defaults to "stream" for (const page of pages) { for (const run of page.runs) { console.log(`(${run.fontSize}pt) ${run.text.trim()} at (${run.x}, ${run.y})`); } // (12pt) Hello from TypeScript at (56, 780) // (12pt) Wrapped copy with predictable line breaks at (56, 740) } ``` --- --- url: 'https://zeropdf.criston.dev/guide/page-assembly.md' --- # Page Assembly Page transfer helpers cover extract, split, merge, and append workflows without serializing through the document API. ```ts import { appendPages, extractPages, mergeDocuments, splitDocument } from "@criston/zeropdf"; ``` ## Extract Pull specific pages into a new PDF. Indexes are zero-based. ```ts const firstAndThird = extractPages(sourceBytes, [0, 2]); ``` ## Split Split a PDF into multiple documents. Pass page-index ranges to control grouping; omit to split per page. ```ts const perPage = splitDocument(sourceBytes); const sections = splitDocument(sourceBytes, [[0, 1], [2, 3], [4, 9]]); ``` Each entry is `[startInclusive, endInclusive]`. ## Merge Concatenate documents in order. Resources, fonts, and images are renumbered to avoid collisions. ```ts const combined = mergeDocuments([coverBytes, bodyBytes, appendixBytes]); ``` ## Append Append selected pages from a source onto a base document. ```ts const withAppendix = appendPages(baseBytes, sourceBytes, [0, 1]); ``` Omit the index list to append every page from the source. ## Editor-based reordering For metadata-preserving in-place reorder, use `editDocument`: ```ts import { editDocument } from "@criston/zeropdf"; const editable = editDocument(bytes); editable.movePage(2, 0); editable.removePage(1); const newPage = editable.insertPage(1); newPage.text("Inserted", { x: 48, y: 780 }); const updated = editable.toUint8Array(); ``` Tagged and PDF/A-conformance documents support a safe incremental subset: metadata/XMP updates, overlay edits on existing pages, and appending new compliant pages. Reorder/remove/mid-insert and form flattening on those documents are blocked until full structure-tree-safe editing lands. --- --- url: 'https://zeropdf.criston.dev/guide/accessibility-and-compliance.md' --- # Accessibility and Compliance `zeropdf` can create tagged PDFs with document language, semantic structure, role maps, alt text, and validation warnings. For output that is intended to validate as PDF/UA-1, enable the PDF/UA profile, embed fonts for all visible text, use semantic flow helpers for meaningful content, mark decorative drawing as artifacts when you use low-level drawing, and write the serialized bytes to your target. ```ts import { readFile, writeFile } from "node:fs/promises"; import { createDocument } from "@criston/zeropdf"; const fontBytes = await readFile("fonts/SourceSans3-Regular.ttf"); const doc = createDocument({ title: "Quarterly Report", conformance: "pdfua-1", tagged: true, language: "en-US", structureRoot: "Document", info: { author: "zeropdf" }, xmpMetadata: { creator: "zeropdf", createDate: "2026-05-05T00:00:00Z", modifyDate: "2026-05-05T00:00:00Z", metadataDate: "2026-05-05T00:00:00Z" } }); const font = doc.embedTrueTypeFont(fontBytes, { family: "SourceSans3" }); const page = doc.addPage({ size: "Letter" }); page.flow({ font }) .heading("Quarterly Report") .paragraph("Revenue, support volume, and accessibility work completed during Q1.") .table( [ [ { text: "Metric", header: true }, { text: "Result", header: true } ], [ { text: "Revenue", header: true, scope: "row" }, "$2.6M" ], [ { text: "Open tickets", header: true, scope: "row" }, "38" ] ], { headerRows: 1, headerColumns: 1, fontSize: 10 } ) .png(logoBytes, { width: 32, altText: "Company logo" }); const issues = doc.validateCompliance(); if (issues.some((issue) => issue.severity === "error")) { throw new Error(issues.map((issue) => issue.message).join("\n")); } await writeFile("quarterly-report.pdf", doc.toUint8Array()); ``` `flow()` keeps a cursor, assigns standard tags for headings and paragraphs, lays out tables and images, applies standard report spacing, and infers structure bounding boxes from the generated placement. Use `structure.boundingBox` only when you need to override the inferred box for a specific element. The default spacing scale is designed around readable PDF reports: body paragraphs have compact after-spacing, headings have stronger before-spacing and tighter after-spacing, tables and figures get object spacing, and headings at the top of a page do not receive unnecessary leading space. For special cases, set `marginTop` or `marginBottom` on a block. For a whole report, set `page.spacing`. For longer reports, use `renderTemplate()` to render a reusable block tree with automatic page creation: ```ts doc.renderTemplate({ title: "Accessibility Audit Report", info: { author: "BarrierBreak" }, xmpMetadata: { creator: "BarrierBreak", createDate: "2026-05-05T00:00:00Z", modifyDate: "2026-05-05T00:00:00Z", metadataDate: "2026-05-05T00:00:00Z" }, page: { size: "A4", font, margin: 56, spacing: { paragraphAfter: 8, headingBefore: { 2: 18, 3: 14 }, headingAfter: { 1: 14, 2: 10, 3: 8 }, tableBefore: 6, tableAfter: 14 } }, blocks: [ { type: "heading", text: "Accessibility Audit Report" }, { type: "paragraph", text: "Executive summary and scope." }, { type: "table", rows: [ [{ text: "Criterion", header: true }, { text: "Result", header: true }], ["Language metadata", "Present"] ], options: { headerRows: 1 } }, { type: "pageBreak" }, { type: "heading", text: "References", options: { level: 2 } }, { type: "link", text: "WCAG 2.2", url: "https://www.w3.org/TR/WCAG22/" } ], header: ({ title, pageNumber, totalPages }) => [ { type: "paragraph", text: `${title ?? "Report"} - page ${pageNumber} of ${totalPages}`, options: { fontSize: 8, tag: "Artifact" } } ], pageNumber: { region: "footer", align: "center" } }); ``` Use `{ type: "pageBreak" }` when the next block should start on a fresh page. A page break before any body content on the current page is ignored, so templates can include defensive breaks without creating empty pages. Headers and footers are rendered after the body pages are known, so callbacks receive `title`, `author`, `pageNumber`, and `totalPages`. Use `pageNumber` for standard running page labels without hand-authoring a footer; set `region` to `"header"` or `"footer"` and `align` to `"left"`, `"center"`, or `"right"`. `conformance: "pdfua-1"` makes serialization fail when required PDF/UA inputs are missing, such as document language, tags, alt text for figures, or embedded fonts for visible text. `validateCompliance()` is still useful before writing because it returns all current warnings and errors instead of throwing on the first blocking issue. You can also stream the same tagged document to a sink: ```ts import { NodeStreamSink } from "@criston/zeropdf"; import { createWriteStream } from "node:fs"; await doc.writeTo(new NodeStreamSink(createWriteStream("quarterly-report.pdf"))); ``` ## Structure containers Use containers when content has semantic relationships that should be preserved in the structure tree. `section` blocks in `renderTemplate` also create proper tagged structure boundaries when `role` or `structure` is specified: ```ts { type: "section", role: "Sect", blocks: [ { type: "heading", text: "Audit details", options: { level: 2 } }, { type: "paragraph", text: "Grouped content stays nested under the section." } ] } ``` ```ts const page = doc.addPage(); page.container("Sect", (section) => { section.flow() .heading("Audit details", { level: 2 }) .paragraph("Grouped content remains nested under the section element.") .table( [ [ { text: "Criterion", header: true }, { text: "Result", header: true } ], ["Language metadata", "Present"] ], { headerRows: 1 } ); }); ``` ## Standards validation `validateCompliance()` is intentionally lightweight. For standards-level PDF/A and PDF/UA checks, install veraPDF and run: ```sh npm run validate:pdf -- output.pdf ``` You can pass veraPDF flags after `--`: ```sh npm run validate:pdf -- output.pdf -- --flavour 1b ``` ## Artifact Types When marking content as decorative (non-semantic), use the `artifactType` option to classify it for assistive technology: * `"Pagination"` — running headers, footers, page numbers * `"Layout"` — ornamental borders, rules, background decorations * `"Page"` — watermarks or page background images ```ts page.flow().paragraph("Page 1 of 10", { tag: "Artifact", artifactType: "Pagination" }); ``` ## Associated Files Structure elements can carry an `/AF` (Associated Files) array linking to embedded files: ```ts const fileRef = doc.embedFile(dataBytes, { filename: "source-data.csv", mimeType: "text/csv" }); page.setAssociatedFile(fileRef, "DataSources"); ``` This annotates the structure tree so processors can locate supporting files by relationship. ## Phonetic Attributes For pronunciation guidance and abbreviation expansion, attach `/Phoneme` or `/E` dictionaries to structure elements: * `/Phoneme` — phonetic transcription (e.g. IPA) for screen reader pronunciation * `/E` — the expanded form of an acronym or abbreviation ```ts doc.setPhoneticExpansion(tag, "National Aeronautics and Space Administration"); doc.setPhoneme(tag, "næʃənəl eɪrənɔtɪks"); ``` ## Table Summary Tables accept a `summary` option that provides a screen-reader–friendly description of the table's purpose: ```ts page.flow().table(rows, { headerRows: 1, summary: "Quarterly revenue by product line and region" }); ``` ## New Conformance Profiles Additional profiles beyond `pdfua-1` are available. See [PDF Versions and Conformance](/guide/pdf-versions-and-conformance) for full details: * `pdfa-2b` and `pdfa-3b` — PDF/A archival standards (levels 2 and 3, basic conformance) * `pdfa-4` — PDF/A-4 (ISO 19005-4), the latest archival standard * `pdfua-2` — PDF/UA-2, the next-generation universal accessibility standard * `wtpdf` — Well-Tagged PDF (WTPDF) readability profile --- --- url: 'https://zeropdf.criston.dev/guide/pdf-versions-and-conformance.md' --- # PDF Versions and Conformance The serializer auto-detects the minimum PDF header version required by the features used. Conformance profiles add stricter validation and metadata. ## Auto-detected versions | Feature | Minimum version | |---------|-----------------| | Baseline | 1.4 | | `objectStreams: true` | 1.5 | | AES-128 encryption | 1.6 | | AES-256 (R=5) | 1.7 | | Attachments / signatures / `pdfua-1` | 1.7 | | AES-256 (R=6) | 2.0 | `mergeDocuments`, `appendPages`, `extractPages`, and `splitDocument` carry the maximum source version forward so output never declares a lower version than its inputs. ## Conformance profiles Set `conformance` to enforce PDF/A or PDF/UA invariants at serialization time: ```ts const archive = createDocument({ title: "Archive", conformance: "pdfa-1b" }); const accessible = createDocument({ conformance: "pdfua-1", tagged: true, language: "en-US" }); ``` | Profile | Notes | |---------|-------| | `pdfa-1b` | Static archival. Fonts must be embedded. ICC output intent required. | | `pdfua-1` | Accessibility. Tags, language, alt text, embedded fonts required. | When a profile is set, missing inputs throw `PdfEngineError` instead of silently producing non-conformant output. Use `validateCompliance()` to collect all warnings/errors first: ```ts const issues = doc.validateCompliance(); for (const issue of issues) { console.log(issue.severity, issue.message); } ``` ## ICC output intents PDF/A documents require an output intent. Provide an ICC profile and identifier: ```ts const doc = createDocument({ conformance: "pdfa-1b", outputIntent: { profile: cmykIccBytes, outputConditionIdentifier: "Press CMYK", alternate: "DeviceCMYK", channels: 4 } }); ``` For RGB workflows, omit `alternate`/`channels` to use the bundled sRGB profile. ## PDF 2.0 considerations PDF 2.0 changes structure namespace handling and AES-256 (R=6) key derivation. The library tracks PDF 2.0 namespacing for tagged elements and emits `2.0` headers automatically when AES-256-R6 or PDF 2.0-only features are used. `validatePdf2Conformance(bytes)` runs additional namespace and structure checks for 2.0 output. ## veraPDF for standards-level checks `validateCompliance()` is intentionally lightweight. For full PDF/A and PDF/UA validation, install veraPDF: ```sh npm run validate:pdf -- output.pdf npm run validate:pdf -- output.pdf -- --flavour 1b VERAPDF_BIN=/opt/verapdf/verapdf npm run validate:pdf -- output.pdf ``` --- --- url: 'https://zeropdf.criston.dev/guide/encryption-and-signatures.md' --- # Encryption and Signatures Generated PDFs can be password-protected with permissions, and the parser/editor accept passwords for protected input. Detached PKCS#7/CMS digital signatures are supported with caller-supplied signing. ## Password protection ```ts import { createDocument, parseDocument } from "@criston/zeropdf"; const doc = createDocument({ encryption: { algorithm: "aes-256", userPassword: "reader", ownerPassword: "owner-secret", permissions: { printing: false, modifying: false, copying: false, annotating: false } } }); const bytes = doc.toUint8Array(); const parsed = parseDocument(bytes, { password: "reader" }); ``` Algorithms: `"rc4-40"` (legacy compatibility), `"rc4-128"` (default), `"aes-128"`, `"aes-256"`. ## Metadata-Only Encryption Encrypt document content but leave metadata (title, author, XMP) in plaintext so search engines and indexers can read it: ```ts const doc = createDocument({ encryption: { algorithm: "aes-256", userPassword: "reader", ownerPassword: "owner-secret", encryptMetadata: false } }); ``` ## Permissions | Flag | Meaning | |------|---------| | `printing` | Allow printing | | `modifying` | Allow document modification | | `copying` | Allow text/image copy | | `annotating` | Allow annotation creation | | `fillingForms` | Allow form fill | | `accessibility` | Allow accessibility extraction | | `assembling` | Allow page assembly | | `highQualityPrinting` | Allow full-resolution print | Omit `permissions` to grant all rights. ### Complete Permission Bits All available permission flags used in full: ```ts permissions: { printing: true, highQualityPrinting: false, modifying: true, copying: true, annotating: true, fillingForms: true, accessibility: true, assembling: false } ``` ## Cross-Version Encryption Upgrade Call `setEncryption()` on an editable document to upgrade legacy RC4 encryption to AES: ```ts const editable = editDocument(rc4Bytes, { password: "reader" }); editable.setEncryption({ algorithm: "aes-256", userPassword: "reader" }); const upgraded = editable.toUint8Array(); ``` ## Empty Password An empty string `""` is a valid user password—useful when you only want an owner password to restrict permissions: ```ts encryption: { algorithm: "aes-256", userPassword: "", ownerPassword: "admin-secret" } ``` Readers can open the PDF without entering a password, but permissions are enforced. ## Certificate-Based Encryption Encrypt for specific recipients using X.509 certificates: ```ts import { readFileSync } from "node:fs"; const cert = readFileSync("recipient.pem"); const doc = createDocument({ encryption: doc.encryptForRecipients([cert], { permissions: { printing: true, modifying: false } }) }); ``` ## Default Permissions for Missing /P PDFs missing the `/P` permissions entry are handled gracefully—the library defaults to granting all rights when no permissions dictionary is present. ## Editing protected PDFs `editDocument` accepts `{ password }` and re-encrypts with the original parameters when serializing: ```ts const editable = editDocument(protectedBytes, { password: "reader" }); editable.updateInfo({ title: "Revised" }); const updated = editable.toUint8Array(); ``` ## Detached signatures Generate a `/ByteRange` and let your signing code produce the CMS blob: ```ts const signed = createDocument({ signature: { fieldName: "approval", reason: "Approved for release", location: "Berlin", contactInfo: "ops@example.com", sign: (byteRange) => signDetachedCms(byteRange) } }); signed.addPage().text("Print proof", { x: 56, y: 760 }); const bytes = signed.toUint8Array(); ``` `sign` receives the bytes covered by `/ByteRange` and must return a DER-encoded CMS `SignedData` value. Use Node `crypto`, `node-forge`, or any PKCS#7 toolkit. The serializer pads `/Contents` to fit the returned blob. --- --- url: 'https://zeropdf.criston.dev/guide/security-hardening.md' --- # Security Hardening Threat model, encryption best practices, signature trust considerations, and guidance for handling untrusted PDFs. ## Threat model ### What encryption protects Password-based PDF encryption (Standard Security Handler, ISO 32000 §7.6) protects **content at rest** — the serialized PDF bytes. When a document is encrypted with a user password: * Stream and string content is encrypted with a document key derived from the password * Metadata (object structure, page count, font names) is NOT encrypted — only content streams and strings * An attacker with the encrypted bytes but without the password cannot read text, extract images, or view embedded data ### What encryption does NOT protect * **Password in transit**: The password must be communicated to the recipient through a separate channel * **Password brute-force**: Short or common passwords are vulnerable to offline cracking (especially rc4-40/rc4-128) * **Content before encryption**: The library works in memory; if the host process is compromised, plaintext content is exposed * **Metadata visibility**: Page count, object structure, font names, and document outlines remain readable in encrypted PDFs * **Evil maid attacks**: An attacker with write access to the file can swap ciphertext or modify metadata ### Threat actors relevant to this library | Actor | Capability | Mitigation | |-------|-----------|------------| | Casual observer | Opens PDF in viewer | Password protection | | Network eavesdropper | Intercepts file in transit | TLS for transport; encryption for file | | Recipient with bad intent | Has password, wants to modify | Digital signature or owner password for modify restrictions | | Malicious input (untrusted PDF) | Provides crafted PDF for parsing/editing | Validate input; see [Parsing untrusted PDFs](#parsing-untrusted-pdfs) | | Host compromise | Has access to process memory | Out of scope — this library is not a sandbox | ## Password recommendations ### Algorithm selection ```ts // Preferred: AES-256 createDocument({ encryption: { algorithm: "aes-256", userPassword: process.env.PDF_ENCRYPTION_KEY!, permissions: { /* ... */ } } }); // Legacy compatibility only createDocument({ encryption: { algorithm: "rc4-128", userPassword: "legacy-minimum", permissions: { /* ... */ } } }); ``` | Algorithm | Recommendation | |-----------|---------------| | `aes-256` | **Preferred.** Current best practice for password-protected PDFs. Supports PDF 1.7+. | | `aes-256-r6` | PDF 2.0 encryption. Use when targeting PDF 2.0 exclusively. | | `aes-128` | Acceptable. Available since PDF 1.6. | | `rc4-128` | Legacy. Use only when compatibility with very old viewers is required (PDF 1.4–1.5). | | `rc4-40` | Deprecated. Avoid unless no alternative is possible. Export-restricted algorithm with 40-bit effective key. | ### Password strength Derive passwords from a cryptographically secure random source with at least 128 bits of entropy: ```ts import { randomBytes } from "node:crypto"; // Good: 128 bits of entropy const password = randomBytes(16).toString("hex"); // e.g., "a3f8b2c1d4e5f6a7b8c9d0e1f2a3b4c5" ``` Avoid: * Dictionary words * Sequential numbers (`"invoice-001"`, `"invoice-002"`) * Hardcoded passwords in source code * Passwords derived from document metadata (title, author, date) ### Key management Never store passwords alongside encrypted PDFs. Use a key management service (KMS), environment variables, or a secrets manager: ```ts // ✅ Environment variable (reads once at startup) const password = process.env.PDF_ENCRYPTION_KEY; // ✅ Secrets manager import { getSecret } from "./secrets.js"; const password = await getSecret("pdf-encryption-key"); // ❌ Hardcoded const password = "SuperSecret123"; // ❌ Derived from document metadata (predictable) const password = doc.info.title?.toLowerCase().replace(/\s/g, "-"); ``` ### Permissions Set the minimum permissions necessary: ```ts encryption: { algorithm: "aes-256", userPassword: "secret-key", permissions: { printing: true, // Allow printing modifying: false, // Prevent editing copying: false, // Prevent text/image extraction annotating: false, // Prevent annotation fillingForms: false, // Prevent form fill accessibility: true, // Allow accessibility tools assembling: false, // Prevent page insertion/deletion highQualityPrinting: false // Downgrade print to low-res } } ``` Permissions are enforced by the PDF viewer, not cryptographically. A malicious viewer can ignore them. Permissions only protect against accidental misuse by compliant viewers. ## Digital signatures ### How signatures work in this library The library generates the `/ByteRange` — the exact byte range of the PDF that the signature covers — and calls your `sign` function to produce the CMS/PKCS#7 signature blob. The serializer then reserves space for the signature value and inserts it at the correct byte offset. ```ts createDocument({ signature: { fieldName: "approval", reason: "Document approved", location: "San Francisco", contactInfo: "security@example.com", sign: (byteRange) => { // byteRange is a Uint8Array of the bytes to sign return signWithPrivateKey(byteRange, privateKey); } } }); ``` ### Trust model The library does NOT verify signatures. It provides the mechanism to create them. Trust is established by: 1. **Signer identity**: The private key used to sign must be protected 2. **Certificate chain**: Embed the signer's X.509 certificate chain in the CMS blob 3. **Timestamp**: Include a trusted timestamp token (TST) in the `UnsignedAttributes` of the CMS `SignerInfo` 4. **Long-term validation (LTV)**: For archival, include CRLs or OCSP responses and timestamps in the document security store (DSS) ### Security considerations * **Private key protection**: The `sign` callback receives raw bytes — it is your responsibility to keep the signing key secure (HSM, KMS, secured environment) * **Byte range stability**: Do not modify the document after signing. The `/ByteRange` covers a specific range; any subsequent edit invalidates the signature * **No signature verification API**: This library does not verify signatures on parsed documents. Use a dedicated PDF signature validator (e.g., Adobe Acrobat, iText, or custom code) if verification is needed * **One signature per document**: The library supports a single detached signature. Multiple signatures (sequential signing) is not supported ### Example: signing with Node.js crypto ```ts import { createSign, createPrivateKey } from "node:crypto"; const privateKey = createPrivateKey({ key: readFileSync("private-key.pem"), passphrase: process.env.KEY_PASSPHRASE }); const doc = createDocument({ signature: { fieldName: "approval", reason: "Approved for release", sign: (byteRange) => { const signer = createSign("SHA256"); signer.update(Buffer.from(byteRange)); return signer.sign(privateKey); } } }); ``` ## Parsing untrusted PDFs ### Risks When you parse or edit a PDF from an untrusted source: 1. **Malformed xref tables**: Can point to arbitrary offsets, causing out-of-bounds reads during parsing. The parser validates offset ranges and rejects out-of-bounds references. 2. **Infinite loops**: Recursive or self-referencing object graphs can cause unbounded CPU consumption during traversal. 3. **Large streams**: Embedded streams (images, fonts) with declared sizes much larger than actual data can cause memory exhaustion. 4. **Cryptographic padding oracle**: RC4-based encryption modes (rc4-40, rc4-128) are stream ciphers — a malicious PDF encrypted with a known password could be crafted to exploit RC4 biases. Use AES modes where possible. 5. **JavaScript injection**: PDFs can contain embedded JavaScript. This library does NOT execute JavaScript, but if you subsequently open the PDF in a viewer that does, embedded JS runs with the viewer's privileges. ### Defenses | Risk | Library behavior | Additional hardening | |------|-----------------|---------------------| | Malformed xref | Validates offsets; rejects out-of-bounds references | — | | Large streams | Allocates based on declared size | Set a maximum file size gate before parsing | | Infinite loops | No recursion in parser; iterative traversal | Setting a timeout on parse operations | | RC4 weaknesses | — | Use `aes-256` encryption; avoid rc4-40 | | JavaScript | Library ignores `/JS` entries | Examine parsed document for `/AA` (additional actions) or `/OpenAction` with JavaScript | ### Pre-parse validation ```ts const MAX_FILE_SIZE = 50 * 1024 * 1024; // 50 MB async function safeParse(input: Uint8Array) { if (input.length > MAX_FILE_SIZE) { throw new Error("PDF exceeds maximum allowed size"); } if (input.length < 5 || !startsWithPdfHeader(input)) { throw new Error("Not a valid PDF header"); } return parseDocument(input); } function startsWithPdfHeader(bytes: Uint8Array): boolean { const header = new TextDecoder().decode(bytes.slice(0, 5)); return header === "%PDF-"; } ``` ### After parsing Inspect the parsed metadata before passing the document downstream: ```ts const parsed = parseDocument(untrustedBytes); // Check for JavaScript actions if (parsed.metadata?.openAction) { throw new Error("PDF contains an open action — rejected"); } // Check encryption (you need the password to read content) if (parsed.metadata?.encrypted && !passwordProvided) { throw new Error("PDF is encrypted — password required"); } ``` ## Environment hardening ### Node.js * Run PDF generation in a worker thread or child process with limited memory * Set `--max-old-space-size` to cap heap usage for bulk generation * Never log password values or encryption keys ### Browser * PDF content is generated in the main thread — large documents will block the UI. Use a Web Worker for generation. * Never store passwords in `localStorage` or `sessionStorage` in plaintext * Be aware that browser extensions can intercept `Uint8Array` content ## See also * [Encryption and Signatures](./encryption-and-signatures) — API reference for encryption and digital signatures * [Edit Existing PDFs](./edit-existing-pdfs) — parsing and editing workflows * [PDF Versions and Conformance](./pdf-versions-and-conformance) — conformance profiles --- --- url: 'https://zeropdf.criston.dev/guide/troubleshooting.md' --- # Troubleshooting Diagnose and fix common issues when generating, parsing, or editing PDFs. ## Error codes reference Every `PdfEngineError` carries a `code` property from the `PdfErrorCode` enum. Catch and inspect it: ```ts import { PdfEngineError, PdfErrorCode } from "@criston/zeropdf"; try { const doc = createDocument({ /* ... */ }); } catch (err) { if (err instanceof PdfEngineError) { console.error(`[${err.code}] ${err.message}`); console.error("Details:", err.details); } } ``` | Code | Typical cause | Fix | |------|--------------|-----| | `INVALID_PDF` | Malformed or unsupported PDF input | Verify the source PDF is valid (not truncated, correct header); if possible, re-export or repair the PDF with a standards-compliant writer | | `UNSUPPORTED_XREF_FORMAT` | Cross-reference stream format is not recognized | The library supports classic xref tables, xref streams, object streams, and incremental xref chains. If you encounter this, the PDF may use malformed or non-standard cross-reference data | | `INVALID_FONT` | Font name is not a standard-14 font (the message suggests the closest match, e.g. `Did you mean "Helvetica"?`), or embedded font data is corrupt | Use exact PostScript names (`"Helvetica"`, `"Times-Roman"`, etc.), register a family with `registerFontFamily()`, or verify TTF data is valid | | `UNSUPPORTED_CHARACTER` | A character has no glyph in any available font | Add an embedded font that covers the character or provide a `fallbackFonts` array | | `INVALID_IMAGE` | Image is corrupt, unsupported format, or wrong color space | Verify image data and use the matching image API: `jpeg`, `png`, `bmp`, `gif`, `jpeg2000`, `jbig2`, `tiff`, `webp`, or `svg` | | `UNSUPPORTED_IMAGE_FORMAT` | Image format variant is not supported | Convert to a supported variant, such as RGB/CMYK JPEG, non-interlaced PNG, lossless WebP, baseline LZW TIFF, or first-frame GIF | | `UNSUPPORTED_IMAGE_COLOR_SPACE` | PNG uses a color space other than RGB or Grayscale | Convert the image to RGB or grayscale | | `UNSUPPORTED_IMAGE_BIT_DEPTH` | PNG bit depth is not 1, 2, 4, 8, or 16 | Convert to 8-bit or 16-bit | | `UNSUPPORTED_IMAGE_INTERLACE` | PNG uses Adam7 interlacing | Re-encode the PNG without interlacing | | `INVALID_ENCRYPTION` | Encryption parameters are inconsistent (e.g., wrong password, unsupported algorithm for current PDF version) | Check algorithm/password/revision combination; avoid `rc4-40` with object streams | | `UNSUPPORTED_ENCRYPTION` | Encryption mode is not supported for parsing or editing | If parsing, the PDF may use public-key or custom security handlers. Password-protected PDFs using the Standard Security Handler with RC4 or AES are supported | | `INVALID_COMPLIANCE` | Document violates an enabled conformance profile (e.g., PDF/UA-1 missing language tag) | Run `doc.validateCompliance()` to see all issues; fix each before serialization | | `INVALID_PAGE` | Page index is out of bounds, or page reference is invalid | Check page count and indices; use `parsed.pages.length` to verify | | `INVALID_TEXT` | Text content or layout options are invalid (e.g., negative font size) | Verify `fontSize`, `lineHeight`, and `width` are positive | | `INVALID_FORM_FIELD` | Form field name is empty, duplicate, or value type mismatch | Ensure unique field names; match value type to field type (string for text, boolean for checkbox) | | `EMPTY_PAGE` | Attempting to serialize a document with zero pages | Add at least one page before calling `toUint8Array()` | | `INVALID_PAGE_SIZE` | Unrecognized page size name or invalid custom dimensions | Use a name from `PAGE_SIZES` or specify `{ width, height }` | | `INVALID_COLOR` | Color components outside valid range or invalid color type | RGB/CMYK values must be 0–1; hex must be 6 hex digits | | `INVALID_PATH` | Invalid path command sequence (e.g., `fill()` without a closed path) | Ensure path commands form a valid drawing sequence | | `INVALID_ATTACHMENT` | File attachment data or metadata is invalid | Verify MIME type string and that file data is non-empty | | `INVALID_ANNOTATION` | Annotation rectangle or options are invalid | Verify annotation coordinates are within page bounds | | `INVALID_DESTINATION` | Named destination target page is invalid | Ensure the target page exists in the document | | `INVALID_LINK` | Link target URL or link rectangle is invalid | Verify URL format and rectangle dimensions | | `INVALID_METADATA` | Document info or XMP metadata is malformed | Check date formats (`D:YYYYMMDDHHmmSS` for info, ISO 8601 for XMP) | | `INVALID_OUTLINE` | Outline bookmark has missing or invalid target | Ensure each outline item has a valid page or named destination | | `INVALID_TRANSFORM` | Matrix is singular or contains non-finite values | Verify matrix determinant is non-zero; all entries must be finite numbers | | `INVALID_DASH_PATTERN` | Dash pattern contains zero or negative values | All dash array elements must be positive numbers | | `INVALID_GRAPHICS_STATE` | Unbalanced `save()`/`restore()` calls | Ensure each `save()` has a matching `restore()` | | `INVALID_PAGE_LABEL` | Page label range or style is invalid | Verify `style` is one of `"decimal"`, `"upperRoman"`, `"lowerRoman"`, `"upperLetter"`, `"lowerLetter"` | | `INVALID_NUMBER` | A numeric API argument is out of range (e.g., negative page index) | Validate all numeric inputs against expected ranges | | `INTERNAL_ERROR` | Unexpected internal state or assertion failure | Check for conflicting options or malformed internal structures | | `INVALID_OPERATION` | API method called in an invalid state (e.g., writing to a closed document) | Verify the document or page object is still open/active | | `SINK_CLOSED` | Attempted to write to a stream sink that has already been closed | Write all data before the sink completes; use a fresh sink for each document | | `SINK_FULL` | Stream sink reached its capacity limit | Increase the sink's internal buffer size or switch to `NodeStreamSink` / `WebStreamSink` | | `UNREACHABLE` | Code path that should never execute was reached | Likely a library bug; report with a minimal reproduction | | `UNSUPPORTED_PAGE_TREE` | Page tree depth exceeds 50 levels or uses an unrecognized node type | Flatten deep page trees before parsing; avoid non-standard page tree layouts | | `INVALID_NUMBER_TREE` | Number tree structure is corrupt or contains duplicate keys | The PDF's internal name/number tree is malformed; re-export from the source application | | `INVALID_FORM_FIELD_NAME` | Form field name contains illegal characters or is empty | Use alphanumeric names; avoid `.` as prefix/suffix unless for hierarchy | | `UNSUPPORTED_SCRIPT` | Text uses a writing system not supported by any loaded font | Add a fallback font with coverage for the required script | ## Broken xref (cross-reference) table ### Symptoms * `PdfEngineError` with code `INVALID_PDF` when calling `parseDocument()` * Error message includes "xref", "offset", "object not found", or "invalid xref" * Viewer shows blank pages or missing content after editing ### Causes 1. **Truncated file**: The file was cut short during download or copy 2. **Malformed xref data**: The PDF uses broken, incomplete, or non-standard cross-reference data. Classic xref tables, xref streams, object streams, and incremental xref chains are supported when well-formed 3. **Incremental updates not merged**: A PDF with multiple incremental updates (appended xref sections) may reference objects from earlier sections that have been superseded 4. **Object stream xref**: PDF 1.5+ files store objects in compressed streams; the library supports these, but malformed streams cause parse failures ### How to detect ```ts try { const parsed = parseDocument(bytes); console.log("Valid PDF,", parsed.pages.length, "page(s)"); } catch (err) { if (err instanceof PdfEngineError && err.code === PdfErrorCode.INVALID_PDF) { console.error("Parse failed:", err.message); // Inspect raw bytes: is the header "%PDF-1.x"? const header = new TextDecoder().decode(bytes.slice(0, 8)); console.log("Header:", header); } } ``` ### Fixes 1. **Verify file integrity**: Run `xxd output.pdf | head -5` — confirm the header is `%PDF-1.` followed by a version 2. **Re-export from source**: If the PDF was generated by another tool, re-export it without compression or incremental saves 3. **Use `editDocument` for minor fixes**: If parsing succeeds, use `editDocument` to produce a cleaned output: `editDocument(bytes).toUint8Array()` 4. **Check for PDF 2.0**: PDF 2.0 uses a different xref format. Use `parseDocument` with the version check: ```ts const parsed = parseDocument(bytes); if (parsed.version?.startsWith("2.")) { // PDF 2.0 — ensure the library version supports it } ``` ## Missing or blank text (font issues) ### Symptoms * Text renders as empty spaces, boxes (□), or `.notdef` glyphs * `UNSUPPORTED_CHARACTER` errors during serialization * CJK or special characters appear as blank space ### Causes 1. **Standard 14 font coverage**: The standard 14 fonts only cover Latin-1 (ISO 8859-1). Any character outside that range (CJK, Arabic, Greek, emoji) produces `.notdef` 2. **Embedded font doesn't cover the character**: The TrueType font has the character, but not in the subset produced 3. **Font family name mismatch**: The font was embedded with a different family name than what's requested in `text()` calls 4. **CJK-specific**: CJK TrueType fonts are large (5–20 MB); subsetting may inadvertently exclude needed glyphs if glyph IDs are not correctly tracked 5. **Fallback not configured**: A fallback font covers the character, but `fallbackFonts` was not passed to `text()` ### Fixes **For standard 14 fonts — switch to an embedded font with Unicode coverage:** ```ts const font = doc.embedTrueTypeFont(fontBytes, { family: "UnicodeSans" }); page.text("Hello 漢字", { font, fontSize: 14 }); ``` **For mixed-script text — use fallback fonts:** ```ts const latin = doc.embedTrueTypeFont(latinBytes, { family: "Latin" }); const cjk = doc.embedTrueTypeFont(cjkBytes, { family: "CJK" }); const arabic = doc.embedTrueTypeFont(arabicBytes, { family: "Arabic" }); page.text("Hello 世界 مرحبا", { font: latin, fallbackFonts: [cjk, arabic], fontSize: 14 }); ``` **For CJK specifically:** 1. Use a CJK-capable TrueType font (Noto Sans CJK, Source Han Sans, etc.) 2. Be aware that subsetting preserves glyph IDs 1:1 — the PDF content references the original glyph index, so there's no remapping risk 3. CJK subsetting can take 20–50ms for fonts with thousands of used glyphs; this is expected 4. If CJK text is still blank, verify the font `.ttf` file is valid TrueType (not OpenType CFF/PostScript outlines): ```ts // Quick check: TrueType fonts start with 0x00010000 or 'true' tag const isTrueType = (bytes: Uint8Array): boolean => { const sfVersion = (bytes[0]! << 24) | (bytes[1]! << 16) | (bytes[2]! << 8) | bytes[3]!; return sfVersion === 0x00010000 || sfVersion === 0x74727565; // 0x74727565 = 'true' }; ``` ## CJK not rendering ### Common causes specific to CJK 1. **Font format**: OpenType fonts with CFF outlines (`.otf` extension, but sometimes named `.ttf`) are not supported by the TrueType embedder. Use a TrueType outline font for CJK text 2. **Writing mode mismatch**: Horizontal text is the default. For CJK vertical layout, pass `writingMode: "vertical"` to text, text block, flow, or template options 3. **Subset size**: If only a few CJK characters appear blank, verify they exist in the font at the expected glyph index. Use `python3 -c "from fontTools.ttLib import TTFont; f = TTFont('your-font.ttf'); print(f.getBestCmap())"` to check 4. **Encoding mismatch**: The library uses glyph IDs directly; there is no CMap/encoding translation at the embedder level. Ensure your text characters map to valid glyph IDs in the font ### Debugging CJK font subsetting ```ts const font = doc.embedTrueTypeFont(cjkFontBytes, { family: "NotoSansCJK" }); // Test a single CJK character page.text("漢", { font, fontSize: 14 }); const bytes = doc.toUint8Array(); // Inspect: the embedded font stream should contain glyphs for just 漢 and .notdef // plus any composite glyph dependencies ``` ### When CJK still doesn't render * Try a different CJK font file * Convert OTF (CFF) to TTF using `fonttools`: `python3 -m fontTools.ttx your-font.otf` and inspect * Use a known-working font: Noto Sans CJK SC (简体), Noto Sans CJK JP (日本語), or Source Han Sans ## Compliance validation failures ### PDF/UA-1 checklist If `validateCompliance()` reports errors for `pdfua-1` conformance: | Error | Fix | |-------|-----| | Missing document language | Set `language: "en-US"` (or appropriate BCP 47 tag) in `createDocument()` | | No structure root | Set `structureRoot: "Document"` in `createDocument()` | | Text without embedded font | Use `embedTrueTypeFont()` for all visible text (standard 14 fonts are not allowed in PDF/UA-1) | | Missing alt text on images | Pass `altText` in image options: `page.png(data, { altText: "Description" })` | | Title fails in Adobe checker | Set top-level `title`; it emits `/Title`, XMP title metadata, and `/ViewerPreferences /DisplayDocTitle true` | | Missing XMP metadata | Provide top-level `title` plus `xmpMetadata` in `createDocument()` or `renderTemplate()` with `creator`, `createDate`, `modifyDate`, and `metadataDate` | | Uncategorized content | Use `flow()` or `renderTemplate()` — raw `text()` without a tag may produce content outside the structure tree | ```ts const doc = createDocument({ title: "Report", conformance: "pdfua-1", tagged: true, language: "en-US", structureRoot: "Document", xmpMetadata: { creator: "zeropdf", createDate: "2026-05-08T00:00:00Z", modifyDate: "2026-05-08T00:00:00Z", metadataDate: "2026-05-08T00:00:00Z" } }); const font = doc.embedTrueTypeFont(fontData, { family: "AccessibleSans" }); const page = doc.addPage(); page.flow({ font }) .heading("Report") .paragraph("Content.") .png(logoData, { altText: "Company logo" }); const issues = doc.validateCompliance(); for (const issue of issues) { console.log(`[${issue.severity}] ${issue.message}`); } ``` ## Encryption problems ### "Wrong password" on a document you created 1. Verify the password was not truncated or modified between creation and parsing 2. Check that the same `algorithm` and `revision` are used (the parser auto-detects these from the encryption dictionary) 3. If you changed the password in an editor, re-create the document — editing with `editDocument` preserves the original encryption parameters ### Cannot encrypt with object streams Object stream mode (`objectStreams: true`) is incompatible with: * `rc4-40` encryption — use at least `rc4-128` * `linearized: true` output — these are mutually exclusive ```ts // ✅ Works createDocument({ objectStreams: true, encryption: { algorithm: "aes-256", userPassword: "key" } }); // ❌ Fails with INVALID_ENCRYPTION createDocument({ objectStreams: true, encryption: { algorithm: "rc4-40", userPassword: "key" } }); ``` ## Large PDFs causing memory issues ### Symptoms * Node.js process crashes with "JavaScript heap out of memory" * Browser tab freezes during `toUint8Array()` or `doc.writeTo()` ### Fixes 1. **Use streaming output**: Replace `toUint8Array()` with `NodeStreamSink` or `WebStreamSink` 2. **Run Node.js with more heap**: `node --max-old-space-size=4096 script.js` 3. **Use a worker thread**: Offload generation to a worker to avoid blocking the main thread 4. **Batch large jobs**: Generate pages in batches of 1000, merge with `mergeDocuments()` ## See also * [Performance Guide](./performance) — streaming, object streams, and memory profiles * [Encryption and Signatures](./encryption-and-signatures) — password protection API * [Accessibility and Compliance](./accessibility-and-compliance) — PDF/UA-1 and tagged PDFs * [Text and Fonts](./text-and-fonts) — font embedding and fallback ## Stream Length Mismatch Warnings When a stream's declared `/Length` does not match the actual byte count of its content, the parser emits a debug-level warning and proceeds using the actual stream boundaries. This is common with PDFs produced by non-standard generators. The warning is informational and does not block parsing; use `getRepairWarnings()` in edit mode to see which streams were affected. ## Damaged Xref Auto-Recovery If the cross-reference table is missing or corrupt, `parseDocument()` scans the raw file for `obj` / `endobj` markers to rebuild object locations. The recovery heuristics handle: * Missing or zeroed `startxref` pointers * Xref entries pointing to wrong offsets * Truncated xref sections in incremental updates Recovered objects are available through the normal `parseDocument()` API. No special flags are needed. ## Deep Page Tree Limits Page trees nested deeper than 50 levels are rejected with `UNSUPPORTED_PAGE_TREE`. Most validators also enforce this limit. If you encounter this, re-export the PDF from the source application with a flattened page tree structure. --- --- url: 'https://zeropdf.criston.dev/changelog.md' --- # Changelog All notable changes to `@criston/zeropdf` are documented here. This project follows [Semantic Versioning](https://semver.org/). ## \[1.3.0] - 2026-06-02 ### Added * Shape helpers on `PdfPage`: `rect()`, `line()`, `circle()`, `ellipse()` with a simplified `ShapeStyle` (inferred fill/stroke paint mode). * Text measurement: `PdfDocument.measureText()`, `measureTextBlock()`, and `measureRichText()` return width/height/line-count without drawing. * `PdfPage.image()` auto-detects the raster format (PNG, JPEG, GIF, BMP, TIFF, WebP, JPEG 2000) from the data. * `addPage({ origin: "top-left" })` flips the y-axis so coordinates grow downward from the top edge — applied across the page drawing, annotation, and form-field methods. * `underline` and `strike` options on text and inline runs, drawn as decorative lines. * Named colors: text/shape `color` options accept names like `"red"`, plus a `color()` helper that resolves named and `#hex` colors. * Shape and image helpers on `PdfStructureContainer` (`rect`, `line`, `circle`, `ellipse`, `image`, `path`) and `ellipse`/`line` on `PdfFlow`. * `registerFontFamily()` accepts raw font bytes per face (embedded automatically) in addition to handles and built-in names (`FontFamilyInput`). * Document-wide shape defaults via `createDocument({ shapeDefaults })`, merged beneath per-call styles by the page shape helpers. * Layout-feedback methods `PdfPage.placeText()` and `placeTextBlock()` that draw and return `{ width, height, (lineCount,) endY }` for manual stacking. * "Choosing an API" guide page mapping common goals to the right API. ### Changed * The `font` option now reports a clear "did you mean" error (`INVALID_FONT`) for an unknown string font instead of silently falling back, suggesting the closest standard-14 name. Unknown page-size names throw `INVALID_PAGE_SIZE` with the same suggestion treatment. * `PdfStructureContainer` builder methods (`text`, `textBlock`, `list`, `table`, image, `link`) now return `this` for chaining, consistent with `PdfPage` and `PdfFlow`. ## \[1.2.1] - 2026-06-02 ### Fixed * The `font` text option now accepts a font-family name registered with `registerFontFamily()` (and any `string`-typed value), instead of rejecting it at compile time. `PdfFont` widened to `FontName | PdfEmbeddedFont | (string & {})`, preserving built-in name autocomplete. ## \[1.2.0] - 2026-06-02 ### Added * Inline rich text: `PdfPage.richText()` and `PdfFlow.richParagraph()` lay out an array of `InlineTextRun` segments that flow on the same line and wrap together, each with its own font, weight, size, color, and optional `link`. * `richParagraph` template block (`TemplateRichParagraphBlock`) for inline rich text in `renderTemplate()`. * Inline rich text supports `align: "justify"`, line-level `direction` (`"ltr" | "rtl" | "auto"`), and `writingMode: "vertical"` (single-column stacking); flow and template rich paragraphs wrap and split across columns and pages. * Vertical alignment: `verticalAlign` (`"top" | "middle" | "bottom"`) on table cells (`TableOptions` default and per-`TableCellDefinition`). * Vertical alignment within a fixed-height box via `height` + `verticalAlign` on `TextBlockOptions` and `RichTextOptions`. * New exported types: `InlineTextRun`, `RichTextOptions`, `FlowRichTextOptions`, `TemplateRichParagraphBlock`, `VerticalAlign`. ## \[1.1.0] - 2026-06-02 ### Added * `bold` and `italic` text options that resolve to the matching font face for the standard-14 base families (Helvetica, Times, Courier). * `PdfDocument.registerFontFamily()` to group font faces (built-in or embedded) under a name, selectable with the `bold`/`italic` flags. * Document-wide text defaults via `createDocument({ defaults })` (`font`, `bold`, `italic`, `fontSize`, `color`, `kerning`, `direction`). * Unit helpers `mm()`, `cm()`, `inch()`, and `pt()` for authoring layouts in physical units. * `PdfDocument.save(path)` convenience alias for `writeToFile()`. ### Changed * `PdfPage` builder methods (text, images, annotations, form fields, graphics state, transforms) now return `this` for fluent chaining. * `bold`/`italic`, registered font families, and document defaults resolve uniformly across `page.text()`/`textBlock()`, the `PdfFlow` cursor API, `renderTemplate()` blocks, and structure containers. ## \[1.0.0] - 2026-05-11 ### Added * Zero-dependency PDF 1.4+ generation engine in TypeScript. * PDF 1.5 object streams and 2.0 encryption support. * Text rendering with 14 standard fonts plus embedded TrueType (Unicode, kerning, ligatures, RTL/Arabic). * Image support: JPEG, PNG (transparency/alpha). * Tagged PDF for accessibility: PDF/UA-1, structure trees, MCID-based marked content. * Flow-based coordinate-free layout engine. * Template-based report/document rendering with headers, footers, page numbers, and auto-outline. * Forms (AcroForm): text, checkbox, radio, choice, push button, signature. * Annotations: URI links, highlights, notes, free-text. * Encryption: rc4-40, rc4-128, AES-128, AES-256. * PDF parsing and incremental editing: metadata, pages, forms, overlays. * Page transfer utilities: extract, split, merge, append. * Streaming output via ByteSink abstraction. * XMP metadata support. * Linearized (Fast Web View) output for single-page documents. * PDF version auto-detection and conformance validation. --- --- url: 'https://zeropdf.criston.dev/api.md' --- **zeropdf v1.3.0** *** # zeropdf v1.3.0 ## Enumerations | Enumeration | Description | | ------ | ------ | | [PdfErrorCode](enumerations/PdfErrorCode.md) | Stable error-code enum used by PdfEngineError to classify failures. | ## Classes | Class | Description | | ------ | ------ | | [BufferSink](classes/BufferSink.md) | Streaming output contract implemented by sinks that receive generated PDF byte chunks. | | [NodeStreamSink](classes/NodeStreamSink.md) | A byte sink adapter for writing generated PDF output to a Node.js writable stream while respecting backpressure and stream errors. | | [ParsedPdfDocument](classes/ParsedPdfDocument.md) | A read-only parsed representation of a PDF document. It provides helpers for inspecting document-level metadata, object references, pages, forms, outlines, structure trees, and source bytes. | | [PdfDocument](classes/PdfDocument.md) | A mutable builder for creating new PDF documents from scratch. It manages pages, fonts, metadata, outlines, attachments, accessibility data, encryption, and serialization. | | [PdfEditableDocument](classes/PdfEditableDocument.md) | A mutable editor for applying incremental updates to an existing PDF document. It supports page edits, appended pages, form updates, structure changes, embedded resources, and incremental serialization. | | [PdfEngineError](classes/PdfEngineError.md) | A structured error type thrown when PDF generation, parsing, validation, or editing fails. It carries a stable error code and optional diagnostic details. | | [PdfFlow](classes/PdfFlow.md) | A cursor-based layout helper for writing report-style content. It manages vertical flow, spacing, page breaks, headings, paragraphs, links, images, and tables. | | [PdfOutlineItem](classes/PdfOutlineItem.md) | A handle for an outline entry in a PDF document. It can receive nested child outline items that point to pages or named destinations. | | [PdfPage](classes/PdfPage.md) | A mutable page builder for placing text, graphics, images, links, annotations, form fields, and structured content on a PDF page. | | [PdfSoftMaskBuilder](classes/PdfSoftMaskBuilder.md) | Sub-builder for the contents of a luminosity soft-mask Form XObject. Supports path operations only. | | [PdfStructureContainer](classes/PdfStructureContainer.md) | A builder for grouping tagged PDF content under a shared structure element. It can add text, blocks, lists, tables, images, and nested sections to the same semantic container. | | [TempFileSink](classes/TempFileSink.md) | A byte sink that writes data to a temporary file, reducing memory pressure for very large documents. The temp file is automatically deleted on [close](classes/TempFileSink.md#close) (or [dispose](classes/TempFileSink.md#dispose)). | | [WebStreamSink](classes/WebStreamSink.md) | A byte sink adapter for writing generated PDF output to a Web WritableStream through its default writer. | ## Interfaces | Interface | Description | | ------ | ------ | | [AttachmentOptions](interfaces/AttachmentOptions.md) | Options that describe an embedded file attachment. | | [BlockTextMetrics](interfaces/BlockTextMetrics.md) | Measured size of a wrapped block of text. | | [BmpImageOptions](interfaces/BmpImageOptions.md) | Options for placing BMP images on a page. | | [BufferSinkOptions](interfaces/BufferSinkOptions.md) | An in-memory byte sink that collects streamed PDF output chunks and exposes them as a single Uint8Array when needed. | | [ByteSink](interfaces/ByteSink.md) | Streaming output contract implemented by sinks that receive generated PDF byte chunks. | | [CheckBoxOptions](interfaces/CheckBoxOptions.md) | Options for creating a checkbox form field widget. | | [ChoiceFieldOptions](interfaces/ChoiceFieldOptions.md) | Options for creating a list box or combo box form field. | | [ClosePathCommand](interfaces/ClosePathCommand.md) | Vector path command that closes the current subpath. | | [CmykColor](interfaces/CmykColor.md) | CMYK color representation used by drawing and text APIs. | | [CurveToCommand](interfaces/CurveToCommand.md) | Vector path command for drawing a cubic Bezier curve. | | [CustomPageSize](interfaces/CustomPageSize.md) | Explicit PDF page dimensions in points. | | [DeviceNColor](interfaces/DeviceNColor.md) | DeviceN (multi-ink spot color) color representation. Emitted as a DeviceN color space; each tint maps through a Type-2 exponential into the alternate process color at full mix. | | [DocumentEncryptionOptions](interfaces/DocumentEncryptionOptions.md) | Password and permission options for encrypting a generated document. | | [DocumentInfo](interfaces/DocumentInfo.md) | Document information dictionary metadata such as title, author, subject, and dates. | | [DocumentOptions](interfaces/DocumentOptions.md) | - | | [DocumentOutputIntentOptions](interfaces/DocumentOutputIntentOptions.md) | ICC output profile options for generated documents. | | [DocumentPermissions](interfaces/DocumentPermissions.md) | Permission flags used when creating an encrypted PDF. | | [DocumentSignatureOptions](interfaces/DocumentSignatureOptions.md) | Detached digital-signature options for generated documents. | | [EmbedTrueTypeFontOptions](interfaces/EmbedTrueTypeFontOptions.md) | Options used when registering a TrueType font with a document. | | [ExtGStateOptions](interfaces/ExtGStateOptions.md) | Graphics-state parameters for fill/stroke alpha and blend mode. Emitted as an inline ExtGState entry referenced by the `gs` operator. | | [ExtractTextOptions](interfaces/ExtractTextOptions.md) | Options for [ParsedPdfDocument.extractText](classes/ParsedPdfDocument.md#extracttext). | | [FieldActions](interfaces/FieldActions.md) | JavaScript actions attached to a form field. | | [FillStyle](interfaces/FillStyle.md) | Fill styling for vector paths. | | [FlowBlockSpacingOptions](interfaces/FlowBlockSpacingOptions.md) | Per-block margin options for flow-authored content. | | [FlowCheckBoxOptions](interfaces/FlowCheckBoxOptions.md) | Options for placing a checkbox form field through the flow layout API. | | [FlowChoiceFieldOptions](interfaces/FlowChoiceFieldOptions.md) | Options for placing a choice form field through the flow layout API. | | [FlowColumnsOptions](interfaces/FlowColumnsOptions.md) | Newspaper-style column layout options for flow and template pages. | | [FlowFreeTextOptions](interfaces/FlowFreeTextOptions.md) | Options for placing a free-text annotation through the flow layout API. | | [FlowHeadingOptions](interfaces/FlowHeadingOptions.md) | Flow text options plus heading-level configuration. | | [FlowHighlightOptions](interfaces/FlowHighlightOptions.md) | Options for placing a highlight annotation through the flow layout API. | | [FlowImageOptions](interfaces/FlowImageOptions.md) | Options for placing images through the flow layout API. | | [FlowLinkOptions](interfaces/FlowLinkOptions.md) | Options for placing URI links through the flow layout API. | | [FlowListOptions](interfaces/FlowListOptions.md) | Options for placing a tagged list through the flow layout API. | | [FlowNoteOptions](interfaces/FlowNoteOptions.md) | Options for placing a text note annotation through the flow layout API. | | [FlowOptions](interfaces/FlowOptions.md) | Initial layout, typography, and spacing options for a PdfFlow cursor. | | [FlowPushButtonOptions](interfaces/FlowPushButtonOptions.md) | Options for placing a push-button form field through the flow layout API. | | [FlowRadioGroupOptions](interfaces/FlowRadioGroupOptions.md) | Options for placing a radio-button group through the flow layout API. | | [FlowRichTextOptions](interfaces/FlowRichTextOptions.md) | Options for placing a paragraph of inline rich-text runs through the flow layout API. Position and width are supplied by the flow cursor; the remaining fields mirror [RichTextOptions](interfaces/RichTextOptions.md). | | [FlowSignatureFieldOptions](interfaces/FlowSignatureFieldOptions.md) | Options for placing a signature form field through the flow layout API. | | [FlowSpacingScale](interfaces/FlowSpacingScale.md) | Semantic spacing scale used by flow layout for paragraphs, headings, tables, images, and links. | | [FlowTableOptions](interfaces/FlowTableOptions.md) | Options for placing tables through the flow layout API. | | [FlowTextFieldOptions](interfaces/FlowTextFieldOptions.md) | Options for placing a text form field through the flow layout API. | | [FlowTextOptions](interfaces/FlowTextOptions.md) | Options for placing paragraphs or text blocks through the flow layout API. | | [FontFamilyFaces](interfaces/FontFamilyFaces.md) | The set of faces that make up a font family registered with [PdfDocument.registerFontFamily](classes/PdfDocument.md#registerfontfamily). Once registered, text APIs can select a face by passing the family name as `font` together with the `bold` and `italic` flags, instead of juggling individual font handles. | | [FontFamilyInput](interfaces/FontFamilyInput.md) | Input accepted by [PdfDocument.registerFontFamily](classes/PdfDocument.md#registerfontfamily). Each face may be a built-in [FontName](type-aliases/FontName.md), an already-embedded font handle, or **raw font bytes** — bytes are embedded automatically under the family name, so you can register a family in one call without embedding each weight first. | | [FreeTextAnnotationOptions](interfaces/FreeTextAnnotationOptions.md) | Options for creating a free-text annotation. | | [GifImageOptions](interfaces/GifImageOptions.md) | Options for placing GIF images on a page. | | [GrayColor](interfaces/GrayColor.md) | Grayscale color representation used by drawing and text APIs. | | [HighlightAnnotationOptions](interfaces/HighlightAnnotationOptions.md) | Options for creating a URI link annotation. | | [InlineTextRun](interfaces/InlineTextRun.md) | A single styled segment of inline rich text. Runs passed together to [PdfPage.richText](classes/PdfPage.md#richtext) or [PdfFlow.richParagraph](classes/PdfFlow.md#richparagraph) flow on the same line and wrap together as one paragraph; each run carries its own style. | | [Jbig2ImageOptions](interfaces/Jbig2ImageOptions.md) | Options for placing JBIG2 images on a page. | | [Jp2ImageOptions](interfaces/Jp2ImageOptions.md) | Options for placing JPEG 2000 (JP2) images on a page. PDF spec supports JPXDecode filter for JPEG 2000 image data. | | [JpegImageOptions](interfaces/JpegImageOptions.md) | Options for placing JPEG images on a page. | | [LineToCommand](interfaces/LineToCommand.md) | Vector path command for drawing a straight line. | | [ListItemDefinition](interfaces/ListItemDefinition.md) | Detailed list item object with optional nested children. | | [ListOptions](interfaces/ListOptions.md) | Options for rendering tagged ordered or unordered lists. | | [MoveToCommand](interfaces/MoveToCommand.md) | Vector path command for moving the current point without drawing. | | [NodeWritableLike](interfaces/NodeWritableLike.md) | Minimal writable-stream shape accepted by NodeStreamSink. | | [NoteAnnotationOptions](interfaces/NoteAnnotationOptions.md) | Options for creating a text note annotation. | | [OutlineOptions](interfaces/OutlineOptions.md) | Options that control outline item state, such as expansion. | | [PageLabelOptions](interfaces/PageLabelOptions.md) | Options for assigning logical page labels and numbering styles. | | [PageLinkOptions](interfaces/PageLinkOptions.md) | Options for creating an internal link annotation to another page. | | [PageOptions](interfaces/PageOptions.md) | Options for creating or inserting a page. | | [PageTextExtraction](interfaces/PageTextExtraction.md) | Per-page extraction result. | | [PageTransparencyGroupOptions](interfaces/PageTransparencyGroupOptions.md) | Page-level transparency group options. | | [ParagraphHighlightAnnotation](interfaces/ParagraphHighlightAnnotation.md) | Highlight a substring of a paragraph. | | [ParagraphLinkAnnotation](interfaces/ParagraphLinkAnnotation.md) | Wrap a substring in a clickable URI link. | | [ParagraphNoteAnnotation](interfaces/ParagraphNoteAnnotation.md) | Attach a sticky-note annotation anchored to a substring. | | [ParagraphSquigglyAnnotation](interfaces/ParagraphSquigglyAnnotation.md) | Draw a squiggly underline beneath a substring (text-markup `/Squiggly`). | | [ParagraphStrikeOutAnnotation](interfaces/ParagraphStrikeOutAnnotation.md) | Strike out a substring of a paragraph (text-markup `/StrikeOut`). | | [ParagraphUnderlineAnnotation](interfaces/ParagraphUnderlineAnnotation.md) | Underline a substring of a paragraph (text-markup `/Underline`). | | [ParseDocumentOptions](interfaces/ParseDocumentOptions.md) | Options that control parsing behavior for existing PDFs. | | [ParsedPdfAttachment](interfaces/ParsedPdfAttachment.md) | Attachment metadata discovered while parsing an existing PDF. | | [ParsedPdfEditableStructureElement](interfaces/ParsedPdfEditableStructureElement.md) | Editable structure element handle returned by editable-document queries. | | [ParsedPdfFormField](interfaces/ParsedPdfFormField.md) | Form field metadata discovered while parsing an existing PDF. | | [ParsedPdfIndirectObject](interfaces/ParsedPdfIndirectObject.md) | Low-level parsed indirect object record. | | [ParsedPdfMetadata](interfaces/ParsedPdfMetadata.md) | Document metadata discovered while parsing an existing PDF. | | [ParsedPdfNamedDestination](interfaces/ParsedPdfNamedDestination.md) | Named destination discovered while parsing an existing PDF. | | [ParsedPdfOutlineItem](interfaces/ParsedPdfOutlineItem.md) | Outline item discovered while parsing an existing PDF. | | [ParsedPdfPage](interfaces/ParsedPdfPage.md) | - | | [ParsedPdfPageLabelRange](interfaces/ParsedPdfPageLabelRange.md) | Page-label range discovered while parsing an existing PDF. | | [ParsedPdfStructureElement](interfaces/ParsedPdfStructureElement.md) | Tagged structure element discovered while parsing an existing PDF. | | [PathStyle](interfaces/PathStyle.md) | Painting, stroke, fill, transform, and tagging options for vector paths. | | [Pdf2ComplianceIssue](interfaces/Pdf2ComplianceIssue.md) | PDF 2.0 conformance issue found while inspecting an existing document. | | [PdfComplianceIssue](interfaces/PdfComplianceIssue.md) | Compliance validation issue returned by document validation. | | [PdfEditableStructureQuery](interfaces/PdfEditableStructureQuery.md) | Query criteria for finding editable structure elements. | | [PdfEditableStructureSimilarityOptions](interfaces/PdfEditableStructureSimilarityOptions.md) | Options for finding structurally similar tagged elements. | | [PdfEmbeddedFont](interfaces/PdfEmbeddedFont.md) | Font handle returned after embedding a TrueType font in a document. | | [PdfStructureOptions](interfaces/PdfStructureOptions.md) | Accessibility metadata and attributes for tagged PDF structure elements. | | [PlacedTextBlockResult](interfaces/PlacedTextBlockResult.md) | Result of [PdfPage.placeTextBlock](classes/PdfPage.md#placetextblock): the drawn block metrics plus the next y to continue at. | | [PlacedTextResult](interfaces/PlacedTextResult.md) | Result of [PdfPage.placeText](classes/PdfPage.md#placetext): the drawn size plus the next y to continue at. | | [PngImageOptions](interfaces/PngImageOptions.md) | Options for placing PNG images on a page. | | [PositionedTextRun](interfaces/PositionedTextRun.md) | A single positioned text run produced by extraction. | | [PushButtonOptions](interfaces/PushButtonOptions.md) | Options for creating a push-button form field. | | [RadioGroupItemOptions](interfaces/RadioGroupItemOptions.md) | Options for a single radio button in a radio group. | | [RadioGroupOptions](interfaces/RadioGroupOptions.md) | Options for creating a radio-button group form field. | | [RectCommand](interfaces/RectCommand.md) | Vector path command for adding a rectangle. | | [RgbColor](interfaces/RgbColor.md) | RGB color representation used by drawing and text APIs. | | [RichTextOptions](interfaces/RichTextOptions.md) | Options for laying out a paragraph of inline rich-text runs. Coordinates and width behave like [TextBlockOptions](interfaces/TextBlockOptions.md); the style fields supply defaults inherited by any [InlineTextRun](interfaces/InlineTextRun.md) that omits them. | | [SeparationColor](interfaces/SeparationColor.md) | Separation (single-ink spot color) color representation. Emitted as a Separation color space with a Type-2 exponential tint transform mapping the tint scalar to the alternate process color. | | [ShapedGlyph](interfaces/ShapedGlyph.md) | A single shaped glyph produced by a [TextShaper](interfaces/TextShaper.md). | | [ShapeStyle](interfaces/ShapeStyle.md) | Simplified styling for the [PdfPage](classes/PdfPage.md) shape helpers (`rect`, `line`, `circle`, `ellipse`). The paint mode is inferred: a `fill` and `stroke` together paint both; `fill` alone fills; otherwise the shape is stroked. | | [SignatureFieldOptions](interfaces/SignatureFieldOptions.md) | Options for creating a signature form field. | | [SoftMaskHandle](interfaces/SoftMaskHandle.md) | Opaque handle returned by [PdfDocument.createLuminositySoftMask](classes/PdfDocument.md#createluminositysoftmask). Pass to [ExtGStateOptions.softMask](interfaces/ExtGStateOptions.md#property-softmask) to apply the mask. | | [SoftMaskOptions](interfaces/SoftMaskOptions.md) | Options for creating a luminosity-based soft mask Form XObject. | | [SquigglyAnnotationOptions](interfaces/SquigglyAnnotationOptions.md) | Options for creating a squiggly text-markup annotation. Draws a wavy underline beneath the rectangle (commonly used to flag spelling or grammar concerns). | | [StrikeOutAnnotationOptions](interfaces/StrikeOutAnnotationOptions.md) | Options for creating a strike-out text-markup annotation. Draws a horizontal line through the vertical middle of the rectangle. | | [StrokeStyle](interfaces/StrokeStyle.md) | Stroke styling for vector paths. | | [SvgImageOptions](interfaces/SvgImageOptions.md) | Options for rendering SVG vector graphics on a page. | | [TableCellDefinition](interfaces/TableCellDefinition.md) | Detailed table cell object with span, header, scope, and structure options. | | [TableOptions](interfaces/TableOptions.md) | Options for rendering tagged tables. | | [TemplateAutoOutlineOptions](interfaces/TemplateAutoOutlineOptions.md) | Top-level options for rendering a reusable document template. | | [TemplateCheckBoxBlock](interfaces/TemplateCheckBoxBlock.md) | Template block for rendering a checkbox form field. | | [TemplateChoiceFieldBlock](interfaces/TemplateChoiceFieldBlock.md) | Template block for rendering a choice form field. | | [TemplateCustomBlock](interfaces/TemplateCustomBlock.md) | Template block for user-defined rendering and estimation logic. | | [TemplateDocumentOptions](interfaces/TemplateDocumentOptions.md) | Top-level options for rendering template blocks into a complete document. | | [TemplateFreeTextBlock](interfaces/TemplateFreeTextBlock.md) | Template block for rendering a free-text annotation. | | [TemplateHeadingBlock](interfaces/TemplateHeadingBlock.md) | Template block for rendering a heading. | | [TemplateHighlightBlock](interfaces/TemplateHighlightBlock.md) | Template block for rendering a highlight annotation. | | [TemplateImageBlock](interfaces/TemplateImageBlock.md) | Template block for rendering a PNG, JPEG, BMP, JBIG2, TIFF, or JPEG2000 image. | | [TemplateLinkBlock](interfaces/TemplateLinkBlock.md) | Template block for rendering a URI link. | | [TemplateListBlock](interfaces/TemplateListBlock.md) | Template block for rendering a tagged list. | | [TemplateNoteBlock](interfaces/TemplateNoteBlock.md) | Template block for rendering a text note annotation. | | [TemplatePageBreakBlock](interfaces/TemplatePageBreakBlock.md) | Template block that forces a new page. | | [TemplatePageLinkBlock](interfaces/TemplatePageLinkBlock.md) | Template block for rendering a page-to-page link annotation. | | [TemplatePageNumberOptions](interfaces/TemplatePageNumberOptions.md) | Options for automatic page-number rendering in templates. | | [TemplatePageOptions](interfaces/TemplatePageOptions.md) | Page layout options used by template rendering. | | [TemplateParagraphBlock](interfaces/TemplateParagraphBlock.md) | Template block for rendering a paragraph. | | [TemplatePathBlock](interfaces/TemplatePathBlock.md) | Template block for rendering vector path commands. | | [TemplatePushButtonBlock](interfaces/TemplatePushButtonBlock.md) | Template block for rendering a push-button form field. | | [TemplateRadioGroupBlock](interfaces/TemplateRadioGroupBlock.md) | Template block for rendering a radio-button group form field. | | [TemplateRectBlock](interfaces/TemplateRectBlock.md) | Template block for rendering a rectangle. | | [TemplateRenderContext](interfaces/TemplateRenderContext.md) | Context passed to template header, footer, and page-number callbacks. | | [TemplateRichParagraphBlock](interfaces/TemplateRichParagraphBlock.md) | Template block for rendering a paragraph of inline rich-text runs, mixing fonts, weights, sizes, colors, and links on the same wrapping lines. | | [TemplateSectionBlock](interfaces/TemplateSectionBlock.md) | Template block that groups child blocks under a structure container. | | [TemplateSignatureFieldBlock](interfaces/TemplateSignatureFieldBlock.md) | Template block for rendering a signature form field. | | [TemplateStrictLayoutOptions](interfaces/TemplateStrictLayoutOptions.md) | Strict layout options for templates that must fail instead of overflowing. | | [TemplateStyle](interfaces/TemplateStyle.md) | A reusable set of typographic and spacing properties applied to template blocks through a [TemplateStylesheet](interfaces/TemplateStylesheet.md). Stylesheet values are merged beneath each block's inline `options`, so inline options always win. | | [TemplateStylesheet](interfaces/TemplateStylesheet.md) | Named styles applied to template blocks. Keys are either *type selectors* matching a block's `type` (`"paragraph"`, `"table"`, `"link"`, `"list"`, `"image"`, plus per-format image types like `"png"`, and per-level headings `"heading"`/`"heading1"`..`"heading6"`) or arbitrary *class names* referenced by a block's `class` field. | | [TemplateTableBlock](interfaces/TemplateTableBlock.md) | Template block for rendering a table. | | [TemplateTextFieldBlock](interfaces/TemplateTextFieldBlock.md) | Template block for rendering a text form field. | | [TextBlockOptions](interfaces/TextBlockOptions.md) | Options for laying out wrapped text blocks. | | [TextDefaults](interfaces/TextDefaults.md) | Document-wide text defaults applied to [PdfPage.text](classes/PdfPage.md#text) and [PdfPage.textBlock](classes/PdfPage.md#textblock) when the corresponding option is omitted on the call. Per-call options always take precedence. | | [TextFieldOptions](interfaces/TextFieldOptions.md) | Options for creating a text form field. | | [TextMetrics](interfaces/TextMetrics.md) | Measured size of a single line of text. | | [TextOptions](interfaces/TextOptions.md) | Options for placing a single line of text. | | [TextShaper](interfaces/TextShaper.md) | Interface for pluggable text shaping engines. | | [TiffImageOptions](interfaces/TiffImageOptions.md) | Options for placing TIFF images on a page. | | [Transform](interfaces/Transform.md) | Affine transform tuple used for graphics and text placement. | | [UnderlineAnnotationOptions](interfaces/UnderlineAnnotationOptions.md) | Options for creating an underline text-markup annotation. The annotation draws a solid underline beneath the rectangle defined by x/y/width/height (the quad runs along the bottom edge of the rect). | | [UriLinkOptions](interfaces/UriLinkOptions.md) | Options for creating an external URI link annotation. | | [WebpImageOptions](interfaces/WebpImageOptions.md) | Options for placing WebP images on a page. | | [XmpMetadataOptions](interfaces/XmpMetadataOptions.md) | Structured XMP metadata fields used to build an XMP packet. | ## Type Aliases | Type Alias | Description | | ------ | ------ | | [BinaryData](type-aliases/BinaryData.md) | Binary input accepted by the library. | | [BuiltInPageSize](type-aliases/BuiltInPageSize.md) | Names of page-size presets that can be passed anywhere a PageSize is accepted. | | [ChoiceFieldMode](type-aliases/ChoiceFieldMode.md) | Choice field display mode for list boxes and combo boxes. | | [ColorInput](type-aliases/ColorInput.md) | A color accepted by drawing and text APIs: a structured [PdfColor](type-aliases/PdfColor.md) or a [NamedColor](type-aliases/NamedColor.md) string (resolved to RGB during normalization). | | [DocumentConformanceProfile](type-aliases/DocumentConformanceProfile.md) | Supported document conformance profiles for PDF/A and PDF/UA output. | | [DocumentEncryptionAlgorithm](type-aliases/DocumentEncryptionAlgorithm.md) | Supported password-encryption algorithms for generated PDFs. | | [FlowMarginShorthand](type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand accepted by flow and template APIs. | | [FontName](type-aliases/FontName.md) | - | | [HeadingLevel](type-aliases/HeadingLevel.md) | Heading levels supported by flow-authored tagged content. | | [ImageOptions](type-aliases/ImageOptions.md) | Options for the auto-detecting [PdfPage.image](classes/PdfPage.md#image) method. The raster format (PNG, JPEG, GIF, BMP, TIFF, WebP, JPEG 2000) is sniffed from the data. | | [LineCap](type-aliases/LineCap.md) | Line-cap styles for stroked vector paths. | | [LineJoin](type-aliases/LineJoin.md) | Line-join styles for stroked vector paths. | | [ListItem](type-aliases/ListItem.md) | Input shape for list items accepted by page list rendering. | | [MeasureRichTextOptions](type-aliases/MeasureRichTextOptions.md) | Options for [PdfDocument.measureRichText](classes/PdfDocument.md#measurerichtext) (position-independent). | | [MeasureTextBlockOptions](type-aliases/MeasureTextBlockOptions.md) | Options for [PdfDocument.measureTextBlock](classes/PdfDocument.md#measuretextblock) (position-independent). | | [MeasureTextOptions](type-aliases/MeasureTextOptions.md) | Options for [PdfDocument.measureText](classes/PdfDocument.md#measuretext) (position-independent). | | [NamedColor](type-aliases/NamedColor.md) | Named colors accepted anywhere a [ColorInput](type-aliases/ColorInput.md) is expected. | | [PageLabelStyle](type-aliases/PageLabelStyle.md) | Supported page-label numbering styles. | | [PageSize](type-aliases/PageSize.md) | Either a built-in page-size name or explicit custom page dimensions. | | [ParagraphTextAnnotation](type-aliases/ParagraphTextAnnotation.md) | Inline annotation anchored to a substring of a paragraph's rendered text. | | [PathCommand](type-aliases/PathCommand.md) | Union of vector path commands accepted by page path drawing. | | [PdfBlendMode](type-aliases/PdfBlendMode.md) | PDF blend mode names defined in ISO 32000-2 § 11.3.5. | | [PdfBoundingBox](type-aliases/PdfBoundingBox.md) | Bounding box tuple in PDF coordinates: left, bottom, right, top. | | [PdfColor](type-aliases/PdfColor.md) | - | | [PdfContainerTag](type-aliases/PdfContainerTag.md) | Standard structure tags that can contain other tagged PDF elements. | | [PdfEditableStructureElement](type-aliases/PdfEditableStructureElement.md) | Editable structure element API for changing roles, alt text, language, and order. | | [PdfFigureStructureTag](type-aliases/PdfFigureStructureTag.md) | Standard structure tags for figure-like content. | | [PdfFont](type-aliases/PdfFont.md) | Font value accepted by text APIs: a built-in [FontName](type-aliases/FontName.md), an embedded font handle, or the name of a family registered with [PdfDocument.registerFontFamily](classes/PdfDocument.md#registerfontfamily). | | [PdfRoleMap](type-aliases/PdfRoleMap.md) | Mapping from custom structure roles to standard PDF structure roles. | | [PdfStandardStructureTag](type-aliases/PdfStandardStructureTag.md) | Union of standard PDF structure tags supported by the library. | | [PdfStructureAttributeValue](type-aliases/PdfStructureAttributeValue.md) | Values accepted in tagged PDF structure attribute dictionaries. | | [PdfStructureTag](type-aliases/PdfStructureTag.md) | Any supported standard, custom, or artifact structure tag. | | [PdfTextStructureTag](type-aliases/PdfTextStructureTag.md) | Standard structure tags for text-like tagged PDF content. | | [ProcessColor](type-aliases/ProcessColor.md) | Process color used as the alternate color space for a Separation or DeviceN tint transform. | | [TableCell](type-aliases/TableCell.md) | Input shape accepted for individual table cells. | | [TableHeaderScope](type-aliases/TableHeaderScope.md) | Header scope values for tagged table header cells. | | [TableRow](type-aliases/TableRow.md) | Input shape accepted for table rows. | | [TemplateBlock](type-aliases/TemplateBlock.md) | Union of block types accepted by template rendering. | | [TemplatePageNumberAlign](type-aliases/TemplatePageNumberAlign.md) | Alignment values supported by template page-number output. | | [TemplateRunningRegion](type-aliases/TemplateRunningRegion.md) | Callback type for template headers and footers. | | [TextAlign](type-aliases/TextAlign.md) | Horizontal text alignment values. | | [TextDirection](type-aliases/TextDirection.md) | Text direction options, including automatic RTL detection. | | [VerticalAlign](type-aliases/VerticalAlign.md) | Vertical alignment of content within a box of known height (a table cell or a text block given an explicit `height`). | | [XmpMetadataInput](type-aliases/XmpMetadataInput.md) | XMP metadata input accepted by document metadata APIs. | ## Variables | Variable | Description | | ------ | ------ | | [PAGE\_SIZES](variables/PAGE_SIZES.md) | Built-in page size presets expressed in PDF points, keyed by the supported page-size names. | ## Functions | Function | Description | | ------ | ------ | | [appendPages](functions/appendPages.md) | Appends selected pages from one PDF to the end of another PDF and returns the updated document bytes. | | [cm](functions/cm.md) | Converts centimetres to points (1 cm = 72 / 2.54 pt). | | [cmyk](functions/cmyk.md) | Creates a CMYK color object using normalized channel values from 0 to 1. | | [color](functions/color.md) | Resolves a [NamedColor](type-aliases/NamedColor.md) to an RGB color. Also accepts a `#RGB`/`#RRGGBB` hex string. Throws [PdfErrorCode.INVALID\_COLOR](enumerations/PdfErrorCode.md#enumeration-member-invalid_color) for an unknown name. | | [createDocument](functions/createDocument.md) | Creates a new PDF document builder for generating pages, text, graphics, forms, metadata, tagging, and attachments. | | [deviceN](functions/deviceN.md) | Creates a DeviceN (multi-ink spot) color. | | [editDocument](functions/editDocument.md) | Opens an existing PDF for incremental edits such as appending pages, updating fields, changing structure metadata, and preserving existing bytes when possible. | | [extractPages](functions/extractPages.md) | Creates a new PDF containing only the selected pages from an existing document. | | [gray](functions/gray.md) | Creates a grayscale color object using a normalized value from 0 for black to 1 for white. | | [hex](functions/hex.md) | Creates an RGB color object from a CSS-style #RGB or #RRGGBB hex string. | | [inch](functions/inch.md) | Converts inches to points (1 in = 72 pt). | | [mergeDocuments](functions/mergeDocuments.md) | Combines multiple PDF documents into a single PDF in the order provided. | | [mm](functions/mm.md) | Converts millimetres to points (1 mm = 72 / 25.4 pt). | | [parseDocument](functions/parseDocument.md) | Parses PDF bytes into an inspection object for metadata, pages, forms, outlines, attachments, and structure information. | | [pt](functions/pt.md) | Identity converter for points. Provided for symmetry with [mm](functions/mm.md), [cm](functions/cm.md), and [inch](functions/inch.md) so unit intent stays explicit at call sites. | | [rgb](functions/rgb.md) | Creates an RGB color object using normalized channel values from 0 to 1. | | [separation](functions/separation.md) | Creates a Separation (single-ink spot) color. | | [splitDocument](functions/splitDocument.md) | Splits a PDF into one single-page PDF byte array per source page. | | [validatePdf2Conformance](functions/validatePdf2Conformance.md) | Validates a parsed document for PDF 2.0 features that this library can detect as deprecated or removed. | --- --- url: 'https://zeropdf.criston.dev/api/classes/BufferSink.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / BufferSink # Class: BufferSink Defined in: [src/internal/byte-sink.ts:40](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L40) Streaming output contract implemented by sinks that receive generated PDF byte chunks. ## Implements * [`ByteSink`](../interfaces/ByteSink.md) ## Constructors ### Constructor ```ts new BufferSink(options?): BufferSink; ``` Defined in: [src/internal/byte-sink.ts:57](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L57) Creates a memory-backed byte sink with an optional capacity limit. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`BufferSinkOptions`](../interfaces/BufferSinkOptions.md) | Options that control the sink behavior. | #### Returns `BufferSink` ## Methods ### close() ```ts close(): Promise; ``` Defined in: [src/internal/byte-sink.ts:83](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L83) Marks the sink as closed so no more chunks can be written. #### Returns `Promise`<`void`> #### Implementation of [`ByteSink`](../interfaces/ByteSink.md).[`close`](../interfaces/ByteSink.md#close) *** ### collect() ```ts collect(): Uint8Array; ``` Defined in: [src/internal/byte-sink.ts:92](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L92) Combines all collected chunks into a single Uint8Array. #### Returns `Uint8Array` The collected bytes. *** ### write() ```ts write(chunk): Promise; ``` Defined in: [src/internal/byte-sink.ts:66](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L66) Stores a streamed byte chunk in memory. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `chunk` | `Uint8Array` | The byte chunk to write. | #### Returns `Promise`<`void`> #### Implementation of [`ByteSink`](../interfaces/ByteSink.md).[`write`](../interfaces/ByteSink.md#write) --- --- url: 'https://zeropdf.criston.dev/api/classes/NodeStreamSink.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / NodeStreamSink # Class: NodeStreamSink Defined in: [src/internal/byte-sink.ts:107](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L107) A byte sink adapter for writing generated PDF output to a Node.js writable stream while respecting backpressure and stream errors. ## Implements * [`ByteSink`](../interfaces/ByteSink.md) ## Constructors ### Constructor ```ts new NodeStreamSink(stream): NodeStreamSink; ``` Defined in: [src/internal/byte-sink.ts:113](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L113) Creates a byte sink for a Node.js writable stream. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `stream` | [`NodeWritableLike`](../interfaces/NodeWritableLike.md) | The writable stream that receives byte chunks. | #### Returns `NodeStreamSink` ## Methods ### close() ```ts close(): Promise; ``` Defined in: [src/internal/byte-sink.ts:168](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L168) Ends the Node.js stream. #### Returns `Promise`<`void`> #### Implementation of [`ByteSink`](../interfaces/ByteSink.md).[`close`](../interfaces/ByteSink.md#close) *** ### write() ```ts write(chunk): Promise; ``` Defined in: [src/internal/byte-sink.ts:120](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L120) Writes a byte chunk to the Node.js stream and waits for backpressure when needed. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `chunk` | `Uint8Array` | The byte chunk to write. | #### Returns `Promise`<`void`> #### Implementation of [`ByteSink`](../interfaces/ByteSink.md).[`write`](../interfaces/ByteSink.md#write) --- --- url: 'https://zeropdf.criston.dev/api/classes/ParsedPdfDocument.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParsedPdfDocument # Class: ParsedPdfDocument Defined in: [src/parser.ts:314](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L314) A read-only parsed representation of a PDF document. It provides helpers for inspecting document-level metadata, object references, pages, forms, outlines, structure trees, and source bytes. ## Constructors ### Constructor ```ts new ParsedPdfDocument( version, xrefOffsets, trailer, objects, sourceBytes, startXrefOffset, encryption?, recoveryMode?, repairWarnings?): ParsedPdfDocument; ``` Defined in: [src/parser.ts:328](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L328) Creates a parsed PDF document wrapper around the trailer, cross-reference data, object table, source bytes, and optional encryption context. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `version` | `string` | The parsed PDF header version. | | `xrefOffsets` | `ReadonlyMap`<`number`, `number`> | The parsed cross-reference offsets by object id. | | `trailer` | `PdfDict` | The parsed trailer dictionary. | | `objects` | `ReadonlyMap`<`number`, [`ParsedPdfIndirectObject`](../interfaces/ParsedPdfIndirectObject.md)> | The parsed indirect objects by object id. | | `sourceBytes` | `Uint8Array` | The original source PDF bytes. | | `startXrefOffset` | `number` | The byte offset of the startxref pointer. | | `encryption?` | `ParsedDocumentEncryption` | The optional parsed encryption context. | | `recoveryMode?` | `boolean` | Whether the document was parsed in recovery mode. | | `repairWarnings?` | readonly `string`\[] | Detailed repair warnings collected during recovery parsing. | #### Returns `ParsedPdfDocument` ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `lazyObjects` | `readonly` | `Set`<`number`> | Set of object ids whose stream data has not yet been decoded. | [src/parser.ts:352](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L352) | | `recoveryMode?` | `readonly` | `boolean` | Whether the document was parsed in recovery mode. | [src/parser.ts:336](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L336) | | `repairWarnings?` | `readonly` | readonly `string`\[] | Detailed repair warnings collected during recovery parsing. | [src/parser.ts:337](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L337) | | `startXrefOffset` | `readonly` | `number` | The byte offset of the startxref pointer. | [src/parser.ts:334](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L334) | | `trailer` | `readonly` | `PdfDict` | The parsed trailer dictionary. | [src/parser.ts:331](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L331) | | `version` | `readonly` | `string` | The parsed PDF header version. | [src/parser.ts:329](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L329) | | `xrefOffsets` | `readonly` | `ReadonlyMap`<`number`, `number`> | The parsed cross-reference offsets by object id. | [src/parser.ts:330](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L330) | ## Methods ### extractText() ```ts extractText(options?): readonly PageTextExtraction[]; ``` Defined in: [src/parser.ts:663](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L663) Extracts positioned Unicode text from every page of the document. Best-effort: decodes each font via its /ToUnicode CMap when present and falls back to Latin-1 otherwise. Positions are user-space coordinates (origin lower-left) computed from the active text and graphics matrices. #### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`ExtractTextOptions`](../interfaces/ExtractTextOptions.md) | #### Returns readonly [`PageTextExtraction`](../interfaces/PageTextExtraction.md)\[] Per-page text and positioned runs. *** ### getConformanceProfile() ```ts getConformanceProfile(): | DocumentConformanceProfile | undefined; ``` Defined in: [src/parser.ts:600](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L600) Detects the supported PDF/A or PDF/UA conformance profile from catalog and XMP metadata. #### Returns | [`DocumentConformanceProfile`](../type-aliases/DocumentConformanceProfile.md) | `undefined` The detected supported conformance profile, if any. *** ### getEffectiveVersion() ```ts getEffectiveVersion(): string; ``` Defined in: [src/parser.ts:468](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L468) Returns the effective PDF version, taking into account a Catalog `/Version` override that may raise the version above the file header. #### Returns `string` *** ### getEncryptionContext() ```ts getEncryptionContext(): PdfEncryptionContext | undefined; ``` Defined in: [src/parser.ts:515](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L515) Returns the parsed encryption context when the source PDF is encrypted. #### Returns `PdfEncryptionContext` | `undefined` The encryption context, if present. *** ### getEncryptionObjectId() ```ts getEncryptionObjectId(): number | undefined; ``` Defined in: [src/parser.ts:524](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L524) Returns the Encrypt dictionary object id when one was parsed. #### Returns `number` | `undefined` The encryption dictionary object id, if present. *** ### getInfoObjectId() ```ts getInfoObjectId(): number | undefined; ``` Defined in: [src/parser.ts:443](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L443) Returns the document information dictionary object id when one is present. #### Returns `number` | `undefined` The information dictionary object id, if present. *** ### getLanguage() ```ts getLanguage(): string | undefined; ``` Defined in: [src/parser.ts:574](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L574) Returns the catalog language value when present. #### Returns `string` | `undefined` The document language, if present. *** ### getMaxObjectId() ```ts getMaxObjectId(): number; ``` Defined in: [src/parser.ts:434](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L434) Returns the highest parsed object id, or zero for an empty object table. #### Returns `number` The highest object id. *** ### getMetadata() ```ts getMetadata(): ParsedPdfMetadata; ``` Defined in: [src/parser.ts:533](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L533) Returns document information dictionary metadata. #### Returns [`ParsedPdfMetadata`](../interfaces/ParsedPdfMetadata.md) The parsed document metadata. *** ### getObject() ```ts getObject(id): | ParsedPdfIndirectObject | undefined; ``` Defined in: [src/parser.ts:361](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L361) Returns a parsed indirect object by object id. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `id` | `number` | The object id to look up. | #### Returns | [`ParsedPdfIndirectObject`](../interfaces/ParsedPdfIndirectObject.md) | `undefined` The parsed object, if present. *** ### getObjectIds() ```ts getObjectIds(): readonly number[]; ``` Defined in: [src/parser.ts:425](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L425) Returns all parsed object ids sorted in ascending order. #### Returns readonly `number`\[] The sorted object ids. *** ### getPageCount() ```ts getPageCount(): number; ``` Defined in: [src/parser.ts:636](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L636) Returns the number of pages in the document. #### Returns `number` The page count. *** ### getPagesObjectId() ```ts getPagesObjectId(): number; ``` Defined in: [src/parser.ts:497](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L497) Returns the root Pages tree object id. #### Returns `number` The Pages tree object id. *** ### getRepairWarnings() ```ts getRepairWarnings(): readonly string[]; ``` Defined in: [src/parser.ts:345](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L345) Returns the repair warnings collected during recovery parsing. #### Returns readonly `string`\[] The repair warnings, or an empty array. *** ### getRootObjectId() ```ts getRootObjectId(): number; ``` Defined in: [src/parser.ts:453](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L453) Returns the catalog object id from the trailer root entry. #### Returns `number` The catalog object id. *** ### getSourceBytes() ```ts getSourceBytes(): Uint8Array; ``` Defined in: [src/parser.ts:506](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L506) Returns a defensive copy of the original source bytes. #### Returns `Uint8Array` A copy of the source bytes. *** ### getXmpMetadata() ```ts getXmpMetadata(): string | undefined; ``` Defined in: [src/parser.ts:557](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L557) Returns decoded XMP metadata from the catalog metadata stream when present. #### Returns `string` | `undefined` The decoded XMP metadata, if present. *** ### inspectStructureElements() ```ts inspectStructureElements(): readonly ParsedPdfInspectedStructureElement[]; ``` Defined in: [src/parser.ts:825](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L825) Returns a nested inspection view of tagged structure elements. #### Returns readonly `ParsedPdfInspectedStructureElement`\[] The nested structure inspection records. *** ### isTagged() ```ts isTagged(): boolean; ``` Defined in: [src/parser.ts:583](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L583) Reports whether the document declares tagged PDF structure. #### Returns `boolean` True when the document is tagged. *** ### listAttachments() ```ts listAttachments(): readonly ParsedPdfAttachment[]; ``` Defined in: [src/parser.ts:754](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L754) Returns embedded file attachment metadata. #### Returns readonly [`ParsedPdfAttachment`](../interfaces/ParsedPdfAttachment.md)\[] The attachment metadata records. *** ### listEditableStructureElements() ```ts listEditableStructureElements(): readonly ParsedPdfEditableStructureElement[]; ``` Defined in: [src/parser.ts:848](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L848) Returns editable handles for tagged structure elements. #### Returns readonly [`ParsedPdfEditableStructureElement`](../interfaces/ParsedPdfEditableStructureElement.md)\[] The editable structure element handles. *** ### listFormFields() ```ts listFormFields(): readonly ParsedPdfFormField[]; ``` Defined in: [src/parser.ts:777](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L777) Returns AcroForm field metadata. #### Returns readonly [`ParsedPdfFormField`](../interfaces/ParsedPdfFormField.md)\[] The parsed form fields. *** ### listNamedDestinations() ```ts listNamedDestinations(): readonly ParsedPdfNamedDestination[]; ``` Defined in: [src/parser.ts:683](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L683) Returns named destinations discovered from the document name tree. #### Returns readonly [`ParsedPdfNamedDestination`](../interfaces/ParsedPdfNamedDestination.md)\[] The named destinations. *** ### listOutlines() ```ts listOutlines(): readonly ParsedPdfOutlineItem[]; ``` Defined in: [src/parser.ts:706](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L706) Returns the document outline tree. #### Returns readonly [`ParsedPdfOutlineItem`](../interfaces/ParsedPdfOutlineItem.md)\[] The outline items. *** ### listPageLabels() ```ts listPageLabels(): readonly ParsedPdfPageLabelRange[]; ``` Defined in: [src/parser.ts:733](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L733) Returns page-label ranges discovered from the page labels number tree. #### Returns readonly [`ParsedPdfPageLabelRange`](../interfaces/ParsedPdfPageLabelRange.md)\[] The page-label ranges. *** ### listPages() ```ts listPages(): readonly ParsedPdfPage[]; ``` Defined in: [src/parser.ts:648](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L648) Returns parsed page records discovered from the page tree. #### Returns readonly [`ParsedPdfPage`](../interfaces/ParsedPdfPage.md)\[] The parsed page records. *** ### listStructureElements() ```ts listStructureElements(): readonly ParsedPdfStructureElement[]; ``` Defined in: [src/parser.ts:803](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L803) Returns a flat list of tagged structure elements. #### Returns readonly [`ParsedPdfStructureElement`](../interfaces/ParsedPdfStructureElement.md)\[] The parsed structure elements. *** ### preloadObjects() ```ts preloadObjects(ids): void; ``` Defined in: [src/parser.ts:412](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L412) Eagerly loads and decodes the specified object ids so they are available without further lazy-parsing. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `ids` | readonly `number`\[] | The object ids to preload. | #### Returns `void` --- --- url: 'https://zeropdf.criston.dev/api/classes/PdfDocument.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfDocument # Class: PdfDocument Defined in: [src/document.ts:4305](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4305) A mutable builder for creating new PDF documents from scratch. It manages pages, fonts, metadata, outlines, attachments, accessibility data, encryption, and serialization. ## Constructors ### Constructor ```ts new PdfDocument(options?): PdfDocument; ``` Defined in: [src/document.ts:4401](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4401) Creates a new mutable PDF document builder. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`DocumentOptions`](../interfaces/DocumentOptions.md) | Options that control the operation. | #### Returns `PdfDocument` ## Properties | Property | Type | Default value | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `_debugThreadSafe` | `boolean` | `false` | When true, warns about potential concurrent access on reentrant calls. | [src/document.ts:4394](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4394) | | `_lockLevel` | `number` | `0` | Reentrant call counter for thread-safety debugging. | [src/document.ts:4391](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4391) | ## Accessors ### remainingPages #### Get Signature ```ts get remainingPages(): number; ``` Defined in: [src/document.ts:5263](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5263) Returns the number of pages that have been added but not yet written via [writeNextPage](#writenextpage). ##### Returns `number` ## Methods ### addNamedDestination() ```ts addNamedDestination(name, target): void; ``` Defined in: [src/document.ts:4667](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4667) Adds a named destination that points to a page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The name to assign or look up. | | `target` | [`PdfPage`](PdfPage.md) | The destination page, outline target, or structure element. | #### Returns `void` *** ### addOutline() ```ts addOutline( title, target, options?): PdfOutlineItem; ``` Defined in: [src/document.ts:4757](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4757) Adds a top-level outline item to the document. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `title` | `string` | The outline title. | | `target` | `string` | [`PdfPage`](PdfPage.md) | The destination page, outline target, or structure element. | | `options` | [`OutlineOptions`](../interfaces/OutlineOptions.md) | Options that control the operation. | #### Returns [`PdfOutlineItem`](PdfOutlineItem.md) The created outline item handle. *** ### addPage() ```ts addPage(options?): PdfPage; ``` Defined in: [src/document.ts:4483](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4483) Adds a page to the document and returns its page builder. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`PageOptions`](../interfaces/PageOptions.md) | Options that control the operation. | #### Returns [`PdfPage`](PdfPage.md) The new page builder. *** ### attachFile() ```ts attachFile( name, data, options?): void; ``` Defined in: [src/document.ts:4696](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4696) Embeds a file attachment in the document. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The name to assign or look up. | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`AttachmentOptions`](../interfaces/AttachmentOptions.md) | Options that control the operation. | #### Returns `void` *** ### clone() ```ts clone(): PdfDocument; ``` Defined in: [src/document.ts:5081](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5081) Creates a deep clone of this document. The clone is independently modifiable — it copies all pages, fonts, images, metadata, and the structure tree. Embedded font data is reused from the shared font cache (cross-document sharing). #### Returns `PdfDocument` A new PdfDocument instance with a deep copy of the document model. *** ### createLuminositySoftMask() ```ts createLuminositySoftMask(options, build): SoftMaskHandle; ``` Defined in: [src/document.ts:4600](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4600) Creates a luminosity soft mask backed by a Form XObject. Pass the returned handle to [ExtGStateOptions.softMask](../interfaces/ExtGStateOptions.md#property-softmask) via [PdfPage.setExtGState](PdfPage.md#setextgstate) to apply the mask. The mask sub-builder supports path operations only. Painted regions with high luminosity (white) become opaque; black becomes transparent. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`SoftMaskOptions`](../interfaces/SoftMaskOptions.md) | Mask BBox dimensions. | | `build` | (`mask`) => `void` | Callback that receives the mask sub-builder. | #### Returns [`SoftMaskHandle`](../interfaces/SoftMaskHandle.md) A handle referencing the created soft-mask Form XObject. *** ### embedTrueTypeFont() ```ts embedTrueTypeFont(data, options?): PdfEmbeddedFont; ``` Defined in: [src/document.ts:4643](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4643) Embeds a TrueType font and registers it under the provided name. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`EmbedTrueTypeFontOptions`](../interfaces/EmbedTrueTypeFontOptions.md) | Options that control the operation. | #### Returns [`PdfEmbeddedFont`](../interfaces/PdfEmbeddedFont.md) The result of the operation. *** ### encryptForRecipients() ```ts encryptForRecipients(certificates): void; ``` Defined in: [src/document.ts:5176](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5176) Configures certificate-based (public-key) encryption for the document. Each recipient certificate is a DER-encoded X.509 certificate whose public key is used to encrypt a random 20-byte seed. The /SubFilter /adbe.pkcs7.s5 security handler stores the encrypted seeds in a /Recipients array so each recipient can decrypt the document with their private key. For simplicity this method only implements encryption — existing encrypted files are not decrypted. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `certificates` | `Uint8Array`<`ArrayBufferLike`>\[] | An array of DER-encoded X.509 certificate bytes. | #### Returns `void` *** ### flattenForms() ```ts flattenForms(): void; ``` Defined in: [src/document.ts:4786](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4786) Flattens form fields into static page content where possible. #### Returns `void` *** ### measureRichText() ```ts measureRichText(runs, options): BlockTextMetrics; ``` Defined in: [src/document.ts:4575](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4575) Measures a paragraph of inline rich-text runs without drawing it. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `runs` | readonly [`InlineTextRun`](../interfaces/InlineTextRun.md)\[] | The styled inline runs. | | `options` | [`MeasureRichTextOptions`](../type-aliases/MeasureRichTextOptions.md) | Block options including `width` (no position needed). | #### Returns [`BlockTextMetrics`](../interfaces/BlockTextMetrics.md) The measured block metrics in PDF points. *** ### measureText() ```ts measureText(text, options?): TextMetrics; ``` Defined in: [src/document.ts:4540](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4540) Measures a single line of text without drawing it, using the document's registered fonts and defaults. Returns the rendered width and the line height (font size). For wrapped multi-line text use [measureTextBlock](#measuretextblock). #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to measure (treated as a single line). | | `options` | [`MeasureTextOptions`](../type-aliases/MeasureTextOptions.md) | Font and style options (no position needed). | #### Returns [`TextMetrics`](../interfaces/TextMetrics.md) The measured width and height in PDF points. *** ### measureTextBlock() ```ts measureTextBlock(text, options): BlockTextMetrics; ``` Defined in: [src/document.ts:4555](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4555) Measures a wrapped text block without drawing it. Returns the width of the longest line, the total height, and the line count after wrapping. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to wrap and measure. | | `options` | [`MeasureTextBlockOptions`](../type-aliases/MeasureTextBlockOptions.md) | Block options including `width` (no position needed). | #### Returns [`BlockTextMetrics`](../interfaces/BlockTextMetrics.md) The measured block metrics in PDF points. *** ### registerFontFamily() ```ts registerFontFamily(name, faces): string; ``` Defined in: [src/document.ts:4513](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4513) Registers a named font family so text APIs can select a face with the `bold` and `italic` flags instead of tracking individual font handles. Faces may be built-in [FontName](../type-aliases/FontName.md)s or handles returned by [embedTrueTypeFont](#embedtruetypefont). Pass the family name as the `font` option on subsequent [PdfPage.text](PdfPage.md#text)/[PdfPage.textBlock](PdfPage.md#textblock) calls. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The family name used as the `font` option. | | `faces` | [`FontFamilyInput`](../interfaces/FontFamilyInput.md) | The faces that make up the family. | #### Returns `string` The family name, for convenient inline use as a `font` value. #### Example ```ts const inter = doc.registerFontFamily("Inter", { regular: doc.embedTrueTypeFont(regularBytes, { family: "Inter" }), bold: doc.embedTrueTypeFont(boldBytes, { family: "Inter" }), }); page.text("Heading", { x: 56, y: 760, font: inter, bold: true }); ``` *** ### renderTemplate() ```ts renderTemplate(options): void; ``` Defined in: [src/document.ts:4619](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4619) Renders a template document into this PDF document. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`TemplateDocumentOptions`](../interfaces/TemplateDocumentOptions.md) | Options that control the operation. | #### Returns `void` *** ### save() ```ts save(path): Promise; ``` Defined in: [src/document.ts:5236](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5236) Serializes the document and writes it to a file path. Convenience alias for [writeToFile](#writetofile) for Node.js callers. In the browser, use [toUint8Array](#touint8array) or [toBlob](#toblob) instead. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | The file path to write to. | #### Returns `Promise`<`void`> *** ### setCalculationOrder() ```ts setCalculationOrder(fieldNames): void; ``` Defined in: [src/document.ts:4774](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4774) Sets the calculation order for form fields. The order determines the sequence in which field calculations run when a field value changes. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `fieldNames` | `string`\[] | The ordered list of form field names. | #### Returns `void` *** ### setPageLabel() ```ts setPageLabel(target, options): void; ``` Defined in: [src/document.ts:4681](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4681) Sets the label style for a page-label range beginning at the target page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `target` | [`PdfPage`](PdfPage.md) | The destination page, outline target, or structure element. | | `options` | [`PageLabelOptions`](../interfaces/PageLabelOptions.md) | Options that control the operation. | #### Returns `void` *** ### setTextShaper() ```ts setTextShaper(shaper): void; ``` Defined in: [src/document.ts:4471](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4471) Sets a custom text shaper for complex script shaping (Devanagari, Khmer, Myanmar, Arabic, Thai, etc.). When provided, the shaper is called for each text run that requires shaping. If not provided, the default shaper handles basic ligature and joining-form substitution but will throw an UNSUPPORTED\_SCRIPT error for scripts it does not support. External shapers such as harfbuzzjs or fontkit can be plugged in to enable full shaping support. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `shaper` | [`TextShaper`](../interfaces/TextShaper.md) | `undefined` | The custom text shaper to use, or undefined to revert to the default. | #### Returns `void` #### Example ```ts import { createDocument } from "@criston/zeropdf"; const doc = createDocument(); // Plug in harfbuzzjs for full complex-script shaping: // import { createHarfBuzzShaper } from "harfbuzzjs-shaper"; // doc.setTextShaper(createHarfBuzzShaper(harfbuzzInstance)); ``` *** ### setXmpMetadata() ```ts setXmpMetadata(metadata): void; ``` Defined in: [src/document.ts:4743](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4743) Sets or clears the document XMP metadata packet. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `metadata` | [`XmpMetadataInput`](../type-aliases/XmpMetadataInput.md) | `undefined` | The XMP metadata input, or undefined to clear it. | #### Returns `void` *** ### toArrayBuffer() ```ts toArrayBuffer(): ArrayBuffer; ``` Defined in: [src/document.ts:4867](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4867) Serializes the document into an ArrayBuffer. #### Returns `ArrayBuffer` The serialized PDF data as an ArrayBuffer. *** ### toBlob() ```ts toBlob(): Blob; ``` Defined in: [src/document.ts:4893](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4893) Serializes the document into a PDF Blob. #### Returns `Blob` The serialized PDF data as a Blob. *** ### toModel() ```ts toModel(): PdfDocumentModel; ``` Defined in: [src/document.ts:4921](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4921) Returns the internal document model used by the serializer. #### Returns `PdfDocumentModel` The internal document model. *** ### toUint8Array() ```ts toUint8Array(): Uint8Array; ``` Defined in: [src/document.ts:4813](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4813) Serializes the document into PDF bytes. #### Returns `Uint8Array` The serialized or collected bytes. *** ### validateCompliance() ```ts validateCompliance(): readonly PdfComplianceIssue[]; ``` Defined in: [src/document.ts:4796](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4796) Validates the current document model against enabled compliance rules. #### Returns readonly [`PdfComplianceIssue`](../interfaces/PdfComplianceIssue.md)\[] The compliance issues found in the current model. *** ### writeNextPage() ```ts writeNextPage(sink): Promise; ``` Defined in: [src/document.ts:5250](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5250) Writes all previously added pages to the sink and returns a new [PdfPage](PdfPage.md) for the next page. When called repeatedly this streams pages as they are built, reducing peak memory for very large documents (1000+ pages). #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sink` | [`ByteSink`](../interfaces/ByteSink.md) | The sink that receives the serialized bytes. | #### Returns `Promise`<[`PdfPage`](PdfPage.md)> A new page builder for continuing to add pages. *** ### writeTo() ```ts writeTo(sink): Promise; ``` Defined in: [src/document.ts:4834](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4834) Streams the serialized document to a byte sink. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sink` | [`ByteSink`](../interfaces/ByteSink.md) | The sink that receives written byte chunks. | #### Returns `Promise`<`void`> *** ### writeToFile() ```ts writeToFile(path): Promise; ``` Defined in: [src/document.ts:5223](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5223) Serializes the document and writes it to a file path. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | The file path to write to. | #### Returns `Promise`<`void`> *** ### estimateSignatureSize() ```ts static estimateSignatureSize(certificateBytes?): number; ``` Defined in: [src/document.ts:5214](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5214) Estimates the byte size needed for a detached-signature placeholder. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `certificateBytes?` | `Uint8Array`<`ArrayBufferLike`> | `null` | Optional certificate bytes for size estimation. | #### Returns `number` The estimated placeholder size in bytes. --- --- url: 'https://zeropdf.criston.dev/api/classes/PdfEditableDocument.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfEditableDocument # Class: PdfEditableDocument Defined in: [src/document.ts:5274](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5274) A mutable editor for applying incremental updates to an existing PDF document. It supports page edits, appended pages, form updates, structure changes, embedded resources, and incremental serialization. ## Constructors ### Constructor ```ts new PdfEditableDocument(base): PdfEditableDocument; ``` Defined in: [src/document.ts:5350](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5350) Creates an editor around a parsed source PDF. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `base` | [`ParsedPdfDocument`](ParsedPdfDocument.md) | The parsed source PDF to edit. | #### Returns `PdfEditableDocument` ## Methods ### addPage() ```ts addPage(options?): PdfPage; ``` Defined in: [src/document.ts:5393](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5393) Appends a new page and returns its page builder. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`PageOptions`](../interfaces/PageOptions.md) | Options that control the operation. | #### Returns [`PdfPage`](PdfPage.md) The new page builder. *** ### editPage() ```ts editPage(index): PdfPage; ``` Defined in: [src/document.ts:5503](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5503) Creates or returns a page builder for editing an existing page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `index` | `number` | The page index. | #### Returns [`PdfPage`](PdfPage.md) The editable page builder. *** ### embedTrueTypeFont() ```ts embedTrueTypeFont(data, options?): PdfEmbeddedFont; ``` Defined in: [src/document.ts:5586](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5586) Embeds a TrueType font for use by appended or edited pages. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`EmbedTrueTypeFontOptions`](../interfaces/EmbedTrueTypeFontOptions.md) | Options that control the operation. | #### Returns [`PdfEmbeddedFont`](../interfaces/PdfEmbeddedFont.md) The result of the operation. *** ### findEditableStructureElements() ```ts findEditableStructureElements(query?): readonly ParsedPdfEditableStructureElement[]; ``` Defined in: [src/document.ts:5832](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5832) Finds editable tagged structure elements that match the supplied query. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `query` | [`PdfEditableStructureQuery`](../interfaces/PdfEditableStructureQuery.md) | The criteria used to match structure elements. | #### Returns readonly [`ParsedPdfEditableStructureElement`](../interfaces/ParsedPdfEditableStructureElement.md)\[] The result of the operation. *** ### findSimilarStructureElements() ```ts findSimilarStructureElements(target, options?): readonly ParsedPdfEditableStructureElement[]; ``` Defined in: [src/document.ts:5879](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5879) Finds tagged structure elements related to the supplied element. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `target` | [`ParsedPdfEditableStructureElement`](../interfaces/ParsedPdfEditableStructureElement.md) | The destination page, outline target, or structure element. | | `options` | [`PdfEditableStructureSimilarityOptions`](../interfaces/PdfEditableStructureSimilarityOptions.md) | Options that control the operation. | #### Returns readonly [`ParsedPdfEditableStructureElement`](../interfaces/ParsedPdfEditableStructureElement.md)\[] The result of the operation. *** ### flattenForms() ```ts flattenForms(): void; ``` Defined in: [src/document.ts:6276](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6276) Queues flattening for all parsed form fields. #### Returns `void` *** ### getPageCount() ```ts getPageCount(): number; ``` Defined in: [src/document.ts:5432](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5432) Returns the current page count including appended and inserted pages. #### Returns `number` The page count. *** ### insertPage() ```ts insertPage(index, options?): PdfPage; ``` Defined in: [src/document.ts:5405](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5405) Inserts a new page at the requested position and returns its page builder. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `index` | `number` | The page index. | | `options` | [`PageOptions`](../interfaces/PageOptions.md) | Options that control the operation. | #### Returns [`PdfPage`](PdfPage.md) The inserted page builder. *** ### listEditableStructureElements() ```ts listEditableStructureElements(): readonly ParsedPdfEditableStructureElement[]; ``` Defined in: [src/document.ts:5817](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5817) Returns editable tagged structure element handles from the source document. #### Returns readonly [`ParsedPdfEditableStructureElement`](../interfaces/ParsedPdfEditableStructureElement.md)\[] The editable structure element handles. *** ### movePage() ```ts movePage(fromIndex, toIndex): void; ``` Defined in: [src/document.ts:5466](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5466) Moves a page from one position to another. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `fromIndex` | `number` | The current page index. | | `toIndex` | `number` | The destination page index. | #### Returns `void` *** ### removePage() ```ts removePage(index): void; ``` Defined in: [src/document.ts:5441](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5441) Removes a page from the editable page order. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `index` | `number` | The page index. | #### Returns `void` *** ### save() ```ts save(path): Promise; ``` Defined in: [src/document.ts:6437](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6437) Serializes the incremental update and writes it to a file path. Convenience alias for [writeToFile](#writetofile) for Node.js callers. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | The file path to write to. | #### Returns `Promise`<`void`> *** ### setEncryption() ```ts setEncryption(options): void; ``` Defined in: [src/document.ts:6103](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6103) Sets encryption options for the next save, upgrading the encryption algorithm. New and modified objects will use the new encryption. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`DocumentEncryptionOptions`](../interfaces/DocumentEncryptionOptions.md) | Encryption options for the next save. | #### Returns `void` *** ### setFieldValue() ```ts setFieldValue(name, value): void; ``` Defined in: [src/document.ts:5648](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5648) Queues a form field value update by field name. /\*\* Queues a form field value update by field name. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The name to assign or look up. | | `value` | `string` | `boolean` | The value to write or apply. | #### Returns `void` *** ### setStructureAltText() ```ts setStructureAltText(target, altText): void; ``` Defined in: [src/document.ts:5942](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5942) Queues alternate text updates for a tagged structure element. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `target` | [`ParsedPdfEditableStructureElement`](../interfaces/ParsedPdfEditableStructureElement.md) | The destination page, outline target, or structure element. | | `altText` | `string` | `undefined` | The replacement alternate text, or undefined to clear it. | #### Returns `void` *** ### setStructureReadingOrder() ```ts setStructureReadingOrder(orderedChildren): void; ``` Defined in: [src/document.ts:5970](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5970) Queues a child reading-order update for a tagged structure element. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `orderedChildren` | readonly [`ParsedPdfEditableStructureElement`](../interfaces/ParsedPdfEditableStructureElement.md)\[] | The child element handles in the desired reading order. | #### Returns `void` *** ### setStructureRole() ```ts setStructureRole(target, role): void; ``` Defined in: [src/document.ts:5898](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5898) Queues a role update for a tagged structure element. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `target` | [`ParsedPdfEditableStructureElement`](../interfaces/ParsedPdfEditableStructureElement.md) | The destination page, outline target, or structure element. | | `role` | | `string` & `object` | [`PdfStandardStructureTag`](../type-aliases/PdfStandardStructureTag.md) | The replacement structure role. | #### Returns `void` *** ### setStructureRoles() ```ts setStructureRoles(targets, role): void; ``` Defined in: [src/document.ts:5927](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5927) Queues role updates for multiple tagged structure elements. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `targets` | readonly [`ParsedPdfEditableStructureElement`](../interfaces/ParsedPdfEditableStructureElement.md)\[] | The structure element handles to update. | | `role` | | `string` & `object` | [`PdfStandardStructureTag`](../type-aliases/PdfStandardStructureTag.md) | The replacement structure role. | #### Returns `void` *** ### setXmpMetadata() ```ts setXmpMetadata(metadata): void; ``` Defined in: [src/document.ts:5633](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5633) Queues an XMP metadata update or removal. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `metadata` | [`XmpMetadataInput`](../type-aliases/XmpMetadataInput.md) | `undefined` | The XMP metadata input, or undefined to clear it. | #### Returns `void` *** ### sign() ```ts sign(options): void; ``` Defined in: [src/document.ts:6113](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6113) Adds a detached digital signature as an incremental update. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`DocumentSignatureOptions`](../interfaces/DocumentSignatureOptions.md) | Signature options, including the CMS/PKCS#7 signer callback. | #### Returns `void` *** ### toArrayBuffer() ```ts toArrayBuffer(): ArrayBuffer; ``` Defined in: [src/document.ts:6209](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6209) Serializes the incremental update into an ArrayBuffer. #### Returns `ArrayBuffer` The serialized PDF data as an ArrayBuffer. *** ### toBlob() ```ts toBlob(): Blob; ``` Defined in: [src/document.ts:6235](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6235) Serializes the incremental update into a PDF Blob. #### Returns `Blob` The serialized PDF data as a Blob. *** ### toIncrementalModel() ```ts toIncrementalModel(): PdfIncrementalUpdateModel; ``` Defined in: [src/document.ts:6332](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6332) Builds the internal incremental update model for serialization. #### Returns `PdfIncrementalUpdateModel` The internal incremental update model. *** ### toUint8Array() ```ts toUint8Array(): Uint8Array; ``` Defined in: [src/document.ts:6123](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6123) Serializes the incremental update into PDF bytes. #### Returns `Uint8Array` The serialized or collected bytes. *** ### updateInfo() ```ts updateInfo(info): void; ``` Defined in: [src/document.ts:5609](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5609) Queues updates to the document information dictionary. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `info` | [`DocumentInfo`](../interfaces/DocumentInfo.md) | The document information metadata to merge. | #### Returns `void` *** ### writePageContent() ```ts writePageContent( index, content, mode): void; ``` Defined in: [src/document.ts:5542](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L5542) Writes raw PDF content operators to an existing page's content stream. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `index` | `number` | The page index. | | `content` | `string` | Raw PDF content stream operators (e.g. "BT /F1 12 Tf (Hello) Tj ET"). | | `mode` | `"replace"` | `"append"` | `"prepend"` | How to apply the content: replace entirely, append after existing (wraps existing in q/Q), or prepend before existing (wraps existing in q/Q). | #### Returns `void` *** ### writeTo() ```ts writeTo(sink): Promise; ``` Defined in: [src/document.ts:6144](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6144) Streams the incremental update bytes to a byte sink. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sink` | [`ByteSink`](../interfaces/ByteSink.md) | The sink that receives written byte chunks. | #### Returns `Promise`<`void`> *** ### writeToFile() ```ts writeToFile(path): Promise; ``` Defined in: [src/document.ts:6425](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6425) Serializes the incremental update and writes it to a file path. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | The file path to write to. | #### Returns `Promise`<`void`> *** ### estimateSignatureSize() ```ts static estimateSignatureSize(certificateBytes?): number; ``` Defined in: [src/document.ts:6416](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6416) Estimates the byte size needed for a detached-signature placeholder. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `certificateBytes?` | `Uint8Array`<`ArrayBufferLike`> | `null` | Optional certificate bytes for size estimation. | #### Returns `number` The estimated placeholder size in bytes. --- --- url: 'https://zeropdf.criston.dev/api/classes/PdfEngineError.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfEngineError # Class: PdfEngineError Defined in: [src/errors.ts:91](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L91) A structured error type thrown when PDF generation, parsing, validation, or editing fails. It carries a stable error code and optional diagnostic details. ## Extends * `Error` ## Constructors ### Constructor ```ts new PdfEngineError( code, message, details?): PdfEngineError; ``` Defined in: [src/errors.ts:104](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L104) Creates a structured PDF engine error with a stable code and optional details. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `code` | [`PdfErrorCode`](../enumerations/PdfErrorCode.md) | The stable error code for the failure. | | `message` | `string` | The human-readable error message. | | `details?` | `Record`<`string`, `unknown`> | Optional diagnostic details for the error. | #### Returns `PdfEngineError` #### Overrides ```ts Error.constructor ``` ## Properties | Property | Modifier | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | ------ | | `cause?` | `public` | `unknown` | - | `Error.cause` | node\_modules/typescript/lib/lib.es2022.error.d.ts:24 | | `code` | `readonly` | [`PdfErrorCode`](../enumerations/PdfErrorCode.md) | Stable machine-readable issue or error code. | - | [src/errors.ts:93](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L93) | | `details?` | `readonly` | `Record`<`string`, `unknown`> | Optional diagnostic details supplied with the error. | - | [src/errors.ts:95](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L95) | | `message` | `public` | `string` | - | `Error.message` | node\_modules/typescript/lib/lib.es5.d.ts:1075 | | `name` | `public` | `string` | - | `Error.name` | node\_modules/typescript/lib/lib.es5.d.ts:1074 | | `stack?` | `public` | `string` | - | `Error.stack` | node\_modules/typescript/lib/lib.es5.d.ts:1076 | | `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured *after* the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | `Error.stackTraceLimit` | node\_modules/@types/node/globals.d.ts:67 | ## Methods ### captureStackTrace() ```ts static captureStackTrace(targetObject, constructorOpt?): void; ``` Defined in: node\_modules/@types/node/globals.d.ts:51 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters | Parameter | Type | | ------ | ------ | | `targetObject` | `object` | | `constructorOpt?` | `Function` | #### Returns `void` #### Inherited from ```ts Error.captureStackTrace ``` *** ### prepareStackTrace() ```ts static prepareStackTrace(err, stackTraces): any; ``` Defined in: node\_modules/@types/node/globals.d.ts:55 #### Parameters | Parameter | Type | | ------ | ------ | | `err` | `Error` | | `stackTraces` | `CallSite`\[] | #### Returns `any` #### See https://v8.dev/docs/stack-trace-api#customizing-stack-traces #### Inherited from ```ts Error.prepareStackTrace ``` --- --- url: 'https://zeropdf.criston.dev/api/classes/PdfFlow.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfFlow # Class: PdfFlow Defined in: [src/document.ts:1300](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1300) A cursor-based layout helper for writing report-style content. It manages vertical flow, spacing, page breaks, headings, paragraphs, links, images, and tables. ## Constructors ### Constructor ```ts new PdfFlow( page, embeddedFonts, state, parent?, overflowHandler?, fontFamilies?, textDefaults?): PdfFlow; ``` Defined in: [src/document.ts:1309](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1309) Creates a cursor-based flow writer for a page and optional parent structure node. #### Parameters | Parameter | Type | Default value | Description | | ------ | ------ | ------ | ------ | | `page` | `InternalPageModel` | `undefined` | The internal page model to write into. | | `embeddedFonts` | `ReadonlyMap`<`string`, `ParsedTrueTypeFont`> | `undefined` | The embedded font registry used for text layout. | | `state` | `FlowState` | `undefined` | The mutable flow state to use. | | `parent` | `InternalStructureNode` | `undefined` | `undefined` | The parent structure element whose child order should change. | | `overflowHandler` | (() => `PdfFlow`) | `undefined` | `undefined` | - | | `fontFamilies` | `ReadonlyMap`<`string`, [`FontFamilyFaces`](../interfaces/FontFamilyFaces.md)> | `...` | - | | `textDefaults?` | [`TextDefaults`](../interfaces/TextDefaults.md) | `undefined` | - | #### Returns `PdfFlow` ## Accessors ### columnCount #### Get Signature ```ts get columnCount(): number; ``` Defined in: [src/document.ts:1366](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1366) Gets the total number of flow columns. ##### Returns `number` The flow column count. *** ### columnIndex #### Get Signature ```ts get columnIndex(): number; ``` Defined in: [src/document.ts:1357](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1357) Gets the zero-based active column index. ##### Returns `number` The current flow column index. *** ### cursorY #### Get Signature ```ts get cursorY(): number; ``` Defined in: [src/document.ts:1339](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1339) Gets the current vertical cursor position. ##### Returns `number` The current cursor y-coordinate. *** ### remainingHeight #### Get Signature ```ts get remainingHeight(): number; ``` Defined in: [src/document.ts:1348](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1348) Gets the remaining writable height above the bottom margin. ##### Returns `number` The remaining writable height. ## Methods ### advanceColumn() ```ts advanceColumn(): boolean; ``` Defined in: [src/document.ts:1375](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1375) Advances the flow cursor to the top of the next column on the same page. #### Returns `boolean` Whether a next column was available. *** ### bmp() ```ts bmp(data, options?): this; ``` Defined in: [src/document.ts:1706](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1706) Adds a BMP image at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`FlowImageOptions`](../interfaces/FlowImageOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### checkBox() ```ts checkBox(name, options): this; ``` Defined in: [src/document.ts:2558](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2558) Adds a checkbox form field at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The fully-qualified field name. | | `options` | [`FlowCheckBoxOptions`](../interfaces/FlowCheckBoxOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### choiceField() ```ts choiceField(name, options): this; ``` Defined in: [src/document.ts:2602](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2602) Adds a choice form field at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The fully-qualified field name. | | `options` | [`FlowChoiceFieldOptions`](../interfaces/FlowChoiceFieldOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### circle() ```ts circle( cx?, cy?, radius?, style?): this; ``` Defined in: [src/document.ts:2993](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2993) Adds a circle path at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `cx?` | `number` | Center x-coordinate override. | | `cy?` | `number` | Center y-coordinate override. | | `radius?` | `number` | Radius override. | | `style?` | [`PathStyle`](../interfaces/PathStyle.md) | The drawing style for the circle. | #### Returns `this` This flow helper for chaining. *** ### ellipse() ```ts ellipse( cx?, cy?, rx?, ry?, style?): this; ``` Defined in: [src/document.ts:3036](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3036) Adds an ellipse at the current flow cursor. Like [circle](#circle) but with independent horizontal (`rx`) and vertical (`ry`) radii; advances the cursor by the full height (`2 × ry`). #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `cx?` | `number` | Center x override (defaults to the column center). | | `cy?` | `number` | Center y override (defaults to one `ry` below the cursor). | | `rx?` | `number` | Horizontal radius override. | | `ry?` | `number` | Vertical radius override. | | `style?` | [`PathStyle`](../interfaces/PathStyle.md) | The drawing style for the ellipse. | #### Returns `this` This flow helper for chaining. *** ### estimate() ```ts estimate(block): number; ``` Defined in: [src/document.ts:1456](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1456) Estimates the height a template block would consume. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `block` | [`TemplateBlock`](../type-aliases/TemplateBlock.md) | The template block to estimate. | #### Returns `number` The estimated height. *** ### estimateTableRowHeights() ```ts estimateTableRowHeights(rows, options?): readonly number[]; ``` Defined in: [src/document.ts:2105](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2105) Returns the rendered height of each row in a table at the current flow position. Heights include cell padding and the trailing `rowGap`. Use this to pre-plan row-by-row page splits when rendering large tables. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `rows` | readonly [`TableRow`](../type-aliases/TableRow.md)\[] | The table rows to measure. | | `options` | [`FlowTableOptions`](../interfaces/FlowTableOptions.md) | Options that control the operation. | #### Returns readonly `number`\[] Per-row heights including padding and trailing rowGap. *** ### freeText() ```ts freeText(options): this; ``` Defined in: [src/document.ts:2892](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2892) Adds a free-text annotation at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`FlowFreeTextOptions`](../interfaces/FlowFreeTextOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### gif() ```ts gif(data, options?): this; ``` Defined in: [src/document.ts:1766](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1766) Adds a GIF image at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`FlowImageOptions`](../interfaces/FlowImageOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### heading() ```ts heading( text, options?, annotations?): this; ``` Defined in: [src/document.ts:1408](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1408) Adds a heading at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to add. | | `options` | [`FlowHeadingOptions`](../interfaces/FlowHeadingOptions.md) | Options that control the operation. | | `annotations?` | readonly [`ParagraphTextAnnotation`](../type-aliases/ParagraphTextAnnotation.md)\[] | - | #### Returns `this` This flow helper for chaining. *** ### highlight() ```ts highlight(options): this; ``` Defined in: [src/document.ts:2773](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2773) Adds a highlight annotation at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`FlowHighlightOptions`](../interfaces/FlowHighlightOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### jbig2() ```ts jbig2(data, options?): this; ``` Defined in: [src/document.ts:1718](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1718) Adds a JBIG2 image at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`FlowImageOptions`](../interfaces/FlowImageOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### jp2() ```ts jp2(data, options?): this; ``` Defined in: [src/document.ts:1742](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1742) Adds a JPEG 2000 image at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`FlowImageOptions`](../interfaces/FlowImageOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### jpeg() ```ts jpeg(data, options?): this; ``` Defined in: [src/document.ts:1694](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1694) Adds a JPEG image at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`FlowImageOptions`](../interfaces/FlowImageOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### line() ```ts line( x1, y1, x2, y2, style?): this; ``` Defined in: [src/document.ts:3069](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3069) Draws a straight line between two absolute points. Unlike [rect](#rect) and [circle](#circle), a line does not consume vertical flow space. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `x1` | `number` | Start x in PDF points. | | `y1` | `number` | Start y in PDF points. | | `x2` | `number` | End x in PDF points. | | `y2` | `number` | End y in PDF points. | | `style?` | [`PathStyle`](../interfaces/PathStyle.md) | The drawing style for the line. | #### Returns `this` This flow helper for chaining. *** ### link() ```ts link( text, url, options?): this; ``` Defined in: [src/document.ts:1792](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1792) Adds a text link at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to add. | | `url` | `string` | The URI target. | | `options` | [`FlowLinkOptions`](../interfaces/FlowLinkOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### list() ```ts list(items, options): this; ``` Defined in: [src/document.ts:3086](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3086) Adds a tagged list at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `items` | readonly [`ListItem`](../type-aliases/ListItem.md)\[] | The list items to add. | | `options` | [`FlowListOptions`](../interfaces/FlowListOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### moveDown() ```ts moveDown(distance?): this; ``` Defined in: [src/document.ts:1940](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1940) Moves the flow cursor downward by the supplied distance. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `distance` | `number` | The distance to move the cursor. | #### Returns `this` This flow helper for chaining. *** ### note() ```ts note(options): this; ``` Defined in: [src/document.ts:2850](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2850) Adds a text note annotation at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`FlowNoteOptions`](../interfaces/FlowNoteOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### paragraph() ```ts paragraph( text, options?, annotations?): this; ``` Defined in: [src/document.ts:1544](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1544) Adds a paragraph at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to add. | | `options` | [`FlowTextOptions`](../interfaces/FlowTextOptions.md) | Options that control the operation. | | `annotations?` | readonly [`ParagraphTextAnnotation`](../type-aliases/ParagraphTextAnnotation.md)\[] | - | #### Returns `this` This flow helper for chaining. *** ### path() ```ts path( commands, style, height): this; ``` Defined in: [src/document.ts:2935](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2935) Adds vector path commands at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `commands` | [`PathCommand`](../type-aliases/PathCommand.md)\[] | The vector path commands to add. | | `style` | [`PathStyle`](../interfaces/PathStyle.md) | The drawing style for the path. | | `height` | `number` | The vertical extent consumed by the path. | #### Returns `this` This flow helper for chaining. *** ### png() ```ts png(data, options?): this; ``` Defined in: [src/document.ts:1682](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1682) Adds a PNG image at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`FlowImageOptions`](../interfaces/FlowImageOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### pushButton() ```ts pushButton(name, options): this; ``` Defined in: [src/document.ts:2686](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2686) Adds a push-button form field at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The fully-qualified field name. | | `options` | [`FlowPushButtonOptions`](../interfaces/FlowPushButtonOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### radioGroup() ```ts radioGroup(name, options): this; ``` Defined in: [src/document.ts:2646](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2646) Adds a radio-button group at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The fully-qualified field name. | | `options` | [`FlowRadioGroupOptions`](../interfaces/FlowRadioGroupOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### rect() ```ts rect( x?, y?, width?, height?, style?): this; ``` Defined in: [src/document.ts:2958](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2958) Adds a rectangle path at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `x?` | `number` | Horizontal position override. | | `y?` | `number` | Vertical position override (bottom edge). | | `width?` | `number` | Width override. | | `height?` | `number` | Height override. | | `style?` | [`PathStyle`](../interfaces/PathStyle.md) | The drawing style for the rectangle. | #### Returns `this` This flow helper for chaining. *** ### render() ```ts render(blocks, stylesheet?): this; ``` Defined in: [src/document.ts:1444](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1444) Renders a sequence of template blocks into the flow. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `blocks` | readonly [`TemplateBlock`](../type-aliases/TemplateBlock.md)\[] | The template blocks to render. | | `stylesheet?` | [`TemplateStylesheet`](../interfaces/TemplateStylesheet.md) | Optional named styles merged beneath each block's inline options. | #### Returns `this` This flow helper for chaining. *** ### reservePageLinkRect() ```ts reservePageLinkRect(options): object; ``` Defined in: [src/document.ts:1877](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1877) Reserves a rectangular region at the current flow cursor and returns its coordinates without emitting any content. Spacing is applied with the `link` defaults so this mirrors [link](#link) layout. The cursor advances by the rect height plus trailing spacing. Used by the template engine to defer page-to-page link emission until after every page exists. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | `Omit`<[`PageLinkOptions`](../interfaces/PageLinkOptions.md), `"x"` | `"y"`> & [`FlowBlockSpacingOptions`](../interfaces/FlowBlockSpacingOptions.md) | Options that control the operation. | #### Returns `object` The reserved rect in PDF coordinates. ##### height ```ts height: number; ``` ##### width ```ts width: number; ``` ##### x ```ts x: number; ``` ##### y ```ts y: number; ``` *** ### richParagraph() ```ts richParagraph(runs, options?): this; ``` Defined in: [src/document.ts:1566](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1566) Adds a paragraph of inline rich-text runs at the current flow cursor. Runs flow on the same line and wrap together; each keeps its own style and may carry a `link`. Styles omitted on a run inherit from `options`, then the flow's configured defaults, then the document defaults. Note: a rich paragraph is placed as a unit and does not split across columns or pages. For very long flowing copy that must break across columns, use [paragraph](#paragraph). #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `runs` | readonly [`InlineTextRun`](../interfaces/InlineTextRun.md)\[] | The styled inline runs to lay out together. | | `options` | [`FlowRichTextOptions`](../interfaces/FlowRichTextOptions.md) | Flow spacing and inherited style defaults. | #### Returns `this` *** ### section() ```ts section( blocks, role?, structure?, stylesheet?): this; ``` Defined in: [src/document.ts:2483](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2483) Renders a section of template blocks within an optional structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `blocks` | readonly [`TemplateBlock`](../type-aliases/TemplateBlock.md)\[] | Child blocks to render. | | `role?` | [`PdfContainerTag`](../type-aliases/PdfContainerTag.md) | Optional structure role (e.g. "Sect", "Div"). | | `structure?` | [`PdfStructureOptions`](../interfaces/PdfStructureOptions.md) | Optional structure options. | | `stylesheet?` | [`TemplateStylesheet`](../interfaces/TemplateStylesheet.md) | - | #### Returns `this` This flow helper for chaining. *** ### setOverflowHandler() ```ts setOverflowHandler(handler): this; ``` Defined in: [src/document.ts:1395](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1395) Registers a callback used by template rendering when flow content exhausts the last column and needs a fresh page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `handler` | (() => `PdfFlow`) | `undefined` | Callback that returns the next flow region. | #### Returns `this` This flow helper for chaining. *** ### signatureField() ```ts signatureField(name, options): this; ``` Defined in: [src/document.ts:2730](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2730) Adds a signature form field placeholder at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The fully-qualified field name. | | `options` | [`FlowSignatureFieldOptions`](../interfaces/FlowSignatureFieldOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### squiggly() ```ts squiggly(options): this; ``` Defined in: [src/document.ts:2806](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2806) Adds a squiggly text-markup annotation at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`FlowHighlightOptions`](../interfaces/FlowHighlightOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### strikeOut() ```ts strikeOut(options): this; ``` Defined in: [src/document.ts:2795](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2795) Adds a strike-out text-markup annotation at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`FlowHighlightOptions`](../interfaces/FlowHighlightOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### svg() ```ts svg(data, options?): this; ``` Defined in: [src/document.ts:1778](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1778) Adds an SVG graphic at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | `string` | [`BinaryData`](../type-aliases/BinaryData.md) | The SVG text data. | | `options` | [`FlowImageOptions`](../interfaces/FlowImageOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### table() ```ts table(rows, options?): this; ``` Defined in: [src/document.ts:1900](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1900) Adds a table at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `rows` | readonly [`TableRow`](../type-aliases/TableRow.md)\[] | The table rows to add. | | `options` | [`FlowTableOptions`](../interfaces/FlowTableOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### textBlock() ```ts textBlock( text, options?, annotations?): this; ``` Defined in: [src/document.ts:1654](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1654) Adds a text block at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to add. | | `options` | [`FlowTextOptions`](../interfaces/FlowTextOptions.md) | Options that control the operation. | | `annotations?` | readonly [`ParagraphTextAnnotation`](../type-aliases/ParagraphTextAnnotation.md)\[] | Optional inline annotations anchored to substrings of the rendered text. | #### Returns `this` This flow helper for chaining. *** ### textField() ```ts textField(name, options): this; ``` Defined in: [src/document.ts:2514](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2514) Adds a text form field at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The fully-qualified field name. | | `options` | [`FlowTextFieldOptions`](../interfaces/FlowTextFieldOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### tiff() ```ts tiff(data, options?): this; ``` Defined in: [src/document.ts:1730](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1730) Adds a TIFF image at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`FlowImageOptions`](../interfaces/FlowImageOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### underline() ```ts underline(options): this; ``` Defined in: [src/document.ts:2784](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L2784) Adds an underline text-markup annotation at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`FlowHighlightOptions`](../interfaces/FlowHighlightOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. *** ### webp() ```ts webp(data, options?): this; ``` Defined in: [src/document.ts:1754](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L1754) Adds a WebP image at the current flow cursor. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`FlowImageOptions`](../interfaces/FlowImageOptions.md) | Options that control the operation. | #### Returns `this` This flow helper for chaining. --- --- url: 'https://zeropdf.criston.dev/api/classes/PdfOutlineItem.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfOutlineItem # Class: PdfOutlineItem Defined in: [src/document.ts:4273](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4273) A handle for an outline entry in a PDF document. It can receive nested child outline items that point to pages or named destinations. ## Constructors ### Constructor ```ts new PdfOutlineItem(outline): PdfOutlineItem; ``` Defined in: [src/document.ts:4279](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4279) Creates an outline item handle for an internal outline model. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `outline` | `InternalOutlineModel` | The internal outline model to wrap. | #### Returns `PdfOutlineItem` ## Methods ### addChild() ```ts addChild( title, target, options?): PdfOutlineItem; ``` Defined in: [src/document.ts:4290](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4290) Adds a nested outline item below this outline entry. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `title` | `string` | The outline title. | | `target` | `string` | [`PdfPage`](PdfPage.md) | The destination page, outline target, or structure element. | | `options` | [`OutlineOptions`](../interfaces/OutlineOptions.md) | Options that control the operation. | #### Returns `PdfOutlineItem` The created child outline item handle. --- --- url: 'https://zeropdf.criston.dev/api/classes/PdfPage.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfPage # Class: PdfPage Defined in: [src/document.ts:3180](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3180) A mutable page builder for placing text, graphics, images, links, annotations, form fields, and structured content on a PDF page. ## Constructors ### Constructor ```ts new PdfPage( page, embeddedFonts, fontFamilies?, textDefaults?, origin?, shapeDefaults?): PdfPage; ``` Defined in: [src/document.ts:3189](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3189) Creates a page builder around an internal page model and embedded font registry. #### Parameters | Parameter | Type | Default value | Description | | ------ | ------ | ------ | ------ | | `page` | `InternalPageModel` | `undefined` | The internal page model to write into. | | `embeddedFonts` | `ReadonlyMap`<`string`, `ParsedTrueTypeFont`> | `undefined` | The embedded font registry used for text layout. | | `fontFamilies` | `ReadonlyMap`<`string`, [`FontFamilyFaces`](../interfaces/FontFamilyFaces.md)> | `...` | Font families registered with the document, used to resolve a family name plus `bold`/`italic` flags to a concrete face. | | `textDefaults?` | [`TextDefaults`](../interfaces/TextDefaults.md) | `undefined` | - | | `origin?` | `"bottom-left"` | `"top-left"` | `"bottom-left"` | - | | `shapeDefaults?` | [`ShapeStyle`](../interfaces/ShapeStyle.md) | `undefined` | - | #### Returns `PdfPage` ## Accessors ### size #### Get Signature ```ts get size(): CustomPageSize; ``` Defined in: [src/document.ts:3250](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3250) Gets the page size. ##### Returns [`CustomPageSize`](../interfaces/CustomPageSize.md) The number of bytes. ## Methods ### bmp() ```ts bmp(data, options): this; ``` Defined in: [src/document.ts:3652](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3652) Adds a BMP image to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`BmpImageOptions`](../interfaces/BmpImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### checkBox() ```ts checkBox(name, options): this; ``` Defined in: [src/document.ts:3987](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3987) Adds a checkbox form field to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The name to assign or look up. | | `options` | [`CheckBoxOptions`](../interfaces/CheckBoxOptions.md) | Options that control the operation. | #### Returns `this` *** ### choiceField() ```ts choiceField(name, options): this; ``` Defined in: [src/document.ts:4015](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4015) Adds a choice form field to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The name to assign or look up. | | `options` | [`ChoiceFieldOptions`](../interfaces/ChoiceFieldOptions.md) | Options that control the operation. | #### Returns `this` *** ### circle() ```ts circle( cx, cy, radius, style?): this; ``` Defined in: [src/document.ts:3593](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3593) Draws a circle centered at (`cx`, `cy`). #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `cx` | `number` | Center x in PDF points. | | `cy` | `number` | Center y in PDF points. | | `radius` | `number` | Radius in PDF points. | | `style?` | [`ShapeStyle`](../interfaces/ShapeStyle.md) | Fill/stroke styling. Stroked when omitted. | #### Returns `this` *** ### container() Creates a tagged structure container on the page. #### Param The structure tag to create. #### Param Either structure options or a build callback. #### Param An optional build callback when options are provided separately. #### Call Signature ```ts container(tag, build?): PdfStructureContainer; ``` Defined in: [src/document.ts:3406](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3406) Creates a tagged structure container on the page. ##### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `tag` | [`PdfContainerTag`](../type-aliases/PdfContainerTag.md) | The structure tag to create. | | `build?` | (`container`) => `void` | An optional callback that receives the created container. | ##### Returns [`PdfStructureContainer`](PdfStructureContainer.md) The created structure container. #### Call Signature ```ts container( tag, options?, build?): PdfStructureContainer; ``` Defined in: [src/document.ts:3419](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3419) Creates a tagged structure container on the page. ##### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `tag` | [`PdfContainerTag`](../type-aliases/PdfContainerTag.md) | The structure tag to create. | | `options?` | [`PdfStructureOptions`](../interfaces/PdfStructureOptions.md) | Options that control the operation. | | `build?` | (`container`) => `void` | An optional callback that receives the created container. | ##### Returns [`PdfStructureContainer`](PdfStructureContainer.md) The created structure container. *** ### ellipse() ```ts ellipse( cx, cy, rx, ry, style?): this; ``` Defined in: [src/document.ts:3607](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3607) Draws an ellipse centered at (`cx`, `cy`) with horizontal radius `rx` and vertical radius `ry`. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `cx` | `number` | Center x in PDF points. | | `cy` | `number` | Center y in PDF points. | | `rx` | `number` | Horizontal radius in PDF points. | | `ry` | `number` | Vertical radius in PDF points. | | `style?` | [`ShapeStyle`](../interfaces/ShapeStyle.md) | Fill/stroke styling. Stroked when omitted. | #### Returns `this` *** ### flow() ```ts flow(options?): PdfFlow; ``` Defined in: [src/document.ts:3527](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3527) Creates a cursor-based flow helper for the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`FlowOptions`](../interfaces/FlowOptions.md) | Options that control the operation. | #### Returns [`PdfFlow`](PdfFlow.md) The created flow helper. *** ### freeText() ```ts freeText(options): this; ``` Defined in: [src/document.ts:3893](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3893) Adds a free-text annotation to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`FreeTextAnnotationOptions`](../interfaces/FreeTextAnnotationOptions.md) | Options that control the operation. | #### Returns `this` *** ### gif() ```ts gif(data, options): this; ``` Defined in: [src/document.ts:3707](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3707) Adds a GIF image to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`GifImageOptions`](../interfaces/GifImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### highlight() ```ts highlight(options): this; ``` Defined in: [src/document.ts:3768](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3768) Adds a highlight annotation to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`HighlightAnnotationOptions`](../interfaces/HighlightAnnotationOptions.md) | Options that control the operation. | #### Returns `this` *** ### image() ```ts image(data, options): this; ``` Defined in: [src/document.ts:3618](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3618) Adds a raster image, auto-detecting the format (PNG, JPEG, GIF, BMP, TIFF, WebP, JPEG 2000) from the data. For SVG use [svg](#svg). #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The image bytes. | | `options` | [`JpegImageOptions`](../interfaces/JpegImageOptions.md) | Placement and tagging options. | #### Returns `this` *** ### jbig2() ```ts jbig2(data, options): this; ``` Defined in: [src/document.ts:3663](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3663) Adds a JBIG2 image to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`Jbig2ImageOptions`](../interfaces/Jbig2ImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### jp2() ```ts jp2(data, options): this; ``` Defined in: [src/document.ts:3685](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3685) Adds a JPEG 2000 image to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`Jp2ImageOptions`](../interfaces/Jp2ImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### jpeg() ```ts jpeg(data, options): this; ``` Defined in: [src/document.ts:3630](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3630) Adds a JPEG image to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`JpegImageOptions`](../interfaces/JpegImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### line() ```ts line( x1, y1, x2, y2, style?): this; ``` Defined in: [src/document.ts:3578](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3578) Draws a straight line between two points. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `x1` | `number` | Start x in PDF points. | | `y1` | `number` | Start y in PDF points. | | `x2` | `number` | End x in PDF points. | | `y2` | `number` | End y in PDF points. | | `style?` | [`ShapeStyle`](../interfaces/ShapeStyle.md) | Stroke styling. | #### Returns `this` *** ### link() ```ts link(url, options): this; ``` Defined in: [src/document.ts:3730](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3730) Adds a URI link annotation to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `url` | `string` | The URI target. | | `options` | [`UriLinkOptions`](../interfaces/UriLinkOptions.md) | Options that control the operation. | #### Returns `this` *** ### linkToPage() ```ts linkToPage(target, options): this; ``` Defined in: [src/document.ts:3742](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3742) Adds an internal page link annotation. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `target` | `PdfPage` | The destination page, outline target, or structure element. | | `options` | [`PageLinkOptions`](../interfaces/PageLinkOptions.md) | Options that control the operation. | #### Returns `this` *** ### list() ```ts list(items, options): this; ``` Defined in: [src/document.ts:3365](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3365) Adds a tagged list to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `items` | readonly [`ListItem`](../type-aliases/ListItem.md)\[] | The list items to add. | | `options` | [`ListOptions`](../interfaces/ListOptions.md) | Options that control the operation. | #### Returns `this` *** ### note() ```ts note(options): this; ``` Defined in: [src/document.ts:3868](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3868) Adds a text note annotation to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`NoteAnnotationOptions`](../interfaces/NoteAnnotationOptions.md) | Options that control the operation. | #### Returns `this` *** ### path() ```ts path(commands, style): this; ``` Defined in: [src/document.ts:3545](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3545) Adds vector path commands to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `commands` | [`PathCommand`](../type-aliases/PathCommand.md)\[] | The vector path commands to add. | | `style` | [`PathStyle`](../interfaces/PathStyle.md) | The drawing style for the path. | #### Returns `this` *** ### placeText() ```ts placeText(text, options): PlacedTextResult; ``` Defined in: [src/document.ts:3336](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3336) Draws a single line of text and returns its measured size plus `endY` — the y where the next element can start. Unlike [text](#placetext) (which chains), this returns layout feedback for manual stacking. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to draw. | | `options` | [`TextOptions`](../interfaces/TextOptions.md) | Text options. | #### Returns [`PlacedTextResult`](../interfaces/PlacedTextResult.md) `{ width, height, endY }` in PDF points. *** ### placeTextBlock() ```ts placeTextBlock(text, options): PlacedTextBlockResult; ``` Defined in: [src/document.ts:3352](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3352) Draws a wrapped text block and returns its measured size, line count, and `endY` — the y just below the block, for stacking the next element. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to wrap and draw. | | `options` | [`TextBlockOptions`](../interfaces/TextBlockOptions.md) | Text block options. | #### Returns [`PlacedTextBlockResult`](../interfaces/PlacedTextBlockResult.md) `{ width, height, lineCount, endY }` in PDF points. *** ### png() ```ts png(data, options): this; ``` Defined in: [src/document.ts:3641](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3641) Adds a PNG image to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`PngImageOptions`](../interfaces/PngImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### pushButton() ```ts pushButton(name, options): this; ``` Defined in: [src/document.ts:4074](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4074) Adds a push-button form field to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The name to assign or look up. | | `options` | [`PushButtonOptions`](../interfaces/PushButtonOptions.md) | Options that control the operation. | #### Returns `this` *** ### radioGroup() ```ts radioGroup(name, options): this; ``` Defined in: [src/document.ts:4043](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4043) Adds a radio-button group to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The name to assign or look up. | | `options` | [`RadioGroupOptions`](../interfaces/RadioGroupOptions.md) | Options that control the operation. | #### Returns `this` *** ### rect() ```ts rect( x, y, width, height, style?): this; ``` Defined in: [src/document.ts:3565](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3565) Draws a rectangle. Convenience wrapper over [path](#path). #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `x` | `number` | Left edge in PDF points. | | `y` | `number` | Bottom edge in PDF points. | | `width` | `number` | Width in PDF points. | | `height` | `number` | Height in PDF points. | | `style?` | [`ShapeStyle`](../interfaces/ShapeStyle.md) | Fill/stroke styling. Stroked when omitted. | #### Returns `this` *** ### restoreState() ```ts restoreState(): this; ``` Defined in: [src/document.ts:4136](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4136) Restores the most recently saved graphics state. #### Returns `this` *** ### richText() ```ts richText(runs, options): this; ``` Defined in: [src/document.ts:3304](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3304) Adds a paragraph of inline rich-text runs. Each [InlineTextRun](../interfaces/InlineTextRun.md) carries its own style yet the runs flow on the same line and wrap together as one paragraph. Runs that omit a style inherit it from `options`, then from the document defaults; runs carrying a `link` become clickable. Supports left/center/right/justify alignment via `options.align`, line-level `direction` ("ltr"/"rtl"/"auto"), and `writingMode: "vertical"` (single column). In the flow and template layouts the paragraph wraps and splits across columns and pages. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `runs` | readonly [`InlineTextRun`](../interfaces/InlineTextRun.md)\[] | The styled inline runs to lay out together. | | `options` | [`RichTextOptions`](../interfaces/RichTextOptions.md) | Block geometry and inherited style defaults. | #### Returns `this` #### Example ```ts page.richText( [ { text: "Read the " }, { text: "terms", bold: true, link: "https://x.com/terms" }, { text: " before continuing." }, ], { x: 56, y: 700, width: 300, fontSize: 12 }, ); ``` *** ### rotate() ```ts rotate(degrees): this; ``` Defined in: [src/document.ts:4176](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4176) Adds a rotation transform to subsequent page operations. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `degrees` | `number` | The rotation angle in degrees. | #### Returns `this` *** ### saveState() ```ts saveState(): this; ``` Defined in: [src/document.ts:4127](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4127) Saves the current graphics state. #### Returns `this` *** ### scale() ```ts scale(x, y?): this; ``` Defined in: [src/document.ts:4166](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4166) Adds a scale transform to subsequent page operations. #### Parameters | Parameter | Type | Default value | Description | | ------ | ------ | ------ | ------ | | `x` | `number` | `undefined` | The horizontal transform value. | | `y` | `number` | `x` | The vertical transform value. | #### Returns `this` *** ### setExtGState() ```ts setExtGState(options): this; ``` Defined in: [src/document.ts:4208](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4208) Sets graphics-state parameters (alpha and/or blend mode) for subsequent painting operations. Emitted as an inline ExtGState entry referenced by the `gs` operator. Pair with [saveState](#savestate)/[restoreState](#restorestate) to scope the effect. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`ExtGStateOptions`](../interfaces/ExtGStateOptions.md) | Alpha and blend-mode options. | #### Returns `this` *** ### signatureField() ```ts signatureField(name, options): this; ``` Defined in: [src/document.ts:4102](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4102) Adds a signature form field placeholder to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The name to assign or look up. | | `options` | [`SignatureFieldOptions`](../interfaces/SignatureFieldOptions.md) | Options that control the operation. | #### Returns `this` *** ### squiggly() ```ts squiggly(options): this; ``` Defined in: [src/document.ts:3843](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3843) Adds a squiggly text-markup annotation to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`SquigglyAnnotationOptions`](../interfaces/SquigglyAnnotationOptions.md) | Options that control the operation. | #### Returns `this` *** ### strikeOut() ```ts strikeOut(options): this; ``` Defined in: [src/document.ts:3818](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3818) Adds a strike-out text-markup annotation to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`StrikeOutAnnotationOptions`](../interfaces/StrikeOutAnnotationOptions.md) | Options that control the operation. | #### Returns `this` *** ### structure() Creates a tagged structure container on the page. #### Param The replacement structure role. #### Param Either structure options or a build callback. #### Param An optional build callback when options are provided separately. #### Call Signature ```ts structure(role, build?): PdfStructureContainer; ``` Defined in: [src/document.ts:3467](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3467) Creates a tagged structure container on the page. ##### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `role` | | `string` & `object` | [`PdfStandardStructureTag`](../type-aliases/PdfStandardStructureTag.md) | The replacement structure role. | | `build?` | (`container`) => `void` | An optional callback that receives the created container. | ##### Returns [`PdfStructureContainer`](PdfStructureContainer.md) The created structure container. #### Call Signature ```ts structure( role, options?, build?): PdfStructureContainer; ``` Defined in: [src/document.ts:3480](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3480) Creates a tagged structure container on the page. ##### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `role` | | `string` & `object` | [`PdfStandardStructureTag`](../type-aliases/PdfStandardStructureTag.md) | The replacement structure role. | | `options?` | [`PdfStructureOptions`](../interfaces/PdfStructureOptions.md) | Options that control the operation. | | `build?` | (`container`) => `void` | An optional callback that receives the created container. | ##### Returns [`PdfStructureContainer`](PdfStructureContainer.md) The created structure container. *** ### svg() ```ts svg(data, options): this; ``` Defined in: [src/document.ts:3718](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3718) Adds an SVG graphic to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | `string` | [`BinaryData`](../type-aliases/BinaryData.md) | The SVG text data. | | `options` | [`SvgImageOptions`](../interfaces/SvgImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### table() ```ts table(rows, options): this; ``` Defined in: [src/document.ts:3385](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3385) Adds a tagged table to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `rows` | readonly [`TableRow`](../type-aliases/TableRow.md)\[] | The table rows to add. | | `options` | [`TableOptions`](../interfaces/TableOptions.md) | Options that control the operation. | #### Returns `this` *** ### text() ```ts text(text, options): this; ``` Defined in: [src/document.ts:3260](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3260) Adds text to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to add. | | `options` | [`TextOptions`](../interfaces/TextOptions.md) | Options that control the operation. | #### Returns `this` *** ### textBlock() ```ts textBlock(text, options): this; ``` Defined in: [src/document.ts:3272](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3272) Adds a multiline text block to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to add. | | `options` | [`TextBlockOptions`](../interfaces/TextBlockOptions.md) | Options that control the operation. | #### Returns `this` *** ### textField() ```ts textField(name, options): this; ``` Defined in: [src/document.ts:3959](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3959) Adds a text form field to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | The name to assign or look up. | | `options` | [`TextFieldOptions`](../interfaces/TextFieldOptions.md) | Options that control the operation. | #### Returns `this` *** ### tiff() ```ts tiff(data, options): this; ``` Defined in: [src/document.ts:3674](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3674) Adds a TIFF image to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`TiffImageOptions`](../interfaces/TiffImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### toInternalModel() ```ts toInternalModel(): InternalPageModel; ``` Defined in: [src/document.ts:4219](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4219) Returns the internal page model used by serializers and editors. #### Returns `InternalPageModel` The internal page model. *** ### transform() ```ts transform(matrix): this; ``` Defined in: [src/document.ts:4194](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4194) Adds a raw transformation matrix to subsequent page operations. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `matrix` | [`Transform`](../interfaces/Transform.md) | The transformation matrix to apply. | #### Returns `this` *** ### translate() ```ts translate(x, y): this; ``` Defined in: [src/document.ts:4155](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4155) Adds a translation transform to subsequent page operations. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `x` | `number` | The horizontal transform value. | | `y` | `number` | The vertical transform value. | #### Returns `this` *** ### underline() ```ts underline(options): this; ``` Defined in: [src/document.ts:3793](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3793) Adds an underline text-markup annotation to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`UnderlineAnnotationOptions`](../interfaces/UnderlineAnnotationOptions.md) | Options that control the operation. | #### Returns `this` *** ### webp() ```ts webp(data, options): this; ``` Defined in: [src/document.ts:3696](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L3696) Adds a WebP image to the page. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`WebpImageOptions`](../interfaces/WebpImageOptions.md) | Options that control the operation. | #### Returns `this` --- --- url: 'https://zeropdf.criston.dev/api/classes/PdfSoftMaskBuilder.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfSoftMaskBuilder # Class: PdfSoftMaskBuilder Defined in: [src/document.ts:4238](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4238) Sub-builder for the contents of a luminosity soft-mask Form XObject. Supports path operations only. ## Methods ### path() ```ts path(commands, style): void; ``` Defined in: [src/document.ts:4246](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4246) Adds a vector path to the soft-mask form. Painted regions whose luminosity is high (white) become opaque; black becomes transparent. #### Parameters | Parameter | Type | | ------ | ------ | | `commands` | readonly [`PathCommand`](../type-aliases/PathCommand.md)\[] | | `style` | [`PathStyle`](../interfaces/PathStyle.md) | #### Returns `void` *** ### restoreState() ```ts restoreState(): void; ``` Defined in: [src/document.ts:4258](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4258) Restores the most recently saved graphics state. #### Returns `void` *** ### saveState() ```ts saveState(): void; ``` Defined in: [src/document.ts:4253](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4253) Saves the current graphics state. #### Returns `void` *** ### transform() ```ts transform(matrix): void; ``` Defined in: [src/document.ts:4263](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L4263) Adds a transformation matrix. #### Parameters | Parameter | Type | | ------ | ------ | | `matrix` | [`Transform`](../interfaces/Transform.md) | #### Returns `void` --- --- url: 'https://zeropdf.criston.dev/api/classes/PdfStructureContainer.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfStructureContainer # Class: PdfStructureContainer Defined in: [src/document.ts:604](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L604) A builder for grouping tagged PDF content under a shared structure element. It can add text, blocks, lists, tables, images, and nested sections to the same semantic container. ## Constructors ### Constructor ```ts new PdfStructureContainer( page, embeddedFonts, node, fontFamilies?, textDefaults?): PdfStructureContainer; ``` Defined in: [src/document.ts:614](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L614) Creates a structure container bound to a page, embedded fonts, and parent structure node. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `page` | `InternalPageModel` | The internal page model to write into. | | `embeddedFonts` | `ReadonlyMap`<`string`, `ParsedTrueTypeFont`> | The embedded font registry used for text layout. | | `node` | `InternalStructureNode` | The parent structure node for tagged content. | | `fontFamilies` | `ReadonlyMap`<`string`, [`FontFamilyFaces`](../interfaces/FontFamilyFaces.md)> | Font families registered with the document. | | `textDefaults?` | [`TextDefaults`](../interfaces/TextDefaults.md) | Document-wide text defaults. | #### Returns `PdfStructureContainer` ## Methods ### bmp() ```ts bmp(data, options): this; ``` Defined in: [src/document.ts:730](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L730) Adds a tagged BMP image to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`BmpImageOptions`](../interfaces/BmpImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### circle() ```ts circle( cx, cy, radius, style?): this; ``` Defined in: [src/document.ts:844](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L844) Draws a circle. See [PdfPage.circle](PdfPage.md#circle). #### Parameters | Parameter | Type | | ------ | ------ | | `cx` | `number` | | `cy` | `number` | | `radius` | `number` | | `style?` | [`ShapeStyle`](../interfaces/ShapeStyle.md) | #### Returns `this` *** ### container() Creates a nested tagged structure container. #### Param The structure tag to create. #### Param Either structure options or a build callback. #### Param An optional build callback when options are provided separately. #### Call Signature ```ts container(tag, build?): PdfStructureContainer; ``` Defined in: [src/document.ts:872](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L872) Creates a nested tagged structure container. ##### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `tag` | [`PdfContainerTag`](../type-aliases/PdfContainerTag.md) | The structure tag to create. | | `build?` | (`container`) => `void` | An optional callback that receives the created container. | ##### Returns `PdfStructureContainer` The created structure container. #### Call Signature ```ts container( tag, options?, build?): PdfStructureContainer; ``` Defined in: [src/document.ts:885](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L885) Creates a nested tagged structure container. ##### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `tag` | [`PdfContainerTag`](../type-aliases/PdfContainerTag.md) | The structure tag to create. | | `options?` | [`PdfStructureOptions`](../interfaces/PdfStructureOptions.md) | Options that control the operation. | | `build?` | (`container`) => `void` | An optional callback that receives the created container. | ##### Returns `PdfStructureContainer` The created structure container. *** ### ellipse() ```ts ellipse( cx, cy, rx, ry, style?): this; ``` Defined in: [src/document.ts:851](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L851) Draws an ellipse. See [PdfPage.ellipse](PdfPage.md#ellipse). #### Parameters | Parameter | Type | | ------ | ------ | | `cx` | `number` | | `cy` | `number` | | `rx` | `number` | | `ry` | `number` | | `style?` | [`ShapeStyle`](../interfaces/ShapeStyle.md) | #### Returns `this` *** ### flow() ```ts flow(options?): PdfFlow; ``` Defined in: [src/document.ts:999](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L999) Creates a flow helper that writes into this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`FlowOptions`](../interfaces/FlowOptions.md) | Options that control the operation. | #### Returns [`PdfFlow`](PdfFlow.md) The created flow helper. *** ### gif() ```ts gif(data, options): this; ``` Defined in: [src/document.ts:785](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L785) Adds a tagged GIF image to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`GifImageOptions`](../interfaces/GifImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### image() ```ts image(data, options): this; ``` Defined in: [src/document.ts:819](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L819) Adds a raster image (auto-detecting the format) tagged under this container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The image bytes. | | `options` | [`JpegImageOptions`](../interfaces/JpegImageOptions.md) | Placement and tagging options. | #### Returns `this` *** ### jbig2() ```ts jbig2(data, options): this; ``` Defined in: [src/document.ts:741](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L741) Adds a tagged JBIG2 image to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`Jbig2ImageOptions`](../interfaces/Jbig2ImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### jp2() ```ts jp2(data, options): this; ``` Defined in: [src/document.ts:763](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L763) Adds a tagged JPEG 2000 image to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`Jp2ImageOptions`](../interfaces/Jp2ImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### jpeg() ```ts jpeg(data, options): this; ``` Defined in: [src/document.ts:708](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L708) Adds a tagged JPEG image to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`JpegImageOptions`](../interfaces/JpegImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### line() ```ts line( x1, y1, x2, y2, style?): this; ``` Defined in: [src/document.ts:834](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L834) Draws a straight line between two points. See [PdfPage.line](PdfPage.md#line). #### Parameters | Parameter | Type | | ------ | ------ | | `x1` | `number` | | `y1` | `number` | | `x2` | `number` | | `y2` | `number` | | `style?` | [`ShapeStyle`](../interfaces/ShapeStyle.md) | #### Returns `this` *** ### link() ```ts link(url, options): this; ``` Defined in: [src/document.ts:808](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L808) Adds a tagged URI link annotation to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `url` | `string` | The URI target. | | `options` | [`UriLinkOptions`](../interfaces/UriLinkOptions.md) | Options that control the operation. | #### Returns `this` *** ### list() ```ts list(items, options): this; ``` Defined in: [src/document.ts:664](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L664) Adds a tagged list to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `items` | readonly [`ListItem`](../type-aliases/ListItem.md)\[] | The list items to add. | | `options` | [`ListOptions`](../interfaces/ListOptions.md) | Options that control the operation. | #### Returns `this` *** ### path() ```ts path(commands, style): this; ``` Defined in: [src/document.ts:858](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L858) Adds vector path commands. Mirrors [PdfPage.path](PdfPage.md#path). #### Parameters | Parameter | Type | | ------ | ------ | | `commands` | [`PathCommand`](../type-aliases/PathCommand.md)\[] | | `style` | [`PathStyle`](../interfaces/PathStyle.md) | #### Returns `this` *** ### png() ```ts png(data, options): this; ``` Defined in: [src/document.ts:719](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L719) Adds a tagged PNG image to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`PngImageOptions`](../interfaces/PngImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### rect() ```ts rect( x, y, width, height, style?): this; ``` Defined in: [src/document.ts:827](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L827) Draws a rectangle. See [PdfPage.rect](PdfPage.md#rect). #### Parameters | Parameter | Type | | ------ | ------ | | `x` | `number` | | `y` | `number` | | `width` | `number` | | `height` | `number` | | `style?` | [`ShapeStyle`](../interfaces/ShapeStyle.md) | #### Returns `this` *** ### structure() Creates a nested tagged structure container. #### Param The replacement structure role. #### Param Either structure options or a build callback. #### Param An optional build callback when options are provided separately. #### Call Signature ```ts structure(role, build?): PdfStructureContainer; ``` Defined in: [src/document.ts:936](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L936) Creates a nested tagged structure container. ##### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `role` | | `string` & `object` | [`PdfStandardStructureTag`](../type-aliases/PdfStandardStructureTag.md) | The replacement structure role. | | `build?` | (`container`) => `void` | An optional callback that receives the created container. | ##### Returns `PdfStructureContainer` The created structure container. #### Call Signature ```ts structure( role, options?, build?): PdfStructureContainer; ``` Defined in: [src/document.ts:949](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L949) Creates a nested tagged structure container. ##### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `role` | | `string` & `object` | [`PdfStandardStructureTag`](../type-aliases/PdfStandardStructureTag.md) | The replacement structure role. | | `options?` | [`PdfStructureOptions`](../interfaces/PdfStructureOptions.md) | Options that control the operation. | | `build?` | (`container`) => `void` | An optional callback that receives the created container. | ##### Returns `PdfStructureContainer` The created structure container. *** ### svg() ```ts svg(data, options): this; ``` Defined in: [src/document.ts:796](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L796) Adds a tagged SVG graphic to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | `string` | [`BinaryData`](../type-aliases/BinaryData.md) | The SVG text data. | | `options` | [`SvgImageOptions`](../interfaces/SvgImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### table() ```ts table(rows, options): this; ``` Defined in: [src/document.ts:684](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L684) Adds a tagged table to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `rows` | readonly [`TableRow`](../type-aliases/TableRow.md)\[] | The table rows to add. | | `options` | [`TableOptions`](../interfaces/TableOptions.md) | Options that control the operation. | #### Returns `this` *** ### text() ```ts text(text, options): this; ``` Defined in: [src/document.ts:628](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L628) Adds tagged text to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to add. | | `options` | [`TextOptions`](../interfaces/TextOptions.md) | Options that control the operation. | #### Returns `this` *** ### textBlock() ```ts textBlock(text, options): this; ``` Defined in: [src/document.ts:646](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L646) Adds a tagged multiline text block to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text to add. | | `options` | [`TextBlockOptions`](../interfaces/TextBlockOptions.md) | Options that control the operation. | #### Returns `this` *** ### tiff() ```ts tiff(data, options): this; ``` Defined in: [src/document.ts:752](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L752) Adds a tagged TIFF image to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`TiffImageOptions`](../interfaces/TiffImageOptions.md) | Options that control the operation. | #### Returns `this` *** ### webp() ```ts webp(data, options): this; ``` Defined in: [src/document.ts:774](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L774) Adds a tagged WebP image to this structure container. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The binary image or font data. | | `options` | [`WebpImageOptions`](../interfaces/WebpImageOptions.md) | Options that control the operation. | #### Returns `this` --- --- url: 'https://zeropdf.criston.dev/api/classes/TempFileSink.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TempFileSink # Class: TempFileSink Defined in: [src/internal/byte-sink.ts:222](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L222) A byte sink that writes data to a temporary file, reducing memory pressure for very large documents. The temp file is automatically deleted on [close](#close) (or [dispose](#dispose)). ## Implements * [`ByteSink`](../interfaces/ByteSink.md) ## Constructors ### Constructor ```ts new TempFileSink(): TempFileSink; ``` Defined in: [src/internal/byte-sink.ts:230](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L230) Creates a TempFileSink backed by a temporary file. #### Returns `TempFileSink` ## Accessors ### path #### Get Signature ```ts get path(): string | null; ``` Defined in: [src/internal/byte-sink.ts:237](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L237) Returns the underlying file path once writing has started. ##### Returns `string` | `null` ## Methods ### close() ```ts close(): Promise; ``` Defined in: [src/internal/byte-sink.ts:267](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L267) Closes the write stream and deletes the temporary file. #### Returns `Promise`<`void`> #### Implementation of [`ByteSink`](../interfaces/ByteSink.md).[`close`](../interfaces/ByteSink.md#close) *** ### dispose() ```ts dispose(): Promise; ``` Defined in: [src/internal/byte-sink.ts:309](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L309) Deletes the temp file without closing the sink cleanly. #### Returns `Promise`<`void`> *** ### getBytes() ```ts getBytes(): Promise>; ``` Defined in: [src/internal/byte-sink.ts:294](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L294) Reads the temp file contents back into memory. The file must still be open (i.e. [close](#close) must not have been called yet). #### Returns `Promise`<`Uint8Array`<`ArrayBufferLike`>> The full temp file contents as a Uint8Array. *** ### write() ```ts write(chunk): Promise; ``` Defined in: [src/internal/byte-sink.ts:241](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L241) Writes a generated PDF byte chunk to the sink. #### Parameters | Parameter | Type | | ------ | ------ | | `chunk` | `Uint8Array` | #### Returns `Promise`<`void`> #### Implementation of [`ByteSink`](../interfaces/ByteSink.md).[`write`](../interfaces/ByteSink.md#write) --- --- url: 'https://zeropdf.criston.dev/api/classes/WebStreamSink.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / WebStreamSink # Class: WebStreamSink Defined in: [src/internal/byte-sink.ts:185](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L185) A byte sink adapter for writing generated PDF output to a Web WritableStream through its default writer. ## Implements * [`ByteSink`](../interfaces/ByteSink.md) ## Constructors ### Constructor ```ts new WebStreamSink(stream): WebStreamSink; ``` Defined in: [src/internal/byte-sink.ts:194](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L194) Creates a byte sink for a Web WritableStream. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `stream` | `WritableStream`<`Uint8Array`<`ArrayBufferLike`>> | The writable stream that receives byte chunks. | #### Returns `WebStreamSink` ## Methods ### close() ```ts close(): Promise; ``` Defined in: [src/internal/byte-sink.ts:211](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L211) Closes the stream writer. #### Returns `Promise`<`void`> #### Implementation of [`ByteSink`](../interfaces/ByteSink.md).[`close`](../interfaces/ByteSink.md#close) *** ### write() ```ts write(chunk): Promise; ``` Defined in: [src/internal/byte-sink.ts:203](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L203) Writes a byte chunk through the stream writer. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `chunk` | `Uint8Array` | The byte chunk to write. | #### Returns `Promise`<`void`> #### Implementation of [`ByteSink`](../interfaces/ByteSink.md).[`write`](../interfaces/ByteSink.md#write) --- --- url: 'https://zeropdf.criston.dev/api/interfaces/AttachmentOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / AttachmentOptions # Interface: AttachmentOptions Defined in: [src/types.ts:2815](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2815) Options that describe an embedded file attachment. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `description?` | `string` | Human-readable attachment description. | [src/types.ts:2817](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2817) | | `mimeType?` | `string` | MIME type associated with the attachment. | [src/types.ts:2819](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2819) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/BlockTextMetrics.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / BlockTextMetrics # Interface: BlockTextMetrics Defined in: [src/types.ts:1004](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1004) Measured size of a wrapped block of text. ## Extended by * [`PlacedTextBlockResult`](PlacedTextBlockResult.md) ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `height` | `number` | Total height in PDF points (line count × line height). | [src/types.ts:1008](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1008) | | `lineCount` | `number` | Number of lines after wrapping. | [src/types.ts:1010](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1010) | | `width` | `number` | Width of the longest rendered line in PDF points. | [src/types.ts:1006](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1006) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/BmpImageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / BmpImageOptions # Interface: BmpImageOptions Defined in: [src/types.ts:2152](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2152) Options for placing BMP images on a page. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `altText?` | `string` | Alternate text for tagged non-text content. | [src/types.ts:2162](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2162) | | `height` | `number` | Height in PDF points. | [src/types.ts:2160](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2160) | | `iccProfile?` | [`BinaryData`](../type-aliases/BinaryData.md) | ICC profile bytes used to tag the image's color space as ICCBased. | [src/types.ts:2170](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2170) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2166](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2166) | | `tag?` | | [`PdfFigureStructureTag`](../type-aliases/PdfFigureStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2164](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2164) | | `width` | `number` | Width in PDF points. | [src/types.ts:2158](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2158) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2154](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2154) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2156](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2156) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/BufferSinkOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / BufferSinkOptions # Interface: BufferSinkOptions Defined in: [src/internal/byte-sink.ts:35](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L35) An in-memory byte sink that collects streamed PDF output chunks and exposes them as a single Uint8Array when needed. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `maxSize?` | `readonly` | `number` | Maximum total bytes the sink will accept before throwing SINK\_FULL. | [src/internal/byte-sink.ts:37](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L37) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ByteSink.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ByteSink # Interface: ByteSink Defined in: [src/internal/byte-sink.ts:6](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L6) Streaming output contract implemented by sinks that receive generated PDF byte chunks. ## Methods ### close() ```ts close(): Promise; ``` Defined in: [src/internal/byte-sink.ts:10](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L10) Closes the sink after all chunks have been written. #### Returns `Promise`<`void`> *** ### write() ```ts write(chunk): Promise; ``` Defined in: [src/internal/byte-sink.ts:8](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L8) Writes a generated PDF byte chunk to the sink. #### Parameters | Parameter | Type | | ------ | ------ | | `chunk` | `Uint8Array` | #### Returns `Promise`<`void`> --- --- url: 'https://zeropdf.criston.dev/api/interfaces/CheckBoxOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / CheckBoxOptions # Interface: CheckBoxOptions Defined in: [src/types.ts:2569](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2569) Options for creating a checkbox form field widget. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [src/types.ts:2603](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2603) | | `appearance?` | | `string` | { `down?`: `string`; `normal?`: `string`; `rollover?`: `string`; } | Custom appearance stream for the checkbox. Can be a raw PDF content stream string (used for all states), or an object with optional normal (/N), down (/D), and rollover (/R) appearance strings. Example string: `"1 0 0 0 0 1 2 10 14 6 re s"` (a check mark at any size) | [src/types.ts:2598](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2598) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [src/types.ts:2579](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2579) | | `checked?` | `boolean` | Initial checkbox checked state. | [src/types.ts:2581](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2581) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [src/types.ts:2591](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2591) | | `height` | `number` | Height in PDF points. | [src/types.ts:2577](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2577) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [src/types.ts:2583](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2583) | | `required?` | `boolean` | Whether the form field is required. | [src/types.ts:2585](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2585) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2607](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2607) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2605](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2605) | | `width` | `number` | Width in PDF points. | [src/types.ts:2575](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2575) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2571](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2571) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2573](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2573) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ChoiceFieldOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ChoiceFieldOptions # Interface: ChoiceFieldOptions Defined in: [src/types.ts:2618](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2618) Options for creating a list box or combo box form field. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [src/types.ts:2666](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2666) | | `appearance?` | `string` | Custom appearance stream content for the choice field. Example: `"1 0 0 rg 0 0 100 20 re f"` | [src/types.ts:2661](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2661) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [src/types.ts:2638](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2638) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:2636](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2636) | | `editable?` | `boolean` | When true, the combo box allows user to type custom values. When false (default), combo box is select-only. Has no effect on list boxes. | [src/types.ts:2650](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2650) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [src/types.ts:2656](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2656) | | `font?` | [`FontName`](../type-aliases/FontName.md) | Font used to render text. | [src/types.ts:2632](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2632) | | `fontSize?` | `number` | Font size in PDF points. | [src/types.ts:2634](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2634) | | `height` | `number` | Height in PDF points. | [src/types.ts:2626](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2626) | | `mode?` | [`ChoiceFieldMode`](../type-aliases/ChoiceFieldMode.md) | Choice field display mode. | [src/types.ts:2644](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2644) | | `options` | `string`\[] | Options that control this item. | [src/types.ts:2628](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2628) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [src/types.ts:2640](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2640) | | `required?` | `boolean` | Whether the form field is required. | [src/types.ts:2642](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2642) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2670](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2670) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2668](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2668) | | `value?` | `string` | Current or default value for the option. | [src/types.ts:2630](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2630) | | `width` | `number` | Width in PDF points. | [src/types.ts:2624](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2624) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2620](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2620) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2622](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2622) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ClosePathCommand.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ClosePathCommand # Interface: ClosePathCommand Defined in: [src/types.ts:2983](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2983) Vector path command that closes the current subpath. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `type` | `"closePath"` | Discriminator identifying this option or command shape. | [src/types.ts:2985](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2985) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/CmykColor.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / CmykColor # Interface: CmykColor Defined in: [src/types.ts:639](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L639) CMYK color representation used by drawing and text APIs. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `c` | `number` | Cyan channel value normalized from 0 to 1. | [src/types.ts:643](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L643) | | `k` | `number` | Key/black channel value normalized from 0 to 1. | [src/types.ts:649](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L649) | | `kind` | `"cmyk"` | Discriminator identifying this value shape. | [src/types.ts:641](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L641) | | `m` | `number` | Magenta channel value normalized from 0 to 1. | [src/types.ts:645](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L645) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:647](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L647) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/CurveToCommand.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / CurveToCommand # Interface: CurveToCommand Defined in: [src/types.ts:2947](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2947) Vector path command for drawing a cubic Bezier curve. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `type` | `"curveTo"` | Discriminator identifying this option or command shape. | [src/types.ts:2949](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2949) | | `x1` | `number` | First Bezier control point x-coordinate. | [src/types.ts:2951](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2951) | | `x2` | `number` | Second Bezier control point x-coordinate. | [src/types.ts:2955](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2955) | | `x3` | `number` | Ending point x-coordinate. | [src/types.ts:2959](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2959) | | `y1` | `number` | First Bezier control point y-coordinate. | [src/types.ts:2953](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2953) | | `y2` | `number` | Second Bezier control point y-coordinate. | [src/types.ts:2957](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2957) | | `y3` | `number` | Ending point y-coordinate. | [src/types.ts:2961](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2961) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/CustomPageSize.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / CustomPageSize # Interface: CustomPageSize Defined in: [src/types.ts:122](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L122) Explicit PDF page dimensions in points. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `height` | `number` | Height in PDF points. | [src/types.ts:126](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L126) | | `width` | `number` | Width in PDF points. | [src/types.ts:124](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L124) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/DeviceNColor.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / DeviceNColor # Interface: DeviceNColor Defined in: [src/types.ts:682](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L682) DeviceN (multi-ink spot color) color representation. Emitted as a DeviceN color space; each tint maps through a Type-2 exponential into the alternate process color at full mix. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `alternate` | [`ProcessColor`](../type-aliases/ProcessColor.md) | Process-color value when all channels are at full tint. | [src/types.ts:690](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L690) | | `kind` | `"deviceN"` | Discriminator identifying this value shape. | [src/types.ts:684](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L684) | | `names` | readonly `string`\[] | One ink name per channel. | [src/types.ts:686](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L686) | | `tints` | readonly `number`\[] | Tint per channel (0..1), one entry per name. | [src/types.ts:688](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L688) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/DocumentEncryptionOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / DocumentEncryptionOptions # Interface: DocumentEncryptionOptions Defined in: [src/types.ts:374](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L374) Password and permission options for encrypting a generated document. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `algorithm?` | [`DocumentEncryptionAlgorithm`](../type-aliases/DocumentEncryptionAlgorithm.md) | Encryption algorithm to use when writing encrypted output. | [src/types.ts:382](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L382) | | `encryptMetadata?` | `boolean` | Whether to encrypt the metadata stream. Defaults to true. When false, the metadata stream is left unencrypted. | [src/types.ts:384](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L384) | | `ownerPassword?` | `string` | Password used to grant owner-level permissions. | [src/types.ts:378](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L378) | | `permissions?` | [`DocumentPermissions`](DocumentPermissions.md) | Permission flags applied to encrypted output. | [src/types.ts:380](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L380) | | `userPassword?` | `string` | Password required to open the document. | [src/types.ts:376](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L376) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/DocumentInfo.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / DocumentInfo # Interface: DocumentInfo Defined in: [src/types.ts:137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L137) Document information dictionary metadata such as title, author, subject, and dates. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `author?` | `string` | Document author name. | [src/types.ts:141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L141) | | `creationDate?` | `string` | `Date` | Document creation date. | [src/types.ts:151](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L151) | | `creator?` | `string` | Application or person that created the document. | [src/types.ts:147](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L147) | | `keywords?` | `string` | `string`\[] | Document keywords for search and metadata. | [src/types.ts:145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L145) | | `modificationDate?` | `string` | `Date` | Document modification date. | [src/types.ts:153](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L153) | | `producer?` | `string` | PDF producer value recorded in metadata. | [src/types.ts:149](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L149) | | `subject?` | `string` | Document subject or summary. | [src/types.ts:143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L143) | | `title?` | `string` | Document title or display title. | [src/types.ts:139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L139) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/DocumentOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / DocumentOptions # Interface: DocumentOptions Defined in: [src/types.ts:450](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L450) ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `compress?` | `boolean` | Whether eligible streams are compressed with FlateDecode. | [src/types.ts:480](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L480) | | `conformance?` | [`DocumentConformanceProfile`](../type-aliases/DocumentConformanceProfile.md) | PDF/A or PDF/UA conformance profile to validate and emit. | [src/types.ts:478](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L478) | | `defaultPageSize?` | [`PageSize`](../type-aliases/PageSize.md) | Page size used when a page does not specify its own size. | [src/types.ts:454](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L454) | | `defaults?` | [`TextDefaults`](TextDefaults.md) | Document-wide text defaults filled in when a text call omits them. | [src/types.ts:456](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L456) | | `encryption?` | [`DocumentEncryptionOptions`](DocumentEncryptionOptions.md) | Password encryption settings for serialized output. | [src/types.ts:468](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L468) | | `info?` | [`DocumentInfo`](DocumentInfo.md) | Document information dictionary values. | [src/types.ts:464](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L464) | | `language?` | `string` | BCP 47 language tag for document or structure content. | [src/types.ts:470](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L470) | | `linearize?` | `boolean` | **`Experimental`** Whether to emit a linearization dictionary for Fast Web View style delivery. — limited to single-page unencrypted documents. Not compatible with object streams, encryption, or detached signatures. | [src/types.ts:489](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L489) | | `objectStreams?` | `boolean` | Whether to emit compressed object streams and xref streams. | [src/types.ts:482](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L482) | | `outputIntent?` | [`DocumentOutputIntentOptions`](DocumentOutputIntentOptions.md) | ICC output intent required by color-managed profiles such as PDF/A. | [src/types.ts:491](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L491) | | `roleMap?` | [`PdfRoleMap`](../type-aliases/PdfRoleMap.md) | Mapping from custom structure roles to standard PDF roles. | [src/types.ts:474](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L474) | | `shapeDefaults?` | [`ShapeStyle`](ShapeStyle.md) | Document-wide default styling for the [PdfPage](../classes/PdfPage.md) shape helpers (`rect`, `line`, `circle`, `ellipse`). Per-call [ShapeStyle](ShapeStyle.md) fields override these. | [src/types.ts:462](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L462) | | `signature?` | [`DocumentSignatureOptions`](DocumentSignatureOptions.md) | Detached digital-signature options for serialized output. | [src/types.ts:493](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L493) | | `structureRoot?` | `false` | [`PdfContainerTag`](../type-aliases/PdfContainerTag.md) | Root structure tag to emit, or false to suppress a custom root. | [src/types.ts:476](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L476) | | `tagged?` | `boolean` | Whether to emit tagged PDF structure metadata. | [src/types.ts:472](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L472) | | `textShaper?` | [`TextShaper`](TextShaper.md) | Custom text shaper for complex script shaping (Devanagari, Arabic, Thai, etc.). When provided, the shaper is called for each text run that requires shaping. If not provided, the default shaper handles basic ligature and joining-form substitution but will throw an UNSUPPORTED\_SCRIPT error for Devanagari and other complex scripts. External shapers such as harfbuzzjs or fontkit can be plugged in to enable full shaping support. | [src/types.ts:502](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L502) | | `title?` | `string` | Document title applied to the information dictionary, structured XMP metadata, and display-title viewer preference. | [src/types.ts:452](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L452) | | `xmpMetadata?` | [`XmpMetadataInput`](../type-aliases/XmpMetadataInput.md) | XMP metadata packet or structured XMP metadata input. | [src/types.ts:466](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L466) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/DocumentOutputIntentOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / DocumentOutputIntentOptions # Interface: DocumentOutputIntentOptions Defined in: [src/types.ts:390](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L390) ICC output profile options for generated documents. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `alternate?` | `"DeviceRGB"` | `"DeviceCMYK"` | `"DeviceGray"` | Fallback device color space for the ICC profile. | [src/types.ts:400](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L400) | | `channels?` | `1` | `4` | `3` | Number of color channels in the ICC profile. | [src/types.ts:402](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L402) | | `info?` | `string` | Document information dictionary values. | [src/types.ts:396](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L396) | | `outputConditionIdentifier?` | `string` | Output condition identifier recorded in the output intent. | [src/types.ts:394](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L394) | | `profile` | [`BinaryData`](../type-aliases/BinaryData.md) | ICC profile bytes for the output intent. | [src/types.ts:392](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L392) | | `registryName?` | `string` | Output intent registry name. | [src/types.ts:398](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L398) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/DocumentPermissions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / DocumentPermissions # Interface: DocumentPermissions Defined in: [src/types.ts:186](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L186) Permission flags used when creating an encrypted PDF. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `accessibility?` | `boolean` | Whether text/graphics extraction for accessibility is permitted (bit 3). | [src/types.ts:196](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L196) | | `annotating?` | `boolean` | Whether annotation and form editing is permitted for encrypted output. | [src/types.ts:194](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L194) | | `assemble?` | `boolean` | Whether document assembly (insert/rotate/delete pages) is permitted (bit 9). | [src/types.ts:198](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L198) | | `copying?` | `boolean` | Whether text and graphics copying is permitted for encrypted output. | [src/types.ts:192](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L192) | | `fillForms?` | `boolean` | Whether filling in form fields is permitted (bit 12). | [src/types.ts:202](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L202) | | `highQualityPrint?` | `boolean` | Whether high-quality printing is permitted (bit 10). | [src/types.ts:200](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L200) | | `modifying?` | `boolean` | Whether document modification is permitted for encrypted output. | [src/types.ts:190](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L190) | | `printing?` | `boolean` | Whether printing is permitted for encrypted output. | [src/types.ts:188](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L188) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/DocumentSignatureOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / DocumentSignatureOptions # Interface: DocumentSignatureOptions Defined in: [src/types.ts:408](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L408) Detached digital-signature options for generated documents. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `contactInfo?` | `string` | Signer contact information recorded in the signature dictionary. | [src/types.ts:416](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L416) | | `fieldName?` | `string` | Signature form field name. | [src/types.ts:410](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L410) | | `location?` | `string` | Signing location recorded in the signature dictionary. | [src/types.ts:414](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L414) | | `name?` | `string` | Name of the item, field, destination, or signer. | [src/types.ts:418](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L418) | | `placeholderBytes?` | `number` | Reserved byte length for the serialized signature contents. | [src/types.ts:420](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L420) | | `reason?` | `string` | Reason string recorded in the signature dictionary. | [src/types.ts:412](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L412) | | `sign` | (`bytes`) => `Uint8Array` | Callback that returns CMS/PKCS#7 signature bytes for the prepared PDF byte range. | [src/types.ts:422](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L422) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/EmbedTrueTypeFontOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / EmbedTrueTypeFontOptions # Interface: EmbedTrueTypeFontOptions Defined in: [src/types.ts:508](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L508) Options used when registering a TrueType font with a document. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `family?` | `string` | Family. | [src/types.ts:510](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L510) | | `ttcIndex?` | `number` | Index of the font to extract from a TrueType Collection (.ttc). Defaults to 0. | [src/types.ts:512](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L512) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ExtGStateOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ExtGStateOptions # Interface: ExtGStateOptions Defined in: [src/types.ts:720](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L720) Graphics-state parameters for fill/stroke alpha and blend mode. Emitted as an inline ExtGState entry referenced by the `gs` operator. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `blendMode?` | [`PdfBlendMode`](../type-aliases/PdfBlendMode.md) | Blend mode applied to subsequent painting operations. Maps to /BM. | [src/types.ts:726](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L726) | | `fillAlpha?` | `number` | Non-stroking (fill) alpha constant (0..1). Maps to /ca. | [src/types.ts:724](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L724) | | `softMask?` | [`SoftMaskHandle`](SoftMaskHandle.md) | `null` | Soft mask reference. When provided, /SMask in the ExtGState references a Form XObject built via [PdfDocument.createLuminositySoftMask](../classes/PdfDocument.md#createluminositysoftmask). Pass `null` to set /SMask /None (clearing any active mask). | [src/types.ts:732](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L732) | | `strokeAlpha?` | `number` | Stroking alpha constant (0..1). Maps to /CA. | [src/types.ts:722](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L722) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ExtractTextOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ExtractTextOptions # Interface: ExtractTextOptions Defined in: [src/parser.ts:54](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L54) Options for [ParsedPdfDocument.extractText](../classes/ParsedPdfDocument.md#extracttext). ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `readingOrder?` | `readonly` | `"structure"` | `"stream"` | Reading order strategy: - "stream" (default): runs in content-stream order - "structure": runs reordered to match StructTree traversal via MCID; runs without MCID are appended in stream order at the end | [src/parser.ts:61](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L61) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FieldActions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FieldActions # Interface: FieldActions Defined in: [src/types.ts:2498](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2498) JavaScript actions attached to a form field. Key mapping (ISO 32000-2 Table 217): * keystroke → /K (Keystroke action) * format → /F (Format action) * validate → /V (Validate action) * calculate → /C (Calculate action) Each string is raw PDF JavaScript source code. The library emits each non-null action as a PDF stream object referenced from the /AA dictionary on the field annotation. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `calculate?` | `string` | Calculate JS → /C in the /AA dict. | [src/types.ts:2506](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2506) | | `format?` | `string` | Format JS → /F in the /AA dict. | [src/types.ts:2502](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2502) | | `keystroke?` | `string` | Keystroke JS → /K in the /AA dict. | [src/types.ts:2500](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2500) | | `validate?` | `string` | Validate JS → /V in the /AA dict. | [src/types.ts:2504](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2504) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FillStyle.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FillStyle # Interface: FillStyle Defined in: [src/types.ts:2855](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2855) Fill styling for vector paths. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:2857](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2857) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowBlockSpacingOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowBlockSpacingOptions # Interface: FlowBlockSpacingOptions Defined in: [src/types.ts:1135](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1135) Per-block margin options for flow-authored content. ## Extended by * [`FlowCheckBoxOptions`](FlowCheckBoxOptions.md) * [`FlowChoiceFieldOptions`](FlowChoiceFieldOptions.md) * [`FlowFreeTextOptions`](FlowFreeTextOptions.md) * [`FlowHighlightOptions`](FlowHighlightOptions.md) * [`FlowListOptions`](FlowListOptions.md) * [`FlowNoteOptions`](FlowNoteOptions.md) * [`FlowPushButtonOptions`](FlowPushButtonOptions.md) * [`FlowRadioGroupOptions`](FlowRadioGroupOptions.md) * [`FlowSignatureFieldOptions`](FlowSignatureFieldOptions.md) * [`FlowTextFieldOptions`](FlowTextFieldOptions.md) * [`FlowImageOptions`](FlowImageOptions.md) * [`FlowLinkOptions`](FlowLinkOptions.md) * [`FlowRichTextOptions`](FlowRichTextOptions.md) * [`FlowTableOptions`](FlowTableOptions.md) * [`FlowTextOptions`](FlowTextOptions.md) ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowCheckBoxOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowCheckBoxOptions # Interface: FlowCheckBoxOptions Defined in: [src/types.ts:1253](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1253) Options for placing a checkbox form field through the flow layout API. ## Extends * `Omit`<[`CheckBoxOptions`](CheckBoxOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [`CheckBoxOptions`](CheckBoxOptions.md).[`actions`](CheckBoxOptions.md#property-actions) | [src/types.ts:2603](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2603) | | `appearance?` | | `string` | { `down?`: `string`; `normal?`: `string`; `rollover?`: `string`; } | Custom appearance stream for the checkbox. Can be a raw PDF content stream string (used for all states), or an object with optional normal (/N), down (/D), and rollover (/R) appearance strings. Example string: `"1 0 0 0 0 1 2 10 14 6 re s"` (a check mark at any size) | [`CheckBoxOptions`](CheckBoxOptions.md).[`appearance`](CheckBoxOptions.md#property-appearance) | [src/types.ts:2598](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2598) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [`CheckBoxOptions`](CheckBoxOptions.md).[`borderWidth`](CheckBoxOptions.md#property-borderwidth) | [src/types.ts:2579](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2579) | | `checked?` | `boolean` | Initial checkbox checked state. | [`CheckBoxOptions`](CheckBoxOptions.md).[`checked`](CheckBoxOptions.md#property-checked) | [src/types.ts:2581](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2581) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [`CheckBoxOptions`](CheckBoxOptions.md).[`encrypt`](CheckBoxOptions.md#property-encrypt) | [src/types.ts:2591](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2591) | | `height` | `number` | Height in PDF points. | [`CheckBoxOptions`](CheckBoxOptions.md).[`height`](CheckBoxOptions.md#property-height) | [src/types.ts:2577](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2577) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [`CheckBoxOptions`](CheckBoxOptions.md).[`readOnly`](CheckBoxOptions.md#property-readonly) | [src/types.ts:2583](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2583) | | `required?` | `boolean` | Whether the form field is required. | [`CheckBoxOptions`](CheckBoxOptions.md).[`required`](CheckBoxOptions.md#property-required) | [src/types.ts:2585](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2585) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`CheckBoxOptions`](CheckBoxOptions.md).[`structure`](CheckBoxOptions.md#property-structure) | [src/types.ts:2607](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2607) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [`CheckBoxOptions`](CheckBoxOptions.md).[`tag`](CheckBoxOptions.md#property-tag) | [src/types.ts:2605](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2605) | | `width?` | `number` | Width override in PDF points. | - | [src/types.ts:1260](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1260) | | `x?` | `number` | Horizontal position override in PDF points. | - | [src/types.ts:1256](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1256) | | `y?` | `number` | Vertical position override in PDF points. | - | [src/types.ts:1258](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1258) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowChoiceFieldOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowChoiceFieldOptions # Interface: FlowChoiceFieldOptions Defined in: [src/types.ts:1266](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1266) Options for placing a choice form field through the flow layout API. ## Extends * `Omit`<[`ChoiceFieldOptions`](ChoiceFieldOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`actions`](ChoiceFieldOptions.md#property-actions) | [src/types.ts:2666](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2666) | | `appearance?` | `string` | Custom appearance stream content for the choice field. Example: `"1 0 0 rg 0 0 100 20 re f"` | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`appearance`](ChoiceFieldOptions.md#property-appearance) | [src/types.ts:2661](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2661) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`borderWidth`](ChoiceFieldOptions.md#property-borderwidth) | [src/types.ts:2638](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2638) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`color`](ChoiceFieldOptions.md#property-color) | [src/types.ts:2636](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2636) | | `editable?` | `boolean` | When true, the combo box allows user to type custom values. When false (default), combo box is select-only. Has no effect on list boxes. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`editable`](ChoiceFieldOptions.md#property-editable) | [src/types.ts:2650](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2650) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`encrypt`](ChoiceFieldOptions.md#property-encrypt) | [src/types.ts:2656](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2656) | | `font?` | [`FontName`](../type-aliases/FontName.md) | Font used to render text. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`font`](ChoiceFieldOptions.md#property-font) | [src/types.ts:2632](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2632) | | `fontSize?` | `number` | Font size in PDF points. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`fontSize`](ChoiceFieldOptions.md#property-fontsize) | [src/types.ts:2634](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2634) | | `height` | `number` | Height in PDF points. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`height`](ChoiceFieldOptions.md#property-height) | [src/types.ts:2626](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2626) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `mode?` | [`ChoiceFieldMode`](../type-aliases/ChoiceFieldMode.md) | Choice field display mode. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`mode`](ChoiceFieldOptions.md#property-mode) | [src/types.ts:2644](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2644) | | `options` | `string`\[] | Options that control this item. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`options`](ChoiceFieldOptions.md#property-options) | [src/types.ts:2628](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2628) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`readOnly`](ChoiceFieldOptions.md#property-readonly) | [src/types.ts:2640](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2640) | | `required?` | `boolean` | Whether the form field is required. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`required`](ChoiceFieldOptions.md#property-required) | [src/types.ts:2642](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2642) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`structure`](ChoiceFieldOptions.md#property-structure) | [src/types.ts:2670](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2670) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`tag`](ChoiceFieldOptions.md#property-tag) | [src/types.ts:2668](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2668) | | `value?` | `string` | Current or default value for the option. | [`ChoiceFieldOptions`](ChoiceFieldOptions.md).[`value`](ChoiceFieldOptions.md#property-value) | [src/types.ts:2630](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2630) | | `width?` | `number` | Width override in PDF points. | - | [src/types.ts:1273](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1273) | | `x?` | `number` | Horizontal position override in PDF points. | - | [src/types.ts:1269](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1269) | | `y?` | `number` | Vertical position override in PDF points. | - | [src/types.ts:1271](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1271) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowColumnsOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowColumnsOptions # Interface: FlowColumnsOptions Defined in: [src/types.ts:1037](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1037) Newspaper-style column layout options for flow and template pages. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `count` | `number` | Number of columns in the flow frame. Defaults to 1 when omitted. | [src/types.ts:1039](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1039) | | `gap?` | `number` | Gap between columns in PDF points. Defaults to 18 when omitted. | [src/types.ts:1041](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1041) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowFreeTextOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowFreeTextOptions # Interface: FlowFreeTextOptions Defined in: [src/types.ts:1339](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1339) Options for placing a free-text annotation through the flow layout API. ## Extends * `Omit`<[`FreeTextAnnotationOptions`](FreeTextAnnotationOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [`FreeTextAnnotationOptions`](FreeTextAnnotationOptions.md).[`borderWidth`](FreeTextAnnotationOptions.md#property-borderwidth) | [src/types.ts:2478](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2478) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [`FreeTextAnnotationOptions`](FreeTextAnnotationOptions.md).[`color`](FreeTextAnnotationOptions.md#property-color) | [src/types.ts:2476](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2476) | | `font?` | [`FontName`](../type-aliases/FontName.md) | Font used to render text. | [`FreeTextAnnotationOptions`](FreeTextAnnotationOptions.md).[`font`](FreeTextAnnotationOptions.md#property-font) | [src/types.ts:2472](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2472) | | `fontSize?` | `number` | Font size in PDF points. | [`FreeTextAnnotationOptions`](FreeTextAnnotationOptions.md).[`fontSize`](FreeTextAnnotationOptions.md#property-fontsize) | [src/types.ts:2474](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2474) | | `height` | `number` | Height in PDF points. | [`FreeTextAnnotationOptions`](FreeTextAnnotationOptions.md).[`height`](FreeTextAnnotationOptions.md#property-height) | [src/types.ts:2468](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2468) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`FreeTextAnnotationOptions`](FreeTextAnnotationOptions.md).[`structure`](FreeTextAnnotationOptions.md#property-structure) | [src/types.ts:2482](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2482) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [`FreeTextAnnotationOptions`](FreeTextAnnotationOptions.md).[`tag`](FreeTextAnnotationOptions.md#property-tag) | [src/types.ts:2480](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2480) | | `text` | `string` | Text content to render or inspect. | [`FreeTextAnnotationOptions`](FreeTextAnnotationOptions.md).[`text`](FreeTextAnnotationOptions.md#property-text) | [src/types.ts:2470](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2470) | | `width?` | `number` | Width override in PDF points. | - | [src/types.ts:1346](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1346) | | `x?` | `number` | Horizontal position override in PDF points. | - | [src/types.ts:1342](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1342) | | `y?` | `number` | Vertical position override in PDF points. | - | [src/types.ts:1344](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1344) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowHeadingOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowHeadingOptions # Interface: FlowHeadingOptions Defined in: [src/types.ts:1162](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1162) Flow text options plus heading-level configuration. ## Extends * [`FlowTextOptions`](FlowTextOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `align?` | [`TextAlign`](../type-aliases/TextAlign.md) | Horizontal alignment for laid-out content. | [`TextBlockOptions`](TextBlockOptions.md).[`align`](TextBlockOptions.md#property-align) | [src/types.ts:871](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L871) | | `blockAlign?` | `"left"` | `"center"` | `"right"` | Alignment of the block inside the flow column. | `FlowHeadingOptions`.[`blockAlign`](#property-blockalign) | [src/types.ts:1156](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1156) | | `blockWidth?` | `number` | Optional width for the flow text block within the flow column. | `FlowHeadingOptions`.[`blockWidth`](#property-blockwidth) | [src/types.ts:1154](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1154) | | `bold?` | `boolean` | Selects the bold variant of `font`. See [TextOptions.bold](TextOptions.md#property-bold). | [`TextBlockOptions`](TextBlockOptions.md).[`bold`](TextBlockOptions.md#property-bold) | [src/types.ts:849](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L849) | | `characterSpacing?` | `number` | Additional spacing between characters in PDF points. | [`TextBlockOptions`](TextBlockOptions.md).[`characterSpacing`](TextBlockOptions.md#property-characterspacing) | [src/types.ts:865](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L865) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [`TextBlockOptions`](TextBlockOptions.md).[`color`](TextBlockOptions.md#property-color) | [src/types.ts:863](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L863) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | [`TextBlockOptions`](TextBlockOptions.md).[`direction`](TextBlockOptions.md#property-direction) | [src/types.ts:859](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L859) | | `encoding?` | `"winansi"` | `"macroman"` | `"pdfdoc"` | Built-in font encoding. When set, the font dictionary emits an /Encoding entry with the specified encoding (e.g. /WinAnsiEncoding). When undefined, the default encoding is used. | [`TextBlockOptions`](TextBlockOptions.md).[`encoding`](TextBlockOptions.md#property-encoding) | [src/types.ts:901](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L901) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | [`TextBlockOptions`](TextBlockOptions.md).[`fallbackFonts`](TextBlockOptions.md#property-fallbackfonts) | [src/types.ts:857](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L857) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | [`TextBlockOptions`](TextBlockOptions.md).[`font`](TextBlockOptions.md#property-font) | [src/types.ts:847](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L847) | | `fontSize?` | `number` | Font size in PDF points. | [`TextBlockOptions`](TextBlockOptions.md).[`fontSize`](TextBlockOptions.md#property-fontsize) | [src/types.ts:861](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L861) | | `height?` | `number` | Box height in PDF points. When set together with [verticalAlign](TextBlockOptions.md#property-verticalalign), the wrapped lines are positioned within a box of this height starting at `y` and extending downward. Has no effect unless `verticalAlign` is given. | [`TextBlockOptions`](TextBlockOptions.md).[`height`](TextBlockOptions.md#property-height) | [src/types.ts:877](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L877) | | `italic?` | `boolean` | Selects the italic variant of `font`. See [TextOptions.italic](TextOptions.md#property-italic). | [`TextBlockOptions`](TextBlockOptions.md).[`italic`](TextBlockOptions.md#property-italic) | [src/types.ts:851](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L851) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | [`TextBlockOptions`](TextBlockOptions.md).[`kerning`](TextBlockOptions.md#property-kerning) | [src/types.ts:886](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L886) | | `level?` | [`HeadingLevel`](../type-aliases/HeadingLevel.md) | Heading level to render and tag. | - | [src/types.ts:1164](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1164) | | `lineHeight?` | `number` | Line height in PDF points. | [`TextBlockOptions`](TextBlockOptions.md).[`lineHeight`](TextBlockOptions.md#property-lineheight) | [src/types.ts:869](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L869) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowTextOptions`](FlowTextOptions.md).[`margin`](FlowTextOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowTextOptions`](FlowTextOptions.md).[`marginBottom`](FlowTextOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowTextOptions`](FlowTextOptions.md).[`marginLeft`](FlowTextOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowTextOptions`](FlowTextOptions.md).[`marginRight`](FlowTextOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowTextOptions`](FlowTextOptions.md).[`marginTop`](FlowTextOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `maxLines?` | `number` | Maximum number of lines to render. | [`TextBlockOptions`](TextBlockOptions.md).[`maxLines`](TextBlockOptions.md#property-maxlines) | [src/types.ts:884](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L884) | | `strike?` | `boolean` | Draws a strike-through line over the text. | [`TextBlockOptions`](TextBlockOptions.md).[`strike`](TextBlockOptions.md#property-strike) | [src/types.ts:855](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L855) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`TextBlockOptions`](TextBlockOptions.md).[`structure`](TextBlockOptions.md#property-structure) | [src/types.ts:895](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L895) | | `tag?` | | [`PdfTextStructureTag`](../type-aliases/PdfTextStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [`TextBlockOptions`](TextBlockOptions.md).[`tag`](TextBlockOptions.md#property-tag) | [src/types.ts:893](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L893) | | `underline?` | `boolean` | Draws an underline beneath the text. | [`TextBlockOptions`](TextBlockOptions.md).[`underline`](TextBlockOptions.md#property-underline) | [src/types.ts:853](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L853) | | `verticalAlign?` | [`VerticalAlign`](../type-aliases/VerticalAlign.md) | Vertical alignment of the wrapped text within `height`. Requires `height`. Defaults to "top". | [`TextBlockOptions`](TextBlockOptions.md).[`verticalAlign`](TextBlockOptions.md#property-verticalalign) | [src/types.ts:882](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L882) | | `wordSpacing?` | `number` | Additional spacing between words in PDF points. | [`TextBlockOptions`](TextBlockOptions.md).[`wordSpacing`](TextBlockOptions.md#property-wordspacing) | [src/types.ts:867](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L867) | | `writingMode?` | `"horizontal"` | `"vertical"` | Text writing mode. "horizontal" (default) places characters left-to-right. "vertical" stacks characters top-to-bottom. | [`TextBlockOptions`](TextBlockOptions.md).[`writingMode`](TextBlockOptions.md#property-writingmode) | [src/types.ts:891](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L891) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowHighlightOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowHighlightOptions # Interface: FlowHighlightOptions Defined in: [src/types.ts:1313](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1313) Options for placing a highlight annotation through the flow layout API. ## Extends * `Omit`<[`HighlightAnnotationOptions`](HighlightAnnotationOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [`HighlightAnnotationOptions`](HighlightAnnotationOptions.md).[`color`](HighlightAnnotationOptions.md#property-color) | [src/types.ts:2363](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2363) | | `height` | `number` | Height in PDF points. | [`HighlightAnnotationOptions`](HighlightAnnotationOptions.md).[`height`](HighlightAnnotationOptions.md#property-height) | [src/types.ts:2361](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2361) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`HighlightAnnotationOptions`](HighlightAnnotationOptions.md).[`structure`](HighlightAnnotationOptions.md#property-structure) | [src/types.ts:2367](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2367) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [`HighlightAnnotationOptions`](HighlightAnnotationOptions.md).[`tag`](HighlightAnnotationOptions.md#property-tag) | [src/types.ts:2365](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2365) | | `width?` | `number` | Width override in PDF points. | - | [src/types.ts:1320](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1320) | | `x?` | `number` | Horizontal position override in PDF points. | - | [src/types.ts:1316](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1316) | | `y?` | `number` | Vertical position override in PDF points. | - | [src/types.ts:1318](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1318) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowImageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowImageOptions # Interface: FlowImageOptions Defined in: [src/types.ts:1183](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1183) Options for placing images through the flow layout API. ## Extends * `Omit`<[`JpegImageOptions`](JpegImageOptions.md), `"x"` | `"y"` | `"width"` | `"height"`>.`Omit`<[`PngImageOptions`](PngImageOptions.md), `"x"` | `"y"` | `"width"` | `"height"`>.`Omit`<[`BmpImageOptions`](BmpImageOptions.md), `"x"` | `"y"` | `"width"` | `"height"`>.`Omit`<[`TiffImageOptions`](TiffImageOptions.md), `"x"` | `"y"` | `"width"` | `"height"`>.`Omit`<[`Jp2ImageOptions`](Jp2ImageOptions.md), `"x"` | `"y"` | `"width"` | `"height"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `align?` | `"left"` | `"center"` | `"right"` | Horizontal alignment for laid-out content. | - | [src/types.ts:1198](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1198) | | `altText?` | `string` | Alternate text for tagged non-text content. | [`JpegImageOptions`](JpegImageOptions.md).[`altText`](JpegImageOptions.md#property-alttext) | [src/types.ts:2112](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2112) | | `height?` | `number` | Height in PDF points. | - | [src/types.ts:1194](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1194) | | `iccProfile?` | [`BinaryData`](../type-aliases/BinaryData.md) | ICC profile bytes used to tag the image's color space as ICCBased (ISO 32000-2 § 8.6.5.5). When provided, the image's ColorSpace becomes \[/ICCBased ref] referencing the embedded profile stream. | [`JpegImageOptions`](JpegImageOptions.md).[`iccProfile`](JpegImageOptions.md#property-iccprofile) | [src/types.ts:2122](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2122) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `maxWidth?` | `number` | Maximum image width in PDF points. | - | [src/types.ts:1196](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1196) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`JpegImageOptions`](JpegImageOptions.md).[`structure`](JpegImageOptions.md#property-structure) | [src/types.ts:2116](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2116) | | `tag?` | | [`PdfFigureStructureTag`](../type-aliases/PdfFigureStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [`JpegImageOptions`](JpegImageOptions.md).[`tag`](JpegImageOptions.md#property-tag) | [src/types.ts:2114](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2114) | | `width?` | `number` | Width in PDF points. | - | [src/types.ts:1192](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1192) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowLinkOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowLinkOptions # Interface: FlowLinkOptions Defined in: [src/types.ts:1204](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1204) Options for placing URI links through the flow layout API. ## Extends * `Omit`<[`UriLinkOptions`](UriLinkOptions.md), `"x"` | `"y"` | `"width"` | `"height"` | `"tag"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `align?` | `"left"` | `"center"` | `"right"` | Horizontal alignment for laid-out content. | - | [src/types.ts:1225](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1225) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [`UriLinkOptions`](UriLinkOptions.md).[`borderWidth`](UriLinkOptions.md#property-borderwidth) | [src/types.ts:2206](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2206) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | - | [src/types.ts:1217](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1217) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | - | [src/types.ts:1213](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1213) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | - | [src/types.ts:1211](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1211) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | - | [src/types.ts:1209](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1209) | | `fontSize?` | `number` | Font size in PDF points. | - | [src/types.ts:1215](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1215) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | - | [src/types.ts:1221](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1221) | | `lineHeight?` | `number` | Line height in PDF points. | - | [src/types.ts:1219](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1219) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`UriLinkOptions`](UriLinkOptions.md).[`structure`](UriLinkOptions.md#property-structure) | [src/types.ts:2210](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2210) | | `tag?` | `"Link"` | Structure tag used for tagged PDF output. | - | [src/types.ts:1223](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1223) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowListOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowListOptions # Interface: FlowListOptions Defined in: [src/types.ts:1352](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1352) Options for placing a tagged list through the flow layout API. ## Extends * `Omit`<[`ListOptions`](ListOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `align?` | [`TextAlign`](../type-aliases/TextAlign.md) | Horizontal alignment for laid-out content. | [`ListOptions`](ListOptions.md).[`align`](ListOptions.md#property-align) | [src/types.ts:1988](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1988) | | `bullet?` | `string` | Bullet text used for unordered list items. | [`ListOptions`](ListOptions.md).[`bullet`](ListOptions.md#property-bullet) | [src/types.ts:1996](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1996) | | `characterSpacing?` | `number` | Additional spacing between characters in PDF points. | [`ListOptions`](ListOptions.md).[`characterSpacing`](ListOptions.md#property-characterspacing) | [src/types.ts:1982](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1982) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [`ListOptions`](ListOptions.md).[`color`](ListOptions.md#property-color) | [src/types.ts:1980](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1980) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | [`ListOptions`](ListOptions.md).[`direction`](ListOptions.md#property-direction) | [src/types.ts:1976](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1976) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | [`ListOptions`](ListOptions.md).[`fallbackFonts`](ListOptions.md#property-fallbackfonts) | [src/types.ts:1974](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1974) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | [`ListOptions`](ListOptions.md).[`font`](ListOptions.md#property-font) | [src/types.ts:1972](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1972) | | `fontSize?` | `number` | Font size in PDF points. | [`ListOptions`](ListOptions.md).[`fontSize`](ListOptions.md#property-fontsize) | [src/types.ts:1978](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1978) | | `indent?` | `number` | List indentation in PDF points. | [`ListOptions`](ListOptions.md).[`indent`](ListOptions.md#property-indent) | [src/types.ts:2000](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2000) | | `itemSpacing?` | `number` | Vertical spacing between list items in PDF points. | [`ListOptions`](ListOptions.md).[`itemSpacing`](ListOptions.md#property-itemspacing) | [src/types.ts:1998](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1998) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | [`ListOptions`](ListOptions.md).[`kerning`](ListOptions.md#property-kerning) | [src/types.ts:1990](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1990) | | `labelGap?` | `number` | Gap between list labels and item bodies in PDF points. | [`ListOptions`](ListOptions.md).[`labelGap`](ListOptions.md#property-labelgap) | [src/types.ts:2002](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2002) | | `lineHeight?` | `number` | Line height in PDF points. | [`ListOptions`](ListOptions.md).[`lineHeight`](ListOptions.md#property-lineheight) | [src/types.ts:1986](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1986) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `ordered?` | `boolean` | Whether to render the list with ordered labels. | [`ListOptions`](ListOptions.md).[`ordered`](ListOptions.md#property-ordered) | [src/types.ts:1992](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1992) | | `startAt?` | `number` | Starting number for ordered output. | [`ListOptions`](ListOptions.md).[`startAt`](ListOptions.md#property-startat) | [src/types.ts:1994](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1994) | | `width?` | `number` | Width override in PDF points. | - | [src/types.ts:1358](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1358) | | `wordSpacing?` | `number` | Additional spacing between words in PDF points. | [`ListOptions`](ListOptions.md).[`wordSpacing`](ListOptions.md#property-wordspacing) | [src/types.ts:1984](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1984) | | `x?` | `number` | Horizontal position override in PDF points. | - | [src/types.ts:1354](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1354) | | `y?` | `number` | Vertical position override in PDF points. | - | [src/types.ts:1356](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1356) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowNoteOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowNoteOptions # Interface: FlowNoteOptions Defined in: [src/types.ts:1326](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1326) Options for placing a text note annotation through the flow layout API. ## Extends * `Omit`<[`NoteAnnotationOptions`](NoteAnnotationOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `contents` | `string` | Annotation contents text. | [`NoteAnnotationOptions`](NoteAnnotationOptions.md).[`contents`](NoteAnnotationOptions.md#property-contents) | [src/types.ts:2448](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2448) | | `height?` | `number` | Height in PDF points. | [`NoteAnnotationOptions`](NoteAnnotationOptions.md).[`height`](NoteAnnotationOptions.md#property-height) | [src/types.ts:2446](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2446) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `open?` | `boolean` | Whether the note annotation is initially open. | [`NoteAnnotationOptions`](NoteAnnotationOptions.md).[`open`](NoteAnnotationOptions.md#property-open) | [src/types.ts:2450](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2450) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`NoteAnnotationOptions`](NoteAnnotationOptions.md).[`structure`](NoteAnnotationOptions.md#property-structure) | [src/types.ts:2454](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2454) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [`NoteAnnotationOptions`](NoteAnnotationOptions.md).[`tag`](NoteAnnotationOptions.md#property-tag) | [src/types.ts:2452](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2452) | | `width?` | `number` | Width override in PDF points. | - | [src/types.ts:1333](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1333) | | `x?` | `number` | Horizontal position override in PDF points. | - | [src/types.ts:1329](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1329) | | `y?` | `number` | Vertical position override in PDF points. | - | [src/types.ts:1331](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1331) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowOptions # Interface: FlowOptions Defined in: [src/types.ts:1047](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1047) Initial layout, typography, and spacing options for a PdfFlow cursor. ## Extended by * [`TemplatePageOptions`](TemplatePageOptions.md) ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `align?` | [`TextAlign`](../type-aliases/TextAlign.md) | Horizontal alignment for laid-out content. | [src/types.ts:1083](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1083) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:1079](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1079) | | `columns?` | [`FlowColumnsOptions`](FlowColumnsOptions.md) | Newspaper-style flow columns. | [src/types.ts:1055](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1055) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | [src/types.ts:1075](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1075) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | [src/types.ts:1073](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1073) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | [src/types.ts:1071](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1071) | | `fontSize?` | `number` | Font size in PDF points. | [src/types.ts:1077](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1077) | | `gap?` | `number` | Default vertical gap between flow blocks in PDF points. | [src/types.ts:1067](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1067) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | [src/types.ts:1085](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1085) | | `lineHeight?` | `number` | Line height in PDF points. | [src/types.ts:1081](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1081) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [src/types.ts:1057](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1057) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [src/types.ts:1063](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1063) | | `marginLeft?` | `number` | Left margin in PDF points. | [src/types.ts:1065](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1065) | | `marginRight?` | `number` | Right margin in PDF points. | [src/types.ts:1061](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1061) | | `marginTop?` | `number` | Top margin in PDF points. | [src/types.ts:1059](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1059) | | `spacing?` | [`FlowSpacingScale`](FlowSpacingScale.md) | Semantic spacing scale used by flow layout. | [src/types.ts:1069](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1069) | | `width?` | `number` | Width in PDF points. | [src/types.ts:1053](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1053) | | `writingMode?` | `"horizontal"` | `"vertical"` | Text writing mode. "horizontal" (default) places characters left-to-right. "vertical" stacks characters top-to-bottom. | [src/types.ts:1090](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1090) | | `x?` | `number` | Horizontal position in PDF points. | [src/types.ts:1049](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1049) | | `y?` | `number` | Vertical position in PDF points. | [src/types.ts:1051](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1051) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowPushButtonOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowPushButtonOptions # Interface: FlowPushButtonOptions Defined in: [src/types.ts:1287](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1287) Options for placing a push-button form field through the flow layout API. ## Extends * `Omit`<[`PushButtonOptions`](PushButtonOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [`PushButtonOptions`](PushButtonOptions.md).[`actions`](PushButtonOptions.md#property-actions) | [src/types.ts:2765](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2765) | | `appearance?` | `string` | Custom appearance stream content for the push button. Example: `"1 0 0 rg 0 0 100 20 re f"` | [`PushButtonOptions`](PushButtonOptions.md).[`appearance`](PushButtonOptions.md#property-appearance) | [src/types.ts:2760](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2760) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [`PushButtonOptions`](PushButtonOptions.md).[`borderWidth`](PushButtonOptions.md#property-borderwidth) | [src/types.ts:2747](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2747) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [`PushButtonOptions`](PushButtonOptions.md).[`color`](PushButtonOptions.md#property-color) | [src/types.ts:2745](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2745) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [`PushButtonOptions`](PushButtonOptions.md).[`encrypt`](PushButtonOptions.md#property-encrypt) | [src/types.ts:2755](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2755) | | `font?` | [`FontName`](../type-aliases/FontName.md) | Font used to render text. | [`PushButtonOptions`](PushButtonOptions.md).[`font`](PushButtonOptions.md#property-font) | [src/types.ts:2741](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2741) | | `fontSize?` | `number` | Font size in PDF points. | [`PushButtonOptions`](PushButtonOptions.md).[`fontSize`](PushButtonOptions.md#property-fontsize) | [src/types.ts:2743](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2743) | | `height` | `number` | Height in PDF points. | [`PushButtonOptions`](PushButtonOptions.md).[`height`](PushButtonOptions.md#property-height) | [src/types.ts:2737](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2737) | | `label` | `string` | Explicit list marker or button label text. | [`PushButtonOptions`](PushButtonOptions.md).[`label`](PushButtonOptions.md#property-label) | [src/types.ts:2739](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2739) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [`PushButtonOptions`](PushButtonOptions.md).[`readOnly`](PushButtonOptions.md#property-readonly) | [src/types.ts:2749](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2749) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`PushButtonOptions`](PushButtonOptions.md).[`structure`](PushButtonOptions.md#property-structure) | [src/types.ts:2769](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2769) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [`PushButtonOptions`](PushButtonOptions.md).[`tag`](PushButtonOptions.md#property-tag) | [src/types.ts:2767](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2767) | | `width?` | `number` | Width override in PDF points. | - | [src/types.ts:1294](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1294) | | `x?` | `number` | Horizontal position override in PDF points. | - | [src/types.ts:1290](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1290) | | `y?` | `number` | Vertical position override in PDF points. | - | [src/types.ts:1292](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1292) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowRadioGroupOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowRadioGroupOptions # Interface: FlowRadioGroupOptions Defined in: [src/types.ts:1279](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1279) Options for placing a radio-button group through the flow layout API. ## Extends * `Omit`<[`RadioGroupOptions`](RadioGroupOptions.md), `"items"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [`RadioGroupOptions`](RadioGroupOptions.md).[`actions`](RadioGroupOptions.md#property-actions) | [src/types.ts:2719](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2719) | | `appearance?` | | `string` | { `down?`: `string`; `normal?`: `string`; `rollover?`: `string`; } | Custom appearance stream for the radio group. Can be a raw PDF content stream string, or an object with optional normal (/N), down (/D), and rollover (/R) appearance strings. | [`RadioGroupOptions`](RadioGroupOptions.md).[`appearance`](RadioGroupOptions.md#property-appearance) | [src/types.ts:2714](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2714) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [`RadioGroupOptions`](RadioGroupOptions.md).[`borderWidth`](RadioGroupOptions.md#property-borderwidth) | [src/types.ts:2698](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2698) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [`RadioGroupOptions`](RadioGroupOptions.md).[`encrypt`](RadioGroupOptions.md#property-encrypt) | [src/types.ts:2708](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2708) | | `items` | [`RadioGroupItemOptions`](RadioGroupItemOptions.md)\[] | Radio-button items in the group with their own positions. | - | [src/types.ts:1281](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1281) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [`RadioGroupOptions`](RadioGroupOptions.md).[`readOnly`](RadioGroupOptions.md#property-readonly) | [src/types.ts:2700](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2700) | | `required?` | `boolean` | Whether the form field is required. | [`RadioGroupOptions`](RadioGroupOptions.md).[`required`](RadioGroupOptions.md#property-required) | [src/types.ts:2702](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2702) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`RadioGroupOptions`](RadioGroupOptions.md).[`structure`](RadioGroupOptions.md#property-structure) | [src/types.ts:2723](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2723) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [`RadioGroupOptions`](RadioGroupOptions.md).[`tag`](RadioGroupOptions.md#property-tag) | [src/types.ts:2721](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2721) | | `value?` | `string` | Current or default value for the option. | [`RadioGroupOptions`](RadioGroupOptions.md).[`value`](RadioGroupOptions.md#property-value) | [src/types.ts:2696](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2696) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowRichTextOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowRichTextOptions # Interface: FlowRichTextOptions Defined in: [src/types.ts:1172](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1172) Options for placing a paragraph of inline rich-text runs through the flow layout API. Position and width are supplied by the flow cursor; the remaining fields mirror [RichTextOptions](RichTextOptions.md). ## Extends * `Omit`<[`RichTextOptions`](RichTextOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `align?` | `"left"` | `"center"` | `"right"` | `"justify"` | Horizontal alignment of each line. Defaults to "left". Ignored in vertical mode. | [`RichTextOptions`](RichTextOptions.md).[`align`](RichTextOptions.md#property-align) | [src/types.ts:958](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L958) | | `blockAlign?` | `"left"` | `"center"` | `"right"` | Alignment of the block inside the flow column. | - | [src/types.ts:1177](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1177) | | `blockWidth?` | `number` | Optional width for the flow text block within the flow column. | - | [src/types.ts:1175](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1175) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Default color for runs that omit one. | [`RichTextOptions`](RichTextOptions.md).[`color`](RichTextOptions.md#property-color) | [src/types.ts:986](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L986) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Reading direction for the runs. "auto" detects from the run text. Right-to-left lays each line out from the right edge; this is line-level direction, not full mixed-direction bidirectional reordering. | [`RichTextOptions`](RichTextOptions.md).[`direction`](RichTextOptions.md#property-direction) | [src/types.ts:975](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L975) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Default font for runs that omit one. | [`RichTextOptions`](RichTextOptions.md).[`font`](RichTextOptions.md#property-font) | [src/types.ts:982](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L982) | | `fontSize?` | `number` | Default font size for runs that omit one. | [`RichTextOptions`](RichTextOptions.md).[`fontSize`](RichTextOptions.md#property-fontsize) | [src/types.ts:984](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L984) | | `height?` | `number` | Box height in PDF points. With [verticalAlign](RichTextOptions.md#property-verticalalign), the wrapped lines are positioned within a box of this height starting at `y` and extending downward. Has no effect unless `verticalAlign` is given. Horizontal mode only. | [`RichTextOptions`](RichTextOptions.md).[`height`](RichTextOptions.md#property-height) | [src/types.ts:964](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L964) | | `kerning?` | `boolean` | Default kerning behavior for runs that omit it. | [`RichTextOptions`](RichTextOptions.md).[`kerning`](RichTextOptions.md#property-kerning) | [src/types.ts:988](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L988) | | `lineHeight?` | `number` | Line height in PDF points (column spacing in vertical mode). Defaults to 1.2 × the largest run font size. | [`RichTextOptions`](RichTextOptions.md).[`lineHeight`](RichTextOptions.md#property-lineheight) | [src/types.ts:956](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L956) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`RichTextOptions`](RichTextOptions.md).[`structure`](RichTextOptions.md#property-structure) | [src/types.ts:992](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L992) | | `tag?` | | [`PdfTextStructureTag`](../type-aliases/PdfTextStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. Defaults to "P". | [`RichTextOptions`](RichTextOptions.md).[`tag`](RichTextOptions.md#property-tag) | [src/types.ts:990](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L990) | | `verticalAlign?` | [`VerticalAlign`](../type-aliases/VerticalAlign.md) | Vertical alignment of the wrapped runs within `height`. Requires `height`. Defaults to "top". Horizontal mode only. | [`RichTextOptions`](RichTextOptions.md).[`verticalAlign`](RichTextOptions.md#property-verticalalign) | [src/types.ts:969](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L969) | | `writingMode?` | `"horizontal"` | `"vertical"` | Writing mode. "horizontal" (default) flows runs left-to-right and wraps onto new lines. "vertical" stacks the runs top-to-bottom in one column. | [`RichTextOptions`](RichTextOptions.md).[`writingMode`](RichTextOptions.md#property-writingmode) | [src/types.ts:980](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L980) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowSignatureFieldOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowSignatureFieldOptions # Interface: FlowSignatureFieldOptions Defined in: [src/types.ts:1300](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1300) Options for placing a signature form field through the flow layout API. ## Extends * `Omit`<[`SignatureFieldOptions`](SignatureFieldOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [`SignatureFieldOptions`](SignatureFieldOptions.md).[`actions`](SignatureFieldOptions.md#property-actions) | [src/types.ts:2805](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2805) | | `appearance?` | `string` | Custom appearance stream content for the signature field. Example: `"1 0 0 rg 0 0 100 20 re f"` | [`SignatureFieldOptions`](SignatureFieldOptions.md).[`appearance`](SignatureFieldOptions.md#property-appearance) | [src/types.ts:2800](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2800) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [`SignatureFieldOptions`](SignatureFieldOptions.md).[`borderWidth`](SignatureFieldOptions.md#property-borderwidth) | [src/types.ts:2785](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2785) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [`SignatureFieldOptions`](SignatureFieldOptions.md).[`encrypt`](SignatureFieldOptions.md#property-encrypt) | [src/types.ts:2795](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2795) | | `height` | `number` | Height in PDF points. | [`SignatureFieldOptions`](SignatureFieldOptions.md).[`height`](SignatureFieldOptions.md#property-height) | [src/types.ts:2783](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2783) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [`SignatureFieldOptions`](SignatureFieldOptions.md).[`readOnly`](SignatureFieldOptions.md#property-readonly) | [src/types.ts:2787](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2787) | | `required?` | `boolean` | Whether the form field is required. | [`SignatureFieldOptions`](SignatureFieldOptions.md).[`required`](SignatureFieldOptions.md#property-required) | [src/types.ts:2789](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2789) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`SignatureFieldOptions`](SignatureFieldOptions.md).[`structure`](SignatureFieldOptions.md#property-structure) | [src/types.ts:2809](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2809) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [`SignatureFieldOptions`](SignatureFieldOptions.md).[`tag`](SignatureFieldOptions.md#property-tag) | [src/types.ts:2807](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2807) | | `width?` | `number` | Width override in PDF points. | - | [src/types.ts:1307](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1307) | | `x?` | `number` | Horizontal position override in PDF points. | - | [src/types.ts:1303](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1303) | | `y?` | `number` | Vertical position override in PDF points. | - | [src/types.ts:1305](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1305) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowSpacingScale.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowSpacingScale # Interface: FlowSpacingScale Defined in: [src/types.ts:1101](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1101) Semantic spacing scale used by flow layout for paragraphs, headings, tables, images, and links. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `headingAfter?` | | `number` | `Partial`<`Record`<[`HeadingLevel`](../type-aliases/HeadingLevel.md), `number`>> | Default spacing after heading blocks. | [src/types.ts:1109](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1109) | | `headingBefore?` | | `number` | `Partial`<`Record`<[`HeadingLevel`](../type-aliases/HeadingLevel.md), `number`>> | Default spacing before heading blocks. | [src/types.ts:1107](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1107) | | `imageAfter?` | `number` | Default spacing after image blocks. | [src/types.ts:1117](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1117) | | `imageBefore?` | `number` | Default spacing before image blocks. | [src/types.ts:1115](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1115) | | `linkAfter?` | `number` | Default spacing after link blocks. | [src/types.ts:1121](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1121) | | `linkBefore?` | `number` | Default spacing before link blocks. | [src/types.ts:1119](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1119) | | `paragraphAfter?` | `number` | Default spacing after paragraph blocks. | [src/types.ts:1105](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1105) | | `paragraphBefore?` | `number` | Default spacing before paragraph blocks. | [src/types.ts:1103](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1103) | | `tableAfter?` | `number` | Default spacing after table blocks. | [src/types.ts:1113](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1113) | | `tableBefore?` | `number` | Default spacing before table blocks. | [src/types.ts:1111](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1111) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowTableOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowTableOptions # Interface: FlowTableOptions Defined in: [src/types.ts:1231](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1231) Options for placing tables through the flow layout API. ## Extends * `Omit`<[`TableOptions`](TableOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `align?` | [`TextAlign`](../type-aliases/TextAlign.md) | Horizontal alignment for laid-out content. | [`TableOptions`](TableOptions.md).[`align`](TableOptions.md#property-align) | [src/types.ts:2081](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2081) | | `cellPadding?` | `number` | Padding inside table cells in PDF points. | [`TableOptions`](TableOptions.md).[`cellPadding`](TableOptions.md#property-cellpadding) | [src/types.ts:2061](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2061) | | `characterSpacing?` | `number` | Additional spacing between characters in PDF points. | [`TableOptions`](TableOptions.md).[`characterSpacing`](TableOptions.md#property-characterspacing) | [src/types.ts:2075](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2075) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [`TableOptions`](TableOptions.md).[`color`](TableOptions.md#property-color) | [src/types.ts:2073](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2073) | | `columnWidths?` | readonly `number`\[] | Explicit table column widths in PDF points. | [`TableOptions`](TableOptions.md).[`columnWidths`](TableOptions.md#property-columnwidths) | [src/types.ts:2055](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2055) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | [`TableOptions`](TableOptions.md).[`direction`](TableOptions.md#property-direction) | [src/types.ts:2069](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2069) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | [`TableOptions`](TableOptions.md).[`fallbackFonts`](TableOptions.md#property-fallbackfonts) | [src/types.ts:2067](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2067) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | [`TableOptions`](TableOptions.md).[`font`](TableOptions.md#property-font) | [src/types.ts:2065](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2065) | | `fontSize?` | `number` | Font size in PDF points. | [`TableOptions`](TableOptions.md).[`fontSize`](TableOptions.md#property-fontsize) | [src/types.ts:2071](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2071) | | `headerColumns?` | `number` | Number of leading columns treated as table headers. | [`TableOptions`](TableOptions.md).[`headerColumns`](TableOptions.md#property-headercolumns) | [src/types.ts:2059](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2059) | | `headerRows?` | `number` | Number of leading rows treated as table headers. | [`TableOptions`](TableOptions.md).[`headerRows`](TableOptions.md#property-headerrows) | [src/types.ts:2057](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2057) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | [`TableOptions`](TableOptions.md).[`kerning`](TableOptions.md#property-kerning) | [src/types.ts:2089](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2089) | | `lineHeight?` | `number` | Line height in PDF points. | [`TableOptions`](TableOptions.md).[`lineHeight`](TableOptions.md#property-lineheight) | [src/types.ts:2079](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2079) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `rowGap?` | `number` | Gap between table rows in PDF points. | [`TableOptions`](TableOptions.md).[`rowGap`](TableOptions.md#property-rowgap) | [src/types.ts:2063](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2063) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`TableOptions`](TableOptions.md).[`structure`](TableOptions.md#property-structure) | [src/types.ts:2091](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2091) | | `summary?` | `string` | Table summary for accessibility (/Summary attribute on the table structure element). Provides a description of the table for screen readers. | [`TableOptions`](TableOptions.md).[`summary`](TableOptions.md#property-summary) | [src/types.ts:2096](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2096) | | `verticalAlign?` | [`VerticalAlign`](../type-aliases/VerticalAlign.md) | Vertical alignment of each cell's content within its row height. Applies to cells shorter than the tallest cell in the row. Defaults to "top". Can be overridden per cell via [TableCellDefinition.verticalAlign](TableCellDefinition.md#property-verticalalign). | [`TableOptions`](TableOptions.md).[`verticalAlign`](TableOptions.md#property-verticalalign) | [src/types.ts:2087](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2087) | | `width?` | `number` | Width in PDF points. | - | [src/types.ts:1234](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1234) | | `wordSpacing?` | `number` | Additional spacing between words in PDF points. | [`TableOptions`](TableOptions.md).[`wordSpacing`](TableOptions.md#property-wordspacing) | [src/types.ts:2077](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2077) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowTextFieldOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowTextFieldOptions # Interface: FlowTextFieldOptions Defined in: [src/types.ts:1240](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1240) Options for placing a text form field through the flow layout API. ## Extends * `Omit`<[`TextFieldOptions`](TextFieldOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [`TextFieldOptions`](TextFieldOptions.md).[`actions`](TextFieldOptions.md#property-actions) | [src/types.ts:2559](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2559) | | `appearance?` | `string` | Custom appearance stream content. When provided, this raw PDF content stream is used instead of the auto-generated appearance for the /N (normal) appearance state. Example: `"1 0 0 rg 0 0 16 16 re f"` | [`TextFieldOptions`](TextFieldOptions.md).[`appearance`](TextFieldOptions.md#property-appearance) | [src/types.ts:2554](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2554) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [`TextFieldOptions`](TextFieldOptions.md).[`borderWidth`](TextFieldOptions.md#property-borderwidth) | [src/types.ts:2530](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2530) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [`TextFieldOptions`](TextFieldOptions.md).[`color`](TextFieldOptions.md#property-color) | [src/types.ts:2528](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2528) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [`TextFieldOptions`](TextFieldOptions.md).[`encrypt`](TextFieldOptions.md#property-encrypt) | [src/types.ts:2547](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2547) | | `font?` | [`FontName`](../type-aliases/FontName.md) | Font used to render text. | [`TextFieldOptions`](TextFieldOptions.md).[`font`](TextFieldOptions.md#property-font) | [src/types.ts:2524](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2524) | | `fontSize?` | `number` | Font size in PDF points. | [`TextFieldOptions`](TextFieldOptions.md).[`fontSize`](TextFieldOptions.md#property-fontsize) | [src/types.ts:2526](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2526) | | `height` | `number` | Height in PDF points. | [`TextFieldOptions`](TextFieldOptions.md).[`height`](TextFieldOptions.md#property-height) | [src/types.ts:2520](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2520) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `multiline?` | `boolean` | Whether the text field accepts multiple lines. | [`TextFieldOptions`](TextFieldOptions.md).[`multiline`](TextFieldOptions.md#property-multiline) | [src/types.ts:2536](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2536) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [`TextFieldOptions`](TextFieldOptions.md).[`readOnly`](TextFieldOptions.md#property-readonly) | [src/types.ts:2532](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2532) | | `required?` | `boolean` | Whether the form field is required. | [`TextFieldOptions`](TextFieldOptions.md).[`required`](TextFieldOptions.md#property-required) | [src/types.ts:2534](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2534) | | `richValue?` | `string` | Rich text value (XML string in XFA rich text format). When set, emitted as /RV in the field dictionary. | [`TextFieldOptions`](TextFieldOptions.md).[`richValue`](TextFieldOptions.md#property-richvalue) | [src/types.ts:2541](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2541) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`TextFieldOptions`](TextFieldOptions.md).[`structure`](TextFieldOptions.md#property-structure) | [src/types.ts:2563](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2563) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [`TextFieldOptions`](TextFieldOptions.md).[`tag`](TextFieldOptions.md#property-tag) | [src/types.ts:2561](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2561) | | `value?` | `string` | Current or default value for the option. | [`TextFieldOptions`](TextFieldOptions.md).[`value`](TextFieldOptions.md#property-value) | [src/types.ts:2522](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2522) | | `width?` | `number` | Width override in PDF points. | - | [src/types.ts:1247](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1247) | | `x?` | `number` | Horizontal position override in PDF points. | - | [src/types.ts:1243](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1243) | | `y?` | `number` | Vertical position override in PDF points. | - | [src/types.ts:1245](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1245) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FlowTextOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowTextOptions # Interface: FlowTextOptions Defined in: [src/types.ts:1151](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1151) Options for placing paragraphs or text blocks through the flow layout API. ## Extends * `Omit`<[`TextBlockOptions`](TextBlockOptions.md), `"x"` | `"y"` | `"width"`>.[`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md) ## Extended by * [`FlowHeadingOptions`](FlowHeadingOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `align?` | [`TextAlign`](../type-aliases/TextAlign.md) | Horizontal alignment for laid-out content. | [`TextBlockOptions`](TextBlockOptions.md).[`align`](TextBlockOptions.md#property-align) | [src/types.ts:871](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L871) | | `blockAlign?` | `"left"` | `"center"` | `"right"` | Alignment of the block inside the flow column. | - | [src/types.ts:1156](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1156) | | `blockWidth?` | `number` | Optional width for the flow text block within the flow column. | - | [src/types.ts:1154](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1154) | | `bold?` | `boolean` | Selects the bold variant of `font`. See [TextOptions.bold](TextOptions.md#property-bold). | [`TextBlockOptions`](TextBlockOptions.md).[`bold`](TextBlockOptions.md#property-bold) | [src/types.ts:849](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L849) | | `characterSpacing?` | `number` | Additional spacing between characters in PDF points. | [`TextBlockOptions`](TextBlockOptions.md).[`characterSpacing`](TextBlockOptions.md#property-characterspacing) | [src/types.ts:865](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L865) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [`TextBlockOptions`](TextBlockOptions.md).[`color`](TextBlockOptions.md#property-color) | [src/types.ts:863](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L863) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | [`TextBlockOptions`](TextBlockOptions.md).[`direction`](TextBlockOptions.md#property-direction) | [src/types.ts:859](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L859) | | `encoding?` | `"winansi"` | `"macroman"` | `"pdfdoc"` | Built-in font encoding. When set, the font dictionary emits an /Encoding entry with the specified encoding (e.g. /WinAnsiEncoding). When undefined, the default encoding is used. | [`TextBlockOptions`](TextBlockOptions.md).[`encoding`](TextBlockOptions.md#property-encoding) | [src/types.ts:901](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L901) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | [`TextBlockOptions`](TextBlockOptions.md).[`fallbackFonts`](TextBlockOptions.md#property-fallbackfonts) | [src/types.ts:857](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L857) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | [`TextBlockOptions`](TextBlockOptions.md).[`font`](TextBlockOptions.md#property-font) | [src/types.ts:847](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L847) | | `fontSize?` | `number` | Font size in PDF points. | [`TextBlockOptions`](TextBlockOptions.md).[`fontSize`](TextBlockOptions.md#property-fontsize) | [src/types.ts:861](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L861) | | `height?` | `number` | Box height in PDF points. When set together with [verticalAlign](TextBlockOptions.md#property-verticalalign), the wrapped lines are positioned within a box of this height starting at `y` and extending downward. Has no effect unless `verticalAlign` is given. | [`TextBlockOptions`](TextBlockOptions.md).[`height`](TextBlockOptions.md#property-height) | [src/types.ts:877](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L877) | | `italic?` | `boolean` | Selects the italic variant of `font`. See [TextOptions.italic](TextOptions.md#property-italic). | [`TextBlockOptions`](TextBlockOptions.md).[`italic`](TextBlockOptions.md#property-italic) | [src/types.ts:851](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L851) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | [`TextBlockOptions`](TextBlockOptions.md).[`kerning`](TextBlockOptions.md#property-kerning) | [src/types.ts:886](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L886) | | `lineHeight?` | `number` | Line height in PDF points. | [`TextBlockOptions`](TextBlockOptions.md).[`lineHeight`](TextBlockOptions.md#property-lineheight) | [src/types.ts:869](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L869) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`margin`](FlowBlockSpacingOptions.md#property-margin) | [src/types.ts:1137](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1137) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginBottom`](FlowBlockSpacingOptions.md#property-marginbottom) | [src/types.ts:1143](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1143) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginLeft`](FlowBlockSpacingOptions.md#property-marginleft) | [src/types.ts:1145](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1145) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginRight`](FlowBlockSpacingOptions.md#property-marginright) | [src/types.ts:1141](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1141) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowBlockSpacingOptions`](FlowBlockSpacingOptions.md).[`marginTop`](FlowBlockSpacingOptions.md#property-margintop) | [src/types.ts:1139](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1139) | | `maxLines?` | `number` | Maximum number of lines to render. | [`TextBlockOptions`](TextBlockOptions.md).[`maxLines`](TextBlockOptions.md#property-maxlines) | [src/types.ts:884](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L884) | | `strike?` | `boolean` | Draws a strike-through line over the text. | [`TextBlockOptions`](TextBlockOptions.md).[`strike`](TextBlockOptions.md#property-strike) | [src/types.ts:855](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L855) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [`TextBlockOptions`](TextBlockOptions.md).[`structure`](TextBlockOptions.md#property-structure) | [src/types.ts:895](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L895) | | `tag?` | | [`PdfTextStructureTag`](../type-aliases/PdfTextStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [`TextBlockOptions`](TextBlockOptions.md).[`tag`](TextBlockOptions.md#property-tag) | [src/types.ts:893](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L893) | | `underline?` | `boolean` | Draws an underline beneath the text. | [`TextBlockOptions`](TextBlockOptions.md).[`underline`](TextBlockOptions.md#property-underline) | [src/types.ts:853](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L853) | | `verticalAlign?` | [`VerticalAlign`](../type-aliases/VerticalAlign.md) | Vertical alignment of the wrapped text within `height`. Requires `height`. Defaults to "top". | [`TextBlockOptions`](TextBlockOptions.md).[`verticalAlign`](TextBlockOptions.md#property-verticalalign) | [src/types.ts:882](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L882) | | `wordSpacing?` | `number` | Additional spacing between words in PDF points. | [`TextBlockOptions`](TextBlockOptions.md).[`wordSpacing`](TextBlockOptions.md#property-wordspacing) | [src/types.ts:867](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L867) | | `writingMode?` | `"horizontal"` | `"vertical"` | Text writing mode. "horizontal" (default) places characters left-to-right. "vertical" stacks characters top-to-bottom. | [`TextBlockOptions`](TextBlockOptions.md).[`writingMode`](TextBlockOptions.md#property-writingmode) | [src/types.ts:891](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L891) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FontFamilyFaces.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FontFamilyFaces # Interface: FontFamilyFaces Defined in: [src/types.ts:56](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L56) The set of faces that make up a font family registered with [PdfDocument.registerFontFamily](../classes/PdfDocument.md#registerfontfamily). Once registered, text APIs can select a face by passing the family name as `font` together with the `bold` and `italic` flags, instead of juggling individual font handles. Each face may be a built-in [FontName](../type-aliases/FontName.md) or an embedded-font handle. Only `regular` is required; missing faces fall back to the closest available face (bold italic → bold → italic → regular). ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `bold?` | [`PdfFont`](../type-aliases/PdfFont.md) | Face used when `bold` is requested without `italic`. | [src/types.ts:60](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L60) | | `boldItalic?` | [`PdfFont`](../type-aliases/PdfFont.md) | Face used when both `bold` and `italic` are requested. | [src/types.ts:64](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L64) | | `italic?` | [`PdfFont`](../type-aliases/PdfFont.md) | Face used when `italic` is requested without `bold`. | [src/types.ts:62](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L62) | | `regular` | [`PdfFont`](../type-aliases/PdfFont.md) | Face used when neither `bold` nor `italic` is requested. | [src/types.ts:58](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L58) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FontFamilyInput.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FontFamilyInput # Interface: FontFamilyInput Defined in: [src/types.ts:73](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L73) Input accepted by [PdfDocument.registerFontFamily](../classes/PdfDocument.md#registerfontfamily). Each face may be a built-in [FontName](../type-aliases/FontName.md), an already-embedded font handle, or **raw font bytes** — bytes are embedded automatically under the family name, so you can register a family in one call without embedding each weight first. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `bold?` | | [`BinaryData`](../type-aliases/BinaryData.md) | [`PdfFont`](../type-aliases/PdfFont.md) | Face used when `bold` is requested without `italic`. | [src/types.ts:77](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L77) | | `boldItalic?` | | [`BinaryData`](../type-aliases/BinaryData.md) | [`PdfFont`](../type-aliases/PdfFont.md) | Face used when both `bold` and `italic` are requested. | [src/types.ts:81](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L81) | | `italic?` | | [`BinaryData`](../type-aliases/BinaryData.md) | [`PdfFont`](../type-aliases/PdfFont.md) | Face used when `italic` is requested without `bold`. | [src/types.ts:79](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L79) | | `regular` | | [`BinaryData`](../type-aliases/BinaryData.md) | [`PdfFont`](../type-aliases/PdfFont.md) | Face used when neither `bold` nor `italic` is requested. | [src/types.ts:75](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L75) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/FreeTextAnnotationOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FreeTextAnnotationOptions # Interface: FreeTextAnnotationOptions Defined in: [src/types.ts:2460](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2460) Options for creating a free-text annotation. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [src/types.ts:2478](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2478) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:2476](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2476) | | `font?` | [`FontName`](../type-aliases/FontName.md) | Font used to render text. | [src/types.ts:2472](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2472) | | `fontSize?` | `number` | Font size in PDF points. | [src/types.ts:2474](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2474) | | `height` | `number` | Height in PDF points. | [src/types.ts:2468](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2468) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2482](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2482) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2480](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2480) | | `text` | `string` | Text content to render or inspect. | [src/types.ts:2470](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2470) | | `width` | `number` | Width in PDF points. | [src/types.ts:2466](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2466) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2462](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2462) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2464](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2464) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/GifImageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / GifImageOptions # Interface: GifImageOptions Defined in: [src/types.ts:2309](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2309) Options for placing GIF images on a page. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `altText?` | `string` | Alternate text for tagged non-text content. | [src/types.ts:2319](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2319) | | `height` | `number` | Height in PDF points. | [src/types.ts:2317](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2317) | | `iccProfile?` | [`BinaryData`](../type-aliases/BinaryData.md) | ICC profile bytes used to tag the image's color space as ICCBased. | [src/types.ts:2327](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2327) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2323](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2323) | | `tag?` | | [`PdfFigureStructureTag`](../type-aliases/PdfFigureStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2321](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2321) | | `width` | `number` | Width in PDF points. | [src/types.ts:2315](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2315) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2311](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2311) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2313](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2313) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/GrayColor.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / GrayColor # Interface: GrayColor Defined in: [src/types.ts:615](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L615) Grayscale color representation used by drawing and text APIs. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `kind` | `"gray"` | Discriminator identifying this value shape. | [src/types.ts:617](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L617) | | `value` | `number` | Current or default value for the option. | [src/types.ts:619](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L619) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/HighlightAnnotationOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / HighlightAnnotationOptions # Interface: HighlightAnnotationOptions Defined in: [src/types.ts:2353](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2353) Options for creating a URI link annotation. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:2363](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2363) | | `height` | `number` | Height in PDF points. | [src/types.ts:2361](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2361) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2367](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2367) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2365](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2365) | | `width` | `number` | Width in PDF points. | [src/types.ts:2359](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2359) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2355](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2355) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2357](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2357) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/InlineTextRun.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / InlineTextRun # Interface: InlineTextRun Defined in: [src/types.ts:914](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L914) A single styled segment of inline rich text. Runs passed together to [PdfPage.richText](../classes/PdfPage.md#richtext) or [PdfFlow.richParagraph](../classes/PdfFlow.md#richparagraph) flow on the same line and wrap together as one paragraph; each run carries its own style. Any style omitted on a run inherits from the block-level options ([RichTextOptions](RichTextOptions.md)). Whitespace between words is taken from the run `text` verbatim — include trailing/leading spaces where you want them between adjacent runs (e.g. `"Hello "` then a bold `"world"`). ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `bold?` | `boolean` | Selects the bold variant of this run's font. See [TextOptions.bold](TextOptions.md#property-bold). | [src/types.ts:920](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L920) | | `characterSpacing?` | `number` | Additional spacing between characters in PDF points. | [src/types.ts:934](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L934) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color for this run. | [src/types.ts:930](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L930) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font for this run (built-in name, embedded handle, or registered family name). | [src/types.ts:918](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L918) | | `fontSize?` | `number` | Font size in PDF points for this run. | [src/types.ts:928](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L928) | | `italic?` | `boolean` | Selects the italic variant of this run's font. See [TextOptions.italic](TextOptions.md#property-italic). | [src/types.ts:922](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L922) | | `kerning?` | `boolean` | Whether kerning is applied for this run. | [src/types.ts:932](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L932) | | `link?` | `string` | When set, wraps this run in a clickable URI link annotation. | [src/types.ts:936](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L936) | | `strike?` | `boolean` | Draws a strike-through line over this run. | [src/types.ts:926](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L926) | | `text` | `string` | Text content of this segment. | [src/types.ts:916](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L916) | | `underline?` | `boolean` | Draws an underline beneath this run. | [src/types.ts:924](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L924) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/Jbig2ImageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / Jbig2ImageOptions # Interface: Jbig2ImageOptions Defined in: [src/types.ts:2176](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2176) Options for placing JBIG2 images on a page. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `altText?` | `string` | Alternate text for tagged non-text content. | [src/types.ts:2186](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2186) | | `height` | `number` | Height in PDF points. | [src/types.ts:2184](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2184) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2190](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2190) | | `tag?` | | [`PdfFigureStructureTag`](../type-aliases/PdfFigureStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2188](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2188) | | `width` | `number` | Width in PDF points. | [src/types.ts:2182](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2182) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2178](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2178) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2180](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2180) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/Jp2ImageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / Jp2ImageOptions # Interface: Jp2ImageOptions Defined in: [src/types.ts:2261](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2261) Options for placing JPEG 2000 (JP2) images on a page. PDF spec supports JPXDecode filter for JPEG 2000 image data. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `altText?` | `string` | Alternate text for tagged non-text content. | [src/types.ts:2271](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2271) | | `height` | `number` | Height in PDF points. | [src/types.ts:2269](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2269) | | `iccProfile?` | [`BinaryData`](../type-aliases/BinaryData.md) | ICC profile bytes used to tag the image's color space as ICCBased. | [src/types.ts:2279](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2279) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2275](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2275) | | `tag?` | | [`PdfFigureStructureTag`](../type-aliases/PdfFigureStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2273](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2273) | | `width` | `number` | Width in PDF points. | [src/types.ts:2267](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2267) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2263](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2263) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2265](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2265) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/JpegImageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / JpegImageOptions # Interface: JpegImageOptions Defined in: [src/types.ts:2102](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2102) Options for placing JPEG images on a page. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `altText?` | `string` | Alternate text for tagged non-text content. | [src/types.ts:2112](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2112) | | `height` | `number` | Height in PDF points. | [src/types.ts:2110](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2110) | | `iccProfile?` | [`BinaryData`](../type-aliases/BinaryData.md) | ICC profile bytes used to tag the image's color space as ICCBased (ISO 32000-2 § 8.6.5.5). When provided, the image's ColorSpace becomes \[/ICCBased ref] referencing the embedded profile stream. | [src/types.ts:2122](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2122) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2116](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2116) | | `tag?` | | [`PdfFigureStructureTag`](../type-aliases/PdfFigureStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2114](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2114) | | `width` | `number` | Width in PDF points. | [src/types.ts:2108](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2108) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2104](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2104) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2106](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2106) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/LineToCommand.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / LineToCommand # Interface: LineToCommand Defined in: [src/types.ts:2935](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2935) Vector path command for drawing a straight line. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `type` | `"lineTo"` | Discriminator identifying this option or command shape. | [src/types.ts:2937](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2937) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2939](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2939) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2941](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2941) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ListItemDefinition.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ListItemDefinition # Interface: ListItemDefinition Defined in: [src/types.ts:1945](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1945) Detailed list item object with optional nested children. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `annotations?` | readonly [`ParagraphTextAnnotation`](../type-aliases/ParagraphTextAnnotation.md)\[] | Inline annotations anchored to substrings of the rendered body text. | [src/types.ts:1953](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1953) | | `body?` | `string` | Primary list item text. | [src/types.ts:1947](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1947) | | `children?` | readonly [`ListItem`](../type-aliases/ListItem.md)\[] | Nested child list items or structure elements. | [src/types.ts:1951](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1951) | | `label?` | `string` | Explicit list marker or button label text. | [src/types.ts:1949](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1949) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ListOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ListOptions # Interface: ListOptions Defined in: [src/types.ts:1964](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1964) Options for rendering tagged ordered or unordered lists. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `align?` | [`TextAlign`](../type-aliases/TextAlign.md) | Horizontal alignment for laid-out content. | [src/types.ts:1988](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1988) | | `bullet?` | `string` | Bullet text used for unordered list items. | [src/types.ts:1996](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1996) | | `characterSpacing?` | `number` | Additional spacing between characters in PDF points. | [src/types.ts:1982](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1982) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:1980](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1980) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | [src/types.ts:1976](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1976) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | [src/types.ts:1974](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1974) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | [src/types.ts:1972](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1972) | | `fontSize?` | `number` | Font size in PDF points. | [src/types.ts:1978](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1978) | | `indent?` | `number` | List indentation in PDF points. | [src/types.ts:2000](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2000) | | `itemSpacing?` | `number` | Vertical spacing between list items in PDF points. | [src/types.ts:1998](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1998) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | [src/types.ts:1990](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1990) | | `labelGap?` | `number` | Gap between list labels and item bodies in PDF points. | [src/types.ts:2002](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2002) | | `lineHeight?` | `number` | Line height in PDF points. | [src/types.ts:1986](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1986) | | `ordered?` | `boolean` | Whether to render the list with ordered labels. | [src/types.ts:1992](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1992) | | `startAt?` | `number` | Starting number for ordered output. | [src/types.ts:1994](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1994) | | `width` | `number` | Width in PDF points. | [src/types.ts:1970](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1970) | | `wordSpacing?` | `number` | Additional spacing between words in PDF points. | [src/types.ts:1984](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1984) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:1966](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1966) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:1968](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1968) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/MoveToCommand.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / MoveToCommand # Interface: MoveToCommand Defined in: [src/types.ts:2923](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2923) Vector path command for moving the current point without drawing. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `type` | `"moveTo"` | Discriminator identifying this option or command shape. | [src/types.ts:2925](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2925) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2927](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2927) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2929](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2929) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/NodeWritableLike.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / NodeWritableLike # Interface: NodeWritableLike Defined in: [src/internal/byte-sink.ts:16](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L16) Minimal writable-stream shape accepted by NodeStreamSink. ## Methods ### end() ```ts end(callback?): unknown; ``` Defined in: [src/internal/byte-sink.ts:28](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L28) Ends the writable stream. #### Parameters | Parameter | Type | | ------ | ------ | | `callback?` | (`error?`) => `void` | #### Returns `unknown` *** ### off()? #### Call Signature ```ts optional off(event, listener): unknown; ``` Defined in: [src/internal/byte-sink.ts:24](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L24) Removes a previously registered drain listener. ##### Parameters | Parameter | Type | | ------ | ------ | | `event` | `"drain"` | | `listener` | () => `void` | ##### Returns `unknown` #### Call Signature ```ts optional off(event, listener): unknown; ``` Defined in: [src/internal/byte-sink.ts:26](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L26) Removes a previously registered error listener. ##### Parameters | Parameter | Type | | ------ | ------ | | `event` | `"error"` | | `listener` | (`error`) => `void` | ##### Returns `unknown` *** ### once() #### Call Signature ```ts once(event, listener): unknown; ``` Defined in: [src/internal/byte-sink.ts:20](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L20) Registers a one-time listener for the drain event. ##### Parameters | Parameter | Type | | ------ | ------ | | `event` | `"drain"` | | `listener` | () => `void` | ##### Returns `unknown` #### Call Signature ```ts once(event, listener): unknown; ``` Defined in: [src/internal/byte-sink.ts:22](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L22) Registers a one-time listener for the error event. ##### Parameters | Parameter | Type | | ------ | ------ | | `event` | `"error"` | | `listener` | (`error`) => `void` | ##### Returns `unknown` *** ### write() ```ts write(chunk, callback?): boolean; ``` Defined in: [src/internal/byte-sink.ts:18](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/byte-sink.ts#L18) Writes a byte chunk and reports whether the stream is ready for more data. #### Parameters | Parameter | Type | | ------ | ------ | | `chunk` | `Uint8Array` | | `callback?` | (`error?`) => `void` | #### Returns `boolean` --- --- url: 'https://zeropdf.criston.dev/api/interfaces/NoteAnnotationOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / NoteAnnotationOptions # Interface: NoteAnnotationOptions Defined in: [src/types.ts:2438](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2438) Options for creating a text note annotation. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `contents` | `string` | Annotation contents text. | [src/types.ts:2448](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2448) | | `height?` | `number` | Height in PDF points. | [src/types.ts:2446](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2446) | | `open?` | `boolean` | Whether the note annotation is initially open. | [src/types.ts:2450](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2450) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2454](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2454) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2452](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2452) | | `width?` | `number` | Width in PDF points. | [src/types.ts:2444](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2444) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2440](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2440) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2442](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2442) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/OutlineOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / OutlineOptions # Interface: OutlineOptions Defined in: [src/types.ts:518](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L518) Options that control outline item state, such as expansion. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `expanded?` | `boolean` | Whether outline items are expanded by default. | [src/types.ts:520](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L520) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PageLabelOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PageLabelOptions # Interface: PageLabelOptions Defined in: [src/types.ts:536](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L536) Options for assigning logical page labels and numbering styles. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `prefix?` | `string` | Text prefix prepended to page labels. | [src/types.ts:540](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L540) | | `startAt?` | `number` | Starting number for ordered output. | [src/types.ts:542](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L542) | | `style?` | [`PageLabelStyle`](../type-aliases/PageLabelStyle.md) | Page-label numbering style. | [src/types.ts:538](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L538) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PageLinkOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PageLinkOptions # Interface: PageLinkOptions Defined in: [src/types.ts:2216](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2216) Options for creating an internal link annotation to another page. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [src/types.ts:2226](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2226) | | `height` | `number` | Height in PDF points. | [src/types.ts:2224](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2224) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2230](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2230) | | `tag?` | `"Link"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2228](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2228) | | `width` | `number` | Width in PDF points. | [src/types.ts:2222](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2222) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2218](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2218) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2220](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2220) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PageOptions # Interface: PageOptions Defined in: [src/types.ts:548](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L548) Options for creating or inserting a page. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `origin?` | `"bottom-left"` | `"top-left"` | Coordinate origin for this page's drawing APIs. "bottom-left" (default) is the native PDF system where `y` grows upward. "top-left" flips `y` so it grows downward from the top edge, matching screen/CSS conventions. Applies to the page drawing, annotation, and form-field methods (`text`, `textBlock`, `richText`, `rect`, `line`, `circle`, `ellipse`, `image`, `path`, `link`, `highlight`, `note`, `freeText`, `textField`, `checkBox`, `choiceField`, `radioGroup`, `pushButton`, `signatureField`, …). The flow/template layout APIs always use bottom-left coordinates. | [src/types.ts:574](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L574) | | `size?` | [`PageSize`](../type-aliases/PageSize.md) | Page size for the generated page. | [src/types.ts:550](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L550) | | `tabOrder?` | `"R"` | `"C"` | `"S"` | Tab order for annotations and form fields on the page. Uses PDF spec values: "R" (row order), "C" (column order), "S" (structure order). Defaults to structure order ("S") for tagged documents, row order otherwise. | [src/types.ts:562](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L562) | | `transparencyGroup?` | [`PageTransparencyGroupOptions`](PageTransparencyGroupOptions.md) | Transparency group dict applied to the page (ISO 32000-2 § 11.6.6). Required by some workflows when the page contains transparency or blend modes that must compose against an explicit blending color space. | [src/types.ts:556](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L556) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PageTextExtraction.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PageTextExtraction # Interface: PageTextExtraction Defined in: [src/internal/text-extract.ts:34](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L34) Per-page extraction result. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `pageIndex` | `readonly` | `number` | Zero-based page index. | [src/internal/text-extract.ts:36](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L36) | | `runs` | `readonly` | readonly [`PositionedTextRun`](PositionedTextRun.md)\[] | Positioned runs in stream order. | [src/internal/text-extract.ts:40](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L40) | | `text` | `readonly` | `string` | Concatenated text in stream order. | [src/internal/text-extract.ts:38](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L38) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PageTransparencyGroupOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PageTransparencyGroupOptions # Interface: PageTransparencyGroupOptions Defined in: [src/types.ts:580](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L580) Page-level transparency group options. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `colorSpace?` | `"DeviceRGB"` | `"DeviceCMYK"` | `"DeviceGray"` | Blending color space. Defaults to DeviceRGB. | [src/types.ts:582](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L582) | | `isolated?` | `boolean` | Whether the group is isolated (/I). Defaults to true for page groups. | [src/types.ts:584](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L584) | | `knockout?` | `boolean` | Whether the group is a knockout group (/K). Defaults to false. | [src/types.ts:586](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L586) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParagraphHighlightAnnotation.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParagraphHighlightAnnotation # Interface: ParagraphHighlightAnnotation Defined in: [src/types.ts:1446](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1446) Highlight a substring of a paragraph. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `color?` | `readonly` | [`PdfColor`](../type-aliases/PdfColor.md) | Fill color of the highlight rectangle. | [src/types.ts:1453](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1453) | | `match` | `readonly` | `string` | Substring to locate in the rendered paragraph text. | [src/types.ts:1449](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1449) | | `occurrence?` | `readonly` | `number` | Zero-based occurrence index to annotate; defaults to every occurrence. | [src/types.ts:1451](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1451) | | `padding?` | `readonly` | | `number` | { `bottom?`: `number`; `left?`: `number`; `right?`: `number`; `top?`: `number`; } | Extra padding in points added around the rect on each side. Defaults to 2 above/below, 0 left/right. | [src/types.ts:1455](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1455) | | `tag?` | `readonly` | `"Annot"` | `"Artifact"` | Structure tag override for the highlight annotation. | [src/types.ts:1460](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1460) | | `type` | `readonly` | `"highlight"` | - | [src/types.ts:1447](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1447) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParagraphLinkAnnotation.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParagraphLinkAnnotation # Interface: ParagraphLinkAnnotation Defined in: [src/types.ts:1522](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1522) Wrap a substring in a clickable URI link. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `borderWidth?` | `readonly` | `number` | Border width in points. | [src/types.ts:1531](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1531) | | `match` | `readonly` | `string` | Substring to locate in the rendered paragraph text. | [src/types.ts:1525](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1525) | | `occurrence?` | `readonly` | `number` | Zero-based occurrence index to annotate; defaults to every occurrence. | [src/types.ts:1527](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1527) | | `tag?` | `readonly` | `"Link"` | `"Artifact"` | Structure tag override. | [src/types.ts:1533](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1533) | | `type` | `readonly` | `"link"` | - | [src/types.ts:1523](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1523) | | `url` | `readonly` | `string` | Target URI. | [src/types.ts:1529](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1529) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParagraphNoteAnnotation.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParagraphNoteAnnotation # Interface: ParagraphNoteAnnotation Defined in: [src/types.ts:1503](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1503) Attach a sticky-note annotation anchored to a substring. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `anchor?` | `readonly` | `"before"` | `"after"` | Icon anchor relative to the matched text. Defaults to "before". | [src/types.ts:1514](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1514) | | `contents` | `readonly` | `string` | Contents of the note. | [src/types.ts:1510](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1510) | | `match` | `readonly` | `string` | Substring to locate in the rendered paragraph text. | [src/types.ts:1506](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1506) | | `occurrence?` | `readonly` | `number` | Zero-based occurrence index to annotate; defaults to every occurrence. | [src/types.ts:1508](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1508) | | `open?` | `readonly` | `boolean` | Whether the note pops open by default. | [src/types.ts:1512](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1512) | | `size?` | `readonly` | `number` | Note icon size in points. Defaults to fontSize + 4. | [src/types.ts:1516](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1516) | | `tag?` | `readonly` | `"Annot"` | `"Artifact"` | Structure tag override. | [src/types.ts:1518](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1518) | | `type` | `readonly` | `"note"` | - | [src/types.ts:1504](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1504) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParagraphSquigglyAnnotation.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParagraphSquigglyAnnotation # Interface: ParagraphSquigglyAnnotation Defined in: [src/types.ts:1490](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1490) Draw a squiggly underline beneath a substring (text-markup `/Squiggly`). ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `color?` | `readonly` | [`PdfColor`](../type-aliases/PdfColor.md) | Stroke color. Defaults to red. | [src/types.ts:1497](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1497) | | `match` | `readonly` | `string` | Substring to locate in the rendered paragraph text. | [src/types.ts:1493](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1493) | | `occurrence?` | `readonly` | `number` | Zero-based occurrence index; defaults to every occurrence. | [src/types.ts:1495](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1495) | | `tag?` | `readonly` | `"Annot"` | `"Artifact"` | Structure tag override. | [src/types.ts:1499](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1499) | | `type` | `readonly` | `"squiggly"` | - | [src/types.ts:1491](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1491) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParagraphStrikeOutAnnotation.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParagraphStrikeOutAnnotation # Interface: ParagraphStrikeOutAnnotation Defined in: [src/types.ts:1477](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1477) Strike out a substring of a paragraph (text-markup `/StrikeOut`). ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `color?` | `readonly` | [`PdfColor`](../type-aliases/PdfColor.md) | Stroke color. Defaults to red. | [src/types.ts:1484](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1484) | | `match` | `readonly` | `string` | Substring to locate in the rendered paragraph text. | [src/types.ts:1480](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1480) | | `occurrence?` | `readonly` | `number` | Zero-based occurrence index; defaults to every occurrence. | [src/types.ts:1482](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1482) | | `tag?` | `readonly` | `"Annot"` | `"Artifact"` | Structure tag override. | [src/types.ts:1486](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1486) | | `type` | `readonly` | `"strikeOut"` | - | [src/types.ts:1478](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1478) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParagraphUnderlineAnnotation.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParagraphUnderlineAnnotation # Interface: ParagraphUnderlineAnnotation Defined in: [src/types.ts:1464](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1464) Underline a substring of a paragraph (text-markup `/Underline`). ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `color?` | `readonly` | [`PdfColor`](../type-aliases/PdfColor.md) | Stroke color. Defaults to black. | [src/types.ts:1471](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1471) | | `match` | `readonly` | `string` | Substring to locate in the rendered paragraph text. | [src/types.ts:1467](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1467) | | `occurrence?` | `readonly` | `number` | Zero-based occurrence index; defaults to every occurrence. | [src/types.ts:1469](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1469) | | `tag?` | `readonly` | `"Annot"` | `"Artifact"` | Structure tag override. | [src/types.ts:1473](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1473) | | `type` | `readonly` | `"underline"` | - | [src/types.ts:1465](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1465) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParseDocumentOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParseDocumentOptions # Interface: ParseDocumentOptions Defined in: [src/parser.ts:305](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L305) Options that control parsing behavior for existing PDFs. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `password?` | `readonly` | `string` | Password used to open an encrypted source PDF. | [src/parser.ts:307](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L307) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParsedPdfAttachment.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParsedPdfAttachment # Interface: ParsedPdfAttachment Defined in: [src/parser.ts:146](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L146) Attachment metadata discovered while parsing an existing PDF. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `byteLength?` | `readonly` | `number` | Attachment byte length when it can be determined. | [src/parser.ts:154](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L154) | | `description?` | `readonly` | `string` | Human-readable attachment description. | [src/parser.ts:150](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L150) | | `mimeType?` | `readonly` | `string` | MIME type associated with the attachment. | [src/parser.ts:152](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L152) | | `name` | `readonly` | `string` | Name of the item, field, destination, or signer. | [src/parser.ts:148](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L148) | | `objectId?` | `readonly` | `number` | PDF indirect object number for the parsed item. | [src/parser.ts:156](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L156) | --- --- url: >- https://zeropdf.criston.dev/api/interfaces/ParsedPdfEditableStructureElement.md --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParsedPdfEditableStructureElement # Interface: ParsedPdfEditableStructureElement Defined in: [src/parser.ts:218](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L218) Editable structure element handle returned by editable-document queries. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `actualText?` | `readonly` | `string` | Replacement text exposed to assistive technology. | [src/parser.ts:234](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L234) | | `altText?` | `readonly` | `string` | Alternate text for tagged non-text content. | [src/parser.ts:232](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L232) | | `children?` | `readonly` | readonly `ParsedPdfEditableStructureElement`\[] | Nested child list items or structure elements. | [src/parser.ts:238](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L238) | | `language?` | `readonly` | `string` | BCP 47 language tag for document or structure content. | [src/parser.ts:236](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L236) | | `mcid?` | `readonly` | `number` | First marked-content id associated with the structure element. | [src/parser.ts:228](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L228) | | `mcids?` | `readonly` | readonly `number`\[] | Marked-content ids associated with the structure element. | [src/parser.ts:230](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L230) | | `objectId` | `readonly` | `number` | PDF indirect object number for the parsed item. | [src/parser.ts:220](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L220) | | `pageObjectId?` | `readonly` | `number` | Object id of the page associated with this item. | [src/parser.ts:226](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L226) | | `parentObjectId?` | `readonly` | `number` | Object id of the parent structure element. | [src/parser.ts:224](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L224) | | `role` | `readonly` | `string` | Structure role used to tag this content. | [src/parser.ts:222](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L222) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParsedPdfFormField.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParsedPdfFormField # Interface: ParsedPdfFormField Defined in: [src/parser.ts:244](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L244) Form field metadata discovered while parsing an existing PDF. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `buttonKind?` | `readonly` | `"checkBox"` | `"pushButton"` | `"radio"` | Resolved button field subtype. | [src/parser.ts:252](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L252) | | `checked?` | `readonly` | `boolean` | Initial checkbox checked state. | [src/parser.ts:260](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L260) | | `choiceMode?` | `readonly` | `"list"` | `"combo"` | Resolved choice field display mode. | [src/parser.ts:258](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L258) | | `fieldType?` | `readonly` | `string` | Raw AcroForm field type name. | [src/parser.ts:250](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L250) | | `multiline?` | `readonly` | `boolean` | Whether the text field accepts multiple lines. | [src/parser.ts:270](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L270) | | `name` | `readonly` | `string` | Name of the item, field, destination, or signer. | [src/parser.ts:248](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L248) | | `objectId` | `readonly` | `number` | PDF indirect object number for the parsed item. | [src/parser.ts:246](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L246) | | `options?` | `readonly` | readonly `string`\[] | Options that control this item. | [src/parser.ts:256](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L256) | | `pageObjectId?` | `readonly` | `number` | Object id of the page associated with this item. | [src/parser.ts:262](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L262) | | `readOnly?` | `readonly` | `boolean` | Whether the form field is read-only. | [src/parser.ts:266](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L266) | | `rect?` | `readonly` | readonly `number`\[] | Annotation or widget rectangle in PDF coordinates. | [src/parser.ts:264](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L264) | | `required?` | `readonly` | `boolean` | Whether the form field is required. | [src/parser.ts:268](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L268) | | `value?` | `readonly` | `string` | Current or default value for the option. | [src/parser.ts:254](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L254) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParsedPdfIndirectObject.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParsedPdfIndirectObject # Interface: ParsedPdfIndirectObject Defined in: [src/parser.ts:37](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L37) Low-level parsed indirect object record. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `generation` | `readonly` | `number` | PDF indirect object generation number. | [src/parser.ts:41](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L41) | | `id` | `readonly` | `number` | PDF indirect object number. | [src/parser.ts:39](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L39) | | `offset` | `readonly` | `number` | Byte offset where the indirect object was parsed. | [src/parser.ts:43](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L43) | | `value` | `readonly` | `PdfValue` | Current or default value for the option. | [src/parser.ts:45](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L45) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParsedPdfMetadata.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParsedPdfMetadata # Interface: ParsedPdfMetadata Defined in: [src/parser.ts:78](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L78) Document metadata discovered while parsing an existing PDF. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `author?` | `readonly` | `string` | Document author name. | [src/parser.ts:82](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L82) | | `creationDate?` | `readonly` | `string` | Document creation date. | [src/parser.ts:92](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L92) | | `creator?` | `readonly` | `string` | Application or person that created the document. | [src/parser.ts:88](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L88) | | `keywords?` | `readonly` | `string` | Document keywords for search and metadata. | [src/parser.ts:86](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L86) | | `modificationDate?` | `readonly` | `string` | Document modification date. | [src/parser.ts:94](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L94) | | `producer?` | `readonly` | `string` | PDF producer value recorded in metadata. | [src/parser.ts:90](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L90) | | `subject?` | `readonly` | `string` | Document subject or summary. | [src/parser.ts:84](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L84) | | `title?` | `readonly` | `string` | Document title or display title. | [src/parser.ts:80](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L80) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParsedPdfNamedDestination.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParsedPdfNamedDestination # Interface: ParsedPdfNamedDestination Defined in: [src/parser.ts:100](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L100) Named destination discovered while parsing an existing PDF. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `mode?` | `readonly` | `string` | Choice field display mode. | [src/parser.ts:106](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L106) | | `name` | `readonly` | `string` | Name of the item, field, destination, or signer. | [src/parser.ts:102](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L102) | | `pageObjectId?` | `readonly` | `number` | Object id of the page associated with this item. | [src/parser.ts:104](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L104) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParsedPdfOutlineItem.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParsedPdfOutlineItem # Interface: ParsedPdfOutlineItem Defined in: [src/parser.ts:112](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L112) Outline item discovered while parsing an existing PDF. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `children` | `readonly` | readonly `ParsedPdfOutlineItem`\[] | Nested child list items or structure elements. | [src/parser.ts:120](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L120) | | `targetName?` | `readonly` | `string` | Named destination targeted by the outline item. | [src/parser.ts:116](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L116) | | `targetPageObjectId?` | `readonly` | `number` | Page object id targeted by the outline item. | [src/parser.ts:118](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L118) | | `title` | `readonly` | `string` | Document title or display title. | [src/parser.ts:114](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L114) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParsedPdfPage.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParsedPdfPage # Interface: ParsedPdfPage Defined in: [src/parser.ts:64](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L64) ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `contentObjectIds` | `readonly` | readonly `number`\[] | Object ids of content streams attached to the page. | [src/parser.ts:70](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L70) | | `mediaBox?` | `readonly` | readonly `number`\[] | Parsed page media box array. | [src/parser.ts:68](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L68) | | `objectId` | `readonly` | `number` | PDF indirect object number for the parsed item. | [src/parser.ts:66](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L66) | | `resources?` | `readonly` | `PdfDict` | Resolved Resources dictionary (inherited from page tree if absent on page). | [src/parser.ts:72](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L72) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParsedPdfPageLabelRange.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParsedPdfPageLabelRange # Interface: ParsedPdfPageLabelRange Defined in: [src/parser.ts:126](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L126) Page-label range discovered while parsing an existing PDF. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `prefix?` | `readonly` | `string` | Text prefix prepended to page labels. | [src/parser.ts:138](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L138) | | `startAt` | `readonly` | `number` | Starting number for ordered output. | [src/parser.ts:140](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L140) | | `startPageIndex` | `readonly` | `number` | Zero-based page index where the label range starts. | [src/parser.ts:128](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L128) | | `style?` | `readonly` | | `"decimal"` | `"romanUpper"` | `"romanLower"` | `"lettersUpper"` | `"lettersLower"` | Page-label numbering style. | [src/parser.ts:130](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L130) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ParsedPdfStructureElement.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParsedPdfStructureElement # Interface: ParsedPdfStructureElement Defined in: [src/parser.ts:162](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L162) Tagged structure element discovered while parsing an existing PDF. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `actualText?` | `readonly` | `string` | Replacement text exposed to assistive technology. | [src/parser.ts:174](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L174) | | `altText?` | `readonly` | `string` | Alternate text for tagged non-text content. | [src/parser.ts:172](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L172) | | `children?` | `readonly` | readonly `ParsedPdfStructureElement`\[] | Nested child list items or structure elements. | [src/parser.ts:178](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L178) | | `language?` | `readonly` | `string` | BCP 47 language tag for document or structure content. | [src/parser.ts:176](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L176) | | `mcid?` | `readonly` | `number` | First marked-content id associated with the structure element. | [src/parser.ts:168](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L168) | | `mcids?` | `readonly` | readonly `number`\[] | Marked-content ids associated with the structure element. | [src/parser.ts:170](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L170) | | `pageObjectId?` | `readonly` | `number` | Object id of the page associated with this item. | [src/parser.ts:166](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L166) | | `role` | `readonly` | `string` | Structure role used to tag this content. | [src/parser.ts:164](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L164) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PathStyle.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PathStyle # Interface: PathStyle Defined in: [src/types.ts:2863](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2863) Painting, stroke, fill, transform, and tagging options for vector paths. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `fill?` | [`FillStyle`](FillStyle.md) | Fill. | [src/types.ts:2869](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2869) | | `paint` | `"fill"` | `"stroke"` | `"fillStroke"` | Paint. | [src/types.ts:2865](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2865) | | `stroke?` | [`StrokeStyle`](StrokeStyle.md) | Stroke. | [src/types.ts:2867](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2867) | | `tag?` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2871](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2871) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/Pdf2ComplianceIssue.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / Pdf2ComplianceIssue # Interface: Pdf2ComplianceIssue Defined in: [src/internal/pdf2-validation.ts:7](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/pdf2-validation.ts#L7) PDF 2.0 conformance issue found while inspecting an existing document. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `code` | `readonly` | `string` | Stable machine-readable issue or error code. | [src/internal/pdf2-validation.ts:9](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/pdf2-validation.ts#L9) | | `message` | `readonly` | `string` | Human-readable diagnostic message. | [src/internal/pdf2-validation.ts:11](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/pdf2-validation.ts#L11) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PdfComplianceIssue.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfComplianceIssue # Interface: PdfComplianceIssue Defined in: [src/types.ts:362](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L362) Compliance validation issue returned by document validation. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `code` | `string` | Stable machine-readable issue or error code. | [src/types.ts:364](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L364) | | `message` | `string` | Human-readable diagnostic message. | [src/types.ts:368](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L368) | | `severity` | `"error"` | `"warning"` | Severity of the compliance issue. | [src/types.ts:366](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L366) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PdfEditableStructureQuery.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfEditableStructureQuery # Interface: PdfEditableStructureQuery Defined in: [src/document.ts:341](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L341) Query criteria for finding editable structure elements. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `hasAltText?` | `readonly` | `boolean` | Whether matched structure elements must have alternate text. | [src/document.ts:349](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L349) | | `objectIds?` | `readonly` | readonly `number`\[] | Specific structure element object ids to match. | [src/document.ts:351](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L351) | | `pageObjectId?` | `readonly` | `number` | Object id of the page associated with this item. | [src/document.ts:345](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L345) | | `parentObjectId?` | `readonly` | `number` | Object id of the parent structure element. | [src/document.ts:347](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L347) | | `role?` | `readonly` | `string` | Structure role used to tag this content. | [src/document.ts:343](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L343) | --- --- url: >- https://zeropdf.criston.dev/api/interfaces/PdfEditableStructureSimilarityOptions.md --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfEditableStructureSimilarityOptions # Interface: PdfEditableStructureSimilarityOptions Defined in: [src/document.ts:357](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L357) Options for finding structurally similar tagged elements. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `scope?` | `readonly` | `"page"` | `"document"` | `"siblings"` | Search scope used when finding related structure elements. | [src/document.ts:359](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L359) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PdfEmbeddedFont.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfEmbeddedFont # Interface: PdfEmbeddedFont Defined in: [src/types.ts:26](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L26) Font handle returned after embedding a TrueType font in a document. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `id` | `readonly` | `string` | PDF indirect object number. | [src/types.ts:30](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L30) | | `kind` | `readonly` | `"embedded-font"` | Discriminator identifying this value shape. | [src/types.ts:28](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L28) | | `postScriptName` | `readonly` | `string` | Post script name. | [src/types.ts:32](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L32) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PdfStructureOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfStructureOptions # Interface: PdfStructureOptions Defined in: [src/types.ts:315](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L315) Accessibility metadata and attributes for tagged PDF structure elements. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `actualText?` | `string` | Replacement text exposed to assistive technology. | [src/types.ts:319](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L319) | | `altText?` | `string` | Alternate text for tagged non-text content. | [src/types.ts:317](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L317) | | `artifactType?` | `"Pagination"` | `"Layout"` | `"Page"` | Artifact type classification for tagged PDF content. "Pagination" for headers/footers, "Layout" for typographic ornaments, "Page" for watermarks. Emitted as /Type in the /Artifact BMC/EMC pair. | [src/types.ts:338](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L338) | | `associatedFiles?` | `object`\[] | Associated files embedded in the structure element. Each file is emitted as an EmbeddedFile stream and Filespec, and referenced from the StructElem /AF array. | [src/types.ts:344](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L344) | | `attributes?` | `Record`<`string`, [`PdfStructureAttributeValue`](../type-aliases/PdfStructureAttributeValue.md)> | Structure attributes to emit for the tagged element. | [src/types.ts:325](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L325) | | `boundingBox?` | [`PdfBoundingBox`](../type-aliases/PdfBoundingBox.md) | Bounding box associated with the structure element. | [src/types.ts:323](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L323) | | `expansion?` | `string` | Abbreviation or acronym expansion for the structure element (/E). Used by screen readers (PDF/UA accessibility attribute). | [src/types.ts:356](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L356) | | `language?` | `string` | BCP 47 language tag for document or structure content. | [src/types.ts:321](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L321) | | `mathML?` | `string` | MathML markup for a Formula structure element. Emitted as an associated file (Subtype application/mathml+xml, AFRelationship=Supplement) and referenced from the StructElem /AF array. Required by PDF/UA Mathematics for accessible mathematical content. | [src/types.ts:332](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L332) | | `phoneme?` | `string` | Pronunciation guide for the structure element (/Phoneme). Used by screen readers (PDF/UA accessibility attribute). | [src/types.ts:351](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L351) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PlacedTextBlockResult.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PlacedTextBlockResult # Interface: PlacedTextBlockResult Defined in: [src/types.ts:1020](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1020) Result of [PdfPage.placeTextBlock](../classes/PdfPage.md#placetextblock): the drawn block metrics plus the next y to continue at. ## Extends * [`BlockTextMetrics`](BlockTextMetrics.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `endY` | `number` | The y below the drawn block — where the next element can start (accounts for the page origin). | - | [src/types.ts:1022](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1022) | | `height` | `number` | Total height in PDF points (line count × line height). | [`BlockTextMetrics`](BlockTextMetrics.md).[`height`](BlockTextMetrics.md#property-height) | [src/types.ts:1008](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1008) | | `lineCount` | `number` | Number of lines after wrapping. | [`BlockTextMetrics`](BlockTextMetrics.md).[`lineCount`](BlockTextMetrics.md#property-linecount) | [src/types.ts:1010](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1010) | | `width` | `number` | Width of the longest rendered line in PDF points. | [`BlockTextMetrics`](BlockTextMetrics.md).[`width`](BlockTextMetrics.md#property-width) | [src/types.ts:1006](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1006) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PlacedTextResult.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PlacedTextResult # Interface: PlacedTextResult Defined in: [src/types.ts:1014](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1014) Result of [PdfPage.placeText](../classes/PdfPage.md#placetext): the drawn size plus the next y to continue at. ## Extends * [`TextMetrics`](TextMetrics.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `endY` | `number` | The y at the far edge of the drawn text — where the next element can start (accounts for the page origin). | - | [src/types.ts:1016](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1016) | | `height` | `number` | Height in PDF points (the font size). | [`TextMetrics`](TextMetrics.md).[`height`](TextMetrics.md#property-height) | [src/types.ts:1000](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1000) | | `width` | `number` | Rendered width in PDF points. | [`TextMetrics`](TextMetrics.md).[`width`](TextMetrics.md#property-width) | [src/types.ts:998](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L998) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PngImageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PngImageOptions # Interface: PngImageOptions Defined in: [src/types.ts:2128](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2128) Options for placing PNG images on a page. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `altText?` | `string` | Alternate text for tagged non-text content. | [src/types.ts:2138](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2138) | | `height` | `number` | Height in PDF points. | [src/types.ts:2136](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2136) | | `iccProfile?` | [`BinaryData`](../type-aliases/BinaryData.md) | ICC profile bytes used to tag the image's color space as ICCBased. | [src/types.ts:2146](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2146) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2142](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2142) | | `tag?` | | [`PdfFigureStructureTag`](../type-aliases/PdfFigureStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2140](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2140) | | `width` | `number` | Width in PDF points. | [src/types.ts:2134](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2134) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2130](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2130) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2132](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2132) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PositionedTextRun.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PositionedTextRun # Interface: PositionedTextRun Defined in: [src/internal/text-extract.ts:14](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L14) A single positioned text run produced by extraction. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `fontName?` | `readonly` | `string` | Active font resource name (e.g. "F1"); undefined when no font is set. | [src/internal/text-extract.ts:26](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L26) | | `fontSize` | `readonly` | `number` | Active font size at the time of emission. | [src/internal/text-extract.ts:24](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L24) | | `mcid?` | `readonly` | `number` | Marked-content MCID covering this run, if any. | [src/internal/text-extract.ts:28](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L28) | | `mcTag?` | `readonly` | `string` | Marked-content tag (e.g. "P", "Span", "Artifact") covering this run, if any. | [src/internal/text-extract.ts:30](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L30) | | `text` | `readonly` | `string` | Decoded Unicode text. | [src/internal/text-extract.ts:16](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L16) | | `width` | `readonly` | `number` | Width of the run in user-space points (sum of glyph advances). | [src/internal/text-extract.ts:22](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L22) | | `x` | `readonly` | `number` | Origin x in user space (PDF points). | [src/internal/text-extract.ts:18](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L18) | | `y` | `readonly` | `number` | Origin y in user space (PDF points). | [src/internal/text-extract.ts:20](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-extract.ts#L20) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/PushButtonOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PushButtonOptions # Interface: PushButtonOptions Defined in: [src/types.ts:2729](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2729) Options for creating a push-button form field. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [src/types.ts:2765](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2765) | | `appearance?` | `string` | Custom appearance stream content for the push button. Example: `"1 0 0 rg 0 0 100 20 re f"` | [src/types.ts:2760](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2760) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [src/types.ts:2747](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2747) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:2745](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2745) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [src/types.ts:2755](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2755) | | `font?` | [`FontName`](../type-aliases/FontName.md) | Font used to render text. | [src/types.ts:2741](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2741) | | `fontSize?` | `number` | Font size in PDF points. | [src/types.ts:2743](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2743) | | `height` | `number` | Height in PDF points. | [src/types.ts:2737](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2737) | | `label` | `string` | Explicit list marker or button label text. | [src/types.ts:2739](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2739) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [src/types.ts:2749](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2749) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2769](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2769) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2767](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2767) | | `width` | `number` | Width in PDF points. | [src/types.ts:2735](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2735) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2731](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2731) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2733](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2733) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/RadioGroupItemOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / RadioGroupItemOptions # Interface: RadioGroupItemOptions Defined in: [src/types.ts:2676](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2676) Options for a single radio button in a radio group. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `height` | `number` | Height in PDF points. | [src/types.ts:2686](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2686) | | `value` | `string` | Current or default value for the option. | [src/types.ts:2678](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2678) | | `width` | `number` | Width in PDF points. | [src/types.ts:2684](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2684) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2680](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2680) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2682](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2682) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/RadioGroupOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / RadioGroupOptions # Interface: RadioGroupOptions Defined in: [src/types.ts:2692](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2692) Options for creating a radio-button group form field. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [src/types.ts:2719](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2719) | | `appearance?` | | `string` | { `down?`: `string`; `normal?`: `string`; `rollover?`: `string`; } | Custom appearance stream for the radio group. Can be a raw PDF content stream string, or an object with optional normal (/N), down (/D), and rollover (/R) appearance strings. | [src/types.ts:2714](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2714) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [src/types.ts:2698](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2698) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [src/types.ts:2708](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2708) | | `items` | [`RadioGroupItemOptions`](RadioGroupItemOptions.md)\[] | Radio-button items in the group. | [src/types.ts:2694](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2694) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [src/types.ts:2700](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2700) | | `required?` | `boolean` | Whether the form field is required. | [src/types.ts:2702](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2702) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2723](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2723) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2721](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2721) | | `value?` | `string` | Current or default value for the option. | [src/types.ts:2696](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2696) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/RectCommand.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / RectCommand # Interface: RectCommand Defined in: [src/types.ts:2967](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2967) Vector path command for adding a rectangle. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `height` | `number` | Height in PDF points. | [src/types.ts:2977](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2977) | | `type` | `"rect"` | Discriminator identifying this option or command shape. | [src/types.ts:2969](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2969) | | `width` | `number` | Width in PDF points. | [src/types.ts:2975](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2975) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2971](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2971) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2973](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2973) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/RgbColor.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / RgbColor # Interface: RgbColor Defined in: [src/types.ts:625](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L625) RGB color representation used by drawing and text APIs. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `b` | `number` | Blue channel value normalized from 0 to 1. | [src/types.ts:633](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L633) | | `g` | `number` | Green channel value normalized from 0 to 1. | [src/types.ts:631](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L631) | | `kind` | `"rgb"` | Discriminator identifying this value shape. | [src/types.ts:627](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L627) | | `r` | `number` | Red channel value normalized from 0 to 1. | [src/types.ts:629](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L629) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/RichTextOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / RichTextOptions # Interface: RichTextOptions Defined in: [src/types.ts:948](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L948) Options for laying out a paragraph of inline rich-text runs. Coordinates and width behave like [TextBlockOptions](TextBlockOptions.md); the style fields supply defaults inherited by any [InlineTextRun](InlineTextRun.md) that omits them. Horizontal writing mode supports left/center/right/justify alignment and left-to-right or right-to-left ordering. Vertical writing mode stacks the runs in a single column. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `align?` | `"left"` | `"center"` | `"right"` | `"justify"` | Horizontal alignment of each line. Defaults to "left". Ignored in vertical mode. | [src/types.ts:958](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L958) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Default color for runs that omit one. | [src/types.ts:986](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L986) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Reading direction for the runs. "auto" detects from the run text. Right-to-left lays each line out from the right edge; this is line-level direction, not full mixed-direction bidirectional reordering. | [src/types.ts:975](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L975) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Default font for runs that omit one. | [src/types.ts:982](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L982) | | `fontSize?` | `number` | Default font size for runs that omit one. | [src/types.ts:984](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L984) | | `height?` | `number` | Box height in PDF points. With [verticalAlign](#property-verticalalign), the wrapped lines are positioned within a box of this height starting at `y` and extending downward. Has no effect unless `verticalAlign` is given. Horizontal mode only. | [src/types.ts:964](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L964) | | `kerning?` | `boolean` | Default kerning behavior for runs that omit it. | [src/types.ts:988](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L988) | | `lineHeight?` | `number` | Line height in PDF points (column spacing in vertical mode). Defaults to 1.2 × the largest run font size. | [src/types.ts:956](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L956) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:992](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L992) | | `tag?` | | [`PdfTextStructureTag`](../type-aliases/PdfTextStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. Defaults to "P". | [src/types.ts:990](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L990) | | `verticalAlign?` | [`VerticalAlign`](../type-aliases/VerticalAlign.md) | Vertical alignment of the wrapped runs within `height`. Requires `height`. Defaults to "top". Horizontal mode only. | [src/types.ts:969](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L969) | | `width` | `number` | Width in PDF points that runs wrap within (horizontal mode). | [src/types.ts:954](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L954) | | `writingMode?` | `"horizontal"` | `"vertical"` | Writing mode. "horizontal" (default) flows runs left-to-right and wraps onto new lines. "vertical" stacks the runs top-to-bottom in one column. | [src/types.ts:980](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L980) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:950](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L950) | | `y` | `number` | Vertical position (baseline of the first line, or top of the column in vertical mode) in PDF points. | [src/types.ts:952](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L952) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/SeparationColor.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / SeparationColor # Interface: SeparationColor Defined in: [src/types.ts:666](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L666) Separation (single-ink spot color) color representation. Emitted as a Separation color space with a Type-2 exponential tint transform mapping the tint scalar to the alternate process color. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `alternate` | [`ProcessColor`](../type-aliases/ProcessColor.md) | Process-color value at full tint, used for the alternate color space. | [src/types.ts:674](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L674) | | `kind` | `"separation"` | Discriminator identifying this value shape. | [src/types.ts:668](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L668) | | `name` | `string` | Spot ink name, e.g. "PANTONE 185 C". Encoded into the PDF name token. | [src/types.ts:670](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L670) | | `tint` | `number` | Tint applied to the spot ink (0..1). | [src/types.ts:672](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L672) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ShapedGlyph.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ShapedGlyph # Interface: ShapedGlyph Defined in: [src/internal/text-shaper.ts:6](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-shaper.ts#L6) A single shaped glyph produced by a [TextShaper](TextShaper.md). ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `glyphId` | `number` | The glyph ID in the font. | [src/internal/text-shaper.ts:9](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-shaper.ts#L9) | | `xAdvance` | `number` | Horizontal advance width. | [src/internal/text-shaper.ts:15](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-shaper.ts#L15) | | `xOffset` | `number` | Horizontal offset for mark positioning. | [src/internal/text-shaper.ts:11](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-shaper.ts#L11) | | `yAdvance` | `number` | Vertical advance height. | [src/internal/text-shaper.ts:17](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-shaper.ts#L17) | | `yOffset` | `number` | Vertical offset for mark positioning. | [src/internal/text-shaper.ts:13](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-shaper.ts#L13) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/ShapeStyle.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ShapeStyle # Interface: ShapeStyle Defined in: [src/types.ts:2879](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2879) Simplified styling for the [PdfPage](../classes/PdfPage.md) shape helpers (`rect`, `line`, `circle`, `ellipse`). The paint mode is inferred: a `fill` and `stroke` together paint both; `fill` alone fills; otherwise the shape is stroked. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `dashArray?` | `number`\[] | Dash pattern for stroked shapes. | [src/types.ts:2891](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2891) | | `fill?` | [`ColorInput`](../type-aliases/ColorInput.md) | Fill color. Presence enables fill painting. | [src/types.ts:2881](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2881) | | `lineCap?` | [`LineCap`](../type-aliases/LineCap.md) | Line cap for stroked shapes. | [src/types.ts:2887](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2887) | | `lineJoin?` | [`LineJoin`](../type-aliases/LineJoin.md) | Line join for stroked shapes. | [src/types.ts:2889](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2889) | | `lineWidth?` | `number` | Stroke width in PDF points. | [src/types.ts:2885](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2885) | | `stroke?` | [`ColorInput`](../type-aliases/ColorInput.md) | Stroke color. Defaults to black when only `lineWidth` is set. | [src/types.ts:2883](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2883) | | `tag?` | `"Artifact"` | Structure tag; use "Artifact" to mark decorative shapes. | [src/types.ts:2893](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2893) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/SignatureFieldOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / SignatureFieldOptions # Interface: SignatureFieldOptions Defined in: [src/types.ts:2775](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2775) Options for creating a signature form field. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [src/types.ts:2805](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2805) | | `appearance?` | `string` | Custom appearance stream content for the signature field. Example: `"1 0 0 rg 0 0 100 20 re f"` | [src/types.ts:2800](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2800) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [src/types.ts:2785](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2785) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [src/types.ts:2795](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2795) | | `height` | `number` | Height in PDF points. | [src/types.ts:2783](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2783) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [src/types.ts:2787](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2787) | | `required?` | `boolean` | Whether the form field is required. | [src/types.ts:2789](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2789) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2809](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2809) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2807](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2807) | | `width` | `number` | Width in PDF points. | [src/types.ts:2781](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2781) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2777](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2777) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2779](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2779) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/SoftMaskHandle.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / SoftMaskHandle # Interface: SoftMaskHandle Defined in: [src/types.ts:749](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L749) Opaque handle returned by [PdfDocument.createLuminositySoftMask](../classes/PdfDocument.md#createluminositysoftmask). Pass to [ExtGStateOptions.softMask](ExtGStateOptions.md#property-softmask) to apply the mask. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `key` | `readonly` | `string` | Internal mask key, used by the serializer to resolve the form XObject. | [src/types.ts:751](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L751) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/SoftMaskOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / SoftMaskOptions # Interface: SoftMaskOptions Defined in: [src/types.ts:738](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L738) Options for creating a luminosity-based soft mask Form XObject. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `height` | `number` | Height of the mask form's BBox in PDF points. | [src/types.ts:742](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L742) | | `width` | `number` | Width of the mask form's BBox in PDF points. | [src/types.ts:740](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L740) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/SquigglyAnnotationOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / SquigglyAnnotationOptions # Interface: SquigglyAnnotationOptions Defined in: [src/types.ts:2418](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2418) Options for creating a squiggly text-markup annotation. Draws a wavy underline beneath the rectangle (commonly used to flag spelling or grammar concerns). ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for the squiggly stroke. Defaults to red. | [src/types.ts:2428](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2428) | | `height` | `number` | Height in PDF points. | [src/types.ts:2426](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2426) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2432](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2432) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2430](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2430) | | `width` | `number` | Width in PDF points. | [src/types.ts:2424](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2424) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2420](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2420) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2422](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2422) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/StrikeOutAnnotationOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / StrikeOutAnnotationOptions # Interface: StrikeOutAnnotationOptions Defined in: [src/types.ts:2396](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2396) Options for creating a strike-out text-markup annotation. Draws a horizontal line through the vertical middle of the rectangle. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for the strike-out stroke. Defaults to red. | [src/types.ts:2406](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2406) | | `height` | `number` | Height in PDF points. | [src/types.ts:2404](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2404) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2410](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2410) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2408](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2408) | | `width` | `number` | Width in PDF points. | [src/types.ts:2402](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2402) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2398](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2398) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2400](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2400) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/StrokeStyle.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / StrokeStyle # Interface: StrokeStyle Defined in: [src/types.ts:2835](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2835) Stroke styling for vector paths. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:2837](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2837) | | `dashArray?` | `number`\[] | Dash array. | [src/types.ts:2847](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2847) | | `dashPhase?` | `number` | Dash phase. | [src/types.ts:2849](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2849) | | `lineCap?` | [`LineCap`](../type-aliases/LineCap.md) | Line cap. | [src/types.ts:2841](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2841) | | `lineJoin?` | [`LineJoin`](../type-aliases/LineJoin.md) | Line join. | [src/types.ts:2843](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2843) | | `miterLimit?` | `number` | Miter limit. | [src/types.ts:2845](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2845) | | `width?` | `number` | Width in PDF points. | [src/types.ts:2839](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2839) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/SvgImageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / SvgImageOptions # Interface: SvgImageOptions Defined in: [src/types.ts:2333](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2333) Options for rendering SVG vector graphics on a page. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `altText?` | `string` | Alternate text for tagged non-text content. | [src/types.ts:2343](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2343) | | `height?` | `number` | Height in PDF points. | [src/types.ts:2341](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2341) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2347](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2347) | | `tag?` | | [`PdfFigureStructureTag`](../type-aliases/PdfFigureStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2345](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2345) | | `width?` | `number` | Width in PDF points. | [src/types.ts:2339](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2339) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2335](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2335) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2337](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2337) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TableCellDefinition.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TableCellDefinition # Interface: TableCellDefinition Defined in: [src/types.ts:2013](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2013) Detailed table cell object with span, header, scope, and structure options. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `annotations?` | readonly [`ParagraphTextAnnotation`](../type-aliases/ParagraphTextAnnotation.md)\[] | Inline annotations anchored to substrings of the rendered cell text. | [src/types.ts:2027](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2027) | | `colSpan?` | `number` | Number of columns spanned by the cell. | [src/types.ts:2023](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2023) | | `header?` | `boolean` | Callback that returns header blocks for each page. | [src/types.ts:2017](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2017) | | `rowSpan?` | `number` | Number of rows spanned by the cell. | [src/types.ts:2021](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2021) | | `scope?` | [`TableHeaderScope`](../type-aliases/TableHeaderScope.md) | Search scope used when finding related structure elements. | [src/types.ts:2019](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2019) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2025](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2025) | | `text` | `string` | Text content to render or inspect. | [src/types.ts:2015](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2015) | | `verticalAlign?` | [`VerticalAlign`](../type-aliases/VerticalAlign.md) | Vertical alignment of this cell's content within the row height, overriding [TableOptions.verticalAlign](TableOptions.md#property-verticalalign). | [src/types.ts:2032](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2032) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TableOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TableOptions # Interface: TableOptions Defined in: [src/types.ts:2047](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2047) Options for rendering tagged tables. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `align?` | [`TextAlign`](../type-aliases/TextAlign.md) | Horizontal alignment for laid-out content. | [src/types.ts:2081](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2081) | | `cellPadding?` | `number` | Padding inside table cells in PDF points. | [src/types.ts:2061](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2061) | | `characterSpacing?` | `number` | Additional spacing between characters in PDF points. | [src/types.ts:2075](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2075) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:2073](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2073) | | `columnWidths?` | readonly `number`\[] | Explicit table column widths in PDF points. | [src/types.ts:2055](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2055) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | [src/types.ts:2069](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2069) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | [src/types.ts:2067](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2067) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | [src/types.ts:2065](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2065) | | `fontSize?` | `number` | Font size in PDF points. | [src/types.ts:2071](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2071) | | `headerColumns?` | `number` | Number of leading columns treated as table headers. | [src/types.ts:2059](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2059) | | `headerRows?` | `number` | Number of leading rows treated as table headers. | [src/types.ts:2057](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2057) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | [src/types.ts:2089](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2089) | | `lineHeight?` | `number` | Line height in PDF points. | [src/types.ts:2079](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2079) | | `rowGap?` | `number` | Gap between table rows in PDF points. | [src/types.ts:2063](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2063) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2091](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2091) | | `summary?` | `string` | Table summary for accessibility (/Summary attribute on the table structure element). Provides a description of the table for screen readers. | [src/types.ts:2096](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2096) | | `verticalAlign?` | [`VerticalAlign`](../type-aliases/VerticalAlign.md) | Vertical alignment of each cell's content within its row height. Applies to cells shorter than the tallest cell in the row. Defaults to "top". Can be overridden per cell via [TableCellDefinition.verticalAlign](TableCellDefinition.md#property-verticalalign). | [src/types.ts:2087](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2087) | | `width` | `number` | Width in PDF points. | [src/types.ts:2053](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2053) | | `wordSpacing?` | `number` | Additional spacing between words in PDF points. | [src/types.ts:2077](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2077) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2049](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2049) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2051](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2051) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateAutoOutlineOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateAutoOutlineOptions # Interface: TemplateAutoOutlineOptions Defined in: [src/types.ts:1817](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1817) Top-level options for rendering a reusable document template. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `expanded?` | `boolean` | Whether outline items render expanded by default. | [src/types.ts:1821](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1821) | | `maxLevel?` | `1` | `2` | `6` | `5` | `4` | `3` | Deepest heading level to include (1-6). Default 3. | [src/types.ts:1819](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1819) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateCheckBoxBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateCheckBoxBlock # Interface: TemplateCheckBoxBlock Defined in: [src/types.ts:1656](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1656) Template block for rendering a checkbox form field. ## Properties | Property | Modifier | Type | Defined in | | ------ | ------ | ------ | ------ | | `keepWithNext?` | `readonly` | `boolean` | [src/types.ts:1660](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1660) | | `name` | `readonly` | `string` | [src/types.ts:1658](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1658) | | `options?` | `readonly` | `Omit`<[`CheckBoxOptions`](CheckBoxOptions.md), `"x"` | `"y"`> | [src/types.ts:1659](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1659) | | `type` | `readonly` | `"checkBox"` | [src/types.ts:1657](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1657) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateChoiceFieldBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateChoiceFieldBlock # Interface: TemplateChoiceFieldBlock Defined in: [src/types.ts:1666](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1666) Template block for rendering a choice form field. ## Properties | Property | Modifier | Type | Defined in | | ------ | ------ | ------ | ------ | | `keepWithNext?` | `readonly` | `boolean` | [src/types.ts:1670](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1670) | | `name` | `readonly` | `string` | [src/types.ts:1668](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1668) | | `options?` | `readonly` | `Omit`<[`ChoiceFieldOptions`](ChoiceFieldOptions.md), `"x"` | `"y"`> | [src/types.ts:1669](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1669) | | `type` | `readonly` | `"choiceField"` | [src/types.ts:1667](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1667) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateCustomBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateCustomBlock # Interface: TemplateCustomBlock Defined in: [src/types.ts:1778](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1778) Template block for user-defined rendering and estimation logic. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `estimate` | `readonly` | (`flow`) => `number` | Estimates the vertical height this block will consume. | [src/types.ts:1783](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1783) | | `keepWithNext?` | `readonly` | `boolean` | - | [src/types.ts:1784](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1784) | | `render` | `readonly` | (`flow`) => `number` | Renders the block and returns the vertical height consumed. | [src/types.ts:1781](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1781) | | `type` | `readonly` | `"custom"` | - | [src/types.ts:1779](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1779) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateDocumentOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateDocumentOptions # Interface: TemplateDocumentOptions Defined in: [src/types.ts:1903](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1903) Top-level options for rendering template blocks into a complete document. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `autoOutline?` | `boolean` | [`TemplateAutoOutlineOptions`](TemplateAutoOutlineOptions.md) | When set, auto-generates a bookmarks/outline tree from heading blocks. `true` uses defaults (maxLevel=3, collapsed); pass an object to customise. | [src/types.ts:1933](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1933) | | `blocks` | readonly [`TemplateBlock`](../type-aliases/TemplateBlock.md)\[] | Child template blocks to render. | [src/types.ts:1913](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1913) | | `footer?` | (`context`) => readonly [`TemplateBlock`](../type-aliases/TemplateBlock.md)\[] | Callback that returns footer blocks for each page. | [src/types.ts:1924](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1924) | | `header?` | (`context`) => readonly [`TemplateBlock`](../type-aliases/TemplateBlock.md)\[] | Callback that returns header blocks for each page. | [src/types.ts:1920](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1920) | | `info?` | [`DocumentInfo`](DocumentInfo.md) | Document information dictionary values. | [src/types.ts:1907](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1907) | | `page?` | [`TemplatePageOptions`](TemplatePageOptions.md) | Page. | [src/types.ts:1911](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1911) | | `pageNumber?` | [`TemplatePageNumberOptions`](TemplatePageNumberOptions.md) | One-based page number currently being rendered. | [src/types.ts:1928](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1928) | | `strictLayout?` | | `boolean` | [`TemplateStrictLayoutOptions`](TemplateStrictLayoutOptions.md) | Enables strict layout checks for fixed templates. When true, oversized content that would overflow a fresh page/column throws instead of being force-placed. | [src/types.ts:1939](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1939) | | `styles?` | [`TemplateStylesheet`](TemplateStylesheet.md) | Reusable named styles merged beneath each block's inline `options`. See [TemplateStylesheet](TemplateStylesheet.md) for the selector and cascade rules. | [src/types.ts:1918](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1918) | | `title?` | `string` | Document title applied to the information dictionary, structured XMP metadata, and display-title viewer preference. | [src/types.ts:1905](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1905) | | `xmpMetadata?` | [`XmpMetadataInput`](../type-aliases/XmpMetadataInput.md) | XMP metadata packet or structured XMP metadata input. | [src/types.ts:1909](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1909) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateFreeTextBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateFreeTextBlock # Interface: TemplateFreeTextBlock Defined in: [src/types.ts:1724](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1724) Template block for rendering a free-text annotation. ## Properties | Property | Modifier | Type | Defined in | | ------ | ------ | ------ | ------ | | `keepWithNext?` | `readonly` | `undefined` | [src/types.ts:1727](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1727) | | `options` | `readonly` | `Omit`<[`FreeTextAnnotationOptions`](FreeTextAnnotationOptions.md), `"x"` | `"y"`> | [src/types.ts:1726](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1726) | | `type` | `readonly` | `"freeText"` | [src/types.ts:1725](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1725) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateHeadingBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateHeadingBlock # Interface: TemplateHeadingBlock Defined in: [src/types.ts:1413](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1413) Template block for rendering a heading. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `annotations?` | `readonly` | readonly [`ParagraphTextAnnotation`](../type-aliases/ParagraphTextAnnotation.md)\[] | Inline annotations anchored to substrings of the rendered heading text. | [src/types.ts:1422](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1422) | | `class?` | `readonly` | `string` | readonly `string`\[] | Stylesheet class name(s) applied beneath inline `options`. | [src/types.ts:1420](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1420) | | `keepWithNext?` | `readonly` | `boolean` | Whether this block should stay on the same page as the following block when possible. | [src/types.ts:1424](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1424) | | `options?` | `readonly` | [`FlowHeadingOptions`](FlowHeadingOptions.md) | Options that control this item. | [src/types.ts:1418](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1418) | | `text` | `readonly` | `string` | Text content to render or inspect. | [src/types.ts:1416](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1416) | | `type` | `readonly` | `"heading"` | - | [src/types.ts:1414](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1414) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateHighlightBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateHighlightBlock # Interface: TemplateHighlightBlock Defined in: [src/types.ts:1706](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1706) Template block for rendering a highlight annotation. ## Properties | Property | Modifier | Type | Defined in | | ------ | ------ | ------ | ------ | | `keepWithNext?` | `readonly` | `undefined` | [src/types.ts:1709](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1709) | | `options` | `readonly` | `Omit`<[`HighlightAnnotationOptions`](HighlightAnnotationOptions.md), `"x"` | `"y"`> | [src/types.ts:1708](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1708) | | `type` | `readonly` | `"highlight"` | [src/types.ts:1707](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1707) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateImageBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateImageBlock # Interface: TemplateImageBlock Defined in: [src/types.ts:1588](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1588) Template block for rendering a PNG, JPEG, BMP, JBIG2, TIFF, or JPEG2000 image. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `class?` | `string` | readonly `string`\[] | Stylesheet class name(s) applied beneath inline `options`. | [src/types.ts:1596](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1596) | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | Binary data for the image, font, PDF, or attachment. | [src/types.ts:1592](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1592) | | `keepWithNext?` | `boolean` | Whether this block should stay on the same page as the following block when possible. | [src/types.ts:1598](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1598) | | `options?` | [`FlowImageOptions`](FlowImageOptions.md) | Options that control this item. | [src/types.ts:1594](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1594) | | `type` | `"png"` | `"jpeg"` | `"bmp"` | `"jbig2"` | `"tiff"` | `"jp2"` | `"webp"` | `"gif"` | `"svg"` | Discriminator identifying this option or command shape. | [src/types.ts:1590](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1590) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateLinkBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateLinkBlock # Interface: TemplateLinkBlock Defined in: [src/types.ts:1604](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1604) Template block for rendering a URI link. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `class?` | `string` | readonly `string`\[] | Stylesheet class name(s) applied beneath inline `options`. | [src/types.ts:1614](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1614) | | `keepWithNext?` | `boolean` | Whether this block should stay on the same page as the following block when possible. | [src/types.ts:1616](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1616) | | `options?` | [`FlowLinkOptions`](FlowLinkOptions.md) | Options that control this item. | [src/types.ts:1612](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1612) | | `text` | `string` | Text content to render or inspect. | [src/types.ts:1608](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1608) | | `type` | `"link"` | Discriminator identifying this option or command shape. | [src/types.ts:1606](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1606) | | `url` | `string` | URI target for the link. | [src/types.ts:1610](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1610) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateListBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateListBlock # Interface: TemplateListBlock Defined in: [src/types.ts:1766](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1766) Template block for rendering a tagged list. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `class?` | `readonly` | `string` | readonly `string`\[] | Stylesheet class name(s) applied beneath inline `options`. | [src/types.ts:1771](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1771) | | `items` | `readonly` | [`ListItem`](../type-aliases/ListItem.md)\[] | - | [src/types.ts:1768](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1768) | | `keepWithNext?` | `readonly` | `boolean` | - | [src/types.ts:1772](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1772) | | `options?` | `readonly` | `Omit`<[`ListOptions`](ListOptions.md), `"x"` | `"y"`> | - | [src/types.ts:1769](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1769) | | `type` | `readonly` | `"list"` | - | [src/types.ts:1767](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1767) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateNoteBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateNoteBlock # Interface: TemplateNoteBlock Defined in: [src/types.ts:1715](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1715) Template block for rendering a text note annotation. ## Properties | Property | Modifier | Type | Defined in | | ------ | ------ | ------ | ------ | | `keepWithNext?` | `readonly` | `undefined` | [src/types.ts:1718](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1718) | | `options` | `readonly` | `Omit`<[`NoteAnnotationOptions`](NoteAnnotationOptions.md), `"x"` | `"y"`> | [src/types.ts:1717](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1717) | | `type` | `readonly` | `"note"` | [src/types.ts:1716](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1716) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplatePageBreakBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplatePageBreakBlock # Interface: TemplatePageBreakBlock Defined in: [src/types.ts:1638](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1638) Template block that forces a new page. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `type` | `"pageBreak"` | Discriminator identifying this option or command shape. | [src/types.ts:1640](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1640) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplatePageLinkBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplatePageLinkBlock # Interface: TemplatePageLinkBlock Defined in: [src/types.ts:1733](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1733) Template block for rendering a page-to-page link annotation. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `keepWithNext?` | `readonly` | `undefined` | - | [src/types.ts:1738](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1738) | | `options` | `readonly` | `Omit`<[`PageLinkOptions`](PageLinkOptions.md), `"x"` | `"y"`> | - | [src/types.ts:1737](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1737) | | `target` | `readonly` | `number` | One-based page number to link to. | [src/types.ts:1736](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1736) | | `type` | `readonly` | `"pageLink"` | - | [src/types.ts:1734](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1734) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplatePageNumberOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplatePageNumberOptions # Interface: TemplatePageNumberOptions Defined in: [src/types.ts:1399](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1399) Options for automatic page-number rendering in templates. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `align?` | [`TemplatePageNumberAlign`](../type-aliases/TemplatePageNumberAlign.md) | Horizontal alignment for laid-out content. | [src/types.ts:1403](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1403) | | `format?` | (`context`) => `string` | Callback that formats the rendered page-number text. | [src/types.ts:1405](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1405) | | `options?` | [`FlowTextOptions`](FlowTextOptions.md) | Options that control this item. | [src/types.ts:1407](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1407) | | `region?` | [`TemplateRunningRegion`](../type-aliases/TemplateRunningRegion.md) | Running region where the content is rendered. | [src/types.ts:1401](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1401) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplatePageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplatePageOptions # Interface: TemplatePageOptions Defined in: [src/types.ts:1364](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1364) Page layout options used by template rendering. ## Extends * [`FlowOptions`](FlowOptions.md) ## Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `align?` | [`TextAlign`](../type-aliases/TextAlign.md) | Horizontal alignment for laid-out content. | [`FlowOptions`](FlowOptions.md).[`align`](FlowOptions.md#property-align) | [src/types.ts:1083](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1083) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [`FlowOptions`](FlowOptions.md).[`color`](FlowOptions.md#property-color) | [src/types.ts:1079](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1079) | | `columns?` | [`FlowColumnsOptions`](FlowColumnsOptions.md) | Newspaper-style flow columns. | [`FlowOptions`](FlowOptions.md).[`columns`](FlowOptions.md#property-columns) | [src/types.ts:1055](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1055) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | [`FlowOptions`](FlowOptions.md).[`direction`](FlowOptions.md#property-direction) | [src/types.ts:1075](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1075) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | [`FlowOptions`](FlowOptions.md).[`fallbackFonts`](FlowOptions.md#property-fallbackfonts) | [src/types.ts:1073](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1073) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | [`FlowOptions`](FlowOptions.md).[`font`](FlowOptions.md#property-font) | [src/types.ts:1071](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1071) | | `fontSize?` | `number` | Font size in PDF points. | [`FlowOptions`](FlowOptions.md).[`fontSize`](FlowOptions.md#property-fontsize) | [src/types.ts:1077](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1077) | | `footerHeight?` | `number` | Reserved footer height in PDF points. | - | [src/types.ts:1370](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1370) | | `gap?` | `number` | Default vertical gap between flow blocks in PDF points. | [`FlowOptions`](FlowOptions.md).[`gap`](FlowOptions.md#property-gap) | [src/types.ts:1067](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1067) | | `headerHeight?` | `number` | Reserved header height in PDF points. | - | [src/types.ts:1368](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1368) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | [`FlowOptions`](FlowOptions.md).[`kerning`](FlowOptions.md#property-kerning) | [src/types.ts:1085](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1085) | | `lineHeight?` | `number` | Line height in PDF points. | [`FlowOptions`](FlowOptions.md).[`lineHeight`](FlowOptions.md#property-lineheight) | [src/types.ts:1081](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1081) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [`FlowOptions`](FlowOptions.md).[`margin`](FlowOptions.md#property-margin) | [src/types.ts:1057](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1057) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [`FlowOptions`](FlowOptions.md).[`marginBottom`](FlowOptions.md#property-marginbottom) | [src/types.ts:1063](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1063) | | `marginLeft?` | `number` | Left margin in PDF points. | [`FlowOptions`](FlowOptions.md).[`marginLeft`](FlowOptions.md#property-marginleft) | [src/types.ts:1065](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1065) | | `marginRight?` | `number` | Right margin in PDF points. | [`FlowOptions`](FlowOptions.md).[`marginRight`](FlowOptions.md#property-marginright) | [src/types.ts:1061](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1061) | | `marginTop?` | `number` | Top margin in PDF points. | [`FlowOptions`](FlowOptions.md).[`marginTop`](FlowOptions.md#property-margintop) | [src/types.ts:1059](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1059) | | `size?` | [`PageSize`](../type-aliases/PageSize.md) | Page size for the generated page. | - | [src/types.ts:1366](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1366) | | `spacing?` | [`FlowSpacingScale`](FlowSpacingScale.md) | Semantic spacing scale used by flow layout. | [`FlowOptions`](FlowOptions.md).[`spacing`](FlowOptions.md#property-spacing) | [src/types.ts:1069](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1069) | | `width?` | `number` | Width in PDF points. | [`FlowOptions`](FlowOptions.md).[`width`](FlowOptions.md#property-width) | [src/types.ts:1053](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1053) | | `writingMode?` | `"horizontal"` | `"vertical"` | Text writing mode. "horizontal" (default) places characters left-to-right. "vertical" stacks characters top-to-bottom. | [`FlowOptions`](FlowOptions.md).[`writingMode`](FlowOptions.md#property-writingmode) | [src/types.ts:1090](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1090) | | `x?` | `number` | Horizontal position in PDF points. | [`FlowOptions`](FlowOptions.md).[`x`](FlowOptions.md#property-x) | [src/types.ts:1049](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1049) | | `y?` | `number` | Vertical position in PDF points. | [`FlowOptions`](FlowOptions.md).[`y`](FlowOptions.md#property-y) | [src/types.ts:1051](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1051) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateParagraphBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateParagraphBlock # Interface: TemplateParagraphBlock Defined in: [src/types.ts:1539](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1539) Template block for rendering a paragraph. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `annotations?` | `readonly` | readonly [`ParagraphTextAnnotation`](../type-aliases/ParagraphTextAnnotation.md)\[] | Inline annotations anchored to specific substrings of the rendered text. | [src/types.ts:1548](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1548) | | `class?` | `readonly` | `string` | readonly `string`\[] | Stylesheet class name(s) applied beneath inline `options`. | [src/types.ts:1546](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1546) | | `keepWithNext?` | `readonly` | `boolean` | Whether this block should stay on the same page as the following block when possible. | [src/types.ts:1550](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1550) | | `options?` | `readonly` | [`FlowTextOptions`](FlowTextOptions.md) | Options that control this item. | [src/types.ts:1544](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1544) | | `text` | `readonly` | `string` | Text content to render or inspect. | [src/types.ts:1542](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1542) | | `type` | `readonly` | `"paragraph"` | - | [src/types.ts:1540](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1540) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplatePathBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplatePathBlock # Interface: TemplatePathBlock Defined in: [src/types.ts:1744](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1744) Template block for rendering vector path commands. ## Properties | Property | Modifier | Type | Defined in | | ------ | ------ | ------ | ------ | | `commands` | `readonly` | [`PathCommand`](../type-aliases/PathCommand.md)\[] | [src/types.ts:1746](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1746) | | `height` | `readonly` | `number` | [src/types.ts:1748](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1748) | | `keepWithNext?` | `readonly` | `boolean` | [src/types.ts:1749](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1749) | | `style` | `readonly` | [`PathStyle`](PathStyle.md) | [src/types.ts:1747](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1747) | | `type` | `readonly` | `"path"` | [src/types.ts:1745](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1745) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplatePushButtonBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplatePushButtonBlock # Interface: TemplatePushButtonBlock Defined in: [src/types.ts:1686](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1686) Template block for rendering a push-button form field. ## Properties | Property | Modifier | Type | Defined in | | ------ | ------ | ------ | ------ | | `keepWithNext?` | `readonly` | `boolean` | [src/types.ts:1690](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1690) | | `name` | `readonly` | `string` | [src/types.ts:1688](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1688) | | `options?` | `readonly` | `Omit`<[`PushButtonOptions`](PushButtonOptions.md), `"x"` | `"y"`> | [src/types.ts:1689](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1689) | | `type` | `readonly` | `"pushButton"` | [src/types.ts:1687](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1687) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateRadioGroupBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateRadioGroupBlock # Interface: TemplateRadioGroupBlock Defined in: [src/types.ts:1676](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1676) Template block for rendering a radio-button group form field. ## Properties | Property | Modifier | Type | Defined in | | ------ | ------ | ------ | ------ | | `keepWithNext?` | `readonly` | `boolean` | [src/types.ts:1680](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1680) | | `name` | `readonly` | `string` | [src/types.ts:1678](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1678) | | `options?` | `readonly` | `Omit`<[`RadioGroupOptions`](RadioGroupOptions.md), `"x"` | `"y"`> | [src/types.ts:1679](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1679) | | `type` | `readonly` | `"radioGroup"` | [src/types.ts:1677](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1677) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateRectBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateRectBlock # Interface: TemplateRectBlock Defined in: [src/types.ts:1755](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1755) Template block for rendering a rectangle. ## Properties | Property | Modifier | Type | Defined in | | ------ | ------ | ------ | ------ | | `height` | `readonly` | `number` | [src/types.ts:1758](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1758) | | `keepWithNext?` | `readonly` | `boolean` | [src/types.ts:1760](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1760) | | `style` | `readonly` | [`PathStyle`](PathStyle.md) | [src/types.ts:1759](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1759) | | `type` | `readonly` | `"rect"` | [src/types.ts:1756](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1756) | | `width` | `readonly` | `number` | [src/types.ts:1757](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1757) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateRenderContext.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateRenderContext # Interface: TemplateRenderContext Defined in: [src/types.ts:1376](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1376) Context passed to template header, footer, and page-number callbacks. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `author?` | `readonly` | `string` | Document author name. | [src/types.ts:1384](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1384) | | `pageNumber` | `readonly` | `number` | One-based page number currently being rendered. | [src/types.ts:1378](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1378) | | `title?` | `readonly` | `string` | Document title or display title. | [src/types.ts:1382](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1382) | | `totalPages` | `readonly` | `number` | Total page count in the rendered template document. | [src/types.ts:1380](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1380) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateRichParagraphBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateRichParagraphBlock # Interface: TemplateRichParagraphBlock Defined in: [src/types.ts:1557](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1557) Template block for rendering a paragraph of inline rich-text runs, mixing fonts, weights, sizes, colors, and links on the same wrapping lines. ## Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `class?` | `readonly` | `string` | readonly `string`\[] | Stylesheet class name(s) applied beneath inline `options`. | [src/types.ts:1564](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1564) | | `keepWithNext?` | `readonly` | `boolean` | Whether this block should stay on the same page as the following block when possible. | [src/types.ts:1566](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1566) | | `options?` | `readonly` | [`FlowRichTextOptions`](FlowRichTextOptions.md) | Options that control this block. | [src/types.ts:1562](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1562) | | `runs` | `readonly` | readonly [`InlineTextRun`](InlineTextRun.md)\[] | The styled inline runs to lay out together. | [src/types.ts:1560](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1560) | | `type` | `readonly` | `"richParagraph"` | - | [src/types.ts:1558](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1558) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateSectionBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateSectionBlock # Interface: TemplateSectionBlock Defined in: [src/types.ts:1622](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1622) Template block that groups child blocks under a structure container. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `blocks` | readonly [`TemplateBlock`](../type-aliases/TemplateBlock.md)\[] | Child template blocks to render. | [src/types.ts:1630](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1630) | | `keepWithNext?` | `boolean` | Whether this block should stay on the same page as the following block when possible. | [src/types.ts:1632](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1632) | | `role?` | [`PdfContainerTag`](../type-aliases/PdfContainerTag.md) | Structure role used to tag this content. | [src/types.ts:1626](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1626) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:1628](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1628) | | `type` | `"section"` | Discriminator identifying this option or command shape. | [src/types.ts:1624](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1624) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateSignatureFieldBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateSignatureFieldBlock # Interface: TemplateSignatureFieldBlock Defined in: [src/types.ts:1696](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1696) Template block for rendering a signature form field. ## Properties | Property | Modifier | Type | Defined in | | ------ | ------ | ------ | ------ | | `keepWithNext?` | `readonly` | `boolean` | [src/types.ts:1700](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1700) | | `name` | `readonly` | `string` | [src/types.ts:1698](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1698) | | `options?` | `readonly` | `Omit`<[`SignatureFieldOptions`](SignatureFieldOptions.md), `"x"` | `"y"`> | [src/types.ts:1699](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1699) | | `type` | `readonly` | `"signatureField"` | [src/types.ts:1697](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1697) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateStrictLayoutOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateStrictLayoutOptions # Interface: TemplateStrictLayoutOptions Defined in: [src/types.ts:1827](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1827) Strict layout options for templates that must fail instead of overflowing. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `maxPages?` | `number` | Maximum number of pages the rendered template may produce. | [src/types.ts:1834](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1834) | | `oversizedContent?` | `"error"` | `"allow"` | How to handle content that cannot fit in a fresh flow region. Defaults to "error" when strict layout is enabled. | [src/types.ts:1832](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1832) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateStyle.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateStyle # Interface: TemplateStyle Defined in: [src/types.ts:1845](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1845) A reusable set of typographic and spacing properties applied to template blocks through a [TemplateStylesheet](TemplateStylesheet.md). Stylesheet values are merged beneath each block's inline `options`, so inline options always win. Note: `align` accepts the full [TextAlign](../type-aliases/TextAlign.md) union; image and link blocks ignore `"justify"` and treat it as `"left"`. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `align?` | [`TextAlign`](../type-aliases/TextAlign.md) | Horizontal alignment for laid-out content. | [src/types.ts:1857](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1857) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:1853](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1853) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | [src/types.ts:1861](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1861) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | [src/types.ts:1849](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1849) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | [src/types.ts:1847](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1847) | | `fontSize?` | `number` | Font size in PDF points. | [src/types.ts:1851](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1851) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | [src/types.ts:1859](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1859) | | `lineHeight?` | `number` | Line height in PDF points. | [src/types.ts:1855](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1855) | | `margin?` | [`FlowMarginShorthand`](../type-aliases/FlowMarginShorthand.md) | CSS-like margin shorthand in PDF points. | [src/types.ts:1865](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1865) | | `marginBottom?` | `number` | Bottom margin in PDF points. | [src/types.ts:1871](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1871) | | `marginLeft?` | `number` | Left margin in PDF points. | [src/types.ts:1873](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1873) | | `marginRight?` | `number` | Right margin in PDF points. | [src/types.ts:1869](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1869) | | `marginTop?` | `number` | Top margin in PDF points. | [src/types.ts:1867](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1867) | | `writingMode?` | `"horizontal"` | `"vertical"` | Text writing mode. | [src/types.ts:1863](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1863) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateStylesheet.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateStylesheet # Interface: TemplateStylesheet Defined in: [src/types.ts:1896](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1896) Named styles applied to template blocks. Keys are either *type selectors* matching a block's `type` (`"paragraph"`, `"table"`, `"link"`, `"list"`, `"image"`, plus per-format image types like `"png"`, and per-level headings `"heading"`/`"heading1"`..`"heading6"`) or arbitrary *class names* referenced by a block's `class` field. Resolution cascade for each block (low to high priority): page defaults → matching type selectors (generic before specific) → each class in `class` order → the block's inline `options`. Merging is shallow. ## Example ```ts styles: { paragraph: { fontSize: 11, lineHeight: 16 }, heading1: { fontSize: 24, color: rgb(0.1, 0.2, 0.5) }, callout: { color: rgb(0.8, 0, 0), marginTop: 12 }, } ``` ## Indexable ```ts [selector: string]: TemplateStyle | undefined ``` --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateTableBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateTableBlock # Interface: TemplateTableBlock Defined in: [src/types.ts:1572](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1572) Template block for rendering a table. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `class?` | `string` | readonly `string`\[] | Stylesheet class name(s) applied beneath inline `options`. | [src/types.ts:1580](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1580) | | `keepWithNext?` | `boolean` | Whether this block should stay on the same page as the following block when possible. | [src/types.ts:1582](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1582) | | `options?` | [`FlowTableOptions`](FlowTableOptions.md) | Options that control this item. | [src/types.ts:1578](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1578) | | `rows` | readonly [`TableRow`](../type-aliases/TableRow.md)\[] | Table rows to render. | [src/types.ts:1576](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1576) | | `type` | `"table"` | Discriminator identifying this option or command shape. | [src/types.ts:1574](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1574) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TemplateTextFieldBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateTextFieldBlock # Interface: TemplateTextFieldBlock Defined in: [src/types.ts:1646](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1646) Template block for rendering a text form field. ## Properties | Property | Modifier | Type | Defined in | | ------ | ------ | ------ | ------ | | `keepWithNext?` | `readonly` | `boolean` | [src/types.ts:1650](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1650) | | `name` | `readonly` | `string` | [src/types.ts:1648](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1648) | | `options?` | `readonly` | `Omit`<[`TextFieldOptions`](TextFieldOptions.md), `"x"` | `"y"`> | [src/types.ts:1649](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1649) | | `type` | `readonly` | `"textField"` | [src/types.ts:1647](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1647) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TextBlockOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TextBlockOptions # Interface: TextBlockOptions Defined in: [src/types.ts:839](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L839) Options for laying out wrapped text blocks. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `align?` | [`TextAlign`](../type-aliases/TextAlign.md) | Horizontal alignment for laid-out content. | [src/types.ts:871](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L871) | | `bold?` | `boolean` | Selects the bold variant of `font`. See [TextOptions.bold](TextOptions.md#property-bold). | [src/types.ts:849](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L849) | | `characterSpacing?` | `number` | Additional spacing between characters in PDF points. | [src/types.ts:865](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L865) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:863](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L863) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | [src/types.ts:859](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L859) | | `encoding?` | `"winansi"` | `"macroman"` | `"pdfdoc"` | Built-in font encoding. When set, the font dictionary emits an /Encoding entry with the specified encoding (e.g. /WinAnsiEncoding). When undefined, the default encoding is used. | [src/types.ts:901](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L901) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | [src/types.ts:857](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L857) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | [src/types.ts:847](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L847) | | `fontSize?` | `number` | Font size in PDF points. | [src/types.ts:861](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L861) | | `height?` | `number` | Box height in PDF points. When set together with [verticalAlign](#property-verticalalign), the wrapped lines are positioned within a box of this height starting at `y` and extending downward. Has no effect unless `verticalAlign` is given. | [src/types.ts:877](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L877) | | `italic?` | `boolean` | Selects the italic variant of `font`. See [TextOptions.italic](TextOptions.md#property-italic). | [src/types.ts:851](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L851) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | [src/types.ts:886](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L886) | | `lineHeight?` | `number` | Line height in PDF points. | [src/types.ts:869](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L869) | | `maxLines?` | `number` | Maximum number of lines to render. | [src/types.ts:884](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L884) | | `strike?` | `boolean` | Draws a strike-through line over the text. | [src/types.ts:855](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L855) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:895](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L895) | | `tag?` | | [`PdfTextStructureTag`](../type-aliases/PdfTextStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:893](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L893) | | `underline?` | `boolean` | Draws an underline beneath the text. | [src/types.ts:853](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L853) | | `verticalAlign?` | [`VerticalAlign`](../type-aliases/VerticalAlign.md) | Vertical alignment of the wrapped text within `height`. Requires `height`. Defaults to "top". | [src/types.ts:882](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L882) | | `width` | `number` | Width in PDF points. | [src/types.ts:845](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L845) | | `wordSpacing?` | `number` | Additional spacing between words in PDF points. | [src/types.ts:867](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L867) | | `writingMode?` | `"horizontal"` | `"vertical"` | Text writing mode. "horizontal" (default) places characters left-to-right. "vertical" stacks characters top-to-bottom. | [src/types.ts:891](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L891) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:841](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L841) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:843](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L843) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TextDefaults.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TextDefaults # Interface: TextDefaults Defined in: [src/types.ts:433](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L433) Document-wide text defaults applied to [PdfPage.text](../classes/PdfPage.md#text) and [PdfPage.textBlock](../classes/PdfPage.md#textblock) when the corresponding option is omitted on the call. Per-call options always take precedence. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `bold?` | `boolean` | Default bold flag. | [src/types.ts:437](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L437) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Default text color. | [src/types.ts:443](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L443) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Default text direction. | [src/types.ts:447](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L447) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Default font (built-in name, embedded handle, or registered family name). | [src/types.ts:435](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L435) | | `fontSize?` | `number` | Default font size in PDF points. | [src/types.ts:441](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L441) | | `italic?` | `boolean` | Default italic flag. | [src/types.ts:439](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L439) | | `kerning?` | `boolean` | Default kerning behavior. | [src/types.ts:445](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L445) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TextFieldOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TextFieldOptions # Interface: TextFieldOptions Defined in: [src/types.ts:2512](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2512) Options for creating a text form field. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `actions?` | [`FieldActions`](FieldActions.md) | JavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code. | [src/types.ts:2559](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2559) | | `appearance?` | `string` | Custom appearance stream content. When provided, this raw PDF content stream is used instead of the auto-generated appearance for the /N (normal) appearance state. Example: `"1 0 0 rg 0 0 16 16 re f"` | [src/types.ts:2554](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2554) | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [src/types.ts:2530](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2530) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:2528](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2528) | | `encrypt?` | `boolean` | Whether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption). | [src/types.ts:2547](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2547) | | `font?` | [`FontName`](../type-aliases/FontName.md) | Font used to render text. | [src/types.ts:2524](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2524) | | `fontSize?` | `number` | Font size in PDF points. | [src/types.ts:2526](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2526) | | `height` | `number` | Height in PDF points. | [src/types.ts:2520](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2520) | | `multiline?` | `boolean` | Whether the text field accepts multiple lines. | [src/types.ts:2536](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2536) | | `readOnly?` | `boolean` | Whether the form field is read-only. | [src/types.ts:2532](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2532) | | `required?` | `boolean` | Whether the form field is required. | [src/types.ts:2534](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2534) | | `richValue?` | `string` | Rich text value (XML string in XFA rich text format). When set, emitted as /RV in the field dictionary. | [src/types.ts:2541](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2541) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2563](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2563) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2561](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2561) | | `value?` | `string` | Current or default value for the option. | [src/types.ts:2522](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2522) | | `width` | `number` | Width in PDF points. | [src/types.ts:2518](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2518) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2514](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2514) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2516](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2516) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TextMetrics.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TextMetrics # Interface: TextMetrics Defined in: [src/types.ts:996](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L996) Measured size of a single line of text. ## Extended by * [`PlacedTextResult`](PlacedTextResult.md) ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `height` | `number` | Height in PDF points (the font size). | [src/types.ts:1000](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1000) | | `width` | `number` | Rendered width in PDF points. | [src/types.ts:998](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L998) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TextOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TextOptions # Interface: TextOptions Defined in: [src/types.ts:762](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L762) Options for placing a single line of text. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `artifactType?` | `"Pagination"` | `"Layout"` | `"Page"` | Artifact type classification for tagged PDF content. "Pagination" for headers/footers, "Layout" for typographic ornaments, "Page" for watermarks. Emitted as /Type in the /Artifact BMC/EMC pair. | [src/types.ts:816](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L816) | | `bold?` | `boolean` | Selects the bold variant of `font`. For a built-in family (`Helvetica`, `Times-Roman`, `Courier`) this resolves to the matching bold base font. For a font family registered with [PdfDocument.registerFontFamily](../classes/PdfDocument.md#registerfontfamily) it selects the registered bold face. Ignored when `font` is an explicit embedded-font handle. | [src/types.ts:776](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L776) | | `characterSpacing?` | `number` | Additional spacing between characters in PDF points. | [src/types.ts:795](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L795) | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for drawing, text, or highlighting. | [src/types.ts:793](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L793) | | `direction?` | [`TextDirection`](../type-aliases/TextDirection.md) | Text direction used for shaping and layout. | [src/types.ts:789](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L789) | | `encoding?` | `"winansi"` | `"macroman"` | `"pdfdoc"` | Built-in font encoding. When set, the font dictionary emits an /Encoding entry with the specified encoding (e.g. /WinAnsiEncoding). When undefined, the default encoding is used. | [src/types.ts:822](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L822) | | `fallbackFonts?` | [`PdfFont`](../type-aliases/PdfFont.md)\[] | Fallback fonts used when the primary font lacks a glyph. | [src/types.ts:787](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L787) | | `font?` | [`PdfFont`](../type-aliases/PdfFont.md) | Font used to render text. | [src/types.ts:768](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L768) | | `fontSize?` | `number` | Font size in PDF points. | [src/types.ts:791](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L791) | | `italic?` | `boolean` | Selects the italic/oblique variant of `font`, following the same resolution rules as [bold](#property-bold). Combine with `bold` for bold italic. | [src/types.ts:781](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L781) | | `kerning?` | `boolean` | Whether kerning should be applied where supported. | [src/types.ts:801](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L801) | | `leading?` | `number` | Text leading value in PDF points. | [src/types.ts:799](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L799) | | `strike?` | `boolean` | Draws a strike-through line over the text. | [src/types.ts:785](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L785) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:810](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L810) | | `tag?` | | [`PdfTextStructureTag`](../type-aliases/PdfTextStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:808](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L808) | | `underline?` | `boolean` | Draws an underline beneath the text. | [src/types.ts:783](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L783) | | `wordSpacing?` | `number` | Additional spacing between words in PDF points. | [src/types.ts:797](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L797) | | `writingMode?` | `"horizontal"` | `"vertical"` | Text writing mode. "horizontal" (default) places characters left-to-right. "vertical" stacks characters top-to-bottom. | [src/types.ts:806](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L806) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:764](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L764) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:766](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L766) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TextShaper.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TextShaper # Interface: TextShaper Defined in: [src/internal/text-shaper.ts:83](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-shaper.ts#L83) Interface for pluggable text shaping engines. The default shaper handles basic Latin ligatures and Arabic joining forms. For complex scripts (Devanagari, Thai, Khmer, Myanmar, etc.), you can provide a custom shaper that uses HarfBuzz, fontkit, or another shaping engine to produce correctly positioned glyphs. ## Creating a custom shaper Implement the [shape](#shape) method and pass your shaper via [DocumentOptions.textShaper](DocumentOptions.md#property-textshaper) or [PdfDocument.setTextShaper](../classes/PdfDocument.md#settextshaper): ## Example ```ts import { createDocument, TextShaper, ShapedGlyph } from "@criston/zeropdf"; // Example custom shaper using harfbuzzjs: // // async function createHarfBuzzShaper(harfbuzzInstance: any): TextShaper { // return { // shape(text, font, direction, script) { // const buffer = harfbuzzInstance.createBuffer(); // buffer.addText(text); // buffer.setDirection(direction === "rtl" ? "rtl" : "ltr"); // if (script) buffer.setScript(script); // const hbFont = createHarfBuzzFontFromParsedFont(font, harfbuzzInstance); // harfbuzzInstance.shape(hbFont, buffer); // const jsonResult = buffer.json(); // buffer.destroy(); // return jsonResult.map((g: any) => ({ // glyphId: g.g, // xOffset: g.dx, // yOffset: g.dy, // xAdvance: g.ax, // yAdvance: g.ay, // })); // } // }; // } // For fontkit-based shaping: // // async function createFontkitShaper(fontData: Uint8Array): TextShaper { // const fontkit = await import("fontkit"); // const fkFont = fontkit.create(fontData); // return { // shape(text, font, direction) { // const run = fkFont.layout(text); // return run.glyphs.map((g: any) => ({ // glyphId: g.id, // xOffset: g.xOffset ?? 0, // yOffset: g.yOffset ?? 0, // xAdvance: g.advanceWidth ?? 0, // yAdvance: g.advanceHeight ?? 0, // })); // } // }; // } const doc = createDocument({ textShaper: myCustomShaper }); ``` ## Methods ### shape() ```ts shape( text, font, direction, script?): ShapedGlyph[]; ``` Defined in: [src/internal/text-shaper.ts:93](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/text-shaper.ts#L93) Shapes a text string into an array of positioned glyphs. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `text` | `string` | The text string to shape. | | `font` | `ParsedTrueTypeFont` | The parsed TrueType/OpenType font. | | `direction` | `"ltr"` | `"rtl"` | The text direction ("ltr" or "rtl"). | | `script?` | `string` | Optional 4-character OpenType script tag (e.g. "deva", "arab", "thai"). | #### Returns [`ShapedGlyph`](ShapedGlyph.md)\[] An array of shaped glyphs with positions and advances. --- --- url: 'https://zeropdf.criston.dev/api/interfaces/TiffImageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TiffImageOptions # Interface: TiffImageOptions Defined in: [src/types.ts:2236](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2236) Options for placing TIFF images on a page. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `altText?` | `string` | Alternate text for tagged non-text content. | [src/types.ts:2246](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2246) | | `height` | `number` | Height in PDF points. | [src/types.ts:2244](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2244) | | `iccProfile?` | [`BinaryData`](../type-aliases/BinaryData.md) | ICC profile bytes used to tag the image's color space as ICCBased. | [src/types.ts:2254](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2254) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2250](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2250) | | `tag?` | | [`PdfFigureStructureTag`](../type-aliases/PdfFigureStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2248](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2248) | | `width` | `number` | Width in PDF points. | [src/types.ts:2242](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2242) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2238](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2238) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2240](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2240) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/Transform.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / Transform # Interface: Transform Defined in: [src/types.ts:2905](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2905) Affine transform tuple used for graphics and text placement. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `a` | `number` | Horizontal scale component of the affine transform matrix. | [src/types.ts:2907](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2907) | | `b` | `number` | Blue channel value normalized from 0 to 1. | [src/types.ts:2909](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2909) | | `c` | `number` | Cyan channel value normalized from 0 to 1. | [src/types.ts:2911](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2911) | | `d` | `number` | Vertical scale component of the affine transform matrix. | [src/types.ts:2913](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2913) | | `e` | `number` | Horizontal translation component of the affine transform matrix. | [src/types.ts:2915](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2915) | | `f` | `number` | Vertical translation component of the affine transform matrix. | [src/types.ts:2917](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2917) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/UnderlineAnnotationOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / UnderlineAnnotationOptions # Interface: UnderlineAnnotationOptions Defined in: [src/types.ts:2375](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2375) Options for creating an underline text-markup annotation. The annotation draws a solid underline beneath the rectangle defined by x/y/width/height (the quad runs along the bottom edge of the rect). ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `color?` | [`ColorInput`](../type-aliases/ColorInput.md) | Color used for the underline stroke. Defaults to black. | [src/types.ts:2385](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2385) | | `height` | `number` | Height in PDF points. | [src/types.ts:2383](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2383) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2389](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2389) | | `tag?` | `"Annot"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2387](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2387) | | `width` | `number` | Width in PDF points. | [src/types.ts:2381](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2381) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2377](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2377) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2379](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2379) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/UriLinkOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / UriLinkOptions # Interface: UriLinkOptions Defined in: [src/types.ts:2196](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2196) Options for creating an external URI link annotation. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `borderWidth?` | `number` | Annotation or field border width in PDF points. | [src/types.ts:2206](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2206) | | `height` | `number` | Height in PDF points. | [src/types.ts:2204](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2204) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2210](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2210) | | `tag?` | `"Link"` | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2208](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2208) | | `width` | `number` | Width in PDF points. | [src/types.ts:2202](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2202) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2198](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2198) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2200](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2200) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/WebpImageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / WebpImageOptions # Interface: WebpImageOptions Defined in: [src/types.ts:2285](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2285) Options for placing WebP images on a page. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `altText?` | `string` | Alternate text for tagged non-text content. | [src/types.ts:2295](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2295) | | `height` | `number` | Height in PDF points. | [src/types.ts:2293](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2293) | | `iccProfile?` | [`BinaryData`](../type-aliases/BinaryData.md) | ICC profile bytes used to tag the image's color space as ICCBased. | [src/types.ts:2303](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2303) | | `structure?` | [`PdfStructureOptions`](PdfStructureOptions.md) | Additional structure metadata for tagged PDF output. | [src/types.ts:2299](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2299) | | `tag?` | | [`PdfFigureStructureTag`](../type-aliases/PdfFigureStructureTag.md) | `"Artifact"` | Structure tag used for tagged PDF output. | [src/types.ts:2297](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2297) | | `width` | `number` | Width in PDF points. | [src/types.ts:2291](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2291) | | `x` | `number` | Horizontal position in PDF points. | [src/types.ts:2287](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2287) | | `y` | `number` | Vertical position in PDF points. | [src/types.ts:2289](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2289) | --- --- url: 'https://zeropdf.criston.dev/api/interfaces/XmpMetadataOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / XmpMetadataOptions # Interface: XmpMetadataOptions Defined in: [src/types.ts:159](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L159) Structured XMP metadata fields used to build an XMP packet. ## Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `createDate?` | `string` | `Date` | XMP creation date. | [src/types.ts:171](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L171) | | `creator?` | `string` | Application or person that created the document. | [src/types.ts:163](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L163) | | `creators?` | readonly `string`\[] | Ordered list of document creator names for XMP metadata. | [src/types.ts:165](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L165) | | `creatorTool?` | `string` | Tool name recorded in XMP metadata. | [src/types.ts:167](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L167) | | `metadataDate?` | `string` | `Date` | XMP metadata packet timestamp. | [src/types.ts:175](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L175) | | `modifyDate?` | `string` | `Date` | XMP modification date. | [src/types.ts:173](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L173) | | `producer?` | `string` | PDF producer value recorded in metadata. | [src/types.ts:169](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L169) | | `title?` | `string` | Document title or display title. | [src/types.ts:161](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L161) | --- --- url: 'https://zeropdf.criston.dev/api/functions/appendPages.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / appendPages # Function: appendPages() ```ts function appendPages( target, source, pageIndexes?): Uint8Array; ``` Defined in: [src/page-transfer.ts:114](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/page-transfer.ts#L114) Appends selected pages from one PDF to the end of another PDF and returns the updated document bytes. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `target` | [`BinaryData`](../type-aliases/BinaryData.md) | The PDF bytes that receive appended pages. | | `source` | [`BinaryData`](../type-aliases/BinaryData.md) | The PDF bytes to copy pages from. | | `pageIndexes?` | readonly `number`\[] | Optional zero-based source page indexes to append. | ## Returns `Uint8Array` The PDF bytes containing the target pages followed by appended source pages. --- --- url: 'https://zeropdf.criston.dev/api/functions/cm.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / cm # Function: cm() ```ts function cm(value): number; ``` Defined in: [src/types.ts:3193](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3193) Converts centimetres to points (1 cm = 72 / 2.54 pt). ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `value` | `number` | Length in centimetres. | ## Returns `number` The equivalent length in points. --- --- url: 'https://zeropdf.criston.dev/api/functions/cmyk.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / cmyk # Function: cmyk() ```ts function cmyk( c, m, y, k): CmykColor; ``` Defined in: [src/types.ts:3068](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3068) Creates a CMYK color object using normalized channel values from 0 to 1. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `c` | `number` | Cyan channel value from 0 to 1. | | `m` | `number` | Magenta channel value from 0 to 1. | | `y` | `number` | Yellow channel value from 0 to 1. | | `k` | `number` | Key/black channel value from 0 to 1. | ## Returns [`CmykColor`](../interfaces/CmykColor.md) The CMYK color object. --- --- url: 'https://zeropdf.criston.dev/api/functions/color.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / color # Function: color() ```ts function color(name): RgbColor; ``` Defined in: [src/types.ts:3149](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3149) Resolves a [NamedColor](../type-aliases/NamedColor.md) to an RGB color. Also accepts a `#RGB`/`#RRGGBB` hex string. Throws [PdfErrorCode.INVALID\_COLOR](../enumerations/PdfErrorCode.md#enumeration-member-invalid_color) for an unknown name. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | A named color or hex string. | ## Returns [`RgbColor`](../interfaces/RgbColor.md) The RGB color. --- --- url: 'https://zeropdf.criston.dev/api/functions/createDocument.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / createDocument # Function: createDocument() ```ts function createDocument(options?): PdfDocument; ``` Defined in: [src/document.ts:6449](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6449) Creates a new PDF document builder for generating pages, text, graphics, forms, metadata, tagging, and attachments. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`DocumentOptions`](../interfaces/DocumentOptions.md) | Document creation options. | ## Returns [`PdfDocument`](../classes/PdfDocument.md) The new mutable PDF document builder. --- --- url: 'https://zeropdf.criston.dev/api/functions/deviceN.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / deviceN # Function: deviceN() ```ts function deviceN( names, tints, alternate): DeviceNColor; ``` Defined in: [src/types.ts:3090](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3090) Creates a DeviceN (multi-ink spot) color. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `names` | readonly `string`\[] | Ink names, one per channel. | | `tints` | readonly `number`\[] | Tint values per channel, one per name (0..1). | | `alternate` | [`ProcessColor`](../type-aliases/ProcessColor.md) | Process color produced when all channels are at full tint. | ## Returns [`DeviceNColor`](../interfaces/DeviceNColor.md) --- --- url: 'https://zeropdf.criston.dev/api/functions/editDocument.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / editDocument # Function: editDocument() ```ts function editDocument(data, options?): PdfEditableDocument; ``` Defined in: [src/document.ts:6461](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L6461) Opens an existing PDF for incremental edits such as appending pages, updating fields, changing structure metadata, and preserving existing bytes when possible. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The source PDF bytes to edit. | | `options` | [`ParseDocumentOptions`](../interfaces/ParseDocumentOptions.md) | Parsing options, including the password for encrypted sources. | ## Returns [`PdfEditableDocument`](../classes/PdfEditableDocument.md) The mutable incremental editor. --- --- url: 'https://zeropdf.criston.dev/api/functions/extractPages.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / extractPages # Function: extractPages() ```ts function extractPages(data, pageIndexes): Uint8Array; ``` Defined in: [src/page-transfer.ts:58](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/page-transfer.ts#L58) Creates a new PDF containing only the selected pages from an existing document. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The source PDF bytes. | | `pageIndexes` | readonly `number`\[] | Zero-based page indexes to copy into the new document. | ## Returns `Uint8Array` The transferred PDF bytes. --- --- url: 'https://zeropdf.criston.dev/api/functions/gray.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / gray # Function: gray() ```ts function gray(value): GrayColor; ``` Defined in: [src/types.ts:3054](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3054) Creates a grayscale color object using a normalized value from 0 for black to 1 for white. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `value` | `number` | Gray channel value from 0 to 1. | ## Returns [`GrayColor`](../interfaces/GrayColor.md) The grayscale color object. --- --- url: 'https://zeropdf.criston.dev/api/functions/hex.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / hex # Function: hex() ```ts function hex(value): RgbColor; ``` Defined in: [src/types.ts:3104](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3104) Creates an RGB color object from a CSS-style #RGB or #RRGGBB hex string. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `value` | `string` | The #RGB or #RRGGBB color string to parse. | ## Returns [`RgbColor`](../interfaces/RgbColor.md) The RGB color object. --- --- url: 'https://zeropdf.criston.dev/api/functions/inch.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / inch # Function: inch() ```ts function inch(value): number; ``` Defined in: [src/types.ts:3204](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3204) Converts inches to points (1 in = 72 pt). ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `value` | `number` | Length in inches. | ## Returns `number` The equivalent length in points. --- --- url: 'https://zeropdf.criston.dev/api/functions/mergeDocuments.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / mergeDocuments # Function: mergeDocuments() ```ts function mergeDocuments(documents): Uint8Array; ``` Defined in: [src/page-transfer.ts:89](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/page-transfer.ts#L89) Combines multiple PDF documents into a single PDF in the order provided. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `documents` | readonly [`BinaryData`](../type-aliases/BinaryData.md)\[] | Source PDF byte arrays to merge. | ## Returns `Uint8Array` The merged PDF bytes. --- --- url: 'https://zeropdf.criston.dev/api/functions/mm.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / mm # Function: mm() ```ts function mm(value): number; ``` Defined in: [src/types.ts:3182](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3182) Converts millimetres to points (1 mm = 72 / 25.4 pt). ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `value` | `number` | Length in millimetres. | ## Returns `number` The equivalent length in points. --- --- url: 'https://zeropdf.criston.dev/api/functions/parseDocument.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / parseDocument # Function: parseDocument() ```ts function parseDocument(data, options?): ParsedPdfDocument; ``` Defined in: [src/parser.ts:874](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/parser.ts#L874) Parses PDF bytes into an inspection object for metadata, pages, forms, outlines, attachments, and structure information. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The PDF bytes to parse. | | `options` | [`ParseDocumentOptions`](../interfaces/ParseDocumentOptions.md) | Parsing options, including a password for encrypted sources. | ## Returns [`ParsedPdfDocument`](../classes/ParsedPdfDocument.md) The parsed PDF inspection object. --- --- url: 'https://zeropdf.criston.dev/api/functions/pt.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / pt # Function: pt() ```ts function pt(value): number; ``` Defined in: [src/types.ts:3216](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3216) Identity converter for points. Provided for symmetry with [mm](mm.md), [cm](cm.md), and [inch](inch.md) so unit intent stays explicit at call sites. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `value` | `number` | Length in points. | ## Returns `number` The same length in points. --- --- url: 'https://zeropdf.criston.dev/api/functions/rgb.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / rgb # Function: rgb() ```ts function rgb( r, g, b): RgbColor; ``` Defined in: [src/types.ts:3043](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3043) Creates an RGB color object using normalized channel values from 0 to 1. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `r` | `number` | Red channel value from 0 to 1. | | `g` | `number` | Green channel value from 0 to 1. | | `b` | `number` | Blue channel value from 0 to 1. | ## Returns [`RgbColor`](../interfaces/RgbColor.md) The RGB color object. --- --- url: 'https://zeropdf.criston.dev/api/functions/separation.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / separation # Function: separation() ```ts function separation( name, tint, alternate): SeparationColor; ``` Defined in: [src/types.ts:3079](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3079) Creates a Separation (single-ink spot) color. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | Spot ink name (e.g. "PANTONE 185 C"). | | `tint` | `number` | Tint value from 0 to 1. | | `alternate` | [`ProcessColor`](../type-aliases/ProcessColor.md) | Process color at full tint. | ## Returns [`SeparationColor`](../interfaces/SeparationColor.md) --- --- url: 'https://zeropdf.criston.dev/api/functions/splitDocument.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / splitDocument # Function: splitDocument() ```ts function splitDocument(data): Uint8Array[]; ``` Defined in: [src/page-transfer.ts:73](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/page-transfer.ts#L73) Splits a PDF into one single-page PDF byte array per source page. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | [`BinaryData`](../type-aliases/BinaryData.md) | The source PDF bytes. | ## Returns `Uint8Array`<`ArrayBufferLike`>\[] One PDF byte array per source page. --- --- url: 'https://zeropdf.criston.dev/api/functions/validatePdf2Conformance.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / validatePdf2Conformance # Function: validatePdf2Conformance() ```ts function validatePdf2Conformance(document): readonly Pdf2ComplianceIssue[]; ``` Defined in: [src/internal/pdf2-validation.ts:83](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/internal/pdf2-validation.ts#L83) Validates a parsed document for PDF 2.0 features that this library can detect as deprecated or removed. ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `document` | [`ParsedPdfDocument`](../classes/ParsedPdfDocument.md) | The parsed PDF document to inspect. | ## Returns readonly [`Pdf2ComplianceIssue`](../interfaces/Pdf2ComplianceIssue.md)\[] The PDF 2.0 conformance issues found in the document. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/BinaryData.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / BinaryData # Type Alias: BinaryData ```ts type BinaryData = Uint8Array | ArrayBuffer; ``` Defined in: [src/types.ts:610](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L610) Binary input accepted by the library. Accepted types: * `Uint8Array` * `ArrayBuffer` Node.js `Buffer` (which extends `Uint8Array`) works directly. Browser `Blob` values must be converted first: ## Example ```ts // Node.js Buffer — works directly import { readFileSync } from "node:fs"; const fontBytes: BinaryData = readFileSync("font.ttf"); // Buffer extends Uint8Array // Browser Blob — convert first const blob = await fetch("image.png").then(r => r.blob()); const imageBytes: BinaryData = await blob.arrayBuffer(); ``` --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/BuiltInPageSize.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / BuiltInPageSize # Type Alias: BuiltInPageSize ```ts type BuiltInPageSize = | "A0" | "A1" | "A2" | "A3" | "A4" | "A5" | "A6" | "B0" | "B1" | "B2" | "B3" | "B4" | "B5" | "B6" | "C4" | "C5" | "C6" | "Letter" | "Legal" | "Tabloid" | "Ledger" | "Executive" | "Statement" | "Folio" | "Quarto" | "Envelope10" | "EnvelopeDL" | "EnvelopeC5" | "EnvelopeC6" | "EnvelopeMonarch"; ``` Defined in: [src/types.ts:87](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L87) Names of page-size presets that can be passed anywhere a PageSize is accepted. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/ChoiceFieldMode.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ChoiceFieldMode # Type Alias: ChoiceFieldMode ```ts type ChoiceFieldMode = "combo" | "list"; ``` Defined in: [src/types.ts:2613](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2613) Choice field display mode for list boxes and combo boxes. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/ColorInput.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ColorInput # Type Alias: ColorInput ```ts type ColorInput = PdfColor | NamedColor; ``` Defined in: [src/types.ts:3167](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3167) A color accepted by drawing and text APIs: a structured [PdfColor](PdfColor.md) or a [NamedColor](NamedColor.md) string (resolved to RGB during normalization). --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/DocumentConformanceProfile.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / DocumentConformanceProfile # Type Alias: DocumentConformanceProfile ```ts type DocumentConformanceProfile = | "pdfa-1b" | "pdfa-2b" | "pdfa-3b" | "pdfa-4" | "pdfua-1" | "pdfua-2" | "wtpdf"; ``` Defined in: [src/types.ts:217](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L217) Supported document conformance profiles for PDF/A and PDF/UA output. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/DocumentEncryptionAlgorithm.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / DocumentEncryptionAlgorithm # Type Alias: DocumentEncryptionAlgorithm ```ts type DocumentEncryptionAlgorithm = "rc4-40" | "rc4-128" | "aes-128" | "aes-256" | "aes-256-r6"; ``` Defined in: [src/types.ts:208](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L208) Supported password-encryption algorithms for generated PDFs. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/FlowMarginShorthand.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FlowMarginShorthand # Type Alias: FlowMarginShorthand ```ts type FlowMarginShorthand = | number | readonly [number, number] | readonly [number, number, number, number]; ``` Defined in: [src/types.ts:1127](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1127) CSS-like margin shorthand accepted by flow and template APIs. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/FontName.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / FontName # Type Alias: FontName ```ts type FontName = | "Courier" | "Courier-Bold" | "Courier-Oblique" | "Courier-BoldOblique" | "Helvetica" | "Helvetica-Bold" | "Helvetica-Oblique" | "Helvetica-BoldOblique" | "Times-Roman" | "Times-Bold" | "Times-Italic" | "Times-BoldItalic" | "Symbol" | "ZapfDingbats"; ``` Defined in: [src/types.ts:7](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L7) --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/HeadingLevel.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / HeadingLevel # Type Alias: HeadingLevel ```ts type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6; ``` Defined in: [src/types.ts:1096](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1096) Heading levels supported by flow-authored tagged content. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/ImageOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ImageOptions # Type Alias: ImageOptions ```ts type ImageOptions = JpegImageOptions; ``` Defined in: [src/types.ts:2900](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2900) Options for the auto-detecting [PdfPage.image](../classes/PdfPage.md#image) method. The raster format (PNG, JPEG, GIF, BMP, TIFF, WebP, JPEG 2000) is sniffed from the data. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/LineCap.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / LineCap # Type Alias: LineCap ```ts type LineCap = "butt" | "round" | "projectingSquare"; ``` Defined in: [src/types.ts:2825](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2825) Line-cap styles for stroked vector paths. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/LineJoin.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / LineJoin # Type Alias: LineJoin ```ts type LineJoin = "miter" | "round" | "bevel"; ``` Defined in: [src/types.ts:2830](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2830) Line-join styles for stroked vector paths. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/ListItem.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ListItem # Type Alias: ListItem ```ts type ListItem = string | ListItemDefinition; ``` Defined in: [src/types.ts:1959](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1959) Input shape for list items accepted by page list rendering. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/MeasureRichTextOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / MeasureRichTextOptions # Type Alias: MeasureRichTextOptions ```ts type MeasureRichTextOptions = Omit; ``` Defined in: [src/types.ts:1032](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1032) Options for [PdfDocument.measureRichText](../classes/PdfDocument.md#measurerichtext) (position-independent). --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/MeasureTextBlockOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / MeasureTextBlockOptions # Type Alias: MeasureTextBlockOptions ```ts type MeasureTextBlockOptions = Omit; ``` Defined in: [src/types.ts:1029](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1029) Options for [PdfDocument.measureTextBlock](../classes/PdfDocument.md#measuretextblock) (position-independent). --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/MeasureTextOptions.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / MeasureTextOptions # Type Alias: MeasureTextOptions ```ts type MeasureTextOptions = Omit; ``` Defined in: [src/types.ts:1026](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1026) Options for [PdfDocument.measureText](../classes/PdfDocument.md#measuretext) (position-independent). --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/NamedColor.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / NamedColor # Type Alias: NamedColor ```ts type NamedColor = | "black" | "white" | "gray" | "grey" | "silver" | "red" | "green" | "blue" | "yellow" | "cyan" | "magenta" | "orange" | "purple" | "pink" | "brown" | "navy" | "teal" | "lime" | "maroon" | "olive"; ``` Defined in: [src/types.ts:3126](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3126) Named colors accepted anywhere a [ColorInput](ColorInput.md) is expected. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PageLabelStyle.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PageLabelStyle # Type Alias: PageLabelStyle ```ts type PageLabelStyle = | "decimal" | "romanUpper" | "romanLower" | "lettersUpper" | "lettersLower"; ``` Defined in: [src/types.ts:526](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L526) Supported page-label numbering styles. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PageSize.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PageSize # Type Alias: PageSize ```ts type PageSize = | BuiltInPageSize | CustomPageSize; ``` Defined in: [src/types.ts:132](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L132) Either a built-in page-size name or explicit custom page dimensions. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/ParagraphTextAnnotation.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ParagraphTextAnnotation # Type Alias: ParagraphTextAnnotation ```ts type ParagraphTextAnnotation = | ParagraphHighlightAnnotation | ParagraphUnderlineAnnotation | ParagraphStrikeOutAnnotation | ParagraphSquigglyAnnotation | ParagraphNoteAnnotation | ParagraphLinkAnnotation; ``` Defined in: [src/types.ts:1437](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1437) Inline annotation anchored to a substring of a paragraph's rendered text. The flow engine searches the laid-out text for `match`. The matching substring's exact rendered position becomes the annotation rectangle, so the annotation covers the precise word(s) regardless of wrapping or font. If `match` spans multiple wrapped lines, one rectangle is emitted per line. If `occurrence` is omitted, every occurrence in the paragraph is annotated. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PathCommand.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PathCommand # Type Alias: PathCommand ```ts type PathCommand = | MoveToCommand | LineToCommand | CurveToCommand | RectCommand | ClosePathCommand; ``` Defined in: [src/types.ts:2991](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2991) Union of vector path commands accepted by page path drawing. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfBlendMode.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfBlendMode # Type Alias: PdfBlendMode ```ts type PdfBlendMode = | "Normal" | "Multiply" | "Screen" | "Overlay" | "Darken" | "Lighten" | "ColorDodge" | "ColorBurn" | "HardLight" | "SoftLight" | "Difference" | "Exclusion" | "Hue" | "Saturation" | "Color" | "Luminosity"; ``` Defined in: [src/types.ts:698](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L698) PDF blend mode names defined in ISO 32000-2 § 11.3.5. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfBoundingBox.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfBoundingBox # Type Alias: PdfBoundingBox ```ts type PdfBoundingBox = readonly [number, number, number, number]; ``` Defined in: [src/types.ts:310](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L310) Bounding box tuple in PDF coordinates: left, bottom, right, top. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfColor.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfColor # Type Alias: PdfColor ```ts type PdfColor = | GrayColor | RgbColor | CmykColor | SeparationColor | DeviceNColor; ``` Defined in: [src/types.ts:693](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L693) --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfContainerTag.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfContainerTag # Type Alias: PdfContainerTag ```ts type PdfContainerTag = | "Document" | "Part" | "Art" | "Sect" | "Div" | "BlockQuote" | "Caption" | "TOC" | "TOCI" | "Index" | "NonStruct" | "Private" | "L" | "LI" | "Lbl" | "LBody" | "Table" | "THead" | "TBody" | "TFoot" | "TR" | "TH" | "TD" | "Link" | "Annot"; ``` Defined in: [src/types.ts:247](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L247) Standard structure tags that can contain other tagged PDF elements. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfEditableStructureElement.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfEditableStructureElement # Type Alias: PdfEditableStructureElement ```ts type PdfEditableStructureElement = ParsedPdfEditableStructureElement; ``` Defined in: [src/document.ts:336](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/document.ts#L336) Editable structure element API for changing roles, alt text, language, and order. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfFigureStructureTag.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfFigureStructureTag # Type Alias: PdfFigureStructureTag ```ts type PdfFigureStructureTag = "Figure" | "Formula" | "Form"; ``` Defined in: [src/types.ts:276](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L276) Standard structure tags for figure-like content. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfFont.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfFont # Type Alias: PdfFont ```ts type PdfFont = | FontName | PdfEmbeddedFont | string & object; ``` Defined in: [src/types.ts:44](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L44) Font value accepted by text APIs: a built-in [FontName](FontName.md), an embedded font handle, or the name of a family registered with [PdfDocument.registerFontFamily](../classes/PdfDocument.md#registerfontfamily). The `string & {}` member keeps `FontName` literals in editor autocomplete while still accepting an arbitrary registered family name. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfRoleMap.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfRoleMap # Type Alias: PdfRoleMap ```ts type PdfRoleMap = Record; ``` Defined in: [src/types.ts:294](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L294) Mapping from custom structure roles to standard PDF structure roles. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfStandardStructureTag.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfStandardStructureTag # Type Alias: PdfStandardStructureTag ```ts type PdfStandardStructureTag = | PdfTextStructureTag | PdfContainerTag | PdfFigureStructureTag; ``` Defined in: [src/types.ts:280](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L280) Union of standard PDF structure tags supported by the library. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfStructureAttributeValue.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfStructureAttributeValue # Type Alias: PdfStructureAttributeValue ```ts type PdfStructureAttributeValue = | string | number | boolean | { name: string; } | readonly PdfStructureAttributeValue[]; ``` Defined in: [src/types.ts:298](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L298) Values accepted in tagged PDF structure attribute dictionaries. ## Union Members `string` *** `number` *** `boolean` *** ### Type Literal ```ts { name: string; } ``` #### name ```ts readonly name: string; ``` Name of the item, field, destination, or signer. *** readonly `PdfStructureAttributeValue`\[] --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfStructureTag.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfStructureTag # Type Alias: PdfStructureTag ```ts type PdfStructureTag = | PdfStandardStructureTag | "Artifact" | string & object; ``` Defined in: [src/types.ts:287](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L287) Any supported standard, custom, or artifact structure tag. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/PdfTextStructureTag.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfTextStructureTag # Type Alias: PdfTextStructureTag ```ts type PdfTextStructureTag = | "P" | "H1" | "H2" | "H3" | "H4" | "H5" | "H6" | "Span" | "Quote" | "Note" | "Reference" | "BibEntry" | "Code" | "Lbl" | "LBody"; ``` Defined in: [src/types.ts:228](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L228) Standard structure tags for text-like tagged PDF content. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/ProcessColor.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / ProcessColor # Type Alias: ProcessColor ```ts type ProcessColor = | GrayColor | RgbColor | CmykColor; ``` Defined in: [src/types.ts:659](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L659) Process color used as the alternate color space for a Separation or DeviceN tint transform. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/TableCell.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TableCell # Type Alias: TableCell ```ts type TableCell = string | TableCellDefinition; ``` Defined in: [src/types.ts:2038](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2038) Input shape accepted for individual table cells. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/TableHeaderScope.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TableHeaderScope # Type Alias: TableHeaderScope ```ts type TableHeaderScope = "row" | "column" | "both"; ``` Defined in: [src/types.ts:2008](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2008) Header scope values for tagged table header cells. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/TableRow.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TableRow # Type Alias: TableRow ```ts type TableRow = readonly TableCell[]; ``` Defined in: [src/types.ts:2042](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L2042) Input shape accepted for table rows. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/TemplateBlock.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateBlock # Type Alias: TemplateBlock ```ts type TemplateBlock = | TemplateHeadingBlock | TemplateParagraphBlock | TemplateRichParagraphBlock | TemplateTableBlock | TemplateImageBlock | TemplateLinkBlock | TemplateSectionBlock | TemplatePageBreakBlock | TemplateTextFieldBlock | TemplateCheckBoxBlock | TemplateChoiceFieldBlock | TemplateRadioGroupBlock | TemplatePushButtonBlock | TemplateSignatureFieldBlock | TemplateHighlightBlock | TemplateNoteBlock | TemplateFreeTextBlock | TemplatePageLinkBlock | TemplatePathBlock | TemplateRectBlock | TemplateListBlock | TemplateCustomBlock; ``` Defined in: [src/types.ts:1790](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1790) Union of block types accepted by template rendering. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/TemplatePageNumberAlign.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplatePageNumberAlign # Type Alias: TemplatePageNumberAlign ```ts type TemplatePageNumberAlign = "left" | "center" | "right"; ``` Defined in: [src/types.ts:1394](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1394) Alignment values supported by template page-number output. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/TemplateRunningRegion.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TemplateRunningRegion # Type Alias: TemplateRunningRegion ```ts type TemplateRunningRegion = "header" | "footer"; ``` Defined in: [src/types.ts:1390](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L1390) Callback type for template headers and footers. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/TextAlign.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TextAlign # Type Alias: TextAlign ```ts type TextAlign = "left" | "center" | "right" | "justify"; ``` Defined in: [src/types.ts:828](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L828) Horizontal text alignment values. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/TextDirection.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / TextDirection # Type Alias: TextDirection ```ts type TextDirection = "ltr" | "rtl" | "auto"; ``` Defined in: [src/types.ts:757](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L757) Text direction options, including automatic RTL detection. --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/VerticalAlign.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / VerticalAlign # Type Alias: VerticalAlign ```ts type VerticalAlign = "top" | "middle" | "bottom"; ``` Defined in: [src/types.ts:834](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L834) Vertical alignment of content within a box of known height (a table cell or a text block given an explicit `height`). --- --- url: 'https://zeropdf.criston.dev/api/type-aliases/XmpMetadataInput.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / XmpMetadataInput # Type Alias: XmpMetadataInput ```ts type XmpMetadataInput = string | XmpMetadataOptions; ``` Defined in: [src/types.ts:181](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L181) XMP metadata input accepted by document metadata APIs. --- --- url: 'https://zeropdf.criston.dev/api/enumerations/PdfErrorCode.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PdfErrorCode # Enumeration: PdfErrorCode Defined in: [src/errors.ts:4](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L4) Stable error-code enum used by PdfEngineError to classify failures. ## Enumeration Members | Enumeration Member | Value | Description | Defined in | | ------ | ------ | ------ | ------ | | `EMPTY_PAGE` | `"EMPTY_PAGE"` | The operation would create or serialize a document without pages. | [src/errors.ts:16](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L16) | | `INTERNAL_ERROR` | `"INTERNAL_ERROR"` | An internal serialization invariant was violated. | [src/errors.ts:72](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L72) | | `INVALID_ANNOTATION` | `"INVALID_ANNOTATION"` | Annotation options or geometry are invalid. | [src/errors.ts:8](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L8) | | `INVALID_ATTACHMENT` | `"INVALID_ATTACHMENT"` | Attachment data or metadata is invalid. | [src/errors.ts:6](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L6) | | `INVALID_COLOR` | `"INVALID_COLOR"` | A color value is outside the supported range or shape. | [src/errors.ts:18](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L18) | | `INVALID_COMPLIANCE` | `"INVALID_COMPLIANCE"` | The requested output violates an enabled compliance profile. | [src/errors.ts:10](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L10) | | `INVALID_DASH_PATTERN` | `"INVALID_DASH_PATTERN"` | A vector path dash pattern is invalid. | [src/errors.ts:20](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L20) | | `INVALID_DESTINATION` | `"INVALID_DESTINATION"` | A named destination or page target is invalid. | [src/errors.ts:12](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L12) | | `INVALID_ENCRYPTION` | `"INVALID_ENCRYPTION"` | Encryption options or encrypted data are invalid. | [src/errors.ts:14](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L14) | | `INVALID_FONT` | `"INVALID_FONT"` | A font name, embedded font, or font program is invalid. | [src/errors.ts:22](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L22) | | `INVALID_FORM_FIELD` | `"INVALID_FORM_FIELD"` | A form field definition or update is invalid. | [src/errors.ts:24](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L24) | | `INVALID_FORM_FIELD_NAME` | `"INVALID_FORM_FIELD_NAME"` | A form field name is invalid due to naming conflicts (e.g. parent vs terminal). | [src/errors.ts:26](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L26) | | `INVALID_GRAPHICS_STATE` | `"INVALID_GRAPHICS_STATE"` | Graphics state operations are unbalanced or invalid. | [src/errors.ts:28](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L28) | | `INVALID_IMAGE` | `"INVALID_IMAGE"` | Image data or image placement options are invalid. | [src/errors.ts:30](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L30) | | `INVALID_LINK` | `"INVALID_LINK"` | A link target or link rectangle is invalid. | [src/errors.ts:32](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L32) | | `INVALID_METADATA` | `"INVALID_METADATA"` | Document metadata or XMP metadata is invalid. | [src/errors.ts:34](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L34) | | `INVALID_NUMBER` | `"INVALID_NUMBER"` | A numeric API argument is invalid. | [src/errors.ts:36](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L36) | | `INVALID_NUMBER_TREE` | `"INVALID_NUMBER_TREE"` | A number tree is corrupt or has invalid keys. | [src/errors.ts:70](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L70) | | `INVALID_OPERATION` | `"INVALID_OPERATION"` | A document-level operation was attempted in an unsupported state or combination. | [src/errors.ts:74](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L74) | | `INVALID_OUTLINE` | `"INVALID_OUTLINE"` | An outline item or outline target is invalid. | [src/errors.ts:38](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L38) | | `INVALID_PAGE` | `"INVALID_PAGE"` | A page reference, page index, or page edit is invalid. | [src/errors.ts:40](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L40) | | `INVALID_PAGE_LABEL` | `"INVALID_PAGE_LABEL"` | A page-label range is invalid. | [src/errors.ts:42](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L42) | | `INVALID_PAGE_SIZE` | `"INVALID_PAGE_SIZE"` | A page size name or custom page dimensions are invalid. | [src/errors.ts:46](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L46) | | `INVALID_PATH` | `"INVALID_PATH"` | Vector path commands or styles are invalid. | [src/errors.ts:48](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L48) | | `INVALID_PDF` | `"INVALID_PDF"` | The source PDF is malformed or unsupported for the requested operation. | [src/errors.ts:44](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L44) | | `INVALID_TEXT` | `"INVALID_TEXT"` | Text content or text layout options are invalid. | [src/errors.ts:50](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L50) | | `INVALID_TRANSFORM` | `"INVALID_TRANSFORM"` | A graphics transform matrix is invalid. | [src/errors.ts:52](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L52) | | `LAYOUT_OVERFLOW` | `"LAYOUT_OVERFLOW"` | Strict layout rendering detected content that cannot fit in its allotted region. | [src/errors.ts:76](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L76) | | `SINK_CLOSED` | `"SINK_CLOSED"` | A ByteSink or stream operation was attempted after the sink was closed. | [src/errors.ts:78](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L78) | | `SINK_FULL` | `"SINK_FULL"` | A ByteSink has reached its maximum configured capacity. | [src/errors.ts:80](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L80) | | `UNREACHABLE` | `"UNREACHABLE"` | A TypeScript type guard failure indicates an unreachable code path. | [src/errors.ts:82](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L82) | | `UNSUPPORTED_CHARACTER` | `"UNSUPPORTED_CHARACTER"` | Text contains a character unsupported by the selected font set. | [src/errors.ts:54](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L54) | | `UNSUPPORTED_ENCRYPTION` | `"UNSUPPORTED_ENCRYPTION"` | Source or output encryption mode is not supported. | [src/errors.ts:64](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L64) | | `UNSUPPORTED_IMAGE_BIT_DEPTH` | `"UNSUPPORTED_IMAGE_BIT_DEPTH"` | Image bit depth is not supported. | [src/errors.ts:56](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L56) | | `UNSUPPORTED_IMAGE_COLOR_SPACE` | `"UNSUPPORTED_IMAGE_COLOR_SPACE"` | Image color space is not supported. | [src/errors.ts:58](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L58) | | `UNSUPPORTED_IMAGE_FORMAT` | `"UNSUPPORTED_IMAGE_FORMAT"` | Image format is not supported. | [src/errors.ts:62](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L62) | | `UNSUPPORTED_IMAGE_INTERLACE` | `"UNSUPPORTED_IMAGE_INTERLACE"` | Interlaced image data is not supported. | [src/errors.ts:60](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L60) | | `UNSUPPORTED_PAGE_TREE` | `"UNSUPPORTED_PAGE_TREE"` | Page tree nesting exceeds maximum supported depth. | [src/errors.ts:66](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L66) | | `UNSUPPORTED_SCRIPT` | `"UNSUPPORTED_SCRIPT"` | A script (e.g. Devanagari, Thai) cannot be shaped by the current shaper. | [src/errors.ts:84](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L84) | | `UNSUPPORTED_XREF_FORMAT` | `"UNSUPPORTED_XREF_FORMAT"` | Cross-reference format is not supported. | [src/errors.ts:68](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/errors.ts#L68) | --- --- url: 'https://zeropdf.criston.dev/api/variables/PAGE_SIZES.md' --- [**zeropdf v1.3.0**](../index.md) *** [zeropdf](../index.md) / PAGE\_SIZES # Variable: PAGE\_SIZES ```ts const PAGE_SIZES: Record; ``` Defined in: [src/types.ts:3001](https://github.com/crstnmac/zeropdf/blob/d0e74477c261dc9c90e43418432cefc53e7e353b/src/types.ts#L3001) Built-in page size presets expressed in PDF points, keyed by the supported page-size names.