Skip to content

zeropdf v1.3.0


zeropdf v1.3.0 โ€‹

Enumerations โ€‹

EnumerationDescription
PdfErrorCodeStable error-code enum used by PdfEngineError to classify failures.

Classes โ€‹

ClassDescription
BufferSinkStreaming output contract implemented by sinks that receive generated PDF byte chunks.
NodeStreamSinkA byte sink adapter for writing generated PDF output to a Node.js writable stream while respecting backpressure and stream errors.
ParsedPdfDocumentA 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.
PdfDocumentA mutable builder for creating new PDF documents from scratch. It manages pages, fonts, metadata, outlines, attachments, accessibility data, encryption, and serialization.
PdfEditableDocumentA 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.
PdfEngineErrorA structured error type thrown when PDF generation, parsing, validation, or editing fails. It carries a stable error code and optional diagnostic details.
PdfFlowA cursor-based layout helper for writing report-style content. It manages vertical flow, spacing, page breaks, headings, paragraphs, links, images, and tables.
PdfOutlineItemA handle for an outline entry in a PDF document. It can receive nested child outline items that point to pages or named destinations.
PdfPageA mutable page builder for placing text, graphics, images, links, annotations, form fields, and structured content on a PDF page.
PdfSoftMaskBuilderSub-builder for the contents of a luminosity soft-mask Form XObject. Supports path operations only.
PdfStructureContainerA 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.
TempFileSinkA byte sink that writes data to a temporary file, reducing memory pressure for very large documents. The temp file is automatically deleted on close (or dispose).
WebStreamSinkA byte sink adapter for writing generated PDF output to a Web WritableStream through its default writer.

Interfaces โ€‹

InterfaceDescription
AttachmentOptionsOptions that describe an embedded file attachment.
BlockTextMetricsMeasured size of a wrapped block of text.
BmpImageOptionsOptions for placing BMP images on a page.
BufferSinkOptionsAn in-memory byte sink that collects streamed PDF output chunks and exposes them as a single Uint8Array when needed.
ByteSinkStreaming output contract implemented by sinks that receive generated PDF byte chunks.
CheckBoxOptionsOptions for creating a checkbox form field widget.
ChoiceFieldOptionsOptions for creating a list box or combo box form field.
ClosePathCommandVector path command that closes the current subpath.
CmykColorCMYK color representation used by drawing and text APIs.
CurveToCommandVector path command for drawing a cubic Bezier curve.
CustomPageSizeExplicit PDF page dimensions in points.
DeviceNColorDeviceN (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.
DocumentEncryptionOptionsPassword and permission options for encrypting a generated document.
DocumentInfoDocument information dictionary metadata such as title, author, subject, and dates.
DocumentOptions-
DocumentOutputIntentOptionsICC output profile options for generated documents.
DocumentPermissionsPermission flags used when creating an encrypted PDF.
DocumentSignatureOptionsDetached digital-signature options for generated documents.
EmbedTrueTypeFontOptionsOptions used when registering a TrueType font with a document.
ExtGStateOptionsGraphics-state parameters for fill/stroke alpha and blend mode. Emitted as an inline ExtGState entry referenced by the gs operator.
ExtractTextOptionsOptions for ParsedPdfDocument.extractText.
FieldActionsJavaScript actions attached to a form field.
FillStyleFill styling for vector paths.
FlowBlockSpacingOptionsPer-block margin options for flow-authored content.
FlowCheckBoxOptionsOptions for placing a checkbox form field through the flow layout API.
FlowChoiceFieldOptionsOptions for placing a choice form field through the flow layout API.
FlowColumnsOptionsNewspaper-style column layout options for flow and template pages.
FlowFreeTextOptionsOptions for placing a free-text annotation through the flow layout API.
FlowHeadingOptionsFlow text options plus heading-level configuration.
FlowHighlightOptionsOptions for placing a highlight annotation through the flow layout API.
FlowImageOptionsOptions for placing images through the flow layout API.
FlowLinkOptionsOptions for placing URI links through the flow layout API.
FlowListOptionsOptions for placing a tagged list through the flow layout API.
FlowNoteOptionsOptions for placing a text note annotation through the flow layout API.
FlowOptionsInitial layout, typography, and spacing options for a PdfFlow cursor.
FlowPushButtonOptionsOptions for placing a push-button form field through the flow layout API.
FlowRadioGroupOptionsOptions for placing a radio-button group through the flow layout API.
FlowRichTextOptionsOptions 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.
FlowSignatureFieldOptionsOptions for placing a signature form field through the flow layout API.
FlowSpacingScaleSemantic spacing scale used by flow layout for paragraphs, headings, tables, images, and links.
FlowTableOptionsOptions for placing tables through the flow layout API.
FlowTextFieldOptionsOptions for placing a text form field through the flow layout API.
FlowTextOptionsOptions for placing paragraphs or text blocks through the flow layout API.
FontFamilyFacesThe set of faces that make up a font family registered with PdfDocument.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.
FontFamilyInputInput accepted by PdfDocument.registerFontFamily. Each face may be a built-in FontName, 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.
FreeTextAnnotationOptionsOptions for creating a free-text annotation.
GifImageOptionsOptions for placing GIF images on a page.
GrayColorGrayscale color representation used by drawing and text APIs.
HighlightAnnotationOptionsOptions for creating a URI link annotation.
InlineTextRunA single styled segment of inline rich text. Runs passed together to PdfPage.richText or PdfFlow.richParagraph flow on the same line and wrap together as one paragraph; each run carries its own style.
Jbig2ImageOptionsOptions for placing JBIG2 images on a page.
Jp2ImageOptionsOptions for placing JPEG 2000 (JP2) images on a page. PDF spec supports JPXDecode filter for JPEG 2000 image data.
JpegImageOptionsOptions for placing JPEG images on a page.
LineToCommandVector path command for drawing a straight line.
ListItemDefinitionDetailed list item object with optional nested children.
ListOptionsOptions for rendering tagged ordered or unordered lists.
MoveToCommandVector path command for moving the current point without drawing.
NodeWritableLikeMinimal writable-stream shape accepted by NodeStreamSink.
NoteAnnotationOptionsOptions for creating a text note annotation.
OutlineOptionsOptions that control outline item state, such as expansion.
PageLabelOptionsOptions for assigning logical page labels and numbering styles.
PageLinkOptionsOptions for creating an internal link annotation to another page.
PageOptionsOptions for creating or inserting a page.
PageTextExtractionPer-page extraction result.
PageTransparencyGroupOptionsPage-level transparency group options.
ParagraphHighlightAnnotationHighlight a substring of a paragraph.
ParagraphLinkAnnotationWrap a substring in a clickable URI link.
ParagraphNoteAnnotationAttach a sticky-note annotation anchored to a substring.
ParagraphSquigglyAnnotationDraw a squiggly underline beneath a substring (text-markup /Squiggly).
ParagraphStrikeOutAnnotationStrike out a substring of a paragraph (text-markup /StrikeOut).
ParagraphUnderlineAnnotationUnderline a substring of a paragraph (text-markup /Underline).
ParseDocumentOptionsOptions that control parsing behavior for existing PDFs.
ParsedPdfAttachmentAttachment metadata discovered while parsing an existing PDF.
ParsedPdfEditableStructureElementEditable structure element handle returned by editable-document queries.
ParsedPdfFormFieldForm field metadata discovered while parsing an existing PDF.
ParsedPdfIndirectObjectLow-level parsed indirect object record.
ParsedPdfMetadataDocument metadata discovered while parsing an existing PDF.
ParsedPdfNamedDestinationNamed destination discovered while parsing an existing PDF.
ParsedPdfOutlineItemOutline item discovered while parsing an existing PDF.
ParsedPdfPage-
ParsedPdfPageLabelRangePage-label range discovered while parsing an existing PDF.
ParsedPdfStructureElementTagged structure element discovered while parsing an existing PDF.
PathStylePainting, stroke, fill, transform, and tagging options for vector paths.
Pdf2ComplianceIssuePDF 2.0 conformance issue found while inspecting an existing document.
PdfComplianceIssueCompliance validation issue returned by document validation.
PdfEditableStructureQueryQuery criteria for finding editable structure elements.
PdfEditableStructureSimilarityOptionsOptions for finding structurally similar tagged elements.
PdfEmbeddedFontFont handle returned after embedding a TrueType font in a document.
PdfStructureOptionsAccessibility metadata and attributes for tagged PDF structure elements.
PlacedTextBlockResultResult of PdfPage.placeTextBlock: the drawn block metrics plus the next y to continue at.
PlacedTextResultResult of PdfPage.placeText: the drawn size plus the next y to continue at.
PngImageOptionsOptions for placing PNG images on a page.
PositionedTextRunA single positioned text run produced by extraction.
PushButtonOptionsOptions for creating a push-button form field.
RadioGroupItemOptionsOptions for a single radio button in a radio group.
RadioGroupOptionsOptions for creating a radio-button group form field.
RectCommandVector path command for adding a rectangle.
RgbColorRGB color representation used by drawing and text APIs.
RichTextOptionsOptions for laying out a paragraph of inline rich-text runs. Coordinates and width behave like TextBlockOptions; the style fields supply defaults inherited by any InlineTextRun that omits them.
SeparationColorSeparation (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.
ShapedGlyphA single shaped glyph produced by a TextShaper.
ShapeStyleSimplified styling for the PdfPage 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.
SignatureFieldOptionsOptions for creating a signature form field.
SoftMaskHandleOpaque handle returned by PdfDocument.createLuminositySoftMask. Pass to ExtGStateOptions.softMask to apply the mask.
SoftMaskOptionsOptions for creating a luminosity-based soft mask Form XObject.
SquigglyAnnotationOptionsOptions for creating a squiggly text-markup annotation. Draws a wavy underline beneath the rectangle (commonly used to flag spelling or grammar concerns).
StrikeOutAnnotationOptionsOptions for creating a strike-out text-markup annotation. Draws a horizontal line through the vertical middle of the rectangle.
StrokeStyleStroke styling for vector paths.
SvgImageOptionsOptions for rendering SVG vector graphics on a page.
TableCellDefinitionDetailed table cell object with span, header, scope, and structure options.
TableOptionsOptions for rendering tagged tables.
TemplateAutoOutlineOptionsTop-level options for rendering a reusable document template.
TemplateCheckBoxBlockTemplate block for rendering a checkbox form field.
TemplateChoiceFieldBlockTemplate block for rendering a choice form field.
TemplateCustomBlockTemplate block for user-defined rendering and estimation logic.
TemplateDocumentOptionsTop-level options for rendering template blocks into a complete document.
TemplateFreeTextBlockTemplate block for rendering a free-text annotation.
TemplateHeadingBlockTemplate block for rendering a heading.
TemplateHighlightBlockTemplate block for rendering a highlight annotation.
TemplateImageBlockTemplate block for rendering a PNG, JPEG, BMP, JBIG2, TIFF, or JPEG2000 image.
TemplateLinkBlockTemplate block for rendering a URI link.
TemplateListBlockTemplate block for rendering a tagged list.
TemplateNoteBlockTemplate block for rendering a text note annotation.
TemplatePageBreakBlockTemplate block that forces a new page.
TemplatePageLinkBlockTemplate block for rendering a page-to-page link annotation.
TemplatePageNumberOptionsOptions for automatic page-number rendering in templates.
TemplatePageOptionsPage layout options used by template rendering.
TemplateParagraphBlockTemplate block for rendering a paragraph.
TemplatePathBlockTemplate block for rendering vector path commands.
TemplatePushButtonBlockTemplate block for rendering a push-button form field.
TemplateRadioGroupBlockTemplate block for rendering a radio-button group form field.
TemplateRectBlockTemplate block for rendering a rectangle.
TemplateRenderContextContext passed to template header, footer, and page-number callbacks.
TemplateRichParagraphBlockTemplate block for rendering a paragraph of inline rich-text runs, mixing fonts, weights, sizes, colors, and links on the same wrapping lines.
TemplateSectionBlockTemplate block that groups child blocks under a structure container.
TemplateSignatureFieldBlockTemplate block for rendering a signature form field.
TemplateStrictLayoutOptionsStrict layout options for templates that must fail instead of overflowing.
TemplateStyleA reusable set of typographic and spacing properties applied to template blocks through a TemplateStylesheet. Stylesheet values are merged beneath each block's inline options, so inline options always win.
TemplateStylesheetNamed 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.
TemplateTableBlockTemplate block for rendering a table.
TemplateTextFieldBlockTemplate block for rendering a text form field.
TextBlockOptionsOptions for laying out wrapped text blocks.
TextDefaultsDocument-wide text defaults applied to PdfPage.text and PdfPage.textBlock when the corresponding option is omitted on the call. Per-call options always take precedence.
TextFieldOptionsOptions for creating a text form field.
TextMetricsMeasured size of a single line of text.
TextOptionsOptions for placing a single line of text.
TextShaperInterface for pluggable text shaping engines.
TiffImageOptionsOptions for placing TIFF images on a page.
TransformAffine transform tuple used for graphics and text placement.
UnderlineAnnotationOptionsOptions 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).
UriLinkOptionsOptions for creating an external URI link annotation.
WebpImageOptionsOptions for placing WebP images on a page.
XmpMetadataOptionsStructured XMP metadata fields used to build an XMP packet.

Type Aliases โ€‹

Type AliasDescription
BinaryDataBinary input accepted by the library.
BuiltInPageSizeNames of page-size presets that can be passed anywhere a PageSize is accepted.
ChoiceFieldModeChoice field display mode for list boxes and combo boxes.
ColorInputA color accepted by drawing and text APIs: a structured PdfColor or a NamedColor string (resolved to RGB during normalization).
DocumentConformanceProfileSupported document conformance profiles for PDF/A and PDF/UA output.
DocumentEncryptionAlgorithmSupported password-encryption algorithms for generated PDFs.
FlowMarginShorthandCSS-like margin shorthand accepted by flow and template APIs.
FontName-
HeadingLevelHeading levels supported by flow-authored tagged content.
ImageOptionsOptions for the auto-detecting PdfPage.image method. The raster format (PNG, JPEG, GIF, BMP, TIFF, WebP, JPEG 2000) is sniffed from the data.
LineCapLine-cap styles for stroked vector paths.
LineJoinLine-join styles for stroked vector paths.
ListItemInput shape for list items accepted by page list rendering.
MeasureRichTextOptionsOptions for PdfDocument.measureRichText (position-independent).
MeasureTextBlockOptionsOptions for PdfDocument.measureTextBlock (position-independent).
MeasureTextOptionsOptions for PdfDocument.measureText (position-independent).
NamedColorNamed colors accepted anywhere a ColorInput is expected.
PageLabelStyleSupported page-label numbering styles.
PageSizeEither a built-in page-size name or explicit custom page dimensions.
ParagraphTextAnnotationInline annotation anchored to a substring of a paragraph's rendered text.
PathCommandUnion of vector path commands accepted by page path drawing.
PdfBlendModePDF blend mode names defined in ISO 32000-2 ยง 11.3.5.
PdfBoundingBoxBounding box tuple in PDF coordinates: left, bottom, right, top.
PdfColor-
PdfContainerTagStandard structure tags that can contain other tagged PDF elements.
PdfEditableStructureElementEditable structure element API for changing roles, alt text, language, and order.
PdfFigureStructureTagStandard structure tags for figure-like content.
PdfFontFont value accepted by text APIs: a built-in FontName, an embedded font handle, or the name of a family registered with PdfDocument.registerFontFamily.
PdfRoleMapMapping from custom structure roles to standard PDF structure roles.
PdfStandardStructureTagUnion of standard PDF structure tags supported by the library.
PdfStructureAttributeValueValues accepted in tagged PDF structure attribute dictionaries.
PdfStructureTagAny supported standard, custom, or artifact structure tag.
PdfTextStructureTagStandard structure tags for text-like tagged PDF content.
ProcessColorProcess color used as the alternate color space for a Separation or DeviceN tint transform.
TableCellInput shape accepted for individual table cells.
TableHeaderScopeHeader scope values for tagged table header cells.
TableRowInput shape accepted for table rows.
TemplateBlockUnion of block types accepted by template rendering.
TemplatePageNumberAlignAlignment values supported by template page-number output.
TemplateRunningRegionCallback type for template headers and footers.
TextAlignHorizontal text alignment values.
TextDirectionText direction options, including automatic RTL detection.
VerticalAlignVertical alignment of content within a box of known height (a table cell or a text block given an explicit height).
XmpMetadataInputXMP metadata input accepted by document metadata APIs.

Variables โ€‹

VariableDescription
PAGE_SIZESBuilt-in page size presets expressed in PDF points, keyed by the supported page-size names.

Functions โ€‹

FunctionDescription
appendPagesAppends selected pages from one PDF to the end of another PDF and returns the updated document bytes.
cmConverts centimetres to points (1 cm = 72 / 2.54 pt).
cmykCreates a CMYK color object using normalized channel values from 0 to 1.
colorResolves a NamedColor to an RGB color. Also accepts a #RGB/#RRGGBB hex string. Throws PdfErrorCode.INVALID_COLOR for an unknown name.
createDocumentCreates a new PDF document builder for generating pages, text, graphics, forms, metadata, tagging, and attachments.
deviceNCreates a DeviceN (multi-ink spot) color.
editDocumentOpens an existing PDF for incremental edits such as appending pages, updating fields, changing structure metadata, and preserving existing bytes when possible.
extractPagesCreates a new PDF containing only the selected pages from an existing document.
grayCreates a grayscale color object using a normalized value from 0 for black to 1 for white.
hexCreates an RGB color object from a CSS-style #RGB or #RRGGBB hex string.
inchConverts inches to points (1 in = 72 pt).
mergeDocumentsCombines multiple PDF documents into a single PDF in the order provided.
mmConverts millimetres to points (1 mm = 72 / 25.4 pt).
parseDocumentParses PDF bytes into an inspection object for metadata, pages, forms, outlines, attachments, and structure information.
ptIdentity converter for points. Provided for symmetry with mm, cm, and inch so unit intent stays explicit at call sites.
rgbCreates an RGB color object using normalized channel values from 0 to 1.
separationCreates a Separation (single-ink spot) color.
splitDocumentSplits a PDF into one single-page PDF byte array per source page.
validatePdf2ConformanceValidates a parsed document for PDF 2.0 features that this library can detect as deprecated or removed.

Released under the ISC license.