blueshoes php application framework and cms            Cpdf
[ class tree: Cpdf ] [ index: Cpdf ] [ all elements ]

Class: Cezpdf

Source Location: /lib/cpdf/class.ezpdf.php

Class Overview

Cpdf
   |
   --Cezpdf

Cpdf


Author(s):

Version:

  • 009

Variables

Methods


Child classes:

Creport
Cpdf

Inherited Variables

Inherited Methods

Class: Cpdf

Cpdf::Cpdf()
class constructor
Cpdf::addDestination()
create a labelled destination within the document
Cpdf::addImage()
add an image into the document, from a GD object
Cpdf::addInfo()
add content to the documents info object
Cpdf::addInternalLink()
add a link in the document to an internal destination (ie. within the document)
Cpdf::addJpegFromFile()
add a JPEG image into the document, from a file
Cpdf::addLink()
add a link in the document to an external URL
Cpdf::addMessage()
used to add messages for use in debugging
Cpdf::addObject()
after an object has been created, it wil only show if it has been added, using this function.
Cpdf::addPngFromFile()
add a PNG image into the document, from a file
Cpdf::addText()
add text to the document, at a specified location, size and angle on the page
Cpdf::addTextAlignRight()
Cpdf::addTextWrap()
add text to the page, but ensure that it fits within a certain width if it does not fit then put in as much as possible, splitting at word boundaries and return the remainder.
Cpdf::ARC4()
ARC4 encrypt a text string
Cpdf::ARC4_init()
initialize the ARC4 encryption
Cpdf::checkAllHere()
should be used for internal checks, not implemented as yet
Cpdf::closeObject()
close an object
Cpdf::curve()
draw a bezier curve based on 4 control points
Cpdf::ellipse()
draw an ellipse note that the part and filled ellipse are just special cases of this function
Cpdf::encryptInit()
initialize the encryption for processing a particular object
Cpdf::filledEllipse()
draw a filled ellipse
Cpdf::filledRectangle()
a filled rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not
Cpdf::getFirstPageId()
function for the user to find out what the ID is of the first page that was created during startup - useful if they wish to add something to it later.
Cpdf::getFontDecender()
return the font decender, this will normally return a negative number
Cpdf::getFontHeight()
return the height in units of the current font in the given size
Cpdf::getTextWidth()
calculate how wide a given text string will be on a page, at a given size.
Cpdf::line()
draw a line from one set of coordinates to another
Cpdf::md5_16()
calculate the 16 byte version of the 128 bit md5 digest of the string
Cpdf::newPage()
add a new page to the document
Cpdf::openHere()
specify where the document should open when it first starts
Cpdf::openObject()
make a loose object, the output will go into this object, until it is closed, then will revert to the current one.
Cpdf::output()
return the pdf stream as a string returned from the function
Cpdf::o_action()
an action object, used to link to URLS initially
Cpdf::o_annotation()
an annotation object, this will add an annotation to the current page.
Cpdf::o_catalog()
define the document catalog, the overall controller for the document
Cpdf::o_contents()
the contents objects hold all of the content which appears on pages
Cpdf::o_destination()
destination object, used to specify the location for the user to jump to, presently on opening
Cpdf::o_encryption()
encryption object.
Cpdf::o_font()
an object to hold the font description
Cpdf::o_fontDescriptor()
a font descriptor, needed for including additional fonts
Cpdf::o_fontEncoding()
the font encoding
Cpdf::o_image()
an image object, will be an XObject in the document, includes description and data
Cpdf::o_info()
define the document information
Cpdf::o_outlines()
define the outlines in the doc, empty for now
Cpdf::o_page()
a page object, it also creates a contents object to hold its contents
Cpdf::o_pages()
object which is a parent to the pages in the document
Cpdf::o_procset()
the document procset, solves some problems with printing to old PS printers
Cpdf::o_viewerPreferences()
set the viewer preferences
Cpdf::partEllipse()
draw a part of an ellipse
Cpdf::polygon()
draw a polygon, the syntax for this is similar to the GD polygon command
Cpdf::rectangle()
draw a rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not
Cpdf::reopenObject()
open an existing object for editing
Cpdf::restoreState()
restore a previously saved state
Cpdf::saveState()
this will be called at a new page to return the state to what it was on the
Cpdf::selectFont()
if the font is not loaded then load it and make the required object
Cpdf::setColor()
sets the colour for fill operations
Cpdf::setColorBy255()
like setColor() but uses values from 0-255 instead of 0-1.
Cpdf::setEncryption()
set the encryption of the document can be used to turn it on and/or set the passwords which it will have.
Cpdf::setFontFamily()
define font families, this is used to initialize the font families for the default fonts and for the user to add new ones for their fonts. The default bahavious can be overridden should that be desired.
Cpdf::setLineStyle()
this sets the line drawing style.
Cpdf::setPreferences()
set the viewer preferences of the document, it is up to the browser to obey these.
Cpdf::setStrokeColor()
sets the colour for stroke operations
Cpdf::setStrokeColorBy255()
like setStrokeColor() but uses values from 0-255 instead of 0-1.
Cpdf::stopObject()
stop an object from appearing on pages from this point on
Cpdf::stream()
output the pdf code, streaming it to the browser
Cpdf::transaction()
a few functions which should allow the document to be treated transactionally.

Class Details

[line 5]
Cpdf

http://www.ros.co.nz/pdf

A PHP class to provide the basic functionality to create a pdf document without any requirement for additional modules.

Note that they companion class CezPdf can be used to extend this class and dramatically simplify the creation of documents.

IMPORTANT NOTE there is no warranty, implied or otherwise with this software.

LICENCE This code has been placed in the Public Domain for all to enjoy.




Tags:

version:  009
author:  Wayne Munro <mailto:pdf@ros.co.nz>


[ Top ]


Class Variables

$ez = array('fontSize'=>10)

[line 21]


Type:   mixed


[ Top ]

$ezPageCount = 0

[line 24]


Type:   mixed


[ Top ]

$ezPages = array()

[line 23]


Type:   mixed


[ Top ]

$y =

[line 22]


Type:   mixed


[ Top ]



Class Methods


constructor Cezpdf [line 28]

Cezpdf Cezpdf( [mixed $paper = 'a4'], [mixed $orientation = 'portrait'])



[ Top ]

method alink [line 1624]

void alink( mixed $info, [mixed $internal = 0])



[ Top ]

method execTemplate [line 1611]

void execTemplate( mixed $id, [mixed $data = array()], [mixed $options = array()])



[ Top ]

method ezColumnsStart [line 144]

void ezColumnsStart( [mixed $options = array()])



[ Top ]

method ezColumnsStop [line 180]

void ezColumnsStop( )



[ Top ]

method ezGetCurrentPageNumber [line 269]

void ezGetCurrentPageNumber( )



[ Top ]

method ezInsertMode [line 190]

void ezInsertMode( [mixed $status = 1], [mixed $pageNum = 1], [mixed $pos = 'before'])



[ Top ]

method ezList [line 1369]

int ezList( array $list, [array $props = array()])

Renders the given list to the pdf.

Something like the




Tags:

return:  (the new y position.)
author:  andrej at blueshoes dot org
access:  public


Parameters:

array   $list   (see above.)
array   $props   (hash, default is an empty array, see above.)

[ Top ]

method ezNewPage [line 207]

void ezNewPage( )



[ Top ]

method ezOutput [line 459]

void ezOutput( [mixed $options = 0])



[ Top ]

method ezProcessText [line 1140]

void ezProcessText( mixed $text)



[ Top ]

method ezPRVTaddPageNumbers [line 375]

void ezPRVTaddPageNumbers( )



[ Top ]

method ezPRVTcleanUp [line 446]

void ezPRVTcleanUp( )



[ Top ]

method ezPrvtGetTextWidth [line 588]

void ezPrvtGetTextWidth( mixed $size, mixed $text)



[ Top ]

method ezPRVTpageNumberSearch [line 358]

void ezPRVTpageNumberSearch( mixed $lbl, mixed &$tmp)



[ Top ]

method ezPrvtTableColumnHeadings [line 524]

void ezPrvtTableColumnHeadings( mixed $cols, mixed $pos, mixed $maxWidth, mixed $height, mixed $decender, mixed $gap, mixed $size, mixed &$y, [mixed $optionsAll = array()])



[ Top ]

method ezPrvtTableDrawLines [line 495]

void ezPrvtTableDrawLines( mixed $pos, mixed $gap, mixed $x0, mixed $x1, mixed $y0, mixed $y1, mixed $y2, mixed $col, mixed $inner, mixed $outer, [mixed $opt = 1])



[ Top ]

method ezSetCmMargins [line 134]

void ezSetCmMargins( mixed $top, mixed $bottom, mixed $left, mixed $right)



[ Top ]

method ezSetDy [line 477]

void ezSetDy( mixed $dy, [mixed $mod = ''])



[ Top ]

method ezSetMargins [line 249]

void ezSetMargins( mixed $top, mixed $bottom, mixed $left, mixed $right)



[ Top ]

method ezSetY [line 466]

void ezSetY( mixed $y)



[ Top ]

method ezStartPageNumbers [line 276]

void ezStartPageNumbers( mixed $x, mixed $y, mixed $size, [mixed $pos = 'left'], [mixed $pattern = '{PAGENUM} of {TOTALPAGENUM}'], [mixed $num = ''])



[ Top ]

method ezStopPageNumbers [line 329]

void ezStopPageNumbers( [mixed $stopTotal = 0], [mixed $next = 0], [mixed $i = 0])



[ Top ]

method ezStream [line 452]

void ezStream( [mixed $options = ''])



[ Top ]

method ezTable [line 604]

void ezTable( mixed &$data, [mixed $cols = ''], [mixed $title = ''], [mixed $options = ''])



[ Top ]

method ezText [line 1150]

void ezText( mixed $text, [mixed $size = 0], [mixed $options = array()], [mixed $test = 0])



[ Top ]

method ezWhatPageNumber [line 302]

void ezWhatPageNumber( mixed $pageNum, [mixed $i = 0])



[ Top ]

method hexToRgb [line 1253]

array hexToRgb( string $hex)

converts a hex color code to an rgb array.



Tags:

return:  (vector with 3 elements: 0=red, 1=green, 2=blue.)
author:  andrej at blueshoes dot org
access:  public


Parameters:

string   $hex   (like 'FFFFFF' or '#ffffff'.)

[ Top ]

method ilink [line 1620]

void ilink( mixed $info)



[ Top ]

method invertY [line 1266]

int invertY( int $y)

inverts the given $y value based on the pageHeight.



Tags:

author:  andrej at blueshoes dot org
access:  public


Parameters:

int   $y  

[ Top ]

method loadTemplate [line 1574]

void loadTemplate( mixed $templateFile)



[ Top ]

method uline [line 1669]

void uline( mixed $info)



[ Top ]


Documentation generated on Mon, 29 Dec 2003 21:13:36 +0100 by phpDocumentor 1.2.3