Class: PDF::Inspector::XObject

Inherits:
PDF::Inspector show all
Defined in:
lib/pdf/inspector/xobject.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PDF::Inspector

analyze, analyze_file, parse

Constructor Details

#initializeXObject

Returns a new instance of XObject.



6
7
8
9
# File 'lib/pdf/inspector/xobject.rb', line 6

def initialize
  @page_xobjects = []
  @xobject_streams = {}
end

Instance Attribute Details

#page_xobjectsObject

Returns the value of attribute page_xobjects.



4
5
6
# File 'lib/pdf/inspector/xobject.rb', line 4

def page_xobjects
  @page_xobjects
end

#xobject_streamsObject

Returns the value of attribute xobject_streams.



4
5
6
# File 'lib/pdf/inspector/xobject.rb', line 4

def xobject_streams
  @xobject_streams
end

Instance Method Details

#begin_page(*params) ⇒ Object



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

def begin_page(*params)
  @page_xobjects << [] 
end

#resource_xobject(*params) ⇒ Object



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

def resource_xobject(*params)
  @page_xobjects.last << params.first
  store_streams(params.first, params.last)
end

#store_streams(resource_name, stream) ⇒ Object



20
21
22
# File 'lib/pdf/inspector/xobject.rb', line 20

def store_streams(resource_name, stream)
  @xobject_streams[resource_name] = stream
end