Index
- Installation
- Getting Started
- Memory Usage
- Readers and Writers
- The Document Class
- Metadata
- Pages
- Canvas
- Page Layout and Mode
- Viewer Preferences
- Document Outline
- Page Labels
- Actions
- Destinations
- Annotations
- Embedded File Streams
- Colors and Color Spaces
- Page Formats and Boundaries
- Standard and Public Key Encryption
- Fonts and Encodings
- Corrupted Documents
- Reader Enabled Documents
- Refactor Old SetaPDF Code
- API Reference
Page Layout and Mode Define the page layout and page mode which shall be used when a document is opened
Table of Contents
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
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:
Constant for page layout value
Display the pages in one column
Constant for page layout value
Display one page at a time
Constant for page layout value
Display the pages in two columns, with odd-numbered pages on the left
Constant for page layout value
Display the pages in two columns, with odd-numbered pages on the right
Constant for page layout value
(PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
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
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:
Constant for page mode value
Full-screen mode, with no menu bar, window controls, or any other window visible
Constant for page mode value
(PDF 1.6) Attachments panel visible
Constant for page mode value
Neither document outline nor thumbnail images visible
Constant for page mode value
(PDF 1.5) Optional content group panel visible
Constant for page mode value
Document outline visible
Constant for page mode value
Thumbnail images visible
Example
$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);