Class: EideticPDF::PdfObjects::PdfCatalog

Inherits:
PdfDictionaryObject show all
Defined in:
lib/epdfo.rb

Overview

root object of a PDF document, with pointers to other top-level objects

Constant Summary collapse

PAGE_MODES =
{
  :use_none => 'UseNone',
  :use_outlines => 'UseOutlines',
  :use_thumbs => 'UseThumbs',
  :full_screen => 'FullScreen'
}.freeze

Instance Attribute Summary collapse

Attributes inherited from IndirectObject

#gen, #seq

Instance Method Summary collapse

Methods inherited from PdfDictionaryObject

#body, #dictionary

Methods inherited from IndirectObject

#body, #footer, #header, #reference_object, #reference_string

Constructor Details

#initialize(seq, gen, page_mode = :use_none, pages = nil, outlines = nil) ⇒ PdfCatalog

Returns a new instance of PdfCatalog.



831
832
833
834
835
836
837
838
839
840
841
842
843
844
# File 'lib/epdfo.rb', line 831

def initialize(seq, gen, page_mode=:use_none, pages=nil, outlines=nil)
  super(seq, gen)
  dictionary['Type'] = PdfName.new('Catalog')
  @page_mode  = page_mode
  dictionary['PageMode'] = PdfName.new(PAGE_MODES[page_mode])
  if pages
    @pages = pages
    dictionary['Pages'] = pages.reference_object
  end
  if outlines
    @outlines = outlines
    dictionary['Outlines'] = outlines.reference_object
  end
end

Instance Attribute Details

#outlinesObject (readonly)

Returns the value of attribute outlines.



829
830
831
# File 'lib/epdfo.rb', line 829

def outlines
  @outlines
end

#page_modeObject (readonly)

Returns the value of attribute page_mode.



829
830
831
# File 'lib/epdfo.rb', line 829

def page_mode
  @page_mode
end

#pagesObject (readonly)

Returns the value of attribute pages.



829
830
831
# File 'lib/epdfo.rb', line 829

def pages
  @pages
end

Instance Method Details

#to_sObject



846
847
848
# File 'lib/epdfo.rb', line 846

def to_s
  super
end