Documentation

Page extends AbstractPage
in package

Pdf page class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
4.2.0

Table of Contents

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'
$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
Imported page object
$index  : int
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
Page width
__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
Get the import page object
getIndex()  : int
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

ENVELOPE_10

Page size constants

public mixed ENVELOPE_10 = 'ENVELOPE_10'

Properties

$annotations

Annotations array

protected array<string|int, mixed> $annotations = []

$fields

Fields array

protected array<string|int, mixed> $fields = []

$images

Images array

protected array<string|int, mixed> $images = []

$importedPageObject

Imported page object

protected PageObject $importedPageObject = null

$index

Page index if page object represents an imported page

protected int $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 = []

Methods

addField()

Add a form to the Pdf page

public addField(AbstractField $field, string $form, int $x, int $y) : Page
Parameters
$field : AbstractField
$form : string
$x : int
$y : int
Return values
Page

addImage()

Add an image to the PDF page

public addImage(Image $image, int $x, int $y) : Page
Parameters
$image : Image
$x : int
$y : int
Return values
Page

Add a link annotation to the PDF page

public addLink(Link $link, int $x, int $y) : Page
Parameters
$link : Link
$x : int
$y : int
Return values
Page

addPath()

Add a path to the Pdf page

public addPath(Path $path) : Page
Parameters
$path : Path
Return values
Page

addText()

Add text to the PDF page

public addText(Text $text, string $font, int $x, int $y) : Page
Parameters
$text : Text
$font : string
$x : int
$y : int
Return values
Page

addTextStream()

Add text to the PDF page

public addTextStream(Stream $textStream) : Page
Parameters
$textStream : Stream
Return values
Page

addUrl()

Add a URL annotation to the PDF page

public addUrl(Url $url, int $x, int $y) : Page
Parameters
$url : Url
$x : int
$y : int
Return values
Page

createFromImage()

Create a page from an image

public static createFromImage(string $image[, int $quality = 70 ]) : Page
Parameters
$image : string
$quality : int = 70
Tags
throws
Exception
Return values
Page

getAnnotations()

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
int

getImages()

Get image objects

public getImages() : array<string|int, mixed>
Return values
array<string|int, mixed>

getImportedPageObject()

Get the import page object

public getImportedPageObject() : PageObject
Return values
PageObject

getIndex()

Get the page index

public getIndex() : int
Return values
int

getPaths()

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
int

hasAnnotations()

Determine if the page has annotation objects

public hasAnnotations() : bool
Return values
bool

hasFields()

Determine if the page has field objects

public hasFields() : bool
Return values
bool

hasImages()

Determine if the page has image objects

public hasImages() : bool
Return values
bool

hasImportedPageObject()

Determine if the document has an imported page object

public hasImportedPageObject() : bool
Return values
bool

hasPaths()

Determine if the page has path objects

public hasPaths() : bool
Return values
bool

hasText()

Determine if the page has text objects

public hasText() : bool
Return values
bool

hasTextStreams()

Determine if the page has text stream objects

public hasTextStreams() : bool
Return values
bool

Search results