SetaPDF_Core_Document_Page Class representing a PDF page
File: /SetaPDF v2/Core/Document/Page.php
Class hierarchy
Implements
Summary
Methods
- __construct()
- _checkBoundary()
- _ensureInheritedAttributes()
- _ensureObservation()
- _getBoundary()
- cleanUp()
- flattenInheritedAttributes()
- getAdditionalActions()
- getAnnotations()
- getArtBox()
- getAttribute()
- getBleedBox()
- getBoundary()
- getCanvas()
- getContents()
- getCropBox()
- getGroup()
- getHeight()
- getLastModified()
- getMediaBox()
- getMetadata()
- getObject()
- getOrientation()
- getPageObject()
- getRotation()
- getStreamProxy()
- getTrimBox()
- getWidth()
- getWidthAndHeight()
- rotateBy()
- setArtBox()
- setBleedBox()
- setBoundary()
- setCropBox()
- setGroup()
- setLastModified()
- setMediaBox()
- setMetadata()
- setRotation()
- setTrimBox()
- toXObject()
Properties
$_additionalActions
The additional actions object of this page
Static Methods
create()
Creates a new page for a specific document.
Parameters
- $document : SetaPDF_Core_Document
- $values
Exceptions
Throws SetaPDF_Core_Exception
Methods
__construct()
The constructor.
Parameters
- $pageObject : SetaPDF_Core_Type_IndirectObject
Exceptions
Throws SetaPDF_Core_Exception
_checkBoundary()
_getBoundary()
Get a page boundary box of the page (wihtout logic for invalid values).
Parameters
- $box
See SetaPDF_Core_PageBoundaries::XXX_BOX constants
- $fallback
Use the fallback box instead if box not exist
- $asRect
Return boundary box as SetaPDF_Core_DataStructure_Rectangle
See
getAttribute()
Get an attribute of the page object or from an inherited pages object.
Parameters
- $name
- $inherited
getBoundary()
Get a page boundary box of the page.
To work with the boundary box it should be cloned and reset by the SetaPDF_Core_Document_Page::setBoundary() method. This is necessary because a box could be inherited by a parent page tree node.
Parameters
- $box
See SetaPDF_Core_PageBoundaries::XXX_BOX constants
- $fallback
Use the fallback box instead if box not exist
- $asRect
Return boundary box as SetaPDF_Core_DataStructure_Rectangle
getHeight()
Get the height of the page.
Parameters
- $box
- $fallback
getMetadata()
Get the metadata stream of a page.
This is a method for low level access to the XMP stream data of a page.
Return Values
Null if no metadata are available.
A string if the desired structure is available.
getOrientation()
Get the orientation of the page.
Parameters
- $box
See SetaPDF_Core_PageBoundaries::XXX_BOX constants
- $fallback
Use the fallback box instead if box not exist
Return Values
false or one of SetaPDF_Core_PageFormats::ORIENTATION_XXX constants
getWidth()
Get the width of the page.
Parameters
- $box
- $fallback
getWidthAndHeight()
Get width and height of the page.
Parameters
- $box
- $fallback
Return Values
array(width, height)
rotateBy()
Rotate a page by degrees.
Parameters
- $rotation
Degrees to rotate by
Return Values
Returns the SetaPDF_Core_Document_Page object for method chaining.
Exceptions
setBleedBox()
Set the bleed box.
Parameters
- $boundary
- $checkBoundary
Ensure that boundary values are valid or not
Exceptions
setBoundary()
Set a boundary box.
A boundary consists of four numeric values: llx, lly, urx and ury. They can be passed in various ways:
- By a simple PHP array.
- A PDF Array with 4 numeric values.
- An instance of SetaPDF_Core_DataStructure_Rectangle.
- An instance of SetaPDF_Core_Type_Dictionary_Entry where the key defines the box and the value the boundary itself.
Parameters
- $boundary
- $box
The page boundary name
- $checkBoundary
Ensure that boundary values are valid or not
Exceptions
Throws InvalidArgumentException
setCropBox()
Set the crop box.
Parameters
- $boundary
- $checkBoundary
Ensure that boundary values are valid or not
Exceptions
setGroup()
setLastModified()
Set the date and time the page was edited.
Parameters
- $date
The last modification date. An instance of SetaPDF_Core_DataStructure_Date. Alternatively a string which is passed to its constructor.
setMediaBox()
Set the media box.
Parameters
- $boundary
- $checkBoundary
Ensure that boundary values are valid or not
Exceptions
setMetadata()
Set the metadata stream.
To remove the metadata just pass null to this method.
Parameters
- $metadata
setRotation()
Set the page rotation.
Parameters
- $rotation
The rotation value
Return Values
Returns the SetaPDF_Core_Document_Page object for method chaining.
Exceptions
Throws InvalidArgumentException
setTrimBox()
Set the trim box.
Parameters
- $boundary
- $checkBoundary
Ensure that boundary values are valid or not
Exceptions
toXObject()
Converts the page object into a form XObject.
Parameters
- $document : SetaPDF_Core_Document
- $box
The name of the bounding box