Class Zend_Pdf_Page

Description

PDF Page

Located in /Zend/Pdf/Page.php (line 64)


	
			
Variable Summary
Method Summary
 Zend_Pdf_Page __construct (mixed $param1, [mixed $param2 = null], [mixed $param3 = null])
 void clipCircle (float $x, float $y, float $radius, [float $startAngle = null], [float $endAngle = null])
 void clipEllipse (float $x1, float $y1, float $x2, float $y2, [float $startAngle = null], [float $endAngle = null])
 void clipPolygon (array $x, array $y, [integer $fillMethod = Zend_Pdf_Const::FILLMETHOD_NONZEROWINDING])
 void clipRectangle (float $x1, float $y1, float $x2, float $y2)
 void drawCircle (float $x, float $y, float $radius, [mixed $param4 = null], [mixed $param5 = null], [mixed $param6 = null])
 void drawContentStream (ZPdfContentStream $cs, float $x1, float $y1, float $x2, float $y2)
 void drawEllipse (float $x1, float $y1, float $x2, float $y2, [mixed $param5 = null], [mixed $param6 = null], [mixed $param7 = null])
 void drawImage (Zend_Pdf_Image $image, float $x1, float $y1, float $x2, float $y2)
 void drawLayoutBox (Zend_Pdf_Element_LayoutBox $box, float $x, float $y)
 void drawLine (float $x1, float $y1, float $x2, float $y2)
 void drawPolygon (array $x, array $y, [integer $fillType = Zend_Pdf_Const::SHAPEDRAW_FILLNSTROKE], [integer $fillMethod = Zend_Pdf_Const::FILLMETHOD_NONZEROWINDING])
 void drawRectangle (float $x1, float $y1, float $x2, float $y2, [integer $fillType = Zend_Pdf_Const::SHAPEDRAW_FILLNSTROKE])
 void drawText (string $text, float $x, float $y)
 void flush ()
 float getFontSize ()
 float getHeight ()
 float getWidth ()
 void pathClose ()
 void pathLine (float $x, float $y)
 void pathMove (float $x, float $y)
 void rawWrite (string $data)
 void render (Zend_Pdf_ElementFactory $objFactory)
 void restoreGS ()
 void rotate (mixed $x, mixed $y, float $angle)
 void saveGS ()
 void setFillColor (Zend_Pdf_Color $color)
 void setFont (Zend_Pdf_Font $font, float $fontSize)
 void setLineColor (Zend_Pdf_Color $color)
 void setLineDashingPattern (array $pattern, array $phase)
 void setLineWidth (float $width)
 void setStyle (Zend_Pdf_Style $style)
 void _addProcSet (string $procSetName)
 string _attachResource (string $type, Zend_Pdf_Reference|Zend_Pdf_Object $resObject)
Variables
boolean $_attached (line 87)

Flag which signals, that page is created separately from any PDF document or attached to anyone.

  • access: private
string $_contents = '' (line 94)

Stream of the drawing instractions.

  • access: private
Zend_Pdf_Font $_font = null (line 115)

Current font

  • access: private
float $_fontSize (line 122)

Current font size

  • access: private
Zend_Pdf_ElementFactory $_objFactory = null (line 79)

PDF objects factory.

  • access: private
Zend_Pdf_Element_Reference $_pageDictionary (line 72)

Reference to the object with page dictionary.

  • access: private
integer $_saveCount = 0 (line 108)

Counter for the "Save" operations

  • access: private
Zend_Pdf_Style $_style = null (line 101)

Current style

  • access: private
Methods
Constructor __construct (line 163)

Object constructor.

Constructor signatures:

  1. Load PDF page from a parsed PDF file. Object factory is created by PDF parser.
--------------------------------------------------------- new Zend_Pdf_Page(Zend_Pdf_Element_Dictionary $pageDict, Zend_Pdf_ElementFactory $factory); ---------------------------------------------------------

2. Clone PDF page. New page is created in the same context as source page. Object factory is shared. Thus it will be attached to the document, but need to be placed into Zend_Pdf::$pages array to be included into output. --------------------------------------------------------- new Zend_Pdf_Page(Zend_Pdf_Page $page); ---------------------------------------------------------

3. Create new page with a specified pagesize. If $factory is null then it will be created and page must be attached to the document to be included into output. --------------------------------------------------------- new Zend_Pdf_Page(string $pagesize, Zend_Pdf_ElementFactory $factory = null); ---------------------------------------------------------

4. Create new page with a specified pagesize (in default user space units). If $factory is null then it will be created and page must be attached to the document to be included into output. --------------------------------------------------------- new Zend_Pdf_Page(numeric $width, numeric $height, Zend_Pdf_ElementFactory $factory = null); ---------------------------------------------------------

  • access: public
  • throws: Zend_Pdf_Exception
Zend_Pdf_Page __construct (mixed $param1, [mixed $param2 = null], [mixed $param3 = null])
  • mixed $param1
  • mixed $param2
  • mixed $param3
clipCircle (line 545)

Intersect current clipping area with a circle.

  • access: public
void clipCircle (float $x, float $y, float $radius, [float $startAngle = null], [float $endAngle = null])
  • float $x
  • float $y
  • float $radius
  • float $startAngle
  • float $endAngle
clipEllipse (line 568)

Intersect current clipping area with a polygon.

Method signatures: drawEllipse($x1, $y1, $x2, $y2); drawEllipse($x1, $y1, $x2, $y2, $startAngle, $endAngle);

  • access: public
  • todo: process special cases with $x2-$x1 == 0 or $y2-$y1 == 0
void clipEllipse (float $x1, float $y1, float $x2, float $y2, [float $startAngle = null], [float $endAngle = null])
  • float $x1
  • float $y1
  • float $x2
  • float $y2
  • float $startAngle
  • float $endAngle
clipPolygon (line 648)

Intersect current clipping area with a polygon.

  • access: public
void clipPolygon (array $x, array $y, [integer $fillMethod = Zend_Pdf_Const::FILLMETHOD_NONZEROWINDING])
  • array $x:
    • array of float (the X co-ordinates of the vertices)
  • array $y:
    • array of float (the Y co-ordinates of the vertices)
  • integer $fillMethod
clipRectangle (line 683)

Intersect current clipping area with a rectangle.

  • access: public
void clipRectangle (float $x1, float $y1, float $x2, float $y2)
  • float $x1
  • float $y1
  • float $x2
  • float $y2
drawCircle (line 733)

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, 3*PI/8, 5*PI/8, 7*PI/8, 9*PI/8, 11*PI/8, 13*PI/8 and 15*PI/8 angles). At 0, PI/4, PI/2, 3*PI/4, PI, 5*PI/4, 3*PI/2 and 7*PI/4 it's exactly a tangent to a circle.

  • access: public
void drawCircle (float $x, float $y, float $radius, [mixed $param4 = null], [mixed $param5 = null], [mixed $param6 = null])
  • float $x
  • float $y
  • float $radius
  • mixed $param4
  • mixed $param5
  • mixed $param6
drawContentStream (line 706)

Draw a Zend_Pdf_ContentStream at the specified position on the page

  • access: public
void drawContentStream (ZPdfContentStream $cs, float $x1, float $y1, float $x2, float $y2)
  • ZPdfContentStream $cs
  • float $x1
  • float $y1
  • float $x2
  • float $y2
drawEllipse (line 759)

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);

  • access: public
  • todo: process special cases with $x2-$x1 == 0 or $y2-$y1 == 0
void drawEllipse (float $x1, float $y1, float $x2, float $y2, [mixed $param5 = null], [mixed $param6 = null], [mixed $param7 = null])
  • float $x1
  • float $y1
  • float $x2
  • float $y2
  • mixed $param5
  • mixed $param6
  • mixed $param7
drawImage (line 876)

Draw an image at the specified position on the page.

  • access: public
void drawImage (Zend_Pdf_Image $image, float $x1, float $y1, float $x2, float $y2)
drawLayoutBox (line 902)

Draw a LayoutBox at the specified position on the page.

  • access: public
void drawLayoutBox (Zend_Pdf_Element_LayoutBox $box, float $x, float $y)
  • Zend_Pdf_Element_LayoutBox $box
  • float $x
  • float $y
drawLine (line 914)

Draw a line from x1,y1 to x2,y2.

  • access: public
void drawLine (float $x1, float $y1, float $x2, float $y2)
  • float $x1
  • float $y1
  • float $x2
  • float $y2
drawPolygon (line 940)

Draw a polygon.

If $fillType is Zend_Pdf_Const::SHAPEDRAW_FILLNSTROKE or Zend_Pdf_Const::SHAPEDRAW_FILL, then polygon is automatically closed. See detailed description of these methods in a PDF documentation (section 4.4.2 Path painting Operators, Filling)

  • access: public
void drawPolygon (array $x, array $y, [integer $fillType = Zend_Pdf_Const::SHAPEDRAW_FILLNSTROKE], [integer $fillMethod = Zend_Pdf_Const::FILLMETHOD_NONZEROWINDING])
  • array $x:
    • array of float (the X co-ordinates of the vertices)
  • array $y:
    • array of float (the Y co-ordinates of the vertices)
  • integer $fillType
  • integer $fillMethod
drawRectangle (line 998)

Draw a rectangle.

Fill types: Zend_Pdf_Const::SHAPEDRAW_FILLNSTROKE - fill rectangle and stroke (default) Zend_Pdf_Const::SHAPEDRAW_STROKE - stroke rectangle Zend_Pdf_Const::SHAPEDRAW_FILL - fill rectangle

  • access: public
void drawRectangle (float $x1, float $y1, float $x2, float $y2, [integer $fillType = Zend_Pdf_Const::SHAPEDRAW_FILLNSTROKE])
  • float $x1
  • float $y1
  • float $x2
  • float $y2
  • integer $fillType
drawText (line 1031)

Draw a line of text at the specified position.

  • access: public
  • throws: Zend_Pdf_Exception
void drawText (string $text, float $x, float $y)
  • string $text
  • float $x
  • float $y
flush (line 309)

Dump current drawing instructions into the content stream.

  • access: public
  • throws: Zend_Pdf_Exception
  • todo: Don't forget to close all current graphics operations (like path drawing)
void flush ()
getFont (line 480)

Get current font.

  • access: public
Zend_Pdf_Font getFont ()
getFontSize (line 490)

Get current font size

  • access: public
float getFontSize ()
getHeight (line 1054)

Return the height of this page in points.

  • access: public
float getHeight ()
getPageDictionary (line 297)

Retrive PDF file reference to the page

  • access: public
Zend_Pdf_Element_Dictionary getPageDictionary ()
getStyle (line 500)

Return the style, applied to the page.

  • access: public
Zend_Pdf_Style|null getStyle ()
getWidth (line 1065)

Return the width of this page in points.

  • access: public
float getWidth ()
pathClose (line 1076)

Close the path by drawing a straight line back to it's beginning.

  • access: public
  • throws: Zend_Pdf_Exception - if a path hasn't been started with pathMove()
void pathClose ()
pathLine (line 1086)

Continue the open path in a straight line to the specified position.

  • access: public
void pathLine (float $x, float $y)
  • float $x:
    • the X co-ordinate to move to
  • float $y:
    • the Y co-ordinate to move to
pathMove (line 1097)

Start a new path at the specified position. If a path has already been started, move the cursor without drawing a line.

  • access: public
void pathMove (float $x, float $y)
  • float $x:
    • the X co-ordinate to move to
  • float $y:
    • the Y co-ordinate to move to
rawWrite (line 1106)

Write raw PDF commands to the page.

  • access: public
void rawWrite (string $data)
  • string $data
render (line 347)

Prepare page to be rendered into PDF.

  • access: public
  • throws: Zend_Pdf_Exception
  • todo: Don't forget to close all current graphics operations (like path drawing)
void render (Zend_Pdf_ElementFactory $objFactory)
restoreGS (line 527)

Restore the graphics state that was saved with the last call to saveGS().

  • access: public
  • throws: Zend_Pdf_Exception - if there is no previously saved state
void restoreGS ()
rotate (line 1115)

Rotate the page.

  • access: public
void rotate (mixed $x, mixed $y, float $angle)
  • float $angle
saveGS (line 514)

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.

  • access: public
  • throws: Zend_Pdf_Exception - if a save is performed with an open path
  • todo: check for the open paths
void saveGS ()
setFillColor (line 379)

Set fill color.

  • access: public
void setFillColor (Zend_Pdf_Color $color)
setFont (line 444)

Set current font.

  • access: public
void setFont (Zend_Pdf_Font $font, float $fontSize)
setLineColor (line 390)

Set line color.

  • access: public
void setLineColor (Zend_Pdf_Color $color)
setLineDashingPattern (line 417)

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.

  • access: public
void setLineDashingPattern (array $pattern, array $phase)
  • array $pattern
  • array $phase
setLineWidth (line 401)

Set line width.

  • access: public
void setLineWidth (float $width)
  • float $width
setStyle (line 462)

Set the style to use for future drawing operations on this page

  • access: public
void setStyle (Zend_Pdf_Style $style)
_addProcSet (line 265)

Add procedureSet to the Page description

  • access: private
void _addProcSet (string $procSetName)
  • string $procSetName
_attachResource (line 232)

Attach resource to the page

  • access: private
string _attachResource (string $type, Zend_Pdf_Reference|Zend_Pdf_Object $resObject)
  • string $type
  • Zend_Pdf_Reference|Zend_Pdf_Object $resObject

Documentation generated on Tue, 18 Apr 2006 11:55:25 -0700 by phpDocumentor 1.3.0RC3