class HexaPDF::Type::Catalog


Represents the PDF’s catalog dictionary which is at the root of the document’s object hierarchy.

The catalog dictionary is linked via the /Root entry from the Trailer.

See: PDF2.0 s7.7.2, Trailer

Field Definitions

NameType/Allowed ValuesRequiredDefault Value
ExtensionsHexaPDF::Dictionary or Hashfalsenil
PagesHexaPDF::Type::PageTreeNode or Hashfalsenil
PageLabelsHexaPDF::NumberTreeNode or Hashfalsenil
NamesHexaPDF::Type::Names or Hashfalsenil
DestsHexaPDF::Dictionary or Hashfalsenil
ViewerPreferencesHexaPDF::Type::ViewerPreferences or Hashfalsenil
One of: :SinglePage, :OneColumn, :TwoColumnLeft, :TwoColumnRight, :TwoPageLeft, :TwoPageRight
One of: :UseNone, :UseOutlines, :UseThumbs, :FullScreen, :UseOC, :UseAttachments
OutlinesHexaPDF::Type::Outline or Hashfalsenil
ThreadsHexaPDF::PDFArray or Arrayfalsenil
OpenActionHexaPDF::Dictionary or HexaPDF::PDFArray or Hash or Arrayfalsenil
AAHexaPDF::Dictionary or Hashfalsenil
URIHexaPDF::Dictionary or Hashfalsenil
AcroFormHexaPDF::Type::AcroForm::Form or Hashfalsenil
MetadataHexaPDF::Type::Metadata or Hashfalsenil
StructTreeRootHexaPDF::Dictionary or Hashfalsenil
MarkInfoHexaPDF::Type::MarkInformation or Hashfalsenil
SpiderInfoHexaPDF::Dictionary or Hashfalsenil
OutputIntentsHexaPDF::PDFArray or Arrayfalsenil
PieceInfoHexaPDF::Dictionary or Hashfalsenil
OCPropertiesHexaPDF::Type::OptionalContentProperties or Hashfalsenil
PermsHexaPDF::Dictionary or Hashfalsenil
LegalHexaPDF::Dictionary or Hashfalsenil
RequirementsHexaPDF::PDFArray or Arrayfalsenil
CollectionHexaPDF::Dictionary or Hashfalsenil
NeedsRenderingTrueClass or FalseClassfalsenil

Public Instance Methods

acro_form(create: false)

Returns the main AcroForm object.

  • If an AcroForm object exists, the create argument is not used.

  • If no AcroForm object exists and create is true, a new AcroForm object with default settings will be created and returned.

  • If no AcroForm object exists and create is false, nil is returned.

See: AcroForm::Form


Returns true since catalog objects must always be indirect.


Returns the name dictionary containing all name trees of the document, creating it if needed.

See: Names


Returns the optional content properties dictionary, creating it if needed.

This is the main entry point for working with optional content, a.k.a. layers.

See: OptionalContentProperties


Returns the document outline, creating it if needed.

See: Outline

page_labels(create: false)

Returns the page labels number tree.

  • If a page labels number tree exists, the create argument is not used.

  • If no page labels number tree exists and create is true, a new one is created.

  • If no page labels number tree exists and create is false, nil is returned.

See: HexaPDF::Document::Pages


Returns the root node of the page tree, creating it if needed.

See: PageTreeNode