Constants

ORIGIN_TOP_LEFT

ORIGIN_TOP_LEFT = 'ORIGIN_TOP_LEFT'

Document origin constants

ORIGIN_TOP_RIGHT

ORIGIN_TOP_RIGHT = 'ORIGIN_TOP_RIGHT'

ORIGIN_BOTTOM_LEFT

ORIGIN_BOTTOM_LEFT = 'ORIGIN_BOTTOM_LEFT'

ORIGIN_BOTTOM_RIGHT

ORIGIN_BOTTOM_RIGHT = 'ORIGIN_BOTTOM_RIGHT'

ORIGIN_CENTER

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\Document\AbstractDocument

Set the document version

Parameters

float $version

Returns

\Pop\Pdf\Document\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\Document\AbstractDocument

Set the compression

Parameters

boolean $compression

Returns

\Pop\Pdf\Document\AbstractDocument

isCompressed()

isCompressed() : boolean

Determine whether the PDF is compressed or not

Returns

boolean

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\Document\Exception

Returns

\Pop\Pdf\Document\Page

orderPages()

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

Order the pages

Parameters

array $pages

Throws

\Pop\Pdf\Document\Exception

Returns

\Pop\Pdf\Document\AbstractDocument

deletePage()

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

Delete a page from the PDF document

Parameters

integer $p

Throws

\Pop\Pdf\Document\Exception

Returns

\Pop\Pdf\Document\AbstractDocument

setCurrentPage()

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

Set the current page of the PDF document

Parameters

integer $p

Throws

\Pop\Pdf\Document\Exception

Returns

\Pop\Pdf\Document\AbstractDocument

setCurrentFont()

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

Set the current font of the PDF document

Parameters

string $name

Throws

\Pop\Pdf\Document\Exception

Returns

\Pop\Pdf\Document\AbstractDocument

__toString()

__toString() : string

Output the PDF document to string

Returns

string