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

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

public const string SetaPDF_Core_Document_Catalog_ViewerPreferences::DUPLEX_FLIP_SHORT_EDGE = 'DuplexFlipShortEdge'

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

_getValue()

protected SetaPDF_Core_Document_Catalog_ViewerPreferences::_getValue (
string $key [, mixed $default = false [, boolean $pdfObject = false ]]
): mixed

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

Throws SetaPDF_Core_SecHandler_Exception

_setBooleanValue()

protected SetaPDF_Core_Document_Catalog_ViewerPreferences::_setBooleanValue (
string $key, boolean $value
): void

Helper method for setting boolean values.

Parameters
$key : string
 
$value : boolean
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

_setNameValue()

protected SetaPDF_Core_Document_Catalog_ViewerPreferences::_setNameValue (
string $key, string $name
): void

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

Throws SetaPDF_Core_SecHandler_Exception

cleanUp()

Release memory and cycled references.

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

getDocument()

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::getNumCopies (
[ int $defaultValue = 1 ]
): bool|mixed

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::getPickTrayByPdfSize (
[ null|boolean $defaultValue = null ]
): bool|mixed

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::getPrintPageRange (
[ array $defaultValue = array ( ) ]
): array

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setCenterWindow (
[ boolean $value = true ]
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setDisplayDocTitle (
[ boolean $value = true ]
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setDuplex (
string|false $name
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setFitWindow (
[ boolean $value = true ]
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setHideMenubar (
[ boolean $value = true ]
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setHideToolbar (
[ boolean $value = true ]
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setHideWindowUI (
[ boolean $value = true ]
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setNumCopies (
integer|false $numCopies
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setPickTrayByPdfSize (
[ boolean $value = true ]
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setPrintArea (
string|false $boundaryName
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setPrintClip (
string|false $boundaryName
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setPrintPageRange (
[ array|null $pageRange = null ]
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setViewArea (
string|false $boundaryName
): void

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

public SetaPDF_Core_Document_Catalog_ViewerPreferences::setViewClip (
string $boundaryName
): void

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