Internal object graph of a PDF document.
A new document automatically contains:
- the root page tree;
- the document catalog;
- a default Helvetica font.
Summary
Functions
Adds a new indirect object to the document.
Adds a page reference to the document page tree.
Returns all indirect objects sorted by their object ID.
Adds document metadata.
Updates the value of an existing indirect object.
Types
@type t() :: %PaperForge.Document{ default_font: PaperForge.Reference.t(), info: PaperForge.Reference.t() | nil, next_object_id: pos_integer(), objects: %{optional(pos_integer()) => PaperForge.Object.t()}, pages: PaperForge.Reference.t(), root: PaperForge.Reference.t() }
Functions
@spec add_object(t(), term()) :: {t(), PaperForge.Reference.t()}
Adds a new indirect object to the document.
Returns the updated document and a reference to the object.
@spec append_page(t(), PaperForge.Reference.t()) :: t()
Adds a page reference to the document page tree.
@spec new() :: t()
@spec objects(t()) :: [PaperForge.Object.t()]
Returns all indirect objects sorted by their object ID.
@spec put_metadata(t(), PaperForge.Metadata.t()) :: t()
Adds document metadata.
Calling this function more than once replaces the active metadata reference, although previous objects remain in the object graph.
@spec update_object( t(), PaperForge.Reference.t(), (term() -> term()) ) :: t()
Updates the value of an existing indirect object.