Image_Graph
[ class tree: Image_Graph ] [ index: Image_Graph ] [ all elements ]

Class: Image_Graph_Driver_PDFlib

Source Location: /Image_Graph-0.3.0/Graph/Driver/PDFlib.php

Class Overview

Image_Graph_Driver
   |
   --Image_Graph_Driver_PDFlib

PDF Driver class.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • Copyright (C) 2003, 2004 Jesper Veggerby Hansen

Methods


Inherited Variables

Inherited Methods

Class: Image_Graph_Driver

Image_Graph_Driver::Image_Graph_Driver()
Create the driver.
Image_Graph_Driver::done()
Output the result of the driver
Image_Graph_Driver::ellipse()
Draw an ellipse
Image_Graph_Driver::endGroup()
End the "current" group.
Image_Graph_Driver::factory()
Driver factory method.
Image_Graph_Driver::getHeight()
Get the height of the canvas
Image_Graph_Driver::getWidth()
Get the width of the canvas
Image_Graph_Driver::line()
Draw a line
Image_Graph_Driver::overlayImage()
Overlay image
Image_Graph_Driver::pieSlice()
Draw a pie slice
Image_Graph_Driver::polygonAdd()
Adds vertex to a polygon
Image_Graph_Driver::polygonEnd()
Draws a polygon
Image_Graph_Driver::rectangle()
Draw a rectangle
Image_Graph_Driver::setDefaultFont()
Sets the default font options.
Image_Graph_Driver::setFill()
Sets the style of the filling of drawn objects.
Image_Graph_Driver::setFillColor()
Sets the color of the filling of drawn objects
Image_Graph_Driver::setFillImage()
Sets an image that should be used for filling
Image_Graph_Driver::setFont()
Sets the font options.
Image_Graph_Driver::setGradientFill()
Sets a gradient fill
Image_Graph_Driver::setLineColor()
Sets the color of the line(s) to be drawn
Image_Graph_Driver::setLineThickness()
Sets the thickness of the line(s) to be drawn
Image_Graph_Driver::splineAdd()
Adds vertex to a polygon
Image_Graph_Driver::splineEnd()
Draws a polygon
Image_Graph_Driver::startGroup()
Start a group.
Image_Graph_Driver::textHeight()
Get the height of a text,
Image_Graph_Driver::textWidth()
Get the width of a text,
Image_Graph_Driver::write()
Writes text

Class Details

[line 63]
PDF Driver class.


[ Top ]


Method Detail

Image_Graph_Driver_PDFlib (Constructor)   [line 159]

Image_Graph_Driver_PDFlib &Image_Graph_Driver_PDFlib( array $param)

Create the PDF driver.

Parameters available:

'page' Specify the page/paper format for the graph's page, available formats are: A0, A1, A2, A3, A4, A5, A6, B5, letter, legal, ledger, 11x17, cd_front, inlay, inlay_nosides

'align' Alignment of the graph on the page, available options are: topleft, topcenter, topright, leftcenter, center, rightcenter, leftbottom, centerbottom, rightbottom

'orientation' Specifies the paper orientation, default is 'portrait' and 'landscape' is also supported.

'creator' The creator tag of the PDF/graph

'author' The author tag of the PDF/graph

'title' The title tag of the PDF/graph

'width' The width of the graph on the page

'height' The height of the graph on the page

'left' The left offset of the graph on the page

'top' The top offset of the graph on the page

'filename' The PDF file to open/add page to, using 'filename' requires the commercial version of PDFlib (http://www.pdflib.com/), this has for obvious ($ 450) reasons not been tested

'pdf' An existing PDFlib PDF document to add the page to

'add_page' (true/false) Used together with 'pdf', to specify whether the driver should add a new graph page (true) or create the graph on the current page (false), default is 'true'

The 'page' and 'width' & 'height' can be mutually omitted, if 'page' is omitted the page is created using dimensions of width x height, and if width and height are omitted the page dimensions are used for the graph.

If 'pdf' is specified, 'filename', 'creator', 'author' and 'title' has no effect.

'left' and 'top' are overridden by 'align'

It is required either to specify 'width' & 'height' or 'page'.

The PDF format/PDFlib has some limitations on the capabilities, which means some functionality available using other drivers (fx. alpha blending and gradient fills) are not supported with PDF (see Drivers.txt in the docs/ folder for further details)


Parameters:

array   $param   —  Parameter array

[ Top ]

done   [line 907]

void done( [array $param = false])

Output the result of the driver
  • Abstract:

Overrides Image_Graph_Driver::done() (Output the result of the driver)

Parameters:

array   $param   —  Parameter array

[ Top ]

ellipse   [line 723]

void ellipse( int $x, int $y, int $rx, int $ry, [mixed $fillColor = false], [mixed $lineColor = false])

Draw an ellipse

Overrides Image_Graph_Driver::ellipse() (Draw an ellipse)

Parameters:

int   $x   —  Center point x-value
int   $y   —  Center point y-value
int   $rx   —  X-radius of ellipse
int   $ry   —  Y-radius of ellipse
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

line   [line 565]

void line( int $x0, int $y0, int $x1, int $y1, [mixed $color = false])

Draw a line

Overrides Image_Graph_Driver::line() (Draw a line)

Parameters:

int   $x0   —  X start point
int   $y0   —  X start point
int   $x1   —  X end point
int   $y1   —  Y end point
mixed   $color   —  The line color, can be omitted

[ Top ]

overlayImage   [line 864]

void overlayImage( int $x, int $y, string $filename, [int $width = false], [int $height = false], [ $alignment = false])

Overlay image

Overrides Image_Graph_Driver::overlayImage() (Overlay image)

Parameters:

int   $x   —  X-point of overlayed image
int   $y   —  Y-point of overlayed image
string   $filename   —  The filename of the image to overlay
int   $width   —  The width of the overlayed image (resizing if possible)
int   $height   —  The height of the overlayed image (resizing if possible)
   $alignment   — 

[ Top ]

pieSlice   [line 779]

void pieSlice( int $x, int $y, int $rx, int $ry, int $v1, int $v2, [int $srx = false], [int $sry = false], [mixed $fillColor = false], [mixed $lineColor = false])

Draw a pie slice

Overrides Image_Graph_Driver::pieSlice() (Draw a pie slice)

Parameters:

int   $x   —  Center point x-value
int   $y   —  Center point y-value
int   $rx   —  X-radius of pie slice
int   $ry   —  Y-radius of pie slice
int   $v1   —  The starting angle
int   $v2   —  The end angle
int   $srx   —  Starting X-radius of the pie slice i.e. for a doughnut)
int   $sry   —  Starting Y-radius of the pie slice (i.e. for a doughnut)
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

polygonEnd   [line 583]

void polygonEnd( [bool $connectEnds = true], [mixed $fillColor = false], [mixed $lineColor = false])

Draws a polygon

Overrides Image_Graph_Driver::polygonEnd() (Draws a polygon)

Parameters:

bool   $connectEnds   —  Specifies whether the start point should be connected to the endpoint (closed polygon) or not (connected line)
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

rectangle   [line 696]

void rectangle( int $x0, int $y0, int $x1, int $y1, [mixed $fillColor = false], [mixed $lineColor = false])

Draw a rectangle

Overrides Image_Graph_Driver::rectangle() (Draw a rectangle)

Parameters:

int   $x0   —  X start point
int   $y0   —  X start point
int   $x1   —  X end point
int   $y1   —  Y end point
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

setFillImage   [line 479]

void setFillImage( string $filename)

Sets an image that should be used for filling.

Image filling is not supported with PDF, filling 'transparent'


Overrides Image_Graph_Driver::setFillImage() (Sets an image that should be used for filling)

Parameters:

string   $filename   —  The filename of the image to fill with

[ Top ]

setFont   [line 510]

void setFont( $fontOptions, array $font)

Sets the font options.

The $font array may have the following entries:

'ttf' = the .ttf file (either the basename, filename or full path) If 'ttf' is specified, then the following can be specified

'size' = size in pixels

'angle' = the angle with which to write the text


Overrides Image_Graph_Driver::setFont() (Sets the font options.)

Parameters:

array   $font   —  The font options.
   $fontOptions   — 

[ Top ]

setGradientFill   [line 491]

void setGradientFill( array $gradient)

Sets a gradient fill

Gradient filling is not supported with PDF, end color used as solid fill.


Overrides Image_Graph_Driver::setGradientFill() (Sets a gradient fill)

Parameters:

array   $gradient   —  Gradient fill options

[ Top ]

splineEnd   [line 625]

void splineEnd( [bool $connectEnds = true], [mixed $fillColor = false], [mixed $lineColor = false])

Draws a polygon

Overrides Image_Graph_Driver::splineEnd() (Draws a polygon)

Parameters:

bool   $connectEnds   —  Specifies whether the start point should be connected to the endpoint (closed polygon) or not (connected line)
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

textHeight   [line 806]

int textHeight( string $text)

Get the height of a text,
  • Return: The height of the text

Overrides Image_Graph_Driver::textHeight() (Get the height of a text,)

Parameters:

string   $text   —  The text to get the height of

[ Top ]

textWidth   [line 791]

int textWidth( string $text)

Get the width of a text,
  • Return: The width of the text

Overrides Image_Graph_Driver::textWidth() (Get the width of a text,)

Parameters:

string   $text   —  The text to get the width of

[ Top ]

write   [line 826]

void write( int $x, int $y, string $text, int $alignment, [mixed $color = false])

Writes text.

Angled text not supported on PDF.


Overrides Image_Graph_Driver::write() (Writes text)

Parameters:

int   $x   —  X-point of text
int   $y   —  Y-point of text
string   $text   —  The text to write
int   $alignment   —  The alignment of the text
mixed   $color   —  The color of the text

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:24:57 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.