Class: Pdfrb::Model::Type::OutlineItem

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

Overview

Single bookmark entry. Lives in its own file so the autoload path matches the TSV-derived class name.

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, 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

#actionObject



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

def action; self[:A]; end

#bold?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/pdfrb/model/type/outline_item.rb', line 28

def bold?
  f&.anybits?(1)
end

#cObject



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

def c; self[:C]; end

#child_countObject



46
47
48
49
50
# File 'lib/pdfrb/model/type/outline_item.rb', line 46

def child_count
  return 0 unless count

  count.abs
end

#colorObject



24
25
26
# File 'lib/pdfrb/model/type/outline_item.rb', line 24

def color
  c if c && (!c.is_a?(Array) || !c.empty?)
end

#countObject



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

def count; self[:Count]; end

#destObject



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

def dest; self[:Dest]; end

#destinationObject



52
53
54
# File 'lib/pdfrb/model/type/outline_item.rb', line 52

def destination
  dest || (action && action[:D])
end

#fObject



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

def f; self[:F]; end

#firstObject



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

def first; self[:First]; end

#has_children?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/pdfrb/model/type/outline_item.rb', line 36

def has_children?
  !!(count && count.nonzero?)
end

#italic?Boolean

Returns:

  • (Boolean)


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

def italic?
  f&.anybits?(2)
end

#lastObject



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

def last; self[:Last]; end

#nextObject



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

def next; self[:Next]; end

#open?Boolean

Returns:

  • (Boolean)


40
41
42
43
44
# File 'lib/pdfrb/model/type/outline_item.rb', line 40

def open?
  return true unless count

  count.positive?
end

#parentObject



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

def parent; self[:Parent]; end

#prevObject



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

def prev; self[:Prev]; end

#seObject



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

def se; self[:SE]; end

#titleObject



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

def title; self[:Title]; end