NativeElixirPdfUtilities.Merge (native_elixir_pdf_utilities v0.18.0)

View Source

PDF utilities for merging documents through the shared native reader.

The merger rebuilds its output with a new PDF 1.7 catalog, flat page tree, cross-reference table, and trailer. It resolves modern input structures, rewrites active indirect references, materializes inherited page values, and preserves stream bytes.

Summary

Functions

Merges a non-empty list of PDF binaries into one rebuilt PDF.

Types

error_reason()

@type error_reason() ::
  :empty_pdf_list | NativeElixirPdfUtilities.Pdf.Reader.error_reason()

pdf_bin()

@type pdf_bin() :: binary()

Functions

merge(inputs)

@spec merge([pdf_bin()]) ::
  {:ok, pdf_bin()}
  | {:error,
     {error_reason(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}

Merges a non-empty list of PDF binaries into one rebuilt PDF.

Input page order determines output page order. Existing outlines are appended in input order and their local destinations are remapped to output pages. Other catalog-level structures such as forms are not preserved.