Class: Pdfrb::Model::Type::DPartRoot

Inherits:
Cos::Dictionary show all
Defined in:
lib/pdfrb/model/type/d_part.rb

Overview

DPartRoot (ISO 16612-2 PDF/VT §6.3.4). The root of the Document Part hierarchy, attached to the Catalog via the /DPartRoot key. Represents the root node of a tree whose leaves are groups of document parts.

Instance Attribute Summary

Attributes inherited from Object

#document, #gen, #oid, #value

Instance Method Summary collapse

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, merged_field, 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::Dictionary

Instance Method Details

#node_name_listObject

/NodeNameList — optional array of names identifying the tree levels (required for PDF/VT-2).



38
39
40
# File 'lib/pdfrb/model/type/d_part.rb', line 38

def node_name_list
  value[:NodeNameList]
end

#record_levelObject

/RecordLevel — optional integer >= 0, the nesting depth at which DParts represent individual records.



32
33
34
# File 'lib/pdfrb/model/type/d_part.rb', line 32

def record_level
  value[:RecordLevel]
end

#root_node(document = nil) ⇒ Object

/DPartRootNode — required indirect reference to the first DPart child.



20
21
22
23
24
25
26
27
28
# File 'lib/pdfrb/model/type/d_part.rb', line 20

def root_node(document = nil)
  ref = value[:DPartRootNode]
  return nil unless ref && document

  resolved = ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
  return nil unless resolved && resolved.value.is_a?(::Hash)

  DPart.new(resolved.value)
end

#typeObject

/Type — optional, fixed "DPartRoot".



14
15
16
# File 'lib/pdfrb/model/type/d_part.rb', line 14

def type
  value[:Type]&.to_sym
end