SetaPDF_Core_Document_Destination Class for handling Destinations in a PDF document

File: /SetaPDF/Core/Document/Destination.php

Class hierarchy

Summary

Constants

FIT_MODE_FIT

Display the page designated by page, with its contents magnified just enough to fit the entire page within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the page within the window in the other dimension.
See
  • PDF 32000-1:2008 - Table 151

FIT_MODE_FIT_B

Display the page designated by page, with its contents magnified just enough to fit its bounding box entirely within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the bounding box within the window in the other dimension.
See
  • PDF 32000-1:2008 - Table 151

FIT_MODE_FIT_BH

Display the page designated by page, with the vertical coordinate top positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of its bounding box within the window. A null value for top specifies that the current value of that parameter shall be retained unchanged.
See
  • PDF 32000-1:2008 - Table 151

FIT_MODE_FIT_BV

Display the page designated by page, with the horizontal coordinate left positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of its bounding box within the window. A null value for left specifies that the current value of that parameter shall be retained unchanged.
See
  • PDF 32000-1:2008 - Table 151

FIT_MODE_FIT_H

Display the page designated by page, with the vertical coordinate toppositioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of the page within the window. A null value for top specifies that the current value of that parameter shall be retained unchanged.
See
  • PDF 32000-1:2008 - Table 151

FIT_MODE_FIT_R

Display the page designated by page, with its contents magnified just enough to fit the rectangle specified by the coordinates left, bottom, right, and top entirely within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the rectangle within the window in the other dimension.
See
  • PDF 32000-1:2008 - Table 151

FIT_MODE_FIT_V

Display the page designated by page, with the horizontal coordinate left positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of the page within the window. A null value for left specifies that the current value of that parameter shall be retained unchanged.
See
  • PDF 32000-1:2008 - Table 151

FIT_MODE_XYZ

Display the page designated by page, with the coordinates (left, top) positioned at the upper-left corner of the window and the contents of the page magnified by the factor zoom. A null value for any of the parameters left, top, or zoom specifies that the current value of that parameter shall be retained unchanged. A zoom value of 0 has the same meaning as a null value.
See
  • PDF 32000-1:2008 - Table 151

Properties

$_destination


Static Methods

createByPage()

Creates a destination by a page object.

All additional arguments are passed to the createDestinationArray() method.

Parameters
$page : SetaPDF_Core_Document_Page
 
See

createByPageNo()

Creates a destination by page number.

All additional arguments are passed to the createDestinationArray() method.

Example:

$destinationArray = SetaPDF_Core_Document_Destination::createByPageNo(
    $document, 123, SetaPDF_Core_Document_Destination::FIT_MODE_XYZ, 30, 50, 200
);
Parameters
$document : SetaPDF_Core_Document
 
$pageNumber : int
 
See

createDestinationArray()

Creates an explicit Destination array.

This method allows you to pass a flexible argument count after the $fitMode parameter, depending on its value. Following fit modes expect following arguments:

SetaPDF_Core_Document_Destination::FIT_MODE_XYZ

float|null $left, float|null $top, float|null $zoom

SetaPDF_Core_Document_Destination::FIT_MODE_FIT

- no parameter -

SetaPDF_Core_Document_Destination::FIT_MODE_FIT_H

float|null $top

SetaPDF_Core_Document_Destination::FIT_MODE_FIT_V

float|null $left

SetaPDF_Core_Document_Destination::FIT_MODE_FIT_R

float $left, float $bottom, float $right, float $top

SetaPDF_Core_Document_Destination::FIT_MODE_B

- no parameter -

SetaPDF_Core_Document_Destination::FIT_MODE_BH

float|null $top

SetaPDF_Core_Document_Destination::FIT_MODE_BV

float|null $left

Example:

$destinationArray = SetaPDF_Core_Document_Destination::createDestinationArray(
    $indirectObject, SetaPDF_Core_Document_Destination::FIT_MODE_XYZ, 30, 50, 200
);
Parameters
$pageObject : SetaPDF_Core_Type_IndirectObject|SetaPDF_Core_Type_Numeric

The indirect object of a page of or the page number for the usage in remote go-to actions.

$fitMode : string
 
Exceptions

Throws InvalidArgumentException

findByName()

Find a destination by a name.

Parameters
$document : SetaPDF_Core_Document
 
$name : string
 
Return Values

The destination object or false if it was not found.


Methods

__construct()

The constructor.

Parameters
$destination : SetaPDF_Core_Type_AbstractType
 
Exceptions

Throws InvalidArgumentException

getDestinationArray()

getPage()

Get the target page object.

Parameters
$document : SetaPDF_Core_Document
 

getPageNo()

Get the target page number.

Parameters
$document : SetaPDF_Core_Document
 

getPdfValue()

Get the PDF value of this destination.