Apache Zeta Components Manual :: Docs For Class ezcDocumentPdf
Document::ezcDocumentPdf
Class ezcDocumentPdf
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.
- // Load the docbook document and create a PDF from it
- // Load a custom style sheet
- // Add a customized footer
- 'showDocumentTitle' => false,
- 'showDocumentAuthor' => false,
- 'height' => '10mm',
- ) )
- ) );
- // Add a customized header
- 'showPageNumber' => false,
- 'height' => '10mm',
- ) )
- ) );
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// |
Member Variables
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. |
Inherited Member Variables
From ezcDocument | |
---|---|
protected |
ezcDocument::$errors
|
protected |
ezcDocument::$options
|
protected |
ezcDocument::$path
|
Method Summary
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 |
Inherited Methods
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 |
Methods
createFromDocbook
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.
Parameters:
Name | Type | Description |
---|---|---|
$document |
ezcDocumentDocbook |
Redefinition of:
Method | Description |
---|---|
ezcDocument::createFromDocbook() |
Create document from docbook document |
getAsDocbook
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.
Redefinition of:
Method | Description |
---|---|
ezcDocument::getAsDocbook() |
Return document compiled to the docbook format |
loadString
Create document from input string
Create a document of the current type handler class and parse it into a usable internal structure.
Parameters:
Name | Type | Description |
---|---|---|
$string |
string |
Redefinition of:
Method | Description |
---|---|
ezcDocument::loadString() |
Create document from input string |
loadStyles
Load style definition file
Parse and load a PCSS file and use the resulting style definitions for rendering.
Parameters:
Name | Type | Description |
---|---|---|
$file |
string |
registerPdfPart
Append a PDF part
Register additional PDF parts to be included in the rendering process, like headers and footers.
Parameters:
Name | Type | Description |
---|---|---|
$part |
ezcDocumentPdfPart |
save
Return document as string
Serialize the document to a string an return it.
Redefinition of:
Method | Description |
---|---|
ezcDocument::save() |
Return document as string |