Page
extends AbstractPage
in package
Pdf page class
Tags
Table of Contents
Constants
- A0 = 'A0'
- A1 = 'A1'
- A2 = 'A2'
- A3 = 'A3'
- A4 = 'A4'
- A5 = 'A5'
- A6 = 'A6'
- A7 = 'A7'
- A8 = 'A8'
- A9 = 'A9'
- B0 = 'B0'
- B1 = 'B1'
- B10 = 'B10'
- B2 = 'B2'
- B3 = 'B3'
- B4 = 'B4'
- B5 = 'B5'
- B6 = 'B6'
- B7 = 'B7'
- B8 = 'B8'
- B9 = 'B9'
- ENVELOPE_10 = 'ENVELOPE_10'
- Page size constants
- ENVELOPE_C5 = 'ENVELOPE_C5'
- ENVELOPE_DL = 'ENVELOPE_DL'
- EXECUTIVE = 'EXECUTIVE'
- FOLIO = 'FOLIO'
- LEDGER = 'LEDGER'
- LEGAL = 'LEGAL'
- LETTER = 'LETTER'
- TABLOID = 'TABLOID'
Properties
- $annotations : array<string|int, mixed>
- Annotations array
- $fields : array<string|int, mixed>
- Fields array
- $height : int
- Page height
- $images : array<string|int, mixed>
- Images array
- $importedPageObject : PageObject|null
- Imported page object
- $index : int|null
- Page index if page object represents an imported page
- $paths : array<string|int, mixed>
- Paths array
- $sizes : array<string|int, mixed>
- Array of page sizes
- $text : array<string|int, mixed>
- Text array
- $textStreams : array<string|int, mixed>
- Text streams array
- $width : int|null
- Page width
Methods
- __construct() : AbstractPage
- Constructor
- addAnnotation() : Page
- Add an annotation to the PDF page
- addField() : Page
- Add a form to the Pdf page
- addImage() : Page
- Add an image to the PDF page
- addLink() : Page
- Add a link annotation to the PDF page
- addPath() : Page
- Add a path to the Pdf page
- addText() : Page
- Add text to the PDF page
- addTextStream() : Page
- Add text to the PDF page
- addUrl() : Page
- Add a URL annotation to the PDF page
- clearContent() : AbstractPage
- Clear page content
- createFromImage() : Page
- Create a page from an image
- getAnnotations() : array<string|int, mixed>
- Get annotation objects
- getFields() : array<string|int, mixed>
- Get field objects
- getHeight() : int
- Get the page height
- getImages() : array<string|int, mixed>
- Get image objects
- getImportedPageObject() : PageObject|null
- Get the import page object
- getIndex() : int|null
- Get the page index
- getPaths() : array<string|int, mixed>
- Get path objects
- getText() : array<string|int, mixed>
- Get text objects
- getTextStreams() : array<string|int, mixed>
- Get text stream objects
- getWidth() : int
- Get the page width
- hasAnnotations() : bool
- Determine if the page has annotation objects
- hasFields() : bool
- Determine if the page has field objects
- hasImages() : bool
- Determine if the page has image objects
- hasImportedPageObject() : bool
- Determine if the document has an imported page object
- hasPaths() : bool
- Determine if the page has path objects
- hasText() : bool
- Determine if the page has text objects
- hasTextStreams() : bool
- Determine if the page has text stream objects
- importPageObject() : Page
- Import page object into the page
- setHeight() : AbstractPage
- Set the page height
- setIndex() : AbstractPage
- Set the page index
- setWidth() : AbstractPage
- Set the page width
Constants
A0
public
mixed
A0
= 'A0'
A1
public
mixed
A1
= 'A1'
A2
public
mixed
A2
= 'A2'
A3
public
mixed
A3
= 'A3'
A4
public
mixed
A4
= 'A4'
A5
public
mixed
A5
= 'A5'
A6
public
mixed
A6
= 'A6'
A7
public
mixed
A7
= 'A7'
A8
public
mixed
A8
= 'A8'
A9
public
mixed
A9
= 'A9'
B0
public
mixed
B0
= 'B0'
B1
public
mixed
B1
= 'B1'
B10
public
mixed
B10
= 'B10'
B2
public
mixed
B2
= 'B2'
B3
public
mixed
B3
= 'B3'
B4
public
mixed
B4
= 'B4'
B5
public
mixed
B5
= 'B5'
B6
public
mixed
B6
= 'B6'
B7
public
mixed
B7
= 'B7'
B8
public
mixed
B8
= 'B8'
B9
public
mixed
B9
= 'B9'
ENVELOPE_10
Page size constants
public
mixed
ENVELOPE_10
= 'ENVELOPE_10'
ENVELOPE_C5
public
mixed
ENVELOPE_C5
= 'ENVELOPE_C5'
ENVELOPE_DL
public
mixed
ENVELOPE_DL
= 'ENVELOPE_DL'
EXECUTIVE
public
mixed
EXECUTIVE
= 'EXECUTIVE'
FOLIO
public
mixed
FOLIO
= 'FOLIO'
LEDGER
public
mixed
LEDGER
= 'LEDGER'
LEGAL
public
mixed
LEGAL
= 'LEGAL'
LETTER
public
mixed
LETTER
= 'LETTER'
TABLOID
public
mixed
TABLOID
= 'TABLOID'
Properties
$annotations
Annotations array
protected
array<string|int, mixed>
$annotations
= []
$fields
Fields array
protected
array<string|int, mixed>
$fields
= []
$height
Page height
protected
int
$height
= null
$images
Images array
protected
array<string|int, mixed>
$images
= []
$importedPageObject
Imported page object
protected
PageObject|null
$importedPageObject
= null
$index
Page index if page object represents an imported page
protected
int|null
$index
= null
$paths
Paths array
protected
array<string|int, mixed>
$paths
= []
$sizes
Array of page sizes
protected
array<string|int, mixed>
$sizes
= ['ENVELOPE_10' => ['width' => 297, 'height' => 684], 'ENVELOPE_C5' => ['width' => 461, 'height' => 648], 'ENVELOPE_DL' => ['width' => 312, 'height' => 624], 'FOLIO' => ['width' => 595, 'height' => 935], 'EXECUTIVE' => ['width' => 522, 'height' => 756], 'LETTER' => ['width' => 612, 'height' => 792], 'LEGAL' => ['width' => 612, 'height' => 1008], 'LEDGER' => ['width' => 1224, 'height' => 792], 'TABLOID' => ['width' => 792, 'height' => 1224], 'A0' => ['width' => 2384, 'height' => 3370], 'A1' => ['width' => 1684, 'height' => 2384], 'A2' => ['width' => 1191, 'height' => 1684], 'A3' => ['width' => 842, 'height' => 1191], 'A4' => ['width' => 595, 'height' => 842], 'A5' => ['width' => 420, 'height' => 595], 'A6' => ['width' => 297, 'height' => 420], 'A7' => ['width' => 210, 'height' => 297], 'A8' => ['width' => 148, 'height' => 210], 'A9' => ['width' => 105, 'height' => 148], 'B0' => ['width' => 2920, 'height' => 4127], 'B1' => ['width' => 2064, 'height' => 2920], 'B2' => ['width' => 1460, 'height' => 2064], 'B3' => ['width' => 1032, 'height' => 1460], 'B4' => ['width' => 729, 'height' => 1032], 'B5' => ['width' => 516, 'height' => 729], 'B6' => ['width' => 363, 'height' => 516], 'B7' => ['width' => 258, 'height' => 363], 'B8' => ['width' => 181, 'height' => 258], 'B9' => ['width' => 127, 'height' => 181], 'B10' => ['width' => 91, 'height' => 127]]
$text
Text array
protected
array<string|int, mixed>
$text
= []
$textStreams
Text streams array
protected
array<string|int, mixed>
$textStreams
= []
$width
Page width
protected
int|null
$width
= null
Methods
__construct()
Constructor
public
__construct() : AbstractPage
Instantiate a PDF page.
Tags
Return values
AbstractPageaddAnnotation()
Add an annotation to the PDF page
public
addAnnotation(AbstractAnnotation $annotation[, int $x = 0 ][, int $y = 0 ]) : Page
Parameters
- $annotation : AbstractAnnotation
- $x : int = 0
- $y : int = 0
Return values
PageaddField()
Add a form to the Pdf page
public
addField(AbstractField $field, string $form[, int $x = 0 ][, int $y = 0 ]) : Page
Parameters
- $field : AbstractField
- $form : string
- $x : int = 0
- $y : int = 0
Return values
PageaddImage()
Add an image to the PDF page
public
addImage(Image $image[, int $x = 0 ][, int $y = 0 ]) : Page
Parameters
- $image : Image
- $x : int = 0
- $y : int = 0
Return values
PageaddLink()
Add a link annotation to the PDF page
public
addLink(Link $link[, int $x = 0 ][, int $y = 0 ]) : Page
Parameters
- $link : Link
- $x : int = 0
- $y : int = 0
Return values
PageaddPath()
Add a path to the Pdf page
public
addPath(Path $path) : Page
Parameters
- $path : Path
Return values
PageaddText()
Add text to the PDF page
public
addText(Text|string $text, string $fontStyle[, int $x = 0 ][, int $y = 0 ]) : Page
Parameters
- $text : Text|string
- $fontStyle : string
-
(can be either a reference to a font or a style)
- $x : int = 0
- $y : int = 0
Return values
PageaddTextStream()
Add text to the PDF page
public
addTextStream(Stream $textStream) : Page
Parameters
- $textStream : Stream
Return values
PageaddUrl()
Add a URL annotation to the PDF page
public
addUrl(Url $url[, int $x = 0 ][, int $y = 0 ]) : Page
Parameters
- $url : Url
- $x : int = 0
- $y : int = 0
Return values
PageclearContent()
Clear page content
public
clearContent() : AbstractPage
Return values
AbstractPagecreateFromImage()
Create a page from an image
public
static createFromImage(string $image[, int $quality = 70 ]) : Page
Parameters
- $image : string
- $quality : int = 70
Tags
Return values
PagegetAnnotations()
Get annotation objects
public
getAnnotations() : array<string|int, mixed>
Return values
array<string|int, mixed>getFields()
Get field objects
public
getFields() : array<string|int, mixed>
Return values
array<string|int, mixed>getHeight()
Get the page height
public
getHeight() : int
Return values
intgetImages()
Get image objects
public
getImages() : array<string|int, mixed>
Return values
array<string|int, mixed>getImportedPageObject()
Get the import page object
public
getImportedPageObject() : PageObject|null
Return values
PageObject|nullgetIndex()
Get the page index
public
getIndex() : int|null
Return values
int|nullgetPaths()
Get path objects
public
getPaths() : array<string|int, mixed>
Return values
array<string|int, mixed>getText()
Get text objects
public
getText() : array<string|int, mixed>
Return values
array<string|int, mixed>getTextStreams()
Get text stream objects
public
getTextStreams() : array<string|int, mixed>
Return values
array<string|int, mixed>getWidth()
Get the page width
public
getWidth() : int
Return values
inthasAnnotations()
Determine if the page has annotation objects
public
hasAnnotations() : bool
Return values
boolhasFields()
Determine if the page has field objects
public
hasFields() : bool
Return values
boolhasImages()
Determine if the page has image objects
public
hasImages() : bool
Return values
boolhasImportedPageObject()
Determine if the document has an imported page object
public
hasImportedPageObject() : bool
Return values
boolhasPaths()
Determine if the page has path objects
public
hasPaths() : bool
Return values
boolhasText()
Determine if the page has text objects
public
hasText() : bool
Return values
boolhasTextStreams()
Determine if the page has text stream objects
public
hasTextStreams() : bool
Return values
boolimportPageObject()
Import page object into the page
public
importPageObject(PageObject $page) : Page
Parameters
- $page : PageObject
Return values
PagesetHeight()
Set the page height
public
setHeight(mixed $height) : AbstractPage
Parameters
- $height : mixed
Return values
AbstractPagesetIndex()
Set the page index
public
setIndex(int $i) : AbstractPage
Parameters
- $i : int
Return values
AbstractPagesetWidth()
Set the page width
public
setWidth(mixed $width) : AbstractPage
Parameters
- $width : mixed