PdfEx.Serializer (pdf_ex v0.1.0)

Copy Markdown View Source

Serializes a PdfEx.Document back to PDF bytes, in one of two modes.

  • :incremental (default) — lossless: edits are appended as a PDF incremental update (matching the source's classic-table or xref-stream style), so the original bytes are a byte-for-byte prefix of the output. A document with no pending edits serializes back to its source verbatim.
  • :full — rewrites a single clean revision (live objects renumbered, references rewritten, /ObjStm and /XRef containers dropped, one xref, no /Prev). Explicitly not byte-lossless; use it to compact away accumulated revisions.

Summary

Functions

Serializes doc to PDF bytes. See the module doc for :incremental (default) vs :full.

Functions

serialize(doc, opts \\ [])

@spec serialize(PdfEx.Document.t(), [{:mode, :incremental | :full}]) :: binary()

Serializes doc to PDF bytes. See the module doc for :incremental (default) vs :full.