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.
Details SIZE_A4_LANDSCAPE = '842:595:'
Size representing an A4 page in landscape (wide) orientation.
Details SIZE_LETTER = '612:792:'
Size representing a US Letter page in portrait (tall) orientation.
Details SIZE_LETTER_LANDSCAPE = '792:612:'
Size representing a US Letter page in landscape (wide) orientation.
Details SHAPE_DRAW_STROKE = '0'
Stroke the path only. Do not fill.
Details SHAPE_DRAW_FILL = '1'
Fill the path only. Do not stroke.
Details SHAPE_DRAW_FILL_AND_STROKE = '2'
Fill and stroke the path.
Details FILL_METHOD_NON_ZERO_WINDING = '0'
Fill the path using the non-zero winding rule.
Details FILL_METHOD_EVEN_ODD = '1'
Fill the path using the even-odd rule.
Details LINE_DASHING_SOLID = '0'
Solid line dash.
Detailsboolean $_attached = ''Flag which signals, that page is created separately from any PDF document or attached to anyone.
Detailsstring $_contents = ''Stream of the drawing instructions.
DetailsZend_Pdf_Resource_Font $_font = 'null'Current font
Detailsfloat $_fontSize = ''Current font size
DetailsZend_Pdf_ElementFactory_Interface $_objFactory = 'null'PDF objects factory.
DetailsZend_Pdf_Element_Reference|Zend_Pdf_Element_Object $_pageDictionary = ''Page dictionary (refers to an inderect Zend_Pdf_Element_Dictionary object).
Detailsboolean $_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
Detailsinteger $_saveCount = '0'Counter for the "Save" operations
DetailsZend_Pdf_Style $_style = 'null'Current style
Details__clone(
)
:
Clone operator
Details__construct(
mixed $param1, mixed $param2
=
null, mixed $param3
=
null
)
:
Object constructor.
Constructor signatures:
new Zend_Pdf_Page(Zend_Pdf_Element_Dictionary $pageDict,
Details_addProcSet(
string $procSetName
)
:
Add procedureSet to the Page description
Details_attachResource(
string $type, Zend_Pdf_Resource $resource
)
:
stringAttach resource to the page
DetailsattachAnnotation(
Zend_Pdf_Annotation $annotation
)
:
Zend_Pdf_Page
DetailsclipCircle(
float $x, float $y, float $radius, float $startAngle
=
null, float $endAngle
=
null
)
:
Zend_Pdf_PageIntersect current clipping area with a circle.
DetailsclipEllipse(
float $x1, float $y1, float $x2, float $y2, float $startAngle
=
null, float $endAngle
=
null
)
:
Zend_Pdf_PageIntersect current clipping area with a polygon.
Method signatures: drawEllipse($x1, $y1, $x2, $y2); drawEllipse($x1, $y1, $x2, $y2, $startAngle, $endAngle);
DetailsclipPolygon(
array $x, array $y, integer $fillMethod
=
Zend_Pdf_Page
)
:
Zend_Pdf_PageIntersect current clipping area with a polygon.
DetailsclipRectangle(
float $x1, float $y1, float $x2, float $y2
)
:
Zend_Pdf_PageIntersect current clipping area with a rectangle.
DetailsdrawCircle(
float $x, float $y, float $radius, mixed $param4
=
null, mixed $param5
=
null, mixed $param6
=
null
)
:
Zend_Pdf_PageDraw 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.
DetailsdrawContentStream(
ZPdfContentStream $cs, float $x1, float $y1, float $x2, float $y2
)
:
Zend_Pdf_PageDraw a Zend_Pdf_ContentStream at the specified position on the page
DetailsdrawEllipse(
float $x1, float $y1, float $x2, float $y2, mixed $param5
=
null, mixed $param6
=
null, mixed $param7
=
null
)
:
Zend_Pdf_PageDraw 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);
DetailsdrawImage(
Zend_Pdf_Image $image, float $x1, float $y1, float $x2, float $y2
)
:
Zend_Pdf_PageDraw an image at the specified position on the page.
DetailsdrawLayoutBox(
Zend_Pdf_Element_LayoutBox $box, float $x, float $y
)
:
Zend_Pdf_PageDraw a LayoutBox at the specified position on the page.
DetailsdrawLine(
float $x1, float $y1, float $x2, float $y2
)
:
Zend_Pdf_PageDraw a line from x1,y1 to x2,y2.
DetailsdrawPolygon(
array $x, array $y, integer $fillType
=
Zend_Pdf_Page, integer $fillMethod
=
Zend_Pdf_Page
)
:
Zend_Pdf_PageDraw 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)
DetailsdrawRectangle(
float $x1, float $y1, float $x2, float $y2, integer $fillType
=
Zend_Pdf_Page
)
:
Zend_Pdf_PageDraw 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
DetailsdrawRoundedRectangle(
float $x1, float $y1, float $x2, float $y2, integer|array $radius, integer $fillType
=
Zend_Pdf_Page
)
:
Zend_Pdf_PageDraw 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
DetailsdrawText(
string $text, float $x, float $y, string $charEncoding
)
:
Zend_Pdf_PageDraw a line of text at the specified position.
DetailsextractFont(
$fontName
)
:
Zend_Pdf_Resource_Font_Extracted|nullExtract font attached to the page by specific font name
$fontName should be specified in UTF-8 encoding
DetailsextractFonts(
)
:
arrayExtract fonts attached to the page
returns array of Zend_Pdf_Resource_Font_Extracted objects
DetailsextractResources(
)
:
arrayExtract 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
Detailsflush(
)
:
Dump current drawing instructions into the content stream.
DetailsgetFont(
)
:
Zend_Pdf_Resource_FontGet current font.
DetailsgetFontSize(
)
:
floatGet current font size
DetailsgetHeight(
)
:
floatReturn the height of this page in points.
DetailsgetPageDictionary(
)
:
Zend_Pdf_Element_DictionaryRetrive PDF file reference to the page
DetailsgetStyle(
)
:
Zend_Pdf_Style|nullReturn the style, applied to the page.
DetailsgetWidth(
)
:
floatReturn the width of this page in points.
DetailspathClose(
)
:
Zend_Pdf_PageClose the path by drawing a straight line back to it's beginning.
DetailspathLine(
float $x, float $y
)
:
Zend_Pdf_PageContinue the open path in a straight line to the specified position.
DetailspathMove(
float $x, float $y
)
:
Zend_Pdf_PageStart a new path at the specified position. If a path has already been started, move the cursor without drawing a line.
DetailsrawWrite(
string $data, string $procSet
=
null
)
:
Zend_Pdf_PageWrites 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.
Detailsrender(
Zend_Pdf_ElementFactory_Interface $objFactory
)
:
Prepare page to be rendered into PDF.
DetailsrestoreGS(
)
:
Zend_Pdf_PageRestore the graphics state that was saved with the last call to saveGS().
Detailsrotate(
float $x, float $y, float $angle
)
:
Zend_Pdf_PageRotate the page.
DetailssaveGS(
)
:
Zend_Pdf_PageSave 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.
Detailsscale(
float $xScale, float $yScale
)
:
Zend_Pdf_PageScale coordination system.
DetailssetAlpha(
float $alpha, string $mode
=
Normal
)
:
Zend_Pdf_PageSet 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
DetailssetFillColor(
Zend_Pdf_Color $color
)
:
Zend_Pdf_PageSet fill color.
DetailssetFont(
Zend_Pdf_Resource_Font $font, float $fontSize
)
:
Zend_Pdf_PageSet current font.
DetailssetLineColor(
Zend_Pdf_Color $color
)
:
Zend_Pdf_PageSet line color.
DetailssetLineDashingPattern(
array $pattern, array $phase
=
0
)
:
Zend_Pdf_PageSet 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.
DetailssetLineWidth(
float $width
)
:
Zend_Pdf_PageSet line width.
DetailssetStyle(
Zend_Pdf_Style $style
)
:
Zend_Pdf_PageSet the style to use for future drawing operations on this page
Detailsskew(
float $x, float $y, float $xAngle, float $yAngle
)
:
Zend_Pdf_PageTranslate coordination system.
Detailstranslate(
float $xShift, float $yShift
)
:
Zend_Pdf_PageTranslate coordination system.
Details