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_A4 = '595:842:'
Size representing an A4 page in portrait (tall) orientation.
SIZE_A4_LANDSCAPE = '842:595:'
Size representing an A4 page in landscape (wide) orientation.
SIZE_LETTER = '612:792:'
Size representing a US Letter page in portrait (tall) orientation.
SIZE_LETTER_LANDSCAPE = '792:612:'
Size representing a US Letter page in landscape (wide) orientation.
SHAPE_DRAW_STROKE = '0'
Stroke the path only. Do not fill.
SHAPE_DRAW_FILL = '1'
Fill the path only. Do not stroke.
SHAPE_DRAW_FILL_AND_STROKE = '2'
Fill and stroke the path.
FILL_METHOD_NON_ZERO_WINDING = '0'
Fill the path using the non-zero winding rule.
FILL_METHOD_EVEN_ODD = '1'
Fill the path using the even-odd rule.
LINE_DASHING_SOLID = '0'
Solid line dash.
boolean $_attached = ''
Flag which signals, that page is created separately from any PDF document or attached to anyone.
string $_contents = ''
Stream of the drawing instructions.
Zend_Pdf_Resource_Font $_font = 'null'
Current font
float $_fontSize = ''
Current font size
Zend_Pdf_ElementFactory_Interface $_objFactory = 'null'
PDF objects factory.
Zend_Pdf_Element_Reference|Zend_Pdf_Element_Object $_pageDictionary = ''
Page dictionary (refers to an inderect Zend_Pdf_Element_Dictionary object).
boolean $_safeGS = ''
Safe Graphics State semafore
If it's false, than we can't be sure Graphics State is restored withing context of previous contents stream (ex. drawing coordinate system may be rotated). We should encompass existing content with save/restore GS operators
integer $_saveCount = '0'
Counter for the "Save" operations
Zend_Pdf_Style $_style = 'null'
Current style
__clone(
)
:
Clone operator
__construct(
mixed $param1, mixed $param2
=
null, mixed $param3
=
null
)
:
Object constructor.
Constructor signatures:
new Zend_Pdf_Page(Zend_Pdf_Element_Dictionary $pageDict,
_addProcSet(
string $procSetName
)
:
Add procedureSet to the Page description
_attachResource(
string $type, Zend_Pdf_Resource $resource
)
:
string
Attach resource to the page
attachAnnotation(
Zend_Pdf_Annotation $annotation
)
:
Zend_Pdf_Page
clipCircle(
float $x, float $y, float $radius, float $startAngle
=
null, float $endAngle
=
null
)
:
Zend_Pdf_Page
Intersect current clipping area with a circle.
clipEllipse(
float $x1, float $y1, float $x2, float $y2, float $startAngle
=
null, float $endAngle
=
null
)
:
Zend_Pdf_Page
Intersect current clipping area with a polygon.
Method signatures: drawEllipse($x1, $y1, $x2, $y2); drawEllipse($x1, $y1, $x2, $y2, $startAngle, $endAngle);
clipPolygon(
array $x, array $y, integer $fillMethod
=
Zend_Pdf_Page
)
:
Zend_Pdf_Page
Intersect current clipping area with a polygon.
clipRectangle(
float $x1, float $y1, float $x2, float $y2
)
:
Zend_Pdf_Page
Intersect current clipping area with a rectangle.
drawCircle(
float $x, float $y, float $radius, mixed $param4
=
null, mixed $param5
=
null, mixed $param6
=
null
)
:
Zend_Pdf_Page
Draw a circle centered on x, y with a radius of radius.
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.
drawContentStream(
ZPdfContentStream $cs, float $x1, float $y1, float $x2, float $y2
)
:
Zend_Pdf_Page
Draw a Zend_Pdf_ContentStream at the specified position on the page
drawEllipse(
float $x1, float $y1, float $x2, float $y2, mixed $param5
=
null, mixed $param6
=
null, mixed $param7
=
null
)
:
Zend_Pdf_Page
Draw an ellipse inside the specified rectangle.
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);
drawImage(
Zend_Pdf_Image $image, float $x1, float $y1, float $x2, float $y2
)
:
Zend_Pdf_Page
Draw an image at the specified position on the page.
drawLayoutBox(
Zend_Pdf_Element_LayoutBox $box, float $x, float $y
)
:
Zend_Pdf_Page
Draw a LayoutBox at the specified position on the page.
drawLine(
float $x1, float $y1, float $x2, float $y2
)
:
Zend_Pdf_Page
Draw a line from x1,y1 to x2,y2.
drawPolygon(
array $x, array $y, integer $fillType
=
Zend_Pdf_Page, integer $fillMethod
=
Zend_Pdf_Page
)
:
Zend_Pdf_Page
Draw a polygon.
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)
drawRectangle(
float $x1, float $y1, float $x2, float $y2, integer $fillType
=
Zend_Pdf_Page
)
:
Zend_Pdf_Page
Draw a rectangle.
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
drawRoundedRectangle(
float $x1, float $y1, float $x2, float $y2, integer|array $radius, integer $fillType
=
Zend_Pdf_Page
)
:
Zend_Pdf_Page
Draw a rounded rectangle.
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
drawText(
string $text, float $x, float $y, string $charEncoding
)
:
Zend_Pdf_Page
Draw a line of text at the specified position.
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
extractFonts(
)
:
array
Extract fonts attached to the page
returns array of Zend_Pdf_Resource_Font_Extracted objects
extractResources(
)
:
array
Extract resources attached to the page
This method is not intended to be used in userland, but helps to optimize some document wide operations
returns array of Zend_Pdf_Element_Dictionary objects
flush(
)
:
Dump current drawing instructions into the content stream.
getFont(
)
:
Zend_Pdf_Resource_Font
Get current font.
getFontSize(
)
:
float
Get current font size
getHeight(
)
:
float
Return the height of this page in points.
getPageDictionary(
)
:
Zend_Pdf_Element_Dictionary
Retrive PDF file reference to the page
getStyle(
)
:
Zend_Pdf_Style|null
Return the style, applied to the page.
getWidth(
)
:
float
Return the width of this page in points.
pathClose(
)
:
Zend_Pdf_Page
Close the path by drawing a straight line back to it's beginning.
pathLine(
float $x, float $y
)
:
Zend_Pdf_Page
Continue the open path in a straight line to the specified position.
pathMove(
float $x, float $y
)
:
Zend_Pdf_Page
Start a new path at the specified position. If a path has already been started, move the cursor without drawing a line.
rawWrite(
string $data, string $procSet
=
null
)
:
Zend_Pdf_Page
Writes the raw data to the page's content stream.
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.
render(
Zend_Pdf_ElementFactory_Interface $objFactory
)
:
Prepare page to be rendered into PDF.
restoreGS(
)
:
Zend_Pdf_Page
Restore the graphics state that was saved with the last call to saveGS().
rotate(
float $x, float $y, float $angle
)
:
Zend_Pdf_Page
Rotate the page.
saveGS(
)
:
Zend_Pdf_Page
Save the graphics state of this page.
This takes a snapshot of the currently applied style, position, clipping area and any rotation/translation/scaling that has been applied.
scale(
float $xScale, float $yScale
)
:
Zend_Pdf_Page
Scale coordination system.
setAlpha(
float $alpha, string $mode
=
Normal
)
:
Zend_Pdf_Page
Set the transparancy
$alpha == 0 - transparent $alpha == 1 - opaque
Transparency modes, supported by PDF: Normal (default), Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion
setFillColor(
Zend_Pdf_Color $color
)
:
Zend_Pdf_Page
Set fill color.
setFont(
Zend_Pdf_Resource_Font $font, float $fontSize
)
:
Zend_Pdf_Page
Set current font.
setLineColor(
Zend_Pdf_Color $color
)
:
Zend_Pdf_Page
Set line color.
setLineDashingPattern(
array $pattern, array $phase
=
0
)
:
Zend_Pdf_Page
Set line dashing pattern
Pattern is an array of floats: array(on_length, off_length, on_length, off_length, ...) Phase is shift from the beginning of line.
setLineWidth(
float $width
)
:
Zend_Pdf_Page
Set line width.
setStyle(
Zend_Pdf_Style $style
)
:
Zend_Pdf_Page
Set the style to use for future drawing operations on this page
skew(
float $x, float $y, float $xAngle, float $yAngle
)
:
Zend_Pdf_Page
Translate coordination system.
translate(
float $xShift, float $yShift
)
:
Zend_Pdf_Page
Translate coordination system.