Class: PDF::Inspector

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf/inspector.rb,
lib/pdf/inspector/page.rb,
lib/pdf/inspector/text.rb,
lib/pdf/inspector/xobject.rb,
lib/pdf/inspector/graphics.rb,
lib/pdf/inspector/extgstate.rb

Defined Under Namespace

Modules: Graphics Classes: ExtGState, Page, Text, XObject

Class Method Summary collapse

Class Method Details

.analyze(output, *args, &block) ⇒ Object



11
12
13
14
15
# File 'lib/pdf/inspector.rb', line 11

def self.analyze(output,*args,&block) 
  obs = self.new(*args, &block)
  PDF::Reader.string(output,obs)
  obs  
end

.analyze_file(filename, *args, &block) ⇒ Object



17
18
19
# File 'lib/pdf/inspector.rb', line 17

def self.analyze_file(filename,*args,&block)
  analyze(File.open(filename, "rb") { |f| f.read },*args,&block)
end

.parse(obj) ⇒ Object



21
22
23
24
# File 'lib/pdf/inspector.rb', line 21

def self.parse(obj)
  PDF::Reader::Parser.new(
    PDF::Reader::Buffer.new(StringIO.new(obj)), nil).parse_token
end