Index
- \SetaPDF
- Core
- Core
- Canvas
- Canvas
- ColorSpace
- ColorSpace
- DataStructure
- Document
- Document
- Encoding
- Encoding
- Filter
- Font
- Font
- Geometry
- IccProfile
- Image
- Image
- Parser
- Reader
- Resource
- Resource
- SecHandler
- SecHandler
- Text
- Text
- Type
- Writer
- Writer
- XObject
- XObject
- XmpHelper
- XmpHelper
- BitConverter
- EmbeddedFileStream
- Exception
- FileSpecification
- OutputIntent
- PageBoundaries
- PageFormats
- Tokenizer
- TransparencyGroup
- WriteInterface
- Zugferd
SetaPDF_Core_PageFormats Class for getting and handling page formats
File: /SetaPDF v2/Core/PageFormats.php
Class hierarchy
Summary
Constants
A3
Page format constant
A4
Page format constant
A5
Page format constant
LEGAL
Page format constant
LETTER
Page format constant
ORIENTATION_AUTO
If this orientation is used the 0 key will be the width while 1 will hold the height
ORIENTATION_LANDSCAPE
Landscape orientation
ORIENTATION_PORTRAIT
Portrait orientation
Static Properties
Static Methods
getAsBoundary()
Get a page format as a boundary rect as a SetaPDF_Core_Type_Array
.
Parameters
- $format : string|array
- $orientation : string
- $boundaryName : string
getFormat()
Returns a normalized format by a page format name or by an array.
Parameters
- $format : string|array
The format as an array with 2 values or a pre-defined format constant
- $orientation : string
The orientation
Return Values
Array where the keys '0' and 'width' are the width and keys '1' and 'height' are the height.
Exceptions
Throws InvalidArgumentException
getHeight()
Get the height of a page format.
Parameters
- $format : string|array
- $orientation : string
getOrientation()
Returns the orientation using width and height.
Parameters
- $width : int|float
- $height : int|float
Return Values
See SetaPDF_Core_PageFormats::ORIENTATION_XXX
constants
getWidth()
Get the width of a page format.
Parameters
- $format : string|array
- $orientation : string
is()
Checks if a rectangle is approximately the same size as a given format.
Parameters
- $format : string|array
The format as an array or as one of the defined page formats
- $rect : array|SetaPDF_Core_Document_Page|SetaPDF_Core_DataStructure_Rectangle|SetaPDF_Core_Geometry_Rectangle
The rectangle or the page that needs to be compared
- $threshold : int|float
The allowed difference between the rectangle and the format
Return Values
false or a string containing the matched orientation.