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 void SetaPDF_Core_Document_Catalog::setPageLayout ( string $pageLayout )

        Set the page layout.

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

        Parameters
        $pageLayout : string

        The name of the page layout

        See

        The SetaPDF_Core_Document_PageLayout class constants are defined as following:

        const string SetaPDF_Core_Document_PageLayout::ONE_COLUMN = 'OneColumn'

        Display the pages in one column

        const string SetaPDF_Core_Document_PageLayout::SINGLE_PAGE = 'SinglePage'

        Display one page at a time

        const string SetaPDF_Core_Document_PageLayout::TWO_COLUMN_LEFT = 'TwoColumnLeft'

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

        const string SetaPDF_Core_Document_PageLayout::TWO_COLUMN_RIGHT = 'TwoColumnRight'

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

        const string SetaPDF_Core_Document_PageLayout::TWO_PAGE_LEFT = 'TwoPageLeft'

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

        const string SetaPDF_Core_Document_PageLayout::TWO_PAGE_RIGHT = 'TwoPageRight'

        (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 method: 

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

        Set the page mode.

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

        Parameters
        $pageMode : string

        The name of the page mode

        See

        The SetaPDF_Core_Document_PageMode class constants are defined as following:

        const string SetaPDF_Core_Document_PageMode::FULL_SCREEN = 'FullScreen'

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

        const string SetaPDF_Core_Document_PageMode::USE_ATTACHMENTS = 'UseAttachments'

        (PDF 1.6) Attachments panel visible

        const string SetaPDF_Core_Document_PageMode::USE_NONE = 'UseNone'

        Neither document outline nor thumbnail images visible

        const string SetaPDF_Core_Document_PageMode::USE_OC = 'UseOC'

        (PDF 1.5) Optional content group panel visible

        const string SetaPDF_Core_Document_PageMode::USE_OUTLINES = 'UseOutlines'

        Document outline visible

        const string SetaPDF_Core_Document_PageMode::USE_THUMBS = 'UseThumbs'

        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);