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
-
#color_spaces ⇒ Object
Returns a Hash of color spaces that are available to this page.
-
#fonts ⇒ Object
Returns a Hash of fonts that are available to this page.
-
#graphic_states ⇒ Object
Returns a Hash of external graphic states that are available to this page.
-
#patterns ⇒ Object
Returns a Hash of patterns that are available to this page.
-
#procedure_sets ⇒ Object
Returns an Array of procedure sets that are available to this page.
-
#properties ⇒ Object
Returns a Hash of properties sets that are available to this page.
-
#shadings ⇒ Object
Returns a Hash of shadings that are available to this page.
-
#xobjects ⇒ Object
Returns a Hash of XObjects that are available to this page.
Instance Method Details
#color_spaces ⇒ Object
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.
16 17 18 |
# File 'lib/pdf/reader/resource_methods.rb', line 16 def color_spaces @objects.deref!(resources[:ColorSpace]) || {} end |
#fonts ⇒ Object
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.
26 27 28 |
# File 'lib/pdf/reader/resource_methods.rb', line 26 def fonts @objects.deref!(resources[:Font]) || {} end |
#graphic_states ⇒ Object
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.
37 38 39 |
# File 'lib/pdf/reader/resource_methods.rb', line 37 def graphic_states @objects.deref!(resources[:ExtGState]) || {} end |
#patterns ⇒ Object
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.
47 48 49 |
# File 'lib/pdf/reader/resource_methods.rb', line 47 def patterns @objects.deref!(resources[:Pattern]) || {} end |
#procedure_sets ⇒ Object
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.
57 58 59 |
# File 'lib/pdf/reader/resource_methods.rb', line 57 def procedure_sets @objects.deref!(resources[:ProcSet]) || [] end |
#properties ⇒ Object
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.
67 68 69 |
# File 'lib/pdf/reader/resource_methods.rb', line 67 def properties @objects.deref!(resources[:Properties]) || {} end |
#shadings ⇒ Object
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.
77 78 79 |
# File 'lib/pdf/reader/resource_methods.rb', line 77 def shadings @objects.deref!(resources[:Shading]) || {} end |
#xobjects ⇒ Object
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.
87 88 89 |
# File 'lib/pdf/reader/resource_methods.rb', line 87 def xobjects @objects.deref!(resources[:XObject]) || {} end |