# pdf_ex v0.1.0 - Table of Contents

> Pure-Elixir PDF parsing and lossless surgery engine: parse, extract text, edit page structure and text content, project to and from HTML, and serialize as byte-exact incremental updates.

## Pages

- [PdfEx](readme.md)
- [Changelog](changelog.md)
- [LICENSE](license.md)

## Modules

- [PdfEx.OT.Addr](PdfEx.OT.Addr.md): Stable glyph address: survives seq-based UID renumbering.
- [PdfEx.OT.Pending](PdfEx.OT.Pending.md): An op in address space, tagged with the base version it was built against.
- [PdfEx.Op.DeleteGlyph](PdfEx.Op.DeleteGlyph.md): Delete the single glyph `uid` from its run.
- [PdfEx.Op.MoveGlyph](PdfEx.Op.MoveGlyph.md): Reposition the glyph `uid` to absolute text-space `x`/`y`.
- [PdfEx.Op.UpdateText](PdfEx.Op.UpdateText.md): Replace the text of the run containing glyph `uid`.

- Core API
  - [PdfEx](PdfEx.md): Pure-Elixir PDF parsing and lossless surgery engine.
  - [PdfEx.Document](PdfEx.Document.md): The immutable in-memory representation of an opened PDF.
  - [PdfEx.Error](PdfEx.Error.md): The single error struct returned across the public API.

- Editing
  - [PdfEx.ContentEdit](PdfEx.ContentEdit.md): Run-level text replacement.
  - [PdfEx.Convert](PdfEx.Convert.md): HTML projections of a document, and the reverse (HTML edit → PDF text ops).
  - [PdfEx.Editor](PdfEx.Editor.md): Structural page operations: delete, insert, reorder.
  - [PdfEx.Glyphs](PdfEx.Glyphs.md): Lazy glyph projection: builds `doc.glyphs` (per page-object ref) and
`doc.uid_index` ("p_<page_obj_id>_g_<seq>" -> {:glyph, contents_ref,
show_op_index, glyph_index}).

- Collaboration (OTP)
  - [PdfEx.OT](PdfEx.OT.md): Operational transformation for collaborative editing (Tier 3, T3.1).
  - [PdfEx.Op](PdfEx.Op.md): Collaborative edit operations as plain structs, plus a pure dispatcher.
  - [PdfEx.Op.Behaviour](PdfEx.Op.Behaviour.md): Behaviour for a collaborative edit operation.
  - [PdfEx.Session](PdfEx.Session.md): Public facade for collaborative editing sessions.

- Observability
  - [PdfEx.Telemetry](PdfEx.Telemetry.md): The telemetry events PdfEx emits, and the single source of truth for their
names. Attach handlers with `:telemetry.attach/4` (or `attach_many/4`).

- Serialization
  - [PdfEx.Serializer](PdfEx.Serializer.md): Serializes a `PdfEx.Document` back to PDF bytes, in one of two modes.

- Object types
  - [PdfEx.COS.HexString](PdfEx.COS.HexString.md): A PDF hex string `<...>`; `value` holds the hex digits as text.
  - [PdfEx.COS.LiteralString](PdfEx.COS.LiteralString.md): A PDF literal string `(...)`; `value` holds the decoded bytes.
  - [PdfEx.COS.Name](PdfEx.COS.Name.md): A PDF name object (e.g. `/Type`). `value` is an atom for the engine's known names, otherwise a binary (untrusted names never become atoms).
  - [PdfEx.COS.Reference](PdfEx.COS.Reference.md): An indirect-object reference (`id gen R`).
  - [PdfEx.COS.Stream](PdfEx.COS.Stream.md): A PDF stream object: its dictionary plus the raw (still filter-encoded) `raw_bytes`. Decode with `PdfEx.Filter`.
  - [PdfEx.Model.Glyph](PdfEx.Model.Glyph.md): A positioned glyph in the page IDM (fix G).
  - [PdfEx.PageTree.Page](PdfEx.PageTree.Page.md): Represents a single resolved PDF page.

- Fonts
  - [PdfEx.Font.Surgery](PdfEx.Font.Surgery.md): TrueType font surgery (Tier 3, T3.4). `subset_truetype/2` produces a smaller
valid sfnt that retains a glyph set (+ composite dependencies) and empties all
other outlines. Glyph ids are preserved (cmap/hmtx untouched). CFF/`OTTO` is
refused. Not wired into PDF embedding (a separate integration layer).

- Filters
  - [PdfEx.Filter](PdfEx.Filter.md): Single entry point for stream filter dispatch.
  - [PdfEx.Filter.Codec](PdfEx.Filter.Codec.md): Behaviour for a stream filter codec (e.g. Flate, LZW, ASCII85).

