SetaPDF_Core_Document_Catalog_ViewerPreferences Class representing the access to the ViewerPreferences dictionary of a document

File: /SetaPDF/Core/Document/Catalog/ViewerPreferences.php

Class hierarchy

Summary

Constants

DIRECTION_L2R

DIRECTION_R2L

DUPLEX_FLIP_LONG_EDGE

Duplex and flip on the long edge of the sheet.

DUPLEX_FLIP_SHORT_EDGE

Duplex and flip on the short edge of the sheet.

DUPLEX_SIMPLEX

Print single-sided.

NON_FULL_SCREEN_PAGE_MODE_USE_NONE

Neither document outline nor thumbnail images visible.

NON_FULL_SCREEN_PAGE_MODE_USE_OC

Optional content group panel visible.

NON_FULL_SCREEN_PAGE_MODE_USE_OUTLINES

Document outline visible.

NON_FULL_SCREEN_PAGE_MODE_USE_THUMBS

Thumbnail images visible.

PRINT_SCALING_APP_DEFAULT

Reader’s default print scaling.

PRINT_SCALING_NONE


Properties


Methods

__construct()

public SetaPDF_Core_Document_Catalog_ViewerPreferences::__construct ( SetaPDF_Core_Document_Catalog $catalog )

The constructor.

Parameters
$catalog : SetaPDF_Core_Document_Catalog
 

_getValue()

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

Helper method to get a value of the ViewerPreferences dictionary.

Parameters
$key : string
 
$default : mixed
 
$pdfObject : boolean
 

_removeKey()

protected void SetaPDF_Core_Document_Catalog_ViewerPreferences::_removeKey ( string $key )

Helper method for removing a key from the ViewerPreferences dictionary.

Parameters
$key : string
 

_setBooleanValue()

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

Helper method for setting boolean values.

Parameters
$key : string
 
$value : boolean
 

_setNameValue()

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

Helper method for setting a name value.

Parameters
$key : string
 
$name : string
 

_setValue()

protected void SetaPDF_Core_Document_Catalog_ViewerPreferences::_setValue ( string $key, SetaPDF_Core_Type_AbstractType $value )

Helper method for setting a value.

Parameters
$key : string
 
$value : SetaPDF_Core_Type_AbstractType
 

cleanUp()

public void SetaPDF_Core_Document_Catalog_ViewerPreferences::cleanUp ( void )

Release memory and cycled references.

getCenterWindow()

public boolean SetaPDF_Core_Document_Catalog_ViewerPreferences::getCenterWindow ( void )

Get the flag specifying whether to position the document’s window in the center of the screen.

getDirection()

public string SetaPDF_Core_Document_Catalog_ViewerPreferences::getDirection ( void )

Get the predominant reading order for text.

getDisplayDocTitle()

public boolean SetaPDF_Core_Document_Catalog_ViewerPreferences::getDisplayDocTitle ( void )

Get the flag whether the title or the filename of the document should be displayed in the window’s title bar.

getDocument()

public SetaPDF_Core_Document SetaPDF_Core_Document_Catalog_ViewerPreferences::getDocument ( void )

Get the document instance.

getDuplex()

public string|null SetaPDF_Core_Document_Catalog_ViewerPreferences::getDuplex ( void )

Get the paper handling option that shall be used when printing the file from the print dialog.

getFitWindow()

public boolean SetaPDF_Core_Document_Catalog_ViewerPreferences::getFitWindow ( void )

Get the flag specifying whether to resize the document’s window to fit the size of the first displayed page.

getHideMenubar()

public boolean SetaPDF_Core_Document_Catalog_ViewerPreferences::getHideMenubar ( void )

Get the flag specifying whether to hide the conforming reader’s menu bar when the document is active.

getHideToolbar()

public boolean SetaPDF_Core_Document_Catalog_ViewerPreferences::getHideToolbar ( void )

Get the flag specifying whether to hide the conforming reader’s tool bars when the document is active.

getHideWindowUI()

public boolean SetaPDF_Core_Document_Catalog_ViewerPreferences::getHideWindowUI ( void )

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.

getNonFullScreenPageMode()

public string SetaPDF_Core_Document_Catalog_ViewerPreferences::getNonFullScreenPageMode ( void )

Get the document's page mode, specifying how to display the document on exiting full-screen mode.

getNumCopies()

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

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.

getPickTrayByPdfSize()

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

Get the flag specifying whether the PDF page size shall be used to select the input paper tray.

Parameters
$defaultValue : null|boolean
 

getPrintArea()

public string SetaPDF_Core_Document_Catalog_ViewerPreferences::getPrintArea ( void )

Get the name of the page boundary representing the area of a page that shall be rendered when printing the document.

getPrintClip()

public string SetaPDF_Core_Document_Catalog_ViewerPreferences::getPrintClip ( void )

Get the name of the page boundary to which the contents of a page shall be clipped when printing the document.

getPrintPageRange()

public array SetaPDF_Core_Document_Catalog_ViewerPreferences::getPrintPageRange ( [ array $defaultValue = 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.

getPrintScaling()

public string SetaPDF_Core_Document_Catalog_ViewerPreferences::getPrintScaling ( void )

Get the page scaling option that shall be selected when a print dialog is displayed for this document.

getViewArea()

public string SetaPDF_Core_Document_Catalog_ViewerPreferences::getViewArea ( void )

Get the page boundary representing the area of a page that shall be displayed when viewing the document on the screen.

getViewClip()

public string SetaPDF_Core_Document_Catalog_ViewerPreferences::getViewClip ( void )

Get the name of the page boundary to which the contents of a page shall be clipped when viewing the document on the screen.

setCenterWindow()

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

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.

setDirection()

public void SetaPDF_Core_Document_Catalog_ViewerPreferences::setDirection ( string $name )

Set the predominant reading order for text.

Parameters
$name : string

A constant value of SetaPDF_Core_Document_Catalog_ViewerPreferences::DIRECTION_XXX.

setDisplayDocTitle()

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

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

setDuplex()

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

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. To remove this preference pass false.

setFitWindow()

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

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.

setHideMenubar()

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

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.

setHideToolbar()

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

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.

setHideWindowUI()

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

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.

setNonFullScreenPageMode()

public void SetaPDF_Core_Document_Catalog_ViewerPreferences::setNonFullScreenPageMode ( [ string $name = self::NON_FULL_SCREEN_PAGE_MODE_USE_NONE ] )

Set the document's page mode, specifying how to display the document on exiting full-screen mode.

Parameters
$name : string

A constant value of SetaPDF_Core_Document_Catalog_ViewerPreferences::NON_FULL_SCREEN_PAGE_MODE_XXX.

setNumCopies()

public void SetaPDF_Core_Document_Catalog_ViewerPreferences::setNumCopies ( integer $numCopies )

Set the number of copies that shall be printed when the print dialog is opened for this file.

Parameters
$numCopies : integer

The number of copies.

setPickTrayByPdfSize()

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

Set the flag specifying whether the PDF page size shall be used to select the input paper tray.

Parameters
$value : boolean

A boolean value

setPrintArea()

public void SetaPDF_Core_Document_Catalog_ViewerPreferences::setPrintArea ( string $boundaryName )

Set the name of the page boundary representing the area of a page that shall be rendered when printing the document.

Parameters
$boundaryName : string

A boundary name as defined as a constant in SetaPDF_Core_PageBoundaries.

Exceptions

Throws InvalidArgumentException

setPrintClip()

public void SetaPDF_Core_Document_Catalog_ViewerPreferences::setPrintClip ( string $boundaryName )

Set the name of the page boundary to which the contents of a page shall be clipped when printing the document.

Parameters
$boundaryName : string

A boundary name as defined as a constant in SetaPDF_Core_PageBoundaries.

Exceptions

Throws InvalidArgumentException

setPrintPageRange()

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

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.

setPrintScaling()

public void SetaPDF_Core_Document_Catalog_ViewerPreferences::setPrintScaling ( string $name )

Set the page scaling option that shall be selected when a print dialog is displayed for this document.

Parameters
$name : string

A constant value of SetaPDF_Core_Document_Catalog_ViewerPreferences::PRINT_SCALING_XXX.

setViewArea()

public void SetaPDF_Core_Document_Catalog_ViewerPreferences::setViewArea ( string $boundaryName )

Set the page boundary representing the area of a page that shall be displayed when viewing the document on the screen.

Parameters
$boundaryName : string

A boundary name as defined as a constant in SetaPDF_Core_PageBoundaries.

Exceptions

Throws InvalidArgumentException

setViewClip()

public void SetaPDF_Core_Document_Catalog_ViewerPreferences::setViewClip ( string $boundaryName )

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 InvalidArgumentException