class HexaPDF:: CLI:: Command
Parent | CmdParse::Command |
---|
Base class for all hexapdf commands. It provides utility methods needed by the individual commands.
Constants
- PAGE_MAP¶
Protected Instance Methods
Applies the encryption related options to the given HexaPDF::Document
instance.
Applies the optimization options to the given HexaPDF::Document
instance.
Defines the encryption options.
See: out_options, apply_encryption_options
Defines the optimization options.
See: out_options, apply_optimization_options
Returns the human readable file size.
Checks whether the given output file exists and ask whether to overwrite the output file if it does. If HexaPDF::CLI#force is set, a possibly existing output file is always overwritten.
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).
The parameter 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.
Creates a HexaPDF::Document
instance for the PDF file and yields it.
If out_file
is given, the document is written to it after yielding.
Writes the document to the given file or does nothing if out_file
is nil
.