Page Layout and Mode Define the page layout and page mode which shall be used when a document is opened

Table of Contents

  1. Page Layout
    1. Page Mode
      1. Example

        Page Layout

        To specify the page layout that shall be used when the document is opened could be defined with the setPageLayout()-method of the SetaPDF_Core_Document_Catalog object, that can be created with the getCatalog()-method from the SetaPDF_Core_Document instance:

        Description
        public SetaPDF_Core_Document_Catalog::setPageLayout (
        string|null $pageLayout
        ): void

        Set the page layout.

        Possible values are declared as class constants in the SetaPDF_Core_Document_PageLayout class.

        Parameters
        $pageLayout : string|null

        The name of the page layout

        Exceptions

        Throws SetaPDF_Core_SecHandler_Exception

        Throws SetaPDF_Core_Type_Exception

        See

        The SetaPDF_Core_Document_PageLayout class constants are defined as following:

        public const string SetaPDF_Core_Document_PageLayout::ONE_COLUMN = 'OneColumn'

        Constant for page layout value

        Display the pages in one column

        public const string SetaPDF_Core_Document_PageLayout::SINGLE_PAGE = 'SinglePage'

        Constant for page layout value

        Display one page at a time

        public const string SetaPDF_Core_Document_PageLayout::TWO_COLUMN_LEFT = 'TwoColumnLeft'

        Constant for page layout value

        Display the pages in two columns, with odd-numbered pages on the left

        public const string SetaPDF_Core_Document_PageLayout::TWO_COLUMN_RIGHT = 'TwoColumnRight'

        Constant for page layout value

        Display the pages in two columns, with odd-numbered pages on the right

        public const string SetaPDF_Core_Document_PageLayout::TWO_PAGE_LEFT = 'TwoPageLeft'

        Constant for page layout value

        (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left

        public const string SetaPDF_Core_Document_PageLayout::TWO_PAGE_RIGHT = 'TwoPageRight'

        Constant for page layout value

        (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right

        Page Mode

        The page mode specifies how the document shall be displayed when opened and can be defined with the setPageMode()-method of the SetaPDF_Core_Document_Catalog

        Description
        public SetaPDF_Core_Document_Catalog::setPageMode (
        string|null $pageMode
        ): void

        Set the page mode.

        Possible values are declared as class constants in the SetaPDF_Core_Document_PageMode class.

        Parameters
        $pageMode : string|null

        The name of the page mode

        Exceptions

        Throws SetaPDF_Core_SecHandler_Exception

        Throws SetaPDF_Core_Type_Exception

        See

        The SetaPDF_Core_Document_PageMode class constants are defined as following:

        public const string SetaPDF_Core_Document_PageMode::FULL_SCREEN = 'FullScreen'

        Constant for page mode value

        Full-screen mode, with no menu bar, window controls, or any other window visible

        public const string SetaPDF_Core_Document_PageMode::USE_ATTACHMENTS = 'UseAttachments'

        Constant for page mode value

        (PDF 1.6) Attachments panel visible

        public const string SetaPDF_Core_Document_PageMode::USE_NONE = 'UseNone'

        Constant for page mode value

        Neither document outline nor thumbnail images visible

        public const string SetaPDF_Core_Document_PageMode::USE_OC = 'UseOC'

        Constant for page mode value

        (PDF 1.5) Optional content group panel visible

        public const string SetaPDF_Core_Document_PageMode::USE_OUTLINES = 'UseOutlines'

        Constant for page mode value

        Document outline visible

        public const string SetaPDF_Core_Document_PageMode::USE_THUMBS = 'UseThumbs'

        Constant for page mode value

        Thumbnail images visible

        Example

        PHP
        $catalog = $document->getCatalog();
        // display one page at a time
        $catalog->setPageLayout(\SetaPDF_Core_Document_PageLayout::SINGLE_PAGE);
        // show the bookmark outline
        $catalog->setPageMode(\SetaPDF_Core_Document_PageMode::USE_OUTLINES);