Constants

ORIGIN_TOP_LEFT

ORIGIN_TOP_LEFT

Document origin constants

ORIGIN_TOP_RIGHT

ORIGIN_TOP_RIGHT

ORIGIN_BOTTOM_LEFT

ORIGIN_BOTTOM_LEFT

ORIGIN_BOTTOM_RIGHT

ORIGIN_BOTTOM_RIGHT

ORIGIN_CENTER

ORIGIN_CENTER

Properties

$version

$version : float

PDF version

Type

float

$pages

$pages : array

Pages array

Type

array

$fonts

$fonts : array

Fonts array

Type

array

$forms

$forms : array

Forms array

Type

array

$currentPage

$currentPage : integer

Current page

Type

integer

$currentFont

$currentFont : string

Current font

Type

string

$compression

$compression : boolean

Compression property

Type

boolean

$origin

$origin : string

Document origin

Type

string

Methods

setVersion()

setVersion(float  $version) : \Pop\Pdf\AbstractDocument

Set the document version

Parameters

float $version

Returns

\Pop\Pdf\AbstractDocument

setOrigin()

setOrigin(string  $origin) : \Pop\Pdf\AbstractDocument

Set the document origin

Parameters

string $origin

Returns

\Pop\Pdf\AbstractDocument

getVersion()

getVersion() : float

Get the document version

Returns

float

getOrigin()

getOrigin() : string

Get the document origin

Returns

string

getPages()

getPages() : array

Get the PDF page objects array

Returns

array

getPage()

getPage(integer  $p) : \Pop\Pdf\Document\Page

Get a PDF page object

Parameters

integer $p

Throws

\Pop\Pdf\Exception

Returns

\Pop\Pdf\Document\Page

hasPages()

hasPages() : boolean

Determine if the document has page objects

Returns

boolean

getFonts()

getFonts() : array

Get the PDF font objects array

Returns

array

getFont()

getFont(string  $name) : \Pop\Pdf\Document\Font

Get a PDF font object

Parameters

string $name

Throws

\Pop\Pdf\Exception

Returns

\Pop\Pdf\Document\Font

hasFonts()

hasFonts() : boolean

Determine if the document has font objects

Returns

boolean

getAvailableFonts()

getAvailableFonts() : array

Get available fonts that have been added to the PDF document

Returns

array

isFontAvailable()

isFontAvailable(string  $font) : boolean

Determine if a font has been added to the PDF document

Parameters

string $font

Returns

boolean

hasFont()

hasFont(string  $font) : boolean

Determine if a font has been added to the PDF document (alias)

Parameters

string $font

Returns

boolean

getCurrentPage()

getCurrentPage() : integer

Get the current page number

Returns

integer

getNumberOfPages()

getNumberOfPages() : integer

Get the current number of pages

Returns

integer

getCurrentFont()

getCurrentFont() : string

Get the current font

Returns

string

getNumberOfFonts()

getNumberOfFonts() : integer

Get the current number of fonts

Returns

integer

getForms()

getForms() : array

Get form objects

Returns

array

getForm()

getForm(string  $name) : \Pop\Pdf\Document\Form

Get form objects

Parameters

string $name

Returns

\Pop\Pdf\Document\Form

hasForms()

hasForms() : boolean

Determine if the document has form objects

Returns

boolean

setCompression()

setCompression(boolean  $compression) : \Pop\Pdf\AbstractDocument

Set the compression

Parameters

boolean $compression

Returns

\Pop\Pdf\AbstractDocument

isCompressed()

isCompressed() : boolean

Determine whether the PDF is compressed or not

Returns

boolean

addPages()

addPages(array  $pages) : \Pop\Pdf\AbstractDocument

Add pages to the PDF document

Parameters

array $pages

Returns

\Pop\Pdf\AbstractDocument

createPage()

createPage(mixed  $size, integer  $height = null) : \Pop\Pdf\Document\Page

Create and return a new page object, adding it to the PDF document

Parameters

mixed $size
integer $height

Returns

\Pop\Pdf\Document\Page

copyPage()

copyPage(integer  $p) : \Pop\Pdf\Document\Page

Copy and return a page of the PDF, adding it to the PDF document

Parameters

integer $p

Throws

\Pop\Pdf\Exception

Returns

\Pop\Pdf\Document\Page

orderPages()

orderPages(array  $pages) : \Pop\Pdf\AbstractDocument

Order the pages

Parameters

array $pages

Throws

\Pop\Pdf\Exception

Returns

\Pop\Pdf\AbstractDocument

deletePage()

deletePage(integer  $p) : \Pop\Pdf\AbstractDocument

Delete a page from the PDF document

Parameters

integer $p

Throws

\Pop\Pdf\Exception

Returns

\Pop\Pdf\AbstractDocument

embedFont()

embedFont(\Pop\Pdf\Document\Font  $font, boolean  $embedOverride = false) : \Pop\Pdf\AbstractDocument

Add a font

Parameters

\Pop\Pdf\Document\Font $font
boolean $embedOverride

Throws

\Pop\Pdf\Exception

Returns

\Pop\Pdf\AbstractDocument

setCurrentPage()

setCurrentPage(integer  $p) : \Pop\Pdf\AbstractDocument

Set the current page of the PDF document

Parameters

integer $p

Throws

\Pop\Pdf\Exception

Returns

\Pop\Pdf\AbstractDocument

setCurrentFont()

setCurrentFont(string  $name) : \Pop\Pdf\AbstractDocument

Set the current font of the PDF document

Parameters

string $name

Throws

\Pop\Pdf\Exception

Returns

\Pop\Pdf\AbstractDocument

__toString()

__toString() : string

Output the PDF document to string

Returns

string