class PDF::Inspector
Public Class Methods
analyze(output,*args,&block)
click to toggle source
# File lib/pdf/inspector.rb, line 12 def self.analyze(output,*args,&block) if output.is_a?(String) output = StringIO.new(output) end obs = self.new(*args, &block) PDF::Reader.open(output) do |reader| reader.pages.each do |page| page.walk(obs) end end obs end
analyze_file(filename,*args,&block)
click to toggle source
# File lib/pdf/inspector.rb, line 25 def self.analyze_file(filename,*args,&block) File.open(filename, "rb") do |io| analyze(io, *args,&block) end end
parse(obj)
click to toggle source
# File lib/pdf/inspector.rb, line 31 def self.parse(obj) PDF::Reader::Parser.new( PDF::Reader::Buffer.new(StringIO.new(obj)), nil).parse_token end