Documentation

Document extends AbstractDocument
in package

Pdf document 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

ORIGIN_BOTTOM_LEFT  = 'ORIGIN_BOTTOM_LEFT'
ORIGIN_BOTTOM_RIGHT  = 'ORIGIN_BOTTOM_RIGHT'
ORIGIN_CENTER  = 'ORIGIN_CENTER'
ORIGIN_TOP_LEFT  = 'ORIGIN_TOP_LEFT'
Document origin constants
ORIGIN_TOP_RIGHT  = 'ORIGIN_TOP_RIGHT'
$compression  : bool
Compression property
$currentFont  : string
Current font
$currentPage  : int
Current page
$fonts  : array<string|int, mixed>
Fonts array
$forms  : array<string|int, mixed>
Forms array
$importedFonts  : array<string|int, mixed>
Imported fonts
$importedObjects  : array<string|int, mixed>
Imported objects
$metadata  : Metadata
PDF metadata for the info object
$origin  : string
Document origin
$pages  : array<string|int, mixed>
Pages array
$version  : float
PDF version
__construct()  : AbstractDocument
Constructor
__toString()  : string
Output the PDF document to string
addFont()  : Document
Add a font
addForm()  : AbstractDocument
Add form
addPage()  : Document
Add a page to the PDF document
addPages()  : Document
Add pages to the PDF document
copyPage()  : Page
Copy and return a page of the PDF, adding it to the PDF document
createPage()  : Page
Create and return a new page object, adding it to the PDF document
deletePage()  : Document
Delete a page from the PDF document
embedFont()  : Document
Add a font
getAvailableFonts()  : array<string|int, mixed>
Get available fonts that have been added to the PDF document
getCurrentFont()  : string
Get the current font
getCurrentPage()  : int
Get the current page number
getFont()  : Font
Get a PDF font object
getFonts()  : array<string|int, mixed>
Get the PDF font objects array
getForm()  : Form
Get form objects
getForms()  : array<string|int, mixed>
Get form objects
getImportedFonts()  : array<string|int, mixed>
Get the import fonts
getImportObjects()  : array<string|int, mixed>
Get the imported objects
getMetadata()  : Metadata
Get the document metadata
getNumberOfFonts()  : int
Get the current number of fonts
getNumberOfPages()  : int
Get the current number of pages
getOrigin()  : string
Get the document origin
getPage()  : Page
Get a PDF page object
getPages()  : array<string|int, mixed>
Get the PDF page objects array
getVersion()  : float
Get the document version
hasFont()  : bool
Determine if a font has been added to the PDF document (alias)
hasFonts()  : bool
Determine if the document has font objects
hasForms()  : bool
Determine if the document has form objects
hasImportedFonts()  : bool
Determine if the document has imported fonts
hasImportedObjects()  : bool
Determine if the document has imported objects
hasPages()  : bool
Determine if the document has page objects
importFonts()  : Document
Import fonts into document
importObjects()  : Document
Import objects into document
isCompressed()  : bool
Determine whether the PDF is compressed or not
isFontAvailable()  : bool
Determine if a font has been added to the PDF document
orderPages()  : Document
Order the pages
setCompression()  : AbstractDocument
Set the compression
setCurrentFont()  : Document
Set the current font of the PDF document
setCurrentPage()  : Document
Set the current page of the PDF document
setMetadata()  : AbstractDocument
Set the document metadata
setOrigin()  : AbstractDocument
Set the document origin
setVersion()  : AbstractDocument
Set the document version

Constants

ORIGIN_BOTTOM_LEFT

public mixed ORIGIN_BOTTOM_LEFT = 'ORIGIN_BOTTOM_LEFT'

ORIGIN_BOTTOM_RIGHT

public mixed ORIGIN_BOTTOM_RIGHT = 'ORIGIN_BOTTOM_RIGHT'

ORIGIN_TOP_LEFT

Document origin constants

public mixed ORIGIN_TOP_LEFT = 'ORIGIN_TOP_LEFT'

Properties

$importedFonts

Imported fonts

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

$importedObjects

Imported objects

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

Methods

__toString()

Output the PDF document to string

public __toString() : string
Return values
string

addFont()

Add a font

public addFont(Font $font[, bool $embedOverride = false ]) : Document
Parameters
$font : Font
$embedOverride : bool = false
Return values
Document

addPages()

Add pages to the PDF document

public addPages(array<string|int, mixed> $pages) : Document
Parameters
$pages : array<string|int, mixed>
Return values
Document

copyPage()

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

public copyPage(int $p[, bool $preserveContent = true ]) : Page
Parameters
$p : int
$preserveContent : bool = true
Tags
throws
Exception
Return values
Page

createPage()

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

public createPage(mixed $size[, int $height = null ]) : Page
Parameters
$size : mixed
$height : int = null
Return values
Page

embedFont()

Add a font

public embedFont(Font $font[, bool $embedOverride = false ]) : Document
Parameters
$font : Font
$embedOverride : bool = false
Return values
Document

getAvailableFonts()

Get available fonts that have been added to the PDF document

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

getCurrentFont()

Get the current font

public getCurrentFont() : string
Return values
string

getCurrentPage()

Get the current page number

public getCurrentPage() : int
Return values
int

getFonts()

Get the PDF font objects array

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

getForm()

Get form objects

public getForm(string $name) : Form
Parameters
$name : string
Return values
Form

getForms()

Get form objects

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

getImportedFonts()

Get the import fonts

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

getImportObjects()

Get the imported objects

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

getNumberOfFonts()

Get the current number of fonts

public getNumberOfFonts() : int
Return values
int

getNumberOfPages()

Get the current number of pages

public getNumberOfPages() : int
Return values
int

getOrigin()

Get the document origin

public getOrigin() : string
Return values
string

getPages()

Get the PDF page objects array

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

getVersion()

Get the document version

public getVersion() : float
Return values
float

hasFont()

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

public hasFont(string $font) : bool
Parameters
$font : string
Return values
bool

hasFonts()

Determine if the document has font objects

public hasFonts() : bool
Return values
bool

hasForms()

Determine if the document has form objects

public hasForms() : bool
Return values
bool

hasImportedFonts()

Determine if the document has imported fonts

public hasImportedFonts() : bool
Return values
bool

hasImportedObjects()

Determine if the document has imported objects

public hasImportedObjects() : bool
Return values
bool

hasPages()

Determine if the document has page objects

public hasPages() : bool
Return values
bool

importFonts()

Import fonts into document

public importFonts(array<string|int, mixed> $fonts) : Document
Parameters
$fonts : array<string|int, mixed>
Return values
Document

importObjects()

Import objects into document

public importObjects(array<string|int, mixed> $objects) : Document
Parameters
$objects : array<string|int, mixed>
Return values
Document

isCompressed()

Determine whether the PDF is compressed or not

public isCompressed() : bool
Return values
bool

isFontAvailable()

Determine if a font has been added to the PDF document

public isFontAvailable(string $font) : bool
Parameters
$font : string
Return values
bool

orderPages()

Order the pages

public orderPages(array<string|int, mixed> $pages) : Document
Parameters
$pages : array<string|int, mixed>
Tags
throws
Exception
Return values
Document

setCurrentFont()

Set the current font of the PDF document

public setCurrentFont(string $name) : Document
Parameters
$name : string
Tags
throws
Exception
Return values
Document

setCurrentPage()

Set the current page of the PDF document

public setCurrentPage(int $p) : Document
Parameters
$p : int
Tags
throws
Exception
Return values
Document

Search results