Class: HexaPDF::CLI::Info

Inherits:
Command
  • Object
show all
Defined in:
lib/hexapdf/cli/info.rb

Overview

Outputs various bits of information about PDF files:

  • The entries in the trailers /Info dictionary

  • Encryption information from the trailers /Encrypt dictionary

  • The number of pages

  • The used PDF version

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

Instance Method Summary collapse

Methods included from Command::Extensions

#help_banner

Constructor Details

#initializeInfo

:nodoc:



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/hexapdf/cli/info.rb', line 49

def initialize #:nodoc:
  super('info', takes_commands: false)
  short_desc("Show document information")
  long_desc("    This command extracts information from the Info dictionary of a PDF file as well\n    as some other useful information like the used PDF version and encryption information.\n  EOF\n  options.on(\"--password PASSWORD\", \"-p\", String,\n             \"The password for decryption. Use - for reading from standard input.\") do |pwd|\n    @password = (pwd == '-' ? read_password : pwd)\n  end\n  @password = nil\n  @auto_decrypt = true\nend\n")

Instance Method Details

#execute(file) ⇒ Object

:nodoc:



64
65
66
# File 'lib/hexapdf/cli/info.rb', line 64

def execute(file) #:nodoc:
  output_info(file)
end