Document handler for PDF documents.
This document handler can load Docbook documents and generate PDF documents from them. It can be configured using its option class ezcDocumentPdfOptions. The example below shows the configuration of a driver.
Like shown in the example, it is possible to load any amount of custom style definitions and register additional PDF parts, like headers and footers.
Source for this file: /Document/src/document/pdf.php
ezcDocument | --ezcDocumentPdf
Version: | //autogen// |
protected string |
$content
The generated PDF |
protected array(ezcDocumentPdfPart) |
$pdfParts
= array()
List of PDF parts to append to documents |
protected ezcDocumentPcssStyleInferencer |
$styles
Container for style directives. |
From ezcDocument | |
---|---|
protected |
ezcDocument::$errors
|
protected |
ezcDocument::$options
|
protected |
ezcDocument::$path
|
public void |
createFromDocbook(
$document
)
Create document from docbook document |
public ezcDocumentDocbook |
getAsDocbook(
)
Return document compiled to the docbook format |
public void |
loadString(
$string
)
Create document from input string |
public void |
loadStyles(
$file
)
Load style definition file |
public void |
registerPdfPart(
$part
)
Append a PDF part |
public string |
save(
)
Return document as string |
From ezcDocument | |
---|---|
public ezcDocument |
ezcDocument::__construct()
Construct new document |
public abstract void |
ezcDocument::createFromDocbook()
Create document from docbook document |
public abstract ezcDocumentDocbook |
ezcDocument::getAsDocbook()
Return document compiled to the docbook format |
public array |
ezcDocument::getErrors()
Return list of errors occured during visiting the document. |
public string |
ezcDocument::getPath()
Get document base path |
public void |
ezcDocument::loadFile()
Create document from file |
public abstract void |
ezcDocument::loadString()
Create document from input string |
public abstract string |
ezcDocument::save()
Return document as string |
public void |
ezcDocument::setPath()
Set document base path |
public void |
ezcDocument::triggerError()
Trigger visitor error |
Create document from docbook document
A document of the docbook format is provided and the internal document structure should be created out of this.
This method is required for all formats to have one central format, so that each format can be compiled into each other format using docbook as an intermediate format.
You may of course just call an existing converter for this conversion.
Name | Type | Description |
---|---|---|
$document |
ezcDocumentDocbook |
Method | Description |
---|---|
ezcDocument::createFromDocbook() |
Create document from docbook document |
Return document compiled to the docbook format
The internal document structure is compiled to the docbook format and the resulting docbook document is returned.
This method is required for all formats to have one central format, so that each format can be compiled into each other format using docbook as an intermediate format.
You may of course just call an existing converter for this conversion.
Method | Description |
---|---|
ezcDocument::getAsDocbook() |
Return document compiled to the docbook format |
Create document from input string
Create a document of the current type handler class and parse it into a usable internal structure.
Name | Type | Description |
---|---|---|
$string |
string |
Method | Description |
---|---|
ezcDocument::loadString() |
Create document from input string |
Load style definition file
Parse and load a PCSS file and use the resulting style definitions for rendering.
Name | Type | Description |
---|---|---|
$file |
string |
Append a PDF part
Register additional PDF parts to be included in the rendering process, like headers and footers.
Name | Type | Description |
---|---|---|
$part |
ezcDocumentPdfPart |
Return document as string
Serialize the document to a string an return it.
Method | Description |
---|---|
ezcDocument::save() |
Return document as string |