PaperForge.Validation (PaperForge v1.4.0)

Copy Markdown View Source

Performs deterministic structural validation before PDF serialization.

Validation checks object identity, required catalog/page-tree objects, indirect-reference integrity, page counts, and supported PDF versions.

Summary

Types

issue()

@type issue() :: %{
  :code => atom(),
  optional(:object_id) => pos_integer(),
  optional(:reference) => pos_integer(),
  optional(:expected) => term(),
  optional(:actual) => term()
}

Functions

validate(document)

@spec validate(PaperForge.Document.t()) :: {:ok, map()} | {:error, [issue()]}

validate!(document)

@spec validate!(PaperForge.Document.t()) :: map()