Class: PDF::Inspector
- Inherits:
-
Object
- Object
- PDF::Inspector
- 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
Direct Known Subclasses
ExtGState, Graphics::CapStyle, Graphics::Color, Graphics::Curve, Graphics::Dash, Graphics::JoinStyle, Graphics::Line, Graphics::Matrix, Graphics::Pattern, Graphics::Rectangle, Graphics::State, Page, Text, XObject
Defined Under Namespace
Modules: Graphics Classes: ExtGState, Page, Text, XObject
Class Method Summary collapse
- .analyze(output, *args, &block) ⇒ Object
- .analyze_file(filename, *args, &block) ⇒ Object
- .parse(obj) ⇒ Object
Class Method Details
.analyze(output, *args, &block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# 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) ⇒ Object
25 26 27 28 29 |
# 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 |