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
  2. Page Mode
  3. 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 \setasign\SetaPDF2\Core\Document\Catalog object, that can be created with the getCatalog()-method from the \setasign\SetaPDF2\Core\Document instance:

Description
public \setasign\SetaPDF2\Core\Document\Catalog::setPageLayout (
?string $pageLayout
): void

Set the page layout.

Possible values are declared as class constants in the \setasign\SetaPDF2\Core\Document\PageLayout class.

Parameters
$pageLayout: ?string

The name of the page layout

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

See
  • PageLayout

The \setasign\SetaPDF2\Core\Document\PageLayout class constants are defined as following:

public const string \setasign\SetaPDF2\Core\Document\PageLayout::ONE_COLUMN = 'OneColumn'

Constant for page layout value

Display the pages in one column

public const string \setasign\SetaPDF2\Core\Document\PageLayout::SINGLE_PAGE = 'SinglePage'

Constant for page layout value

Display one page at a time

public const string \setasign\SetaPDF2\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 \setasign\SetaPDF2\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 \setasign\SetaPDF2\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 \setasign\SetaPDF2\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 \setasign\SetaPDF2\Core\Document\Catalog

Description
public \setasign\SetaPDF2\Core\Document\Catalog::setPageMode (
?string $pageMode
): void

Set the page mode.

Possible values are declared as class constants in the \setasign\SetaPDF2\Core\Document\PageMode class.

Parameters
$pageMode: ?string

The name of the page mode

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

See
  • PageMode

The \setasign\SetaPDF2\Core\Document\PageMode class constants are defined as following:

public const string \setasign\SetaPDF2\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 \setasign\SetaPDF2\Core\Document\PageMode::USE_ATTACHMENTS = 'UseAttachments'

Constant for page mode value

(PDF 1.6) Attachments panel visible

public const string \setasign\SetaPDF2\Core\Document\PageMode::USE_NONE = 'UseNone'

Constant for page mode value

Neither document outline nor thumbnail images visible

public const string \setasign\SetaPDF2\Core\Document\PageMode::USE_OC = 'UseOC'

Constant for page mode value

(PDF 1.5) Optional content group panel visible

public const string \setasign\SetaPDF2\Core\Document\PageMode::USE_OUTLINES = 'UseOutlines'

Constant for page mode value

Document outline visible

public const string \setasign\SetaPDF2\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(\setasign\SetaPDF2\Core\Document\PageLayout::SINGLE_PAGE);
// show the bookmark outline
$catalog->setPageMode(\setasign\SetaPDF2\Core\Document\PageMode::USE_OUTLINES);