class HexaPDF::Type::Resources

Parent

Represents the resources needed by a content stream.

See: PDF2.0 s7.8.3

Field Definitions

NameType/Allowed ValuesRequiredDefault Value
ExtGStateHexaPDF::Dictionary or Hashfalsenil
ColorSpaceHexaPDF::Dictionary or Hashfalsenil
PatternHexaPDF::Dictionary or Hashfalsenil
ShadingHexaPDF::Dictionary or Hashfalsenil
XObjectHexaPDF::Dictionary or Hashfalsenil
FontHexaPDF::Dictionary or Hashfalsenil
ProcSetHexaPDF::PDFArray or Arrayfalsenil
PropertiesHexaPDF::Dictionary or Hashfalsenil

Public Instance Methods

add_color_space(color_space)

Adds the color space to the resources and returns the name under which it is stored.

If there already exists a color space with the same definition, it is reused. The device color spaces :DeviceGray, :DeviceRGB and :DeviceCMYK are never stored, their respective name is just returned.

add_ext_gstate(object)

Adds the graphics state parameter dictionary to the resources and returns the name under which it is stored.

If there already exists a name for the given dictionary, it is just returned.

add_font(object)

Adds the font dictionary to the resources and returns the name under which it is stored.

If there already exists a name for the given dictionary, it is just returned.

add_pattern(object)

Adds the pattern dictionary to the resources and returns the name under which it is stored.

If there already exists a name for the given dictionary, it is just returned.

add_property_list(dict)

Adds the property list to the resources and returns the name under which it is stored.

If there already exists a name for the given property list, it is just returned.

add_xobject(object)

Adds the XObject to the resources and returns the name under which it is stored.

If there already exists a name for the given XObject, it is just returned.

color_space(name)

Returns the color space stored under the given name.

If the color space is not found, an error is raised.

Note: The color spaces :DeviceGray, :DeviceRGB and :DeviceCMYK are returned without a lookup since they are fixed.

ext_gstate(name)

Returns the graphics state parameter dictionary (see Type::GraphicsStateParameter) stored under the given name.

If the dictionary is not found, an error is raised.

font(name)

Returns the font dictionary stored under the given name.

If the dictionary is not found, an error is raised.

pattern(name)

Returns the pattern dictionary stored under the given name.

If the dictionary is not found, an error is raised.

property_list(name)

Returns the property list stored under the given name.

If the property list is not found, an error is raised.

xobject(name)

Returns the XObject stored under the given name.

If the XObject is not found, an error is raised.