Document: ezcDocumentPdfDriver
[ ]
[ Conversion ] [ Styles ]
[ ]
[ ]
[ ]
[ ]
Class: ezcDocumentPdfDriver
|
Abstract base class for driver implementations. [
source]
Driver implement the actual creation of PDF documents. They offer a simple unified API for PDF creation and proxy them to the actual PDF implementation, which will create the binary data.
The unit used for all values passed to methods of this class is milimeters. The extending drivers need to transform these values in a representation they can use.
Descendents
Constants
Method Summary
|
public abstract float |
calculateWordWidth(
$word )
Calculate the rendered width of the current word |
|
public abstract void |
createPage(
$width, $height )
Create a new page |
|
public abstract void |
drawImage(
$file, $type, $x, $y, $width, $height )
Draw image |
|
public abstract void |
drawWord(
$x, $y, $word )
Draw word at given position |
|
public abstract float |
getCurrentLineHeight(
)
Get current line height |
|
public abstract string |
save(
)
Generate and return PDF |
|
public abstract void |
setTextFormatting(
$type, $value )
Set text formatting option |
Methods
calculateWordWidth
float calculateWordWidth(
string
$word )
Calculate the rendered width of the current word
Calculate the width of the passed word, using the currently set text formatting options.
Parameters
| Name |
Type |
Description |
$word |
string |
|
Redefined in descendants as
createPage
void createPage(
float
$width, float
$height )
Create a new page
Create a new page in the PDF document with the given width and height.
Parameters
| Name |
Type |
Description |
$width |
float |
|
$height |
float |
|
Redefined in descendants as
drawImage
void drawImage(
string
$file, string
$type, float
$x, float
$y, float
$width, float
$height )
Draw image
Draw image at the defined position. The first parameter is the (absolute) path to the image file, and the second defines the type of the image. If the driver cannot handle this aprticular image type, it should throw an exception.
The further parameters define the location where the image should be rendered and the dimensions of the image in the rendered output. The dimensions do not neccesarily match the real image dimensions, and might require some kind of scaling inside the driver depending on the used backend.
Parameters
| Name |
Type |
Description |
$file |
string |
|
$type |
string |
|
$x |
float |
|
$y |
float |
|
$width |
float |
|
$height |
float |
|
Redefined in descendants as
drawWord
void drawWord(
float
$x, float
$y, string
$word )
Draw word at given position
Draw the given word at the given position using the currently set text formatting options.
The coordinate specifies the left bottom edge of the words bounding box.
Parameters
| Name |
Type |
Description |
$x |
float |
|
$y |
float |
|
$word |
string |
|
Redefined in descendants as
getCurrentLineHeight
float getCurrentLineHeight(
)
Get current line height
Return the current line height in millimeter based on the current font and text rendering settings.
Redefined in descendants as
save
string save(
)
Generate and return PDF
Return the generated binary PDF content as a string.
Redefined in descendants as
setTextFormatting
void setTextFormatting(
string
$type, mixed
$value )
Set text formatting option
Set a text formatting option. The names of the options are the same used in the PCSS files and need to be translated by the driver to the proper backend calls.
Parameters
| Name |
Type |
Description |
$type |
string |
|
$value |
mixed |
|
Redefined in descendants as
Last updated: Tue, 01 Sep 2009