NativeElixirPdfUtilities.Pdf.Reader (native_elixir_pdf_utilities v0.6.0)
View SourceStrict, native PDF object reader shared by PDF utilities.
The reader resolves direct and compressed objects, validates the final xref pointer, decodes the standard non-encryption stream filters, and walks the page tree with inherited resources. It intentionally does not decrypt PDFs.
Summary
Functions
Resolves an indirect stream and decodes its declared filters.
Resolves a dictionary value, returning an error when it is not a dictionary.
Returns a dictionary key after resolving the dictionary itself.
Parses a PDF binary into a resolver document.
Resolves an indirect value in a parsed document.
Types
@type error_reason() ::
:encrypted_pdf
| :invalid_pdf_input
| :unsupported_pdf_feature
| :resource_limit_exceeded
@type object() :: %{ value: value(), stream: binary() | nil, offset: non_neg_integer() | nil, tokens: [NativeElixirPdfUtilities.Tokenizer.token()] }
@type ref() :: {non_neg_integer(), non_neg_integer()}
@type xref_entry() :: {:free, non_neg_integer(), non_neg_integer()} | {:uncompressed, non_neg_integer(), non_neg_integer()} | {:compressed, pos_integer(), non_neg_integer()}
Functions
@spec decoded_stream(document(), value()) :: {:ok, binary()} | {:error, {error_reason(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Resolves an indirect stream and decodes its declared filters.
@spec dictionary(document(), value()) :: {:ok, map()} | {:error, {error_reason(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Resolves a dictionary value, returning an error when it is not a dictionary.
@spec fetch(document(), value(), binary()) :: {:ok, value() | nil} | {:error, {error_reason(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Returns a dictionary key after resolving the dictionary itself.
@spec read(binary()) :: {:ok, document()} | {:error, {error_reason(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Parses a PDF binary into a resolver document.
@spec resolve(document(), value()) :: {:ok, value()} | {:error, {error_reason(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Resolves an indirect value in a parsed document.