Base class for all hexapdf commands. It provides utility methods needed by the individual commands.
Protected Instance Methods
Defines the encryption options.
See: out_options, apply_encryption_options
Defines the optimization options.
See: out_options, apply_optimization_options
Checks whether the given output file exists and raises an error if it does and HexaPDF::CLI#force is not set.
Applies the chosen stream mode to the given object.
Parses the pages specification string and returns an array of tuples
containing a page number and a rotation value (either -90, 90, 180, :none
nil where an integer means adding a rotation by that number
of degrees, :none means removing any set rotation value and
nil means preserving the set rotation value).
count needs to be the total number of pages in
For details on the pages specification see the hexapdf(1) manual page.
Returns a hash with HexaPDF::Document options based on the given password and the option switches.
Reads a password from the standard input and falls back to the console if needed.
The optional argument
prompt can be used to customize the
prompt when reading from the console.
Removes unused pages and page tree nodes from the document.
Creates a HexaPDF::Document instance for the PDF file and yields it.
out_file is given, the document is written to it after
Writes the document to the given file or does nothing if