SetaPDF_Core_Document_Catalog_ViewerPreferences Class representing the access to the ViewerPreferences dictionary of a document
File: /SetaPDF v2/Core/Document/Catalog/ViewerPreferences.php
Class hierarchy
Summary
Methods
- __construct()
- _getValue()
- _removeKey()
- _setBooleanValue()
- _setNameValue()
- _setValue()
- cleanUp()
- getCenterWindow()
- getDirection()
- getDisplayDocTitle()
- getDocument()
- getDuplex()
- getFitWindow()
- getHideMenubar()
- getHideToolbar()
- getHideWindowUI()
- getNonFullScreenPageMode()
- getNumCopies()
- getPickTrayByPdfSize()
- getPrintArea()
- getPrintClip()
- getPrintPageRange()
- getPrintScaling()
- getViewArea()
- getViewClip()
- setCenterWindow()
- setDirection()
- setDisplayDocTitle()
- setDuplex()
- setFitWindow()
- setHideMenubar()
- setHideToolbar()
- setHideWindowUI()
- setNonFullScreenPageMode()
- setNumCopies()
- setPickTrayByPdfSize()
- setPrintArea()
- setPrintClip()
- setPrintPageRange()
- setPrintScaling()
- setViewArea()
- setViewClip()
Constants
DIRECTION_L2R
Constant value for predominant reading order for text.
Left to right.
DIRECTION_R2L
Constant value for predominant reading order for text.
Right to left.
DUPLEX_FLIP_LONG_EDGE
Constant value of the paper handling option that shall be used when printing the file from the print dialog.
Duplex and flip on the long edge of the sheet.
DUPLEX_FLIP_SHORT_EDGE
Constant value of the paper handling option that shall be used when printing the file from the print dialog.
Duplex and flip on the short edge of the sheet.
DUPLEX_SIMPLEX
Constant value of the paper handling option that shall be used when printing the file from the print dialog.
Print single-sided.
NON_FULL_SCREEN_PAGE_MODE_USE_NONE
Constant value specifying how to display the document on exiting full-screen mode.
Neither document outline nor thumbnail images visible.
NON_FULL_SCREEN_PAGE_MODE_USE_OC
Constant value specifying how to display the document on exiting full-screen mode.
Optional content group panel visible.
NON_FULL_SCREEN_PAGE_MODE_USE_OUTLINES
Constant value specifying how to display the document on exiting full-screen mode.
Document outline visible.
NON_FULL_SCREEN_PAGE_MODE_USE_THUMBS
Constant value specifying how to display the document on exiting full-screen mode.
Thumbnail images visible.
PRINT_SCALING_APP_DEFAULT
Constant value of the the page scaling option that shall be selected when a print dialog is displayed for this document.
Reader’s default print scaling.
PRINT_SCALING_NONE
Constant value of the the page scaling option that shall be selected when a print dialog is displayed for this document.
No page scaling.
Properties
Methods
__construct()
The constructor.
Parameters
- $catalog : SetaPDF_Core_Document_Catalog
_getValue()
Helper method to get a value of the ViewerPreferences dictionary.
Parameters
- $key : string
- $default : mixed
- $pdfObject : boolean
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
_removeKey()
Helper method for removing a key from the ViewerPreferences dictionary.
Parameters
- $key : string
Exceptions
Throws SetaPDF_Core_Type_Exception
_setBooleanValue()
Helper method for setting boolean values.
Parameters
- $key : string
- $value : boolean
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
_setNameValue()
Helper method for setting a name value.
Parameters
- $key : string
- $name : string
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
_setValue()
Helper method for setting a value.
Parameters
- $key : string
- $value : SetaPDF_Core_Type_AbstractType
Exceptions
Throws SetaPDF_Core_Type_Exception
getCenterWindow()
Get the flag specifying whether to position the document’s window in the center of the screen.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getDirection()
Get the predominant reading order for text.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getDisplayDocTitle()
Get the flag whether the title or the filename of the document should be displayed in the window’s title bar.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getDuplex()
Get the paper handling option that shall be used when printing the file from the print dialog.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getFitWindow()
Get the flag specifying whether to resize the document’s window to fit the size of the first displayed page.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getHideMenubar()
Get the flag specifying whether to hide the conforming reader’s menu bar when the document is active.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getHideToolbar()
Get the flag specifying whether to hide the conforming reader’s tool bars when the document is active.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getHideWindowUI()
Get flag specifying whether to hide user interface elements in the document’s window (such as scroll bars and navigation controls), leaving only the document’s contents displayed.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getNonFullScreenPageMode()
Get the document's page mode, specifying how to display the document on exiting full-screen mode.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getNumCopies()
Get the number of copies that shall be printed when the print dialog is opened.
Parameters
- $defaultValue : int
A default value, to be used if no preference is defined.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getPickTrayByPdfSize()
Get the flag specifying whether the PDF page size shall be used to select the input paper tray.
Parameters
- $defaultValue : null|boolean
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getPrintArea()
Get the name of the page boundary representing the area of a page that shall be rendered when printing the document.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getPrintClip()
Get the name of the page boundary to which the contents of a page shall be clipped when printing the document.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getPrintPageRange()
Get the page numbers used to initialize the print dialog box when the file is printed.
Parameters
- $defaultValue : array
A default value that will be returned if no preference is defined.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getPrintScaling()
Get the page scaling option that shall be selected when a print dialog is displayed for this document.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getViewArea()
Get the page boundary representing the area of a page that shall be displayed when viewing the document on the screen.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getViewClip()
Get the name of the page boundary to which the contents of a page shall be clipped when viewing the document on the screen.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setCenterWindow()
Set the flag specifying whether to position the document’s window in the center of the screen.
Parameters
- $value : boolean
A boolean value defining whether to position the document’s window in the center.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setDirection()
Set the predominant reading order for text.
Parameters
- $name : string|false
A constant value of
SetaPDF_Core_Document_Catalog_ViewerPreferences::DIRECTION_XXX
or false to remove this entry.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setDisplayDocTitle()
Set the flag whether the title or the filename of the document should be displayed in the window’s title bar.
Parameters
- $value : boolean
The value defining whether if the title of the document should be displayed in the window’s title bar (true) or the filename (false).
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setDuplex()
Set the paper handling option that shall be used when printing the file from the print dialog.
Parameters
- $name : string|false
A constant value of
SetaPDF_Core_Document_Catalog_ViewerPreferences::DUPLEX_XXX
or false to remove that entry.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setFitWindow()
Set the flag specifying whether to resize the document’s window to fit the size of the first displayed page.
Parameters
- $value : boolean
A boolean value defining whether to resize the document’s window.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setHideMenubar()
Set the flag specifying whether to hide the conforming reader’s menu bar when the document is active.
Does not affect the display through a browser plugin.
Parameters
- $value : boolean
A boolean value defining whether to hide the menu bar or not.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setHideToolbar()
Set the flag specifying whether to hide the conforming reader’s tool bars when the document is active.
Parameters
- $value : boolean
A boolean value defining whether to hide the tool bars or not.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setHideWindowUI()
Set flag specifying whether to hide user interface elements in the document’s window (such as scroll bars and navigation controls), leaving only the document’s contents displayed.
Parameters
- $value : boolean
A boolean value defining whether to hide user interface elements in the document's windows.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setNonFullScreenPageMode()
Set the document's page mode, specifying how to display the document on exiting full-screen mode.
Parameters
- $name : string|false
A constant value of
SetaPDF_Core_Document_Catalog_ViewerPreferences::NON_FULL_SCREEN_PAGE_MODE_XXX
or false to remove the entry.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setNumCopies()
Set the number of copies that shall be printed when the print dialog is opened for this file.
Parameters
- $numCopies : integer|false
The number of copies or false to remove this entry.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setPickTrayByPdfSize()
Set the flag specifying whether the PDF page size shall be used to select the input paper tray.
Parameters
- $value : boolean
A boolean value
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setPrintArea()
Set the name of the page boundary representing the area of a page that shall be rendered when printing the document.
Parameters
- $boundaryName : string|false
A boundary name as defined as a constant in
SetaPDF_Core_PageBoundaries
or false to remove that entry.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setPrintClip()
Set the name of the page boundary to which the contents of a page shall be clipped when printing the document.
Parameters
- $boundaryName : string|false
A boundary name as defined as a constant in
SetaPDF_Core_PageBoundaries
or false to remove that entry.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setPrintPageRange()
Set the page numbers used to initialize the print dialog box when the file is printed.
Parameters
- $pageRange : array|null
An array of even number of integer values to be interpreted in pairs. Each pair represents the first and last pages in a sub-range of pages.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setPrintScaling()
Set the page scaling option that shall be selected when a print dialog is displayed for this document.
Parameters
- $name : string|false
A constant value of
SetaPDF_Core_Document_Catalog_ViewerPreferences::PRINT_SCALING_XXX
or false to remove that entry.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setViewArea()
Set the page boundary representing the area of a page that shall be displayed when viewing the document on the screen.
Parameters
- $boundaryName : string|false
A boundary name as defined as a constant in
SetaPDF_Core_PageBoundaries
or false to remove this entry.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setViewClip()
Set the name of the page boundary to which the contents of a page shall be clipped when viewing the document on the screen.
Parameters
- $boundaryName : string
A boundary name as defined as a constant in
SetaPDF_Core_PageBoundaries
.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception