Base class for all hexapdf commands. It provides utility methods needed by the individual commands.
Protected Instance Methods
Defines the encryption options.
Defines the optimization options.
Returns the human readable file size.
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 or
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 the document.
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.
HexaPDF::Document instance for the PDF file and yields it.
out_file is given, the document is written to it after yielding.
Writes the document to the given file or does nothing if