Class: Pdfrb::Model::Type::Catalog
Overview
Root of the document object hierarchy (s7.7.2). Linked from
the trailer's /Root. Fields: /Type, /Version, /Extensions,
/Pages, /PageLabels, /Names, /Dests, /ViewerPreferences,
/PageLayout, /PageMode, /Outlines, /Threads, /OpenAction,
/AA, /URI, /AcroForm, /Metadata, /StructTreeRoot, /MarkInfo,
/Lang, /SpiderInfo, /OutputIntents, /PieceInfo, /OCProperties,
/Perms, /Legal, /Requirements, /Collection, /NeedsRendering,
/DSS, /AF, /DPartRoot.
Instance Attribute Summary
Attributes inherited from Object
#document, #gen, #oid, #value
Instance Method Summary
collapse
#[], #[]=, apply_arlington_definition, arlington_default, arlington_key_to_symbol, arlington_one_type_to_ruby, arlington_required?, arlington_scalar, 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
#arlington_object
Methods inherited from Object
#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, pdf_type, #pdf_type, #ref
Instance Method Details
30
|
# File 'lib/pdfrb/model/type/catalog.rb', line 30
def acro_form; self[:AcroForm]; end
|
#additional_actions ⇒ Object
28
|
# File 'lib/pdfrb/model/type/catalog.rb', line 28
def additional_actions; self[:AA]; end
|
#associated_files ⇒ Object
45
|
# File 'lib/pdfrb/model/type/catalog.rb', line 45
def associated_files; self[:AF]; end
|
#collection ⇒ Object
42
|
# File 'lib/pdfrb/model/type/catalog.rb', line 42
def collection; self[:Collection]; end
|
75
76
77
|
# File 'lib/pdfrb/model/type/catalog.rb', line 75
def contains_form?
!!acro_form
end
|
#contains_outlines? ⇒ Boolean
79
80
81
|
# File 'lib/pdfrb/model/type/catalog.rb', line 79
def contains_outlines?
!!outlines
end
|
#contains_struct_tree? ⇒ Boolean
71
72
73
|
# File 'lib/pdfrb/model/type/catalog.rb', line 71
def contains_struct_tree?
!!struct_tree_root
end
|
#destinations ⇒ Object
21
|
# File 'lib/pdfrb/model/type/catalog.rb', line 21
def destinations; self[:Dests]; end
|
#dpart_root ⇒ Object
46
|
# File 'lib/pdfrb/model/type/catalog.rb', line 46
def dpart_root; self[:DPartRoot]; end
|
44
|
# File 'lib/pdfrb/model/type/catalog.rb', line 44
def dss; self[:DSS]; end
|
#each_output_intent ⇒ Object
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
# File 'lib/pdfrb/model/type/catalog.rb', line 114
def each_output_intent
return enum_for(:each_output_intent) unless block_given?
return unless output_intents && document
arr = if output_intents.is_a?(Pdfrb::Model::Reference)
document.object(output_intents)
else
output_intents
end
return unless arr.is_a?(Array) || arr.is_a?(Pdfrb::Model::PdfArray)
arr.each do |entry|
obj = document.resolve(entry)
yield obj if obj
end
end
|
#extensions ⇒ Object
48
|
# File 'lib/pdfrb/model/type/catalog.rb', line 48
def extensions; self[:Extensions]; end
|
#full_screen_mode? ⇒ Boolean
64
|
# File 'lib/pdfrb/model/type/catalog.rb', line 64
def full_screen_mode?; page_mode&.to_sym == :FullScreen; end
|
34
|
# File 'lib/pdfrb/model/type/catalog.rb', line 34
def lang; self[:Lang]; end
|
40
|
# File 'lib/pdfrb/model/type/catalog.rb', line 40
def legal; self[:Legal]; end
|
#mark_info ⇒ Object
33
|
# File 'lib/pdfrb/model/type/catalog.rb', line 33
def mark_info; self[:MarkInfo]; end
|
31
|
# File 'lib/pdfrb/model/type/catalog.rb', line 31
def metadata; self[:Metadata]; end
|
20
|
# File 'lib/pdfrb/model/type/catalog.rb', line 20
def names; self[:Names]; end
|
#needs_rendering? ⇒ Boolean
43
|
# File 'lib/pdfrb/model/type/catalog.rb', line 43
def needs_rendering?; truthy?(self[:NeedsRendering]); end
|
#oc_properties ⇒ Object
38
|
# File 'lib/pdfrb/model/type/catalog.rb', line 38
def oc_properties; self[:OCProperties]; end
|
#one_column_layout? ⇒ Boolean
51
|
# File 'lib/pdfrb/model/type/catalog.rb', line 51
def one_column_layout?; page_layout&.to_sym == :OneColumn; end
|
#open_action ⇒ Object
27
|
# File 'lib/pdfrb/model/type/catalog.rb', line 27
def open_action; self[:OpenAction]; end
|
25
|
# File 'lib/pdfrb/model/type/catalog.rb', line 25
def outlines; self[:Outlines]; end
|
#output_intents ⇒ Object
36
|
# File 'lib/pdfrb/model/type/catalog.rb', line 36
def output_intents; self[:OutputIntents]; end
|
#page_count ⇒ Object
83
84
85
86
87
88
|
# File 'lib/pdfrb/model/type/catalog.rb', line 83
def page_count
return 0 unless pages
obj = pages.is_a?(Pdfrb::Model::Reference) && document ? document.object(pages) : pages
obj && obj[:Count]
end
|
#page_labels ⇒ Object
19
|
# File 'lib/pdfrb/model/type/catalog.rb', line 19
def page_labels; self[:PageLabels]; end
|
#page_layout ⇒ Object
23
|
# File 'lib/pdfrb/model/type/catalog.rb', line 23
def page_layout; self[:PageLayout]; end
|
#page_mode ⇒ Object
24
|
# File 'lib/pdfrb/model/type/catalog.rb', line 24
def page_mode; self[:PageMode]; end
|
18
|
# File 'lib/pdfrb/model/type/catalog.rb', line 18
def pages; self[:Pages]; end
|
39
|
# File 'lib/pdfrb/model/type/catalog.rb', line 39
def perms; self[:Perms]; end
|
#piece_info ⇒ Object
37
|
# File 'lib/pdfrb/model/type/catalog.rb', line 37
def piece_info; self[:PieceInfo]; end
|
#requirements ⇒ Object
41
|
# File 'lib/pdfrb/model/type/catalog.rb', line 41
def requirements; self[:Requirements]; end
|
96
97
98
99
100
|
# File 'lib/pdfrb/model/type/catalog.rb', line 96
def resolved_acro_form
return nil unless acro_form && document
document.object(acro_form)
end
|
108
109
110
111
112
|
# File 'lib/pdfrb/model/type/catalog.rb', line 108
def resolved_metadata
return nil unless metadata && document
document.object(metadata)
end
|
#resolved_outlines ⇒ Object
102
103
104
105
106
|
# File 'lib/pdfrb/model/type/catalog.rb', line 102
def resolved_outlines
return nil unless outlines && document
document.object(outlines)
end
|
#resolved_pages ⇒ Object
90
91
92
93
94
|
# File 'lib/pdfrb/model/type/catalog.rb', line 90
def resolved_pages
return nil unless pages && document
document.object(pages)
end
|
#single_page_layout? ⇒ Boolean
50
|
# File 'lib/pdfrb/model/type/catalog.rb', line 50
def single_page_layout?; page_layout&.to_sym == :SinglePage; end
|
#spider_info ⇒ Object
35
|
# File 'lib/pdfrb/model/type/catalog.rb', line 35
def spider_info; self[:SpiderInfo]; end
|
#struct_tree_root ⇒ Object
32
|
# File 'lib/pdfrb/model/type/catalog.rb', line 32
def struct_tree_root; self[:StructTreeRoot]; end
|
#tagged? ⇒ Boolean
67
68
69
|
# File 'lib/pdfrb/model/type/catalog.rb', line 67
def tagged?
mark_info && !!mark_info[:Marked]
end
|
26
|
# File 'lib/pdfrb/model/type/catalog.rb', line 26
def threads; self[:Threads]; end
|
#two_column_layout? ⇒ Boolean
53
54
55
|
# File 'lib/pdfrb/model/type/catalog.rb', line 53
def two_column_layout?
[:TwoColumnLeft, :TwoColumnRight].include?(page_layout&.to_sym)
end
|
#two_page_layout? ⇒ Boolean
57
58
59
|
# File 'lib/pdfrb/model/type/catalog.rb', line 57
def two_page_layout?
[:TwoPageLeft, :TwoPageRight].include?(page_layout&.to_sym)
end
|
29
|
# File 'lib/pdfrb/model/type/catalog.rb', line 29
def uri; self[:URI]; end
|
#use_attachments_mode? ⇒ Boolean
61
|
# File 'lib/pdfrb/model/type/catalog.rb', line 61
def use_attachments_mode?; page_mode&.to_sym == :UseAttachments; end
|
#use_oc_mode? ⇒ Boolean
65
|
# File 'lib/pdfrb/model/type/catalog.rb', line 65
def use_oc_mode?; page_mode&.to_sym == :UseOC; end
|
#use_outlines_mode? ⇒ Boolean
63
|
# File 'lib/pdfrb/model/type/catalog.rb', line 63
def use_outlines_mode?; page_mode&.to_sym == :UseOutlines; end
|
#use_thumbs_mode? ⇒ Boolean
62
|
# File 'lib/pdfrb/model/type/catalog.rb', line 62
def use_thumbs_mode?; page_mode&.to_sym == :UseThumbs; end
|
#version_override ⇒ Object
47
|
# File 'lib/pdfrb/model/type/catalog.rb', line 47
def version_override; self[:Version]; end
|
#viewer_preferences ⇒ Object
22
|
# File 'lib/pdfrb/model/type/catalog.rb', line 22
def viewer_preferences; self[:ViewerPreferences]; end
|