Mutable, in-memory PDF editor backed by pdf_oxide's DocumentEditor.
Summary
Functions
Opens a PDF document for editing from the given binary data.
Opens a PDF document for editing from the given binary data, raising an error if it fails.
Opens a PDF document for editing from the specified file path.
Opens a PDF document for editing from the specified file path, raising an error if it fails.
Writes all in-memory changes to a PDF file at the given path.
Writes all in-memory changes to a PDF file at the given path, raising an error if it fails.
Returns the file path from which the editor was loaded, or nil if it
was loaded from binary data.
Serialises all in-memory changes into a PDF binary.
Serialises all in-memory changes into a PDF binary, raising an error if it fails.
Types
@type save_opts() :: [ incremental: boolean(), compress: boolean(), linearize: boolean(), garbage_collect: boolean() ]
Options accepted by save/3 and save!/3.
:incremental— write an incremental update instead of a full rewrite. Defaults tofalse.:compress— compress streams. Defaults totrue.:linearize— linearize the output for fast web view. Defaults tofalse.:garbage_collect— drop unreferenced objects. Defaults totrue.
Defaults mirror pdf_oxide's SaveOptions::full_rewrite(), so
calling save/2 is equivalent to save/3 with no options.
Functions
Opens a PDF document for editing from the given binary data.
Opens a PDF document for editing from the given binary data, raising an error if it fails.
Opens a PDF document for editing from the specified file path.
Opens a PDF document for editing from the specified file path, raising an error if it fails.
Writes all in-memory changes to a PDF file at the given path.
Writes all in-memory changes to a PDF file at the given path, raising an error if it fails.
Returns the file path from which the editor was loaded, or nil if it
was loaded from binary data.
Serialises all in-memory changes into a PDF binary.
The result is a fully self-contained PDF that can be written to disk, stored in a database, or streamed over HTTP.
Accepts the same save_opts/0 keyword list as save/3. Note that
:incremental is not supported here — upstream returns
{:error, _} because incremental updates can only be appended to
the original file.
Serialises all in-memory changes into a PDF binary, raising an error if it fails.