Class: Origami::PDF::Parser

Inherits:
Origami::Parser show all
Defined in:
lib/origami/parsers/pdf.rb

Direct Known Subclasses

LinearParser

Constant Summary

Constants inherited from Origami::Parser

Origami::Parser::VERBOSE_DEBUG, Origami::Parser::VERBOSE_INFO, Origami::Parser::VERBOSE_INSANE, Origami::Parser::VERBOSE_QUIET

Instance Attribute Summary

Attributes inherited from Origami::Parser

#options

Instance Method Summary collapse

Methods inherited from Origami::Parser

#parse, #parse_object, #parse_trailer, #parse_xreftable, #target_data, #target_filename, #target_filesize

Constructor Details

#initialize(params = {}) ⇒ Parser

Returns a new instance of Parser.



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/origami/parsers/pdf.rb', line 32

def initialize(params = {})
  options =
  {
    :password => '',            # Default password being tried when opening a protected document.
    :prompt_password => Proc.new { 
      print "Password: "
      gets.chomp 
    },                          # Callback procedure to prompt password when document is encrypted.
    :force => false             # Force PDF header detection
  }.update(params)

  super(options)
end