Class: PDF::Writer::Object::Catalog
- Inherits:
-
PDF::Writer::Object
- Object
- PDF::Writer::Object
- PDF::Writer::Object::Catalog
- Defined in:
- lib/gems/pdf-writer-1.1.8/lib/pdf/writer/object/catalog.rb
Overview
Define the document catalog, the overall controller for the document
Instance Attribute Summary collapse
-
#open_here ⇒ Object
Returns the value of attribute open_here.
-
#outlines ⇒ Object
Returns the value of attribute outlines.
-
#page_mode ⇒ Object
Returns the value of attribute page_mode.
-
#pages ⇒ Object
Returns the value of attribute pages.
-
#viewer_preferences ⇒ Object
Returns the value of attribute viewer_preferences.
Attributes inherited from PDF::Writer::Object
Instance Method Summary collapse
-
#initialize(parent) ⇒ Catalog
constructor
A new instance of Catalog.
- #to_s ⇒ Object
Constructor Details
#initialize(parent) ⇒ Catalog
Returns a new instance of Catalog.
13 14 15 16 17 18 19 20 21 |
# File 'lib/gems/pdf-writer-1.1.8/lib/pdf/writer/object/catalog.rb', line 13 def initialize(parent) super(parent) @outlines = nil @pages = nil @open_here = nil @viewer_preferences = nil @page_mode = nil end |
Instance Attribute Details
#open_here ⇒ Object
Returns the value of attribute open_here.
25 26 27 |
# File 'lib/gems/pdf-writer-1.1.8/lib/pdf/writer/object/catalog.rb', line 25 def open_here @open_here end |
#outlines ⇒ Object
Returns the value of attribute outlines.
23 24 25 |
# File 'lib/gems/pdf-writer-1.1.8/lib/pdf/writer/object/catalog.rb', line 23 def outlines @outlines end |
#page_mode ⇒ Object
Returns the value of attribute page_mode.
27 28 29 |
# File 'lib/gems/pdf-writer-1.1.8/lib/pdf/writer/object/catalog.rb', line 27 def page_mode @page_mode end |
#pages ⇒ Object
Returns the value of attribute pages.
24 25 26 |
# File 'lib/gems/pdf-writer-1.1.8/lib/pdf/writer/object/catalog.rb', line 24 def pages @pages end |
#viewer_preferences ⇒ Object
Returns the value of attribute viewer_preferences.
26 27 28 |
# File 'lib/gems/pdf-writer-1.1.8/lib/pdf/writer/object/catalog.rb', line 26 def viewer_preferences @viewer_preferences end |
Instance Method Details
#to_s ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/gems/pdf-writer-1.1.8/lib/pdf/writer/object/catalog.rb', line 29 def to_s res = "\n#{@oid} 0 obj\n<< /Type /Catalog" res << "\n/Outlines #{@outlines.oid} 0 R" unless @outlines.nil? res << "\n/Pages #{@pages.oid} 0 R" unless @pages.nil? res << "\n/ViewerPreferences #{@viewer_preferences.oid} 0 R" if @viewer_preferences and @parent.version >= '1.2' res << "\n/OpenAction #{@open_here.oid} 0 R" unless @open_here.nil? res << "\n/PageMode /#{@page_mode}" unless @page_mode.nil? res << "\n/Version /#{@parent.version}" if @parent.version >= '1.4' res << ">>\nendobj" end |