class HexaPDF::CLI::Info

Outputs various bits of information about PDF files:

See: HexaPDF::Type::Info, HexaPDF::Encryption::SecurityHandler

Private Instance Methods

pdf_options(password) click to toggle source

Use custom options if we are checking the PDF file for errors.

Calls superclass method HexaPDF::CLI::Command#pdf_options
# File lib/hexapdf/cli/info.rb, line 148
def pdf_options(password)
  if @check_file
    options = {decryption_opts: {password: password}, config: {}}
    HexaPDF::GlobalConfiguration['filter.predictor.strict'] = false
    options[:config]['parser.try_xref_reconstruction'] = true
    options[:config]['parser.on_correctable_error'] = lambda do |_, msg, pos|
      puts "WARNING: Parse error at position #{pos}: #{msg}"
      false
    end
    options
  else
    super
  end
end