Class: Pdfrb::Model::Type::XObjectForm

Inherits:
Cos::Stream show all
Defined in:
lib/pdfrb/model/type/xobject_form.rb

Overview

Form XObject (s8.10). /Type /XObject, /Subtype /Form, /BBox, /Matrix, /Resources, /Group, /Filter, etc.

Instance Attribute Summary

Attributes inherited from Cos::Stream

#stream

Attributes inherited from Object

#document, #gen, #oid, #value

Instance Method Summary collapse

Methods inherited from Cos::Stream

#decoded_stream, #encoded_stream=, #initialize

Methods inherited from Cos::Dictionary

#[], #[]=, arlington_available?, arlington_default, arlington_key_to_symbol, arlington_loaded_for?, arlington_mark_loaded, arlington_object, arlington_one_type_to_ruby, arlington_required?, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, #empty?, field, #initialize, #key?, #keys, lookup_type, own_fields, #pdf_type, register_type, type_map, #validate

Methods inherited from Object

#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type

Constructor Details

This class inherits a constructor from Pdfrb::Model::Cos::Stream

Instance Method Details

#associated_filesObject



24
# File 'lib/pdfrb/model/type/xobject_form.rb', line 24

def associated_files; self[:AF]; end

#bboxObject



12
# File 'lib/pdfrb/model/type/xobject_form.rb', line 12

def bbox; self[:BBox]; end

#decode_parmsObject



17
# File 'lib/pdfrb/model/type/xobject_form.rb', line 17

def decode_parms; self[:DecodeParms]; end

#default_color_spaceObject



39
40
41
# File 'lib/pdfrb/model/type/xobject_form.rb', line 39

def default_color_space
  group && group[:CS]
end

#filterObject



16
# File 'lib/pdfrb/model/type/xobject_form.rb', line 16

def filter; self[:Filter]; end

#form_typeObject



18
# File 'lib/pdfrb/model/type/xobject_form.rb', line 18

def form_type; self[:FormType] || 1; end

#groupObject



15
# File 'lib/pdfrb/model/type/xobject_form.rb', line 15

def group; self[:Group]; end

#identity_matrix?Boolean

Returns:

  • (Boolean)


43
44
45
46
47
48
49
50
# File 'lib/pdfrb/model/type/xobject_form.rb', line 43

def identity_matrix?
  return true unless matrix

  arr = matrix.is_a?(Pdfrb::Model::PdfArray) ? matrix.to_a : matrix
  return true unless arr.is_a?(Array) && arr.size == 6

  arr[0] == 1 && arr[1].zero? && arr[2].zero? && arr[3] == 1 && arr[4].zero? && arr[5].zero?
end

#isolated?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/pdfrb/model/type/xobject_form.rb', line 31

def isolated?
  group && !!group[:I]
end

#knockout?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/pdfrb/model/type/xobject_form.rb', line 35

def knockout?
  group && !!group[:K]
end

#last_modifiedObject



21
# File 'lib/pdfrb/model/type/xobject_form.rb', line 21

def last_modified; self[:LastModified]; end

#mark_stream_data?Boolean

Returns:

  • (Boolean)


25
# File 'lib/pdfrb/model/type/xobject_form.rb', line 25

def mark_stream_data?; truthy?(self[:MS]); end

#matrixObject



13
# File 'lib/pdfrb/model/type/xobject_form.rb', line 13

def matrix; self[:Matrix]; end

#nameObject



20
# File 'lib/pdfrb/model/type/xobject_form.rb', line 20

def name; self[:Name]; end

#ocObject



19
# File 'lib/pdfrb/model/type/xobject_form.rb', line 19

def oc; self[:OC]; end

#piece_infoObject



22
# File 'lib/pdfrb/model/type/xobject_form.rb', line 22

def piece_info; self[:PieceInfo]; end

#resourcesObject



14
# File 'lib/pdfrb/model/type/xobject_form.rb', line 14

def resources; self[:Resources]; end

#struct_parentObject



23
# File 'lib/pdfrb/model/type/xobject_form.rb', line 23

def struct_parent; self[:StructParent]; end

#subtypeObject



11
# File 'lib/pdfrb/model/type/xobject_form.rb', line 11

def subtype; self[:Subtype]; end

#transparency_group?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/pdfrb/model/type/xobject_form.rb', line 27

def transparency_group?
  !!group
end