Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
PDF Page
SIZE_LETTER_LANDSCAPE
= '792:612:'
Size representing a US Letter page in landscape (wide) orientation.

boolean
$_attached= ''
Flag which signals, that page is created separately from any PDF document or attached to anyone.

\Zend_Pdf_Element_Reference|\Zend_Pdf_Element_Object
$_dictionary= ''
Page dictionary (refers to an inderect Zend_Pdf_Element_Dictionary object).

__clone(
)
:
void
Clone page, extract it and dependent objects from the current document, so it can be used within other docs.

__construct(
mixed $param1, mixed $param2
=
null, mixed $param3
=
null
)
:
void
Object constructor.
Constructor signatures:
new Zend_Pdf_Page(Zend_Pdf_Element_Dictionary $pageDict,
Name | Type | Description |
---|---|---|
$param1 | mixed | |
$param2 | mixed | |
$param3 | mixed |
Exception | Description |
---|---|
\Zend_Pdf_Exception |

_addProcSet(
string $procSetName
)
:
void
Add procedureSet to the Page description
Name | Type | Description |
---|---|---|
$procSetName | string |

_attachResource(
string $type, \Zend_Pdf_Resource $resource
)
:
string
Attach resource to the canvas
Method returns a name of the resource which can be used as a resource reference within drawing instructions stream Allowed types: 'ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font', 'Properties'
Name | Type | Description |
---|---|---|
$type | string | |
$resource | \Zend_Pdf_Resource |
Type | Description |
---|---|
string |

attachAnnotation(
\Zend_Pdf_Annotation $annotation
)
:
\Zend_Pdf_Page
Name | Type | Description |
---|---|---|
$annotation | \Zend_Pdf_Annotation |
Type | Description |
---|---|
\Zend_Pdf_Page |

clipCircle(
float $x, float $y, float $radius, float $startAngle
=
null, float $endAngle
=
null
)
:
\Zend_Pdf_Canvas_Interface
Intersect current clipping area with a circle.
Inherited from: \Zend_Pdf_Canvas_Abstract::clipCircle()Name | Type | Description |
---|---|---|
$x | float | |
$y | float | |
$radius | float | |
$startAngle | float | |
$endAngle | float |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

clipEllipse(
float $x1, float $y1, float $x2, float $y2, float $startAngle
=
null, float $endAngle
=
null
)
:
\Zend_Pdf_Canvas_Interface
Intersect current clipping area with a polygon.
Inherited from: \Zend_Pdf_Canvas_Abstract::clipEllipse()Method signatures: drawEllipse($x1, $y1, $x2, $y2); drawEllipse($x1, $y1, $x2, $y2, $startAngle, $endAngle);
Name | Type | Description |
---|---|---|
$x1 | float | |
$y1 | float | |
$x2 | float | |
$y2 | float | |
$startAngle | float | |
$endAngle | float |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

clipPolygon(
array $x, array $y, integer $fillMethod
=
Zend_Pdf_Page
)
:
\Zend_Pdf_Canvas_Interface
Intersect current clipping area with a polygon.
Inherited from: \Zend_Pdf_Canvas_Abstract::clipPolygon()Name | Type | Description |
---|---|---|
$x | array |
|
$y | array |
|
$fillMethod | integer |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

clipRectangle(
float $x1, float $y1, float $x2, float $y2
)
:
\Zend_Pdf_Canvas_Interface
Intersect current clipping area with a rectangle.
Inherited from: \Zend_Pdf_Canvas_Abstract::clipRectangle()Name | Type | Description |
---|---|---|
$x1 | float | |
$y1 | float | |
$x2 | float | |
$y2 | float |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

drawCanvas(
\Zend_Pdf_Canvas_Interface $canvas, float $x1, float $y1, float $x2
=
null, float $y2
=
null
)
:
\Zend_Pdf_Canvas_Interface
Draw a canvas at the specified location
Inherited from: \Zend_Pdf_Canvas_Abstract::drawCanvas()If upper right corner is not specified then canvas heght and width are used.
Name | Type | Description |
---|---|---|
$canvas | \Zend_Pdf_Canvas_Interface | |
$x1 | float | |
$y1 | float | |
$x2 | float | |
$y2 | float |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

drawCircle(
float $x, float $y, float $radius, mixed $param4
=
null, mixed $param5
=
null, mixed $param6
=
null
)
:
\Zend_Pdf_Canvas_Interface
Draw a circle centered on x, y with a radius of radius.
Inherited from: \Zend_Pdf_Canvas_Abstract::drawCircle()Method signatures: drawCircle($x, $y, $radius); drawCircle($x, $y, $radius, $fillType); drawCircle($x, $y, $radius, $startAngle, $endAngle); drawCircle($x, $y, $radius, $startAngle, $endAngle, $fillType);
It's not a really circle, because PDF supports only cubic Bezier curves. But very good approximation. It differs from a real circle on a maximum 0.00026 radiuses (at PI/8, 3PI/8, 5PI/8, 7PI/8, 9PI/8, 11PI/8, 13PI/8 and 15PI/8 angles). At 0, PI/4, PI/2, 3PI/4, PI, 5PI/4, 3PI/2 and 7*PI/4 it's exactly a tangent to a circle.
Name | Type | Description |
---|---|---|
$x | float | |
$y | float | |
$radius | float | |
$param4 | mixed | |
$param5 | mixed | |
$param6 | mixed |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

drawEllipse(
float $x1, float $y1, float $x2, float $y2, mixed $param5
=
null, mixed $param6
=
null, mixed $param7
=
null
)
:
\Zend_Pdf_Canvas_Interface
Draw an ellipse inside the specified rectangle.
Inherited from: \Zend_Pdf_Canvas_Abstract::drawEllipse()Method signatures: drawEllipse($x1, $y1, $x2, $y2); drawEllipse($x1, $y1, $x2, $y2, $fillType); drawEllipse($x1, $y1, $x2, $y2, $startAngle, $endAngle); drawEllipse($x1, $y1, $x2, $y2, $startAngle, $endAngle, $fillType);
Name | Type | Description |
---|---|---|
$x1 | float | |
$y1 | float | |
$x2 | float | |
$y2 | float | |
$param5 | mixed | |
$param6 | mixed | |
$param7 | mixed |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

drawImage(
\Zend_Pdf_Image $image, float $x1, float $y1, float $x2, float $y2
)
:
\Zend_Pdf_Canvas_Interface
Draw an image at the specified position on the page.
Inherited from: \Zend_Pdf_Canvas_Abstract::drawImage()Name | Type | Description |
---|---|---|
$image | \Zend_Pdf_Image | |
$x1 | float | |
$y1 | float | |
$x2 | float | |
$y2 | float |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

drawLine(
float $x1, float $y1, float $x2, float $y2
)
:
\Zend_Pdf_Canvas_Interface
Draw a line from x1,y1 to x2,y2.
Inherited from: \Zend_Pdf_Canvas_Abstract::drawLine()Name | Type | Description |
---|---|---|
$x1 | float | |
$y1 | float | |
$x2 | float | |
$y2 | float |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

drawPolygon(
array $x, array $y, integer $fillType
=
Zend_Pdf_Page, integer $fillMethod
=
Zend_Pdf_Page
)
:
\Zend_Pdf_Canvas_Interface
Draw a polygon.
Inherited from: \Zend_Pdf_Canvas_Abstract::drawPolygon()If $fillType is Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE or Zend_Pdf_Page::SHAPE_DRAW_FILL, then polygon is automatically closed. See detailed description of these methods in a PDF documentation (section 4.4.2 Path painting Operators, Filling)
Name | Type | Description |
---|---|---|
$x | array |
|
$y | array |
|
$fillType | integer | |
$fillMethod | integer |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

drawRectangle(
float $x1, float $y1, float $x2, float $y2, integer $fillType
=
Zend_Pdf_Page
)
:
\Zend_Pdf_Canvas_Interface
Draw a rectangle.
Inherited from: \Zend_Pdf_Canvas_Abstract::drawRectangle()Fill types: Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE - fill rectangle and stroke (default) Zend_Pdf_Page::SHAPE_DRAW_STROKE - stroke rectangle Zend_Pdf_Page::SHAPE_DRAW_FILL - fill rectangle
Name | Type | Description |
---|---|---|
$x1 | float | |
$y1 | float | |
$x2 | float | |
$y2 | float | |
$fillType | integer |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

drawRoundedRectangle(
float $x1, float $y1, float $x2, float $y2, integer|array $radius, integer $fillType
=
Zend_Pdf_Page
)
:
\Zend_Pdf_Canvas_Interface
Draw a rounded rectangle.
Inherited from: \Zend_Pdf_Canvas_Abstract::drawRoundedRectangle()Fill types: Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE - fill rectangle and stroke (default) Zend_Pdf_Page::SHAPE_DRAW_STROKE - stroke rectangle Zend_Pdf_Page::SHAPE_DRAW_FILL - fill rectangle
radius is an integer representing radius of the four corners, or an array of four integers representing the radius starting at top left, going clockwise
Name | Type | Description |
---|---|---|
$x1 | float | |
$y1 | float | |
$x2 | float | |
$y2 | float | |
$radius | integer|array | |
$fillType | integer |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

drawText(
string $text, float $x, float $y, string $charEncoding
)
:
\Zend_Pdf_Canvas_Interface
Draw a line of text at the specified position.
Inherited from: \Zend_Pdf_Canvas_Abstract::drawText()Name | Type | Description |
---|---|---|
$text | string | |
$x | float | |
$y | float | |
$charEncoding | string | (optional) Character encoding of source text. Defaults to current locale. |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |
Exception | Description |
---|---|
\Zend_Pdf_Exception |

extractFont(
$fontName
)
:
\Zend_Pdf_Resource_Font_Extracted|null
Extract font attached to the page by specific font name
$fontName should be specified in UTF-8 encoding
Name | Type | Description |
---|---|---|
$fontName |
Type | Description |
---|---|
\Zend_Pdf_Resource_Font_Extractednull |
Exception | Description |
---|---|
\Zend_Pdf_Exception |

extractFonts(
)
:
array
Extract fonts attached to the page
returns array of Zend_Pdf_Resource_Font_Extracted objects
Type | Description |
---|---|
array |
Exception | Description |
---|---|
\Zend_Pdf_Exception |

flush(
)
:
void
Dump current drawing instructions into the content stream.
Exception | Description |
---|---|
\Zend_Pdf_Exception |

getFont(
)
:
\Zend_Pdf_Resource_Font
Get current font.
Inherited from: \Zend_Pdf_Canvas_Abstract::getFont()Type | Description |
---|---|
\Zend_Pdf_Resource_Font | $font |

getFontSize(
)
:
float
Get current font size
Inherited from: \Zend_Pdf_Canvas_Abstract::getFontSize()Type | Description |
---|---|
float | $fontSize |

getStyle(
)
:
\Zend_Pdf_Style
Return the style, applied to the page.
Inherited from: \Zend_Pdf_Canvas_Abstract::getStyle()Type | Description |
---|---|
\Zend_Pdf_Style |

rawWrite(
string $data, string $procSet
=
null
)
:
\Zend_Pdf_Canvas_Interface
Writes the raw data to the page's content stream.
Inherited from: \Zend_Pdf_Canvas_Abstract::rawWrite()Be sure to consult the PDF reference to ensure your syntax is correct. No attempt is made to ensure the validity of the stream data.
Name | Type | Description |
---|---|---|
$data | string | |
$procSet | string | (optional) Name of ProcSet to add. |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

render(
\Zend_Pdf_ElementFactory_Interface $objFactory
)
:
void
Prepare page to be rendered into PDF.
Name | Type | Description |
---|---|---|
$objFactory | \Zend_Pdf_ElementFactory_Interface |
Exception | Description |
---|---|
\Zend_Pdf_Exception |

restoreGS(
)
:
\Zend_Pdf_Canvas_Interface
Restore the graphics state that was saved with the last call to saveGS().
Inherited from: \Zend_Pdf_Canvas_Abstract::restoreGS()Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |
Exception | Description |
---|---|
\Zend_Pdf_Exception | - if there is no previously saved state |

rotate(
float $x, float $y, float $angle
)
:
\Zend_Pdf_Canvas_Interface
Rotate the page.
Inherited from: \Zend_Pdf_Canvas_Abstract::rotate()Name | Type | Description |
---|---|---|
$x | float |
|
$y | float |
|
$angle | float |
|
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

saveGS(
)
:
\Zend_Pdf_Canvas_Interface
Save the graphics state of this page.
Inherited from: \Zend_Pdf_Canvas_Abstract::saveGS()This takes a snapshot of the currently applied style, position, clipping area and any rotation/translation/scaling that has been applied.
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |
Exception | Description |
---|---|
\Zend_Pdf_Exception | - if a save is performed with an open path |

scale(
float $xScale, float $yScale
)
:
\Zend_Pdf_Canvas_Interface
Scale coordination system.
Inherited from: \Zend_Pdf_Canvas_Abstract::scale()Name | Type | Description |
---|---|---|
$xScale | float |
|
$yScale | float |
|
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

setAlpha(
float $alpha, string $mode
=
Normal
)
:
\Zend_Pdf_Canvas_Interface
Set the transparancy
Inherited from: \Zend_Pdf_Canvas_Abstract::setAlpha()$alpha == 0 - transparent $alpha == 1 - opaque
Transparency modes, supported by PDF: Normal (default), Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion
Name | Type | Description |
---|---|---|
$alpha | float | |
$mode | string |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |
Exception | Description |
---|---|
\Zend_Pdf_Exception |

setFillColor(
\Zend_Pdf_Color $color
)
:
\Zend_Pdf_Canvas_Interface
Set fill color.
Inherited from: \Zend_Pdf_Canvas_Abstract::setFillColor()Name | Type | Description |
---|---|---|
$color | \Zend_Pdf_Color |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

setFont(
\Zend_Pdf_Resource_Font $font, float $fontSize
)
:
\Zend_Pdf_Canvas_Interface
Set current font.
Inherited from: \Zend_Pdf_Canvas_Abstract::setFont()Name | Type | Description |
---|---|---|
$font | \Zend_Pdf_Resource_Font | |
$fontSize | float |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

setLineColor(
\Zend_Pdf_Color $color
)
:
\Zend_Pdf_Canvas_Interface
Set line color.
Inherited from: \Zend_Pdf_Canvas_Abstract::setLineColor()Name | Type | Description |
---|---|---|
$color | \Zend_Pdf_Color |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

setLineDashingPattern(
mixed $pattern, array $phase
=
0
)
:
\Zend_Pdf_Canvas_Interface
Set line dashing pattern
Inherited from: \Zend_Pdf_Canvas_Abstract::setLineDashingPattern()Pattern is an array of floats: array(on_length, off_length, on_length, off_length, ...) or Zend_Pdf_Page::LINE_DASHING_SOLID constant Phase is shift from the beginning of line.
Name | Type | Description |
---|---|---|
$pattern | mixed | |
$phase | array |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

setLineWidth(
float $width
)
:
\Zend_Pdf_Canvas_Interface
Set line width.
Inherited from: \Zend_Pdf_Canvas_Abstract::setLineWidth()
setStyle(
\Zend_Pdf_Style $style
)
:
\Zend_Pdf_Canvas_Interface
Set the style to use for future drawing operations on this page
Inherited from: \Zend_Pdf_Canvas_Abstract::setStyle()Name | Type | Description |
---|---|---|
$style | \Zend_Pdf_Style |
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

skew(
float $x, float $y, float $xAngle, float $yAngle
)
:
\Zend_Pdf_Canvas_Interface
Translate coordination system.
Inherited from: \Zend_Pdf_Canvas_Abstract::skew()Name | Type | Description |
---|---|---|
$x | float |
|
$y | float |
|
$xAngle | float |
|
$yAngle | float |
|
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |

translate(
float $xShift, float $yShift
)
:
\Zend_Pdf_Canvas_Interface
Translate coordination system.
Inherited from: \Zend_Pdf_Canvas_Abstract::translate()Name | Type | Description |
---|---|---|
$xShift | float |
|
$yShift | float |
|
Type | Description |
---|---|
\Zend_Pdf_Canvas_Interface |