Pdf/Canvas/Interface.php

Show: PublicProtectedPrivateinherited
    Table of Contents
    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.
    Category
    Zend  
    Copyright
    Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
    License
    New BSD License  
    Package
    Zend_Pdf  
    Version
    $Id: Style.php 20096 2010-01-06 02:05:09Z bkarwin $  

    \Zend_Pdf_Canvas_Interface

    Package: Zend_Pdf
    Canvas is an abstract rectangle drawing area which can be dropped into page object at specified place.
    Copyright
    Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
    License
    New BSD License  

    Methods

    methodpublicclipCircle(float $x, float $y, float $radius, float $startAngle = null, float $endAngle = null) : \Zend_Pdf_Canvas_Interface

    Intersect current clipping area with a circle.

    Parameters
    NameTypeDescription
    $xfloat
    $yfloat
    $radiusfloat
    $startAnglefloat
    $endAnglefloat
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicclipEllipse(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.

    Method signatures: drawEllipse($x1, $y1, $x2, $y2); drawEllipse($x1, $y1, $x2, $y2, $startAngle, $endAngle);
    Parameters
    NameTypeDescription
    $x1float
    $y1float
    $x2float
    $y2float
    $startAnglefloat
    $endAnglefloat
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    Details
    Todo
    process special cases with $x2-$x1 == 0 or $y2-$y1 == 0  
    methodpublicclipPolygon(array $x, array $y, integer $fillMethod = \Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING) : \Zend_Pdf_Canvas_Interface

    Intersect current clipping area with a polygon.

    Parameters
    NameTypeDescription
    $xarray
    • array of float (the X co-ordinates of the vertices)
    $yarray
    • array of float (the Y co-ordinates of the vertices)
    $fillMethodinteger
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicclipRectangle(float $x1, float $y1, float $x2, float $y2) : \Zend_Pdf_Canvas_Interface

    Intersect current clipping area with a rectangle.

    Parameters
    NameTypeDescription
    $x1float
    $y1float
    $x2float
    $y2float
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicdrawCanvas(\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

    If upper right corner is not specified then canvas heght and width are used.
    Parameters
    NameTypeDescription
    $canvas\Zend_Pdf_Canvas_Interface
    $x1float
    $y1float
    $x2float
    $y2float
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicdrawCircle(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.

    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.
    Parameters
    NameTypeDescription
    $xfloat
    $yfloat
    $radiusfloat
    $param4mixed
    $param5mixed
    $param6mixed
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicdrawEllipse(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.

    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);
    Parameters
    NameTypeDescription
    $x1float
    $y1float
    $x2float
    $y2float
    $param5mixed
    $param6mixed
    $param7mixed
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    Details
    Todo
    process special cases with $x2-$x1 == 0 or $y2-$y1 == 0  
    methodpublicdrawImage(\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.

    Parameters
    NameTypeDescription
    $image\Zend_Pdf_Image
    $x1float
    $y1float
    $x2float
    $y2float
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicdrawLine(float $x1, float $y1, float $x2, float $y2) : \Zend_Pdf_Canvas_Interface

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

    Parameters
    NameTypeDescription
    $x1float
    $y1float
    $x2float
    $y2float
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicdrawPolygon(array $x, array $y, integer $fillType = \Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE, integer $fillMethod = \Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING) : \Zend_Pdf_Canvas_Interface

    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)
    Parameters
    NameTypeDescription
    $xarray
    • array of float (the X co-ordinates of the vertices)
    $yarray
    • array of float (the Y co-ordinates of the vertices)
    $fillTypeinteger
    $fillMethodinteger
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicdrawRectangle(float $x1, float $y1, float $x2, float $y2, integer $fillType = \Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE) : \Zend_Pdf_Canvas_Interface

    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
    Parameters
    NameTypeDescription
    $x1float
    $y1float
    $x2float
    $y2float
    $fillTypeinteger
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicdrawRoundedRectangle(float $x1, float $y1, float $x2, float $y2, integer | array $radius, integer $fillType = \Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE) : \Zend_Pdf_Canvas_Interface

    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
    Parameters
    NameTypeDescription
    $x1float
    $y1float
    $x2float
    $y2float
    $radiusinteger | array
    $fillTypeinteger
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicdrawText(string $text, float $x, float $y, string $charEncoding = '') : \Zend_Pdf_Canvas_Interface

    Draw a line of text at the specified position.

    Parameters
    NameTypeDescription
    $textstring
    $xfloat
    $yfloat
    $charEncodingstring

    (optional) Character encoding of source text. Defaults to current locale.

    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    Throws
    ExceptionDescription
    \Zend_Pdf_Exception
    methodpublicgetFont() : \Zend_Pdf_Resource_Font

    Get current font.

    Returns
    TypeDescription
    \Zend_Pdf_Resource_Font$font
    methodpublicgetFontSize() : float

    Get current font size

    Returns
    TypeDescription
    float$fontSize
    methodpublicgetHeight() : float

    Return canvas height.

    Returns
    TypeDescription
    float
    methodpublicgetStyle() : \Zend_Pdf_Style | null

    Return the style, applied to the page.

    Returns
    TypeDescription
    \Zend_Pdf_Style | null
    methodpublicgetWidth() : float

    Return canvas width.

    Returns
    TypeDescription
    float
    methodpublicrawWrite(string $data, string $procSet = null) : \Zend_Pdf_Canvas_Interface

    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.
    Parameters
    NameTypeDescription
    $datastring
    $procSetstring

    (optional) Name of ProcSet to add.

    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicrotate(float $x, float $y, float $angle) : \Zend_Pdf_Canvas_Interface

    Rotate the page.

    Parameters
    NameTypeDescription
    $xfloat
    • the X co-ordinate of rotation point
    $yfloat
    • the Y co-ordinate of rotation point
    $anglefloat
    • rotation angle
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicsaveGS() : \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.
    Returns
    TypeDescription
    \Zend_Pdf_Page
    Throws
    ExceptionDescription
    \Zend_Pdf_Exception- if a save is performed with an open path
    methodpublicscale(float $xScale, float $yScale) : \Zend_Pdf_Canvas_Interface

    Scale coordination system.

    Parameters
    NameTypeDescription
    $xScalefloat
    • X dimention scale factor
    $yScalefloat
    • Y dimention scale factor
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicsetAlpha(float $alpha, string $mode = 'Normal') : \Zend_Pdf_Canvas_Interface

    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
    Parameters
    NameTypeDescription
    $alphafloat
    $modestring
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    Throws
    ExceptionDescription
    \Zend_Pdf_Exception
    methodpublicsetFillColor(\Zend_Pdf_Color $color) : \Zend_Pdf_Canvas_Interface

    Set fill color.

    Parameters
    NameTypeDescription
    $color\Zend_Pdf_Color
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicsetFont(\Zend_Pdf_Resource_Font $font, float $fontSize) : \Zend_Pdf_Canvas_Interface

    Set current font.

    Parameters
    NameTypeDescription
    $font\Zend_Pdf_Resource_Font
    $fontSizefloat
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicsetLineColor(\Zend_Pdf_Color $color) : \Zend_Pdf_Canvas_Interface

    Set line color.

    Parameters
    NameTypeDescription
    $color\Zend_Pdf_Color
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicsetLineDashingPattern(mixed $pattern, array $phase = 0) : \Zend_Pdf_Canvas_Interface

    Set line dashing pattern

    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.
    Parameters
    NameTypeDescription
    $patternmixed
    $phasearray
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicsetLineWidth(float $width) : \Zend_Pdf_Canvas_Interface

    Set line width.

    Parameters
    NameTypeDescription
    $widthfloat
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicsetStyle(\Zend_Pdf_Style $style) : \Zend_Pdf_Canvas_Interface

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

    Parameters
    NameTypeDescription
    $style\Zend_Pdf_Style
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublicskew(float $x, float $y, float $xAngle, float $yAngle) : \Zend_Pdf_Canvas_Interface

    Translate coordination system.

    Parameters
    NameTypeDescription
    $xfloat
    • the X co-ordinate of axis skew point
    $yfloat
    • the Y co-ordinate of axis skew point
    $xAnglefloat
    • X axis skew angle
    $yAnglefloat
    • Y axis skew angle
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    methodpublictranslate(float $xShift, float $yShift) : \Zend_Pdf_Canvas_Interface

    Translate coordination system.

    Parameters
    NameTypeDescription
    $xShiftfloat
    • X coordinate shift
    $yShiftfloat
    • Y coordinate shift
    Returns
    TypeDescription
    \Zend_Pdf_Canvas_Interface
    Documentation was generated by phpDocumentor 2.2.0 .