Module: PDF::Reader::ResourceMethods

Included in:
FormXObject, Page
Defined in:
lib/pdf/reader/resource_methods.rb

Overview

mixin for common methods in Page and FormXobjects

Instance Method Summary collapse

Instance Method Details

#color_spacesObject

Returns a Hash of color spaces that are available to this page

NOTE: this method de-serialise objects from the underlying PDF

with no caching. You will want to cache the results instead
of calling it over and over.


21
22
23
# File 'lib/pdf/reader/resource_methods.rb', line 21

def color_spaces
  @objects.deref!(resources[:ColorSpace]) || {}
end

#fontsObject

Returns a Hash of fonts that are available to this page

NOTE: this method de-serialise objects from the underlying PDF

with no caching. You will want to cache the results instead
of calling it over and over.


31
32
33
# File 'lib/pdf/reader/resource_methods.rb', line 31

def fonts
  @objects.deref!(resources[:Font]) || {}
end

#graphic_statesObject

Returns a Hash of external graphic states that are available to this page

NOTE: this method de-serialise objects from the underlying PDF

with no caching. You will want to cache the results instead
of calling it over and over.


42
43
44
# File 'lib/pdf/reader/resource_methods.rb', line 42

def graphic_states
  @objects.deref!(resources[:ExtGState]) || {}
end

#patternsObject

Returns a Hash of patterns that are available to this page

NOTE: this method de-serialise objects from the underlying PDF

with no caching. You will want to cache the results instead
of calling it over and over.


52
53
54
# File 'lib/pdf/reader/resource_methods.rb', line 52

def patterns
  @objects.deref!(resources[:Pattern]) || {}
end

#procedure_setsObject

Returns an Array of procedure sets that are available to this page

NOTE: this method de-serialise objects from the underlying PDF

with no caching. You will want to cache the results instead
of calling it over and over.


62
63
64
# File 'lib/pdf/reader/resource_methods.rb', line 62

def procedure_sets
  @objects.deref!(resources[:ProcSet]) || []
end

#propertiesObject

Returns a Hash of properties sets that are available to this page

NOTE: this method de-serialise objects from the underlying PDF

with no caching. You will want to cache the results instead
of calling it over and over.


72
73
74
# File 'lib/pdf/reader/resource_methods.rb', line 72

def properties
  @objects.deref!(resources[:Properties]) || {}
end

#shadingsObject

Returns a Hash of shadings that are available to this page

NOTE: this method de-serialise objects from the underlying PDF

with no caching. You will want to cache the results instead
of calling it over and over.


82
83
84
# File 'lib/pdf/reader/resource_methods.rb', line 82

def shadings
  @objects.deref!(resources[:Shading]) || {}
end

#xobjectsObject

Returns a Hash of XObjects that are available to this page

NOTE: this method de-serialise objects from the underlying PDF

with no caching. You will want to cache the results instead
of calling it over and over.


92
93
94
# File 'lib/pdf/reader/resource_methods.rb', line 92

def xobjects
  @objects.deref!(resources[:XObject]) || {}
end