NativeElixirPdfUtilities.Validators.OutlineValidator (native_elixir_pdf_utilities v0.18.0)
View SourceValidation and normalization for PDF document outlines.
The validator is the single source of truth for caller-provided outline trees and outline structures read from existing PDFs. Prepared items use one-based page numbers so writers can resolve them against their own page object allocation.
Summary
Functions
Reads and normalizes the active outline tree from a shared PDF context.
Validates and normalizes a caller-provided outline tree.
Types
@type item() :: %{ title: String.t(), page: pos_integer() | nil, view: view(), open: boolean(), children: [item()] }
A normalized outline item.
@type view() :: :fit | :fit_b | {:fit_h, number() | nil} | {:fit_v, number() | nil} | {:fit_bh, number() | nil} | {:fit_bv, number() | nil} | {:fit_r, number(), number(), number(), number()} | {:xyz, number() | nil, number() | nil, number() | nil}
A supported PDF destination view.
Functions
@spec extract(NativeElixirPdfUtilities.Validators.PdfValidator.context()) :: {:ok, [item()]} | {:error, {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Reads and normalizes the active outline tree from a shared PDF context.
A document without an outline returns an empty list.
@spec normalize(term(), non_neg_integer()) :: {:ok, [item()]} | {:error, {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Validates and normalizes a caller-provided outline tree.