AbstractDocument
in package
implements
DocumentInterface
Abstract Pdf document class
Tags
Table of Contents
Interfaces
- DocumentInterface
- Pdf document interface
Constants
- 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'
Properties
- $compression : bool
- Compression property
- $currentFont : string|null
- Current font
- $currentPage : int|null
- Current page
- $fonts : array<string|int, mixed>
- Fonts array
- $forms : array<string|int, mixed>
- Forms array
- $metadata : Metadata|null
- PDF metadata for the info object
- $origin : string
- Document origin
- $pages : array<string|int, mixed>
- Pages array
- $styles : array<string|int, mixed>
- Styles array
- $version : float
- PDF version
Methods
- __construct() : AbstractDocument
- Constructor
- __toString() : string
- Output the PDF document to string
- addFont() : AbstractDocument
- Add a font
- addFonts() : AbstractDocument
- Add fonts
- addForm() : AbstractDocument
- Add form
- addPage() : AbstractDocument
- Add a page to the PDF document
- addPages() : AbstractDocument
- Add pages to the PDF document
- addStyle() : AbstractDocument
- Add a style
- addStyles() : AbstractDocument
- Add styles
- 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
- createStyle() : AbstractDocument
- Create style
- deletePage() : AbstractDocument
- Delete a page from the PDF document
- embedFont() : AbstractDocument
- Embed a font
- embedFonts() : AbstractDocument
- Embed fonts
- getAvailableFonts() : array<string|int, mixed>
- Get available fonts that have been added to the PDF document
- getAvailableStyles() : array<string|int, mixed>
- Get available styles that have been added to the PDF document
- getCurrentFont() : string|null
- Get the current font
- getCurrentPage() : int|null
- 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|null
- Get form objects
- getForms() : array<string|int, mixed>
- Get form objects
- getMetadata() : Metadata|null
- 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
- getStyle() : Style
- Get a PDF style object
- getStyles() : array<string|int, mixed>
- Get the PDF style 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
- hasPages() : bool
- Determine if the document has page objects
- hasStyle() : bool
- Determine if a style has been added to the PDF document (alias)
- hasStyles() : bool
- Determine if the document has style objects
- isCompressed() : bool
- Determine whether the PDF is compressed or not
- isFontAvailable() : bool
- Determine if a font has been added to the PDF document
- isStyleAvailable() : bool
- Determine if a style has been added to the PDF document
- orderPages() : AbstractDocument
- Order the pages
- setCompression() : AbstractDocument
- Set the compression
- setCurrentFont() : AbstractDocument
- Set the current font of the PDF document
- setCurrentPage() : AbstractDocument
- 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_CENTER
public
mixed
ORIGIN_CENTER
= 'ORIGIN_CENTER'
ORIGIN_TOP_LEFT
Document origin constants
public
mixed
ORIGIN_TOP_LEFT
= 'ORIGIN_TOP_LEFT'
ORIGIN_TOP_RIGHT
public
mixed
ORIGIN_TOP_RIGHT
= 'ORIGIN_TOP_RIGHT'
Properties
$compression
Compression property
protected
bool
$compression
= false
$currentFont
Current font
protected
string|null
$currentFont
= null
$currentPage
Current page
protected
int|null
$currentPage
= null
$fonts
Fonts array
protected
array<string|int, mixed>
$fonts
= []
$forms
Forms array
protected
array<string|int, mixed>
$forms
= []
$metadata
PDF metadata for the info object
protected
Metadata|null
$metadata
= null
$origin
Document origin
protected
string
$origin
= 'ORIGIN_BOTTOM_LEFT'
$pages
Pages array
protected
array<string|int, mixed>
$pages
= []
$styles
Styles array
protected
array<string|int, mixed>
$styles
= []
$version
PDF version
protected
float
$version
= 1.7
Methods
__construct()
Constructor
public
abstract __construct([Page|null $page = null ][, Metadata|null $metadata = null ]) : AbstractDocument
Instantiate a PDF document
Parameters
Return values
AbstractDocument__toString()
Output the PDF document to string
public
abstract __toString() : string
Return values
stringaddFont()
Add a font
public
abstract addFont(Font $font) : AbstractDocument
Parameters
- $font : Font
Tags
Return values
AbstractDocumentaddFonts()
Add fonts
public
abstract addFonts(array<string|int, mixed> $fonts) : AbstractDocument
Parameters
- $fonts : array<string|int, mixed>
Tags
Return values
AbstractDocumentaddForm()
Add form
public
addForm(Form $form) : AbstractDocument
Parameters
- $form : Form
Return values
AbstractDocumentaddPage()
Add a page to the PDF document
public
abstract addPage(Page $page) : AbstractDocument
Parameters
- $page : Page
Return values
AbstractDocumentaddPages()
Add pages to the PDF document
public
abstract addPages(array<string|int, mixed> $pages) : AbstractDocument
Parameters
- $pages : array<string|int, mixed>
Return values
AbstractDocumentaddStyle()
Add a style
public
abstract addStyle(Style|string $style) : AbstractDocument
Parameters
- $style : Style|string
Return values
AbstractDocumentaddStyles()
Add styles
public
abstract addStyles(array<string|int, mixed> $styles) : AbstractDocument
Parameters
- $styles : array<string|int, mixed>
Return values
AbstractDocumentcopyPage()
Copy and return a page of the PDF, adding it to the PDF document
public
abstract copyPage(int $p) : Page
Parameters
- $p : int
Tags
Return values
PagecreatePage()
Create and return a new page object, adding it to the PDF document
public
abstract createPage(mixed $size[, int|null $height = null ]) : Page
Parameters
- $size : mixed
- $height : int|null = null
Return values
PagecreateStyle()
Create style
public
abstract createStyle(Style|string $style[, string|null $font = null ][, int|float|null $size = null ]) : AbstractDocument
Parameters
- $style : Style|string
- $font : string|null = null
- $size : int|float|null = null
Return values
AbstractDocumentdeletePage()
Delete a page from the PDF document
public
abstract deletePage(int $p) : AbstractDocument
Parameters
- $p : int
Tags
Return values
AbstractDocumentembedFont()
Embed a font
public
abstract embedFont(Font $font[, bool $embedOverride = false ]) : AbstractDocument
Parameters
- $font : Font
- $embedOverride : bool = false
Tags
Return values
AbstractDocumentembedFonts()
Embed fonts
public
abstract embedFonts(array<string|int, mixed> $fonts[, bool $embedOverride = false ]) : AbstractDocument
Parameters
- $fonts : array<string|int, mixed>
- $embedOverride : bool = false
Tags
Return values
AbstractDocumentgetAvailableFonts()
Get available fonts that have been added to the PDF document
public
getAvailableFonts() : array<string|int, mixed>
Return values
array<string|int, mixed>getAvailableStyles()
Get available styles that have been added to the PDF document
public
getAvailableStyles() : array<string|int, mixed>
Return values
array<string|int, mixed>getCurrentFont()
Get the current font
public
getCurrentFont() : string|null
Return values
string|nullgetCurrentPage()
Get the current page number
public
getCurrentPage() : int|null
Return values
int|nullgetFont()
Get a PDF font object
public
getFont(string $name) : Font
Parameters
- $name : string
Tags
Return values
FontgetFonts()
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|null
Parameters
- $name : string
Return values
Form|nullgetForms()
Get form objects
public
getForms() : array<string|int, mixed>
Return values
array<string|int, mixed>getMetadata()
Get the document metadata
public
getMetadata() : Metadata|null
Return values
Metadata|nullgetNumberOfFonts()
Get the current number of fonts
public
getNumberOfFonts() : int
Return values
intgetNumberOfPages()
Get the current number of pages
public
getNumberOfPages() : int
Return values
intgetOrigin()
Get the document origin
public
getOrigin() : string
Return values
stringgetPage()
Get a PDF page object
public
getPage(int $p) : Page
Parameters
- $p : int
Tags
Return values
PagegetPages()
Get the PDF page objects array
public
getPages() : array<string|int, mixed>
Return values
array<string|int, mixed>getStyle()
Get a PDF style object
public
getStyle(string $name) : Style
Parameters
- $name : string
Tags
Return values
StylegetStyles()
Get the PDF style objects array
public
getStyles() : array<string|int, mixed>
Return values
array<string|int, mixed>getVersion()
Get the document version
public
getVersion() : float
Return values
floathasFont()
Determine if a font has been added to the PDF document (alias)
public
hasFont(string $font) : bool
Parameters
- $font : string
Return values
boolhasFonts()
Determine if the document has font objects
public
hasFonts() : bool
Return values
boolhasForms()
Determine if the document has form objects
public
hasForms() : bool
Return values
boolhasPages()
Determine if the document has page objects
public
hasPages() : bool
Return values
boolhasStyle()
Determine if a style has been added to the PDF document (alias)
public
hasStyle(string $style) : bool
Parameters
- $style : string
Return values
boolhasStyles()
Determine if the document has style objects
public
hasStyles() : bool
Return values
boolisCompressed()
Determine whether the PDF is compressed or not
public
isCompressed() : bool
Return values
boolisFontAvailable()
Determine if a font has been added to the PDF document
public
isFontAvailable(string $font) : bool
Parameters
- $font : string
Return values
boolisStyleAvailable()
Determine if a style has been added to the PDF document
public
isStyleAvailable(string $style) : bool
Parameters
- $style : string
Return values
boolorderPages()
Order the pages
public
abstract orderPages(array<string|int, mixed> $pages) : AbstractDocument
Parameters
- $pages : array<string|int, mixed>
Tags
Return values
AbstractDocumentsetCompression()
Set the compression
public
setCompression(bool $compression) : AbstractDocument
Parameters
- $compression : bool
Return values
AbstractDocumentsetCurrentFont()
Set the current font of the PDF document
public
abstract setCurrentFont(string $name) : AbstractDocument
Parameters
- $name : string
Tags
Return values
AbstractDocumentsetCurrentPage()
Set the current page of the PDF document
public
abstract setCurrentPage(int $p) : AbstractDocument
Parameters
- $p : int
Tags
Return values
AbstractDocumentsetMetadata()
Set the document metadata
public
setMetadata(Metadata $metadata) : AbstractDocument
Parameters
- $metadata : Metadata
Return values
AbstractDocumentsetOrigin()
Set the document origin
public
setOrigin(string $origin) : AbstractDocument
Parameters
- $origin : string
Return values
AbstractDocumentsetVersion()
Set the document version
public
setVersion(float $version) : AbstractDocument
Parameters
- $version : float