phpDocumentor Cpdf
[ class tree: Cpdf ] [ index: Cpdf ] [ all elements ]

Class: Cpdf

Source Location: /phpDocumentor/Converters/PDF/default/class.pdf.php

Class Cpdf

Class Overview

Cpdf

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.

Located in /phpDocumentor/Converters/PDF/default/class.pdf.php [line 23]



		
				Author(s):
		
		
		
Information Tags:
Link:  http://www.ros.co.nz/pdf
Version:  009

Properties

Methods

[ Top ]
Direct descendents
Child Class Description
Cezpdf This class will take the basic interaction facilities of the Cpdf class and make more useful functions so that the user does not have to know all the ins and outs of pdf presentation to produce something pretty.

[ Top ]
Property Summary
mixed   $addLooseObjects   array contains infomation about how the loose objects are to be added to the document
mixed   $arc4   the ancryption array for the document encryption is stored here
mixed   $arc4_objnum   the object Id of the encryption information
mixed   $callback   array which forms a stack to keep track of nested callback functions
mixed   $catalogId   the objectId (number within the objects array) of the document catalog
mixed   $checkpoint   store the stack for the transaction commands, each item in here is a record of the values of all the variables within the class, so that the user can rollback at will (from each 'start' command) note that this includes the objects array, so these can be large.
mixed   $currentBaseFont   the current base font
mixed   $currentColour   current colour for fill operations, defaults to inactive value, all three components should be between 0 and 1 inclusive when active
mixed   $currentContents   object number of the currently active contents block
mixed   $currentFont   a record of the current font
mixed   $currentFontNum   the number of the current font within the font array
mixed   $currentLineStyle   current style that lines are drawn in
mixed   $currentNode  
mixed   $currentPage   object number of the current page
mixed   $currentStrokeColour   current colour for stroke operations (lines etc.)
mixed   $currentTextState   track if the current font is bolded or italicised
mixed   $destinations   store label->id pairs for named destinations, these will be used to replace internal links
mixed   $encrypted   a flag to say if a document is to be encrypted or not
mixed   $encryptionKey   the ancryption key for the encryption of all the document content (structure is not encrypted)
mixed   $fileIdentifier   the file identifier, used to uniquely identify a pdf document
mixed   $firstPageId   the objectId of the first page of the document
mixed   $fontFamilies   store the information about the relationship between font families this used so that the code knows which font is the bold version of another font, etc.
mixed   $fonts   array carrying information about the fonts that the system currently knows about
mixed   $infoObject   the objectId of the information object for the document this contains authorship, title etc.
mixed   $looseObjects   an array which contains information about the objects which are not firmly attached to pages
mixed   $messages   messages are stored here during processing, these can be selected afterwards to give some useful debug information
mixed   $nCallback   the number of callback functions in the callback array
mixed   $nStack   number of elements within the object Id storage stack
mixed   $nStateStack   number of elements within the state stack
mixed   $numFonts   number of fonts within the system
mixed   $numImages   number of images being tracked within the document
mixed   $numObj   the current number of pdf objects in the document
mixed   $numPages   number of page objects within the document
mixed   $objects   this array contains all of the pdf objects, ready for final assembly
mixed   $options   an array containing options about the document
mixed   $procsetObjectId   the object Id of the procset object
mixed   $stack   object Id storage stack
mixed   $stateStack   an array which is used to save the state of the document, mainly the colours and styles
mixed   $wordSpaceAdjust   used to track the last used value of the inter-word spacing, this is so that it is known when the spacing is changed.

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

[ Top ]
Properties
mixed   $addLooseObjects = array() [line 111]

array contains infomation about how the loose objects are to be added to the document


[ Top ]
mixed   $arc4 = '' [line 156]

the ancryption array for the document encryption is stored here


[ Top ]
mixed   $arc4_objnum [line 160]

the object Id of the encryption information


[ Top ]
mixed   $callback = array() [line 176]

array which forms a stack to keep track of nested callback functions


[ Top ]
mixed   $catalogId [line 36]

the objectId (number within the objects array) of the document catalog


[ Top ]
mixed   $checkpoint = '' [line 191]

store the stack for the transaction commands, each item in here is a record of the values of all the variables within the class, so that the user can rollback at will (from each 'start' command) note that this includes the objects array, so these can be large.


[ Top ]
mixed   $currentBaseFont = '' [line 49]

the current base font


[ Top ]
mixed   $currentColour = array('r'=>-1,'g'=>-1,'b'=>-1) [line 73]

current colour for fill operations, defaults to inactive value, all three components should be between 0 and 1 inclusive when active


[ Top ]
mixed   $currentContents [line 65]

object number of the currently active contents block


[ Top ]
mixed   $currentFont = '' [line 45]

a record of the current font


[ Top ]
mixed   $currentFontNum [line 53]

the number of the current font within the font array


[ Top ]
mixed   $currentLineStyle = '' [line 81]

current style that lines are drawn in


[ Top ]
mixed   $currentNode [line 57]

[ Top ]
mixed   $currentPage [line 61]

object number of the current page


[ Top ]
mixed   $currentStrokeColour = array('r'=>-1,'g'=>-1,'b'=>-1) [line 77]

current colour for stroke operations (lines etc.)


[ Top ]
mixed   $currentTextState = '' [line 148]

track if the current font is bolded or italicised


[ Top ]
mixed   $destinations = array() [line 185]

store label->id pairs for named destinations, these will be used to replace internal links

done this way so that destinations can be defined after the location that links to them


[ Top ]
mixed   $encrypted [line 168]

a flag to say if a document is to be encrypted or not


[ Top ]
mixed   $encryptionKey = '' [line 172]

the ancryption key for the encryption of all the document content (structure is not encrypted)


[ Top ]
mixed   $fileIdentifier = '' [line 164]

the file identifier, used to uniquely identify a pdf document


[ Top ]
mixed   $firstPageId [line 129]

the objectId of the first page of the document


[ Top ]
mixed   $fontFamilies = array() [line 144]

store the information about the relationship between font families this used so that the code knows which font is the bold version of another font, etc.

the value of this array is initialised in the constuctor function.


[ Top ]
mixed   $fonts = array() [line 41]

array carrying information about the fonts that the system currently knows about

used to ensure that a font is not loaded twice, among other things


[ Top ]
mixed   $infoObject [line 116]

the objectId of the information object for the document this contains authorship, title etc.


[ Top ]
mixed   $looseObjects = array() [line 107]

an array which contains information about the objects which are not firmly attached to pages

these have been added with the addObject function


[ Top ]
mixed   $messages = '' [line 152]

messages are stored here during processing, these can be selected afterwards to give some useful debug information


[ Top ]
mixed   $nCallback = 0 [line 180]

the number of callback functions in the callback array


[ Top ]
mixed   $nStack [line 102]

number of elements within the object Id storage stack


[ Top ]
mixed   $nStateStack = 0 [line 90]

number of elements within the state stack


[ Top ]
mixed   $numFonts [line 69]

number of fonts within the system


[ Top ]
mixed   $numImages [line 120]

number of images being tracked within the document


[ Top ]
mixed   $numObj [line 28]

the current number of pdf objects in the document


[ Top ]
mixed   $numPages [line 94]

number of page objects within the document


[ Top ]
mixed   $objects = array() [line 32]

this array contains all of the pdf objects, ready for final assembly


[ Top ]
mixed   $options = array('compression'=>1) [line 125]

an array containing options about the document

it defaults to turning on the compression of the objects


[ Top ]
mixed   $procsetObjectId [line 138]

the object Id of the procset object


[ Top ]
mixed   $stack = array() [line 98]

object Id storage stack


[ Top ]
mixed   $stateStack = array() [line 86]

an array which is used to save the state of the document, mainly the colours and styles

it is used to temporarily change to another state, the change back to what it was before


[ Top ]
mixed   $wordSpaceAdjust [line 134]

used to track the last used value of the inter-word spacing, this is so that it is known when the spacing is changed.


[ Top ]
Methods
Constructor Cpdf  [line 197]

  Cpdf Cpdf( [ $pageSize = array(0,0,612,792)]  )

class constructor

this will start a new document

Parameters:
   $pageSize: 


[ Top ]
addDestination  [line 2969]

  void addDestination( $label, $style, [ $a = 0], [ $b = 0], [ $c = 0]  )

create a labelled destination within the document

Parameters:
   $label: 
   $style: 
   $a: 
   $b: 
   $c: 


[ Top ]
addImage  [line 2870]

  void addImage( &$img, $x, $y, [ $w = 0], [ $h = 0], [ $quality = 75]  )

add an image into the document, from a GD object

this function is not all that reliable, and I would probably encourage people to use the file based functions

Parameters:
   &$img: 
   $x: 
   $y: 
   $w: 
   $h: 
   $quality: 


[ Top ]
addInfo  [line 2590]

  void addInfo( $label, [ $value = 0]  )

add content to the documents info object

Parameters:
   $label: 
   $value: 


[ Top ]
addInternalLink  [line 1173]

  void addInternalLink( $label, $x0, $y0, $x1, $y1  )

add a link in the document to an internal destination (ie. within the document)

Parameters:
   $label: 
   $x0: 
   $y0: 
   $x1: 
   $y1: 


[ Top ]
addJpegFromFile  [line 2825]

  void addJpegFromFile( $img, $x, $y, [ $w = 0], [ $h = 0]  )

add a JPEG image into the document, from a file

Parameters:
   $img: 
   $x: 
   $y: 
   $w: 
   $h: 


[ Top ]
addLink  [line 1164]

  void addLink( $url, $x0, $y0, $x1, $y1  )

add a link in the document to an external URL

Parameters:
   $url: 
   $x0: 
   $y0: 
   $x1: 
   $y1: 


[ Top ]
addMessage  [line 3022]

  void addMessage( $message  )

used to add messages for use in debugging

Parameters:
   $message: 


Redefined in descendants as:

[ Top ]
addObject  [line 2544]

  void addObject( $id, [ $options = 'add']  )

after an object has been created, it wil only show if it has been added, using this function.

Parameters:
   $id: 
   $options: 


[ Top ]
addPngFromFile  [line 2637]

  void addPngFromFile( $file, $x, $y, [ $w = 0], [ $h = 0]  )

add a PNG image into the document, from a file

this should work with remote files

Parameters:
   $file: 
   $x: 
   $y: 
   $w: 
   $h: 


[ Top ]
addText  [line 2156]

  void addText( $x, $y, $size, $text, [ $angle = 0], [ $wordSpaceAdjust = 0]  )

add text to the document, at a specified location, size and angle on the page

Parameters:
   $x: 
   $y: 
   $size: 
   $text: 
   $angle: 
   $wordSpaceAdjust: 


[ Top ]
addTextWrap  [line 2331]

  void addTextWrap( $x, $y, $width, $size, $text, [ $justification = 'left'], [ $angle = 0], [ $test = 0]  )

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.

justification and angle can also be specified for the text

Parameters:
   $x: 
   $y: 
   $width: 
   $size: 
   $text: 
   $justification: 
   $angle: 
   $test: 


[ Top ]
ARC4  [line 1138]

  void ARC4( $text  )

ARC4 encrypt a text string

Parameters:
   $text: 


[ Top ]
ARC4_init  [line 1112]

  void ARC4_init( [ $key = '']  )

initialize the ARC4 encryption

Parameters:
   $key: 


[ Top ]
checkAllHere  [line 1214]

  void checkAllHere( )

should be used for internal checks, not implemented as yet



[ Top ]
closeObject  [line 2518]

  void closeObject( )

close an object



[ Top ]
curve  [line 1682]

  void curve( $x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3  )

draw a bezier curve based on 4 control points

Parameters:
   $x0: 
   $y0: 
   $x1: 
   $y1: 
   $x2: 
   $y2: 
   $x3: 
   $y3: 


[ Top ]
ellipse  [line 1713]

  void ellipse( $x0, $y0, $r1, [ $r2 = 0], [ $angle = 0], [ $nSeg = 8], [ $astart = 0], [ $afinish = 360], [ $close = 1], [ $fill = 0]  )

draw an ellipse note that the part and filled ellipse are just special cases of this function

draws an ellipse in the current line style centered at $x0,$y0, radii $r1,$r2 if $r2 is not set, then a circle is drawn nSeg is not allowed to be less than 2, as this will simply draw a line (and will even draw a pretty crappy shape at 2, as we are approximating with bezier curves.

Parameters:
   $x0: 
   $y0: 
   $r1: 
   $r2: 
   $angle: 
   $nSeg: 
   $astart: 
   $afinish: 
   $close: 
   $fill: 


[ Top ]
encryptInit  [line 1098]

  void encryptInit( $id  )

initialize the encryption for processing a particular object

Parameters:
   $id: 


[ Top ]
filledEllipse  [line 1699]

  void filledEllipse( $x0, $y0, $r1, [ $r2 = 0], [ $angle = 0], [ $nSeg = 8], [ $astart = 0], [ $afinish = 360]  )

draw a filled ellipse

Parameters:
   $x0: 
   $y0: 
   $r1: 
   $r2: 
   $angle: 
   $nSeg: 
   $astart: 
   $afinish: 


[ Top ]
filledRectangle  [line 1835]

  void filledRectangle( $x1, $y1, $width, $height  )

a filled rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not

the coordinates of the upper-right corner

Parameters:
   $x1: 
   $y1: 
   $width: 
   $height: 


[ Top ]
getFirstPageId  [line 1639]

  void 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.



[ Top ]
getFontDecender  [line 1943]

  void getFontDecender( $size  )

return the font decender, this will normally return a negative number

if you add this number to the baseline, you get the level of the bottom of the font it is in the pdf user units

Parameters:
   $size: 


[ Top ]
getFontHeight  [line 1929]

  void getFontHeight( $size  )

return the height in units of the current font in the given size

Parameters:
   $size: 


[ Top ]
getTextWidth  [line 2248]

  void getTextWidth( $size, $text  )

calculate how wide a given text string will be on a page, at a given size.

this can be called externally, but is alse used by the other class functions

Parameters:
   $size: 
   $text: 


[ Top ]
line  [line 1675]

  void line( $x1, $y1, $x2, $y2  )

draw a line from one set of coordinates to another

Parameters:
   $x1: 
   $y1: 
   $x2: 
   $y2: 


[ Top ]
md5_16  [line 1086]

  void md5_16( $string  )

calculate the 16 byte version of the 128 bit md5 digest of the string

Parameters:
   $string: 


[ Top ]
newPage  [line 1851]

  void newPage( [ $insert = 0], [ $id = 0], [ $pos = 'after']  )

add a new page to the document

this also makes the new page the current active object

Parameters:
   $insert: 
   $id: 
   $pos: 


[ Top ]
openHere  [line 2949]

  void openHere( $style, [ $a = 0], [ $b = 0], [ $c = 0]  )

specify where the document should open when it first starts

Parameters:
   $style: 
   $a: 
   $b: 
   $c: 


[ Top ]
openObject  [line 2490]

  void openObject( )

make a loose object, the output will go into this object, until it is closed, then will revert to the current one.

this object will not appear until it is included within a page. the function will return the object number



[ Top ]
output  [line 1220]

  void output( [ $debug = 0]  )

return the pdf stream as a string returned from the function

Parameters:
   $debug: 


[ Top ]
o_action  [line 726]

  void o_action( $id, $action, [ $options = '']  )

an action object, used to link to URLS initially

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_annotation  [line 769]

  void o_annotation( $id, $action, [ $options = '']  )

an annotation object, this will add an annotation to the current page.

initially will support just link annotations

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_catalog  [line 297]

  void o_catalog( $id, $action, [ $options = '']  )

define the document catalog, the overall controller for the document

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_contents  [line 890]

  void o_contents( $id, $action, [ $options = '']  )

the contents objects hold all of the content which appears on pages

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_destination  [line 224]

  void o_destination( $id, $action, [ $options = '']  )

destination object, used to specify the location for the user to jump to, presently on opening

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_encryption  [line 1015]

  void o_encryption( $id, $action, [ $options = '']  )

encryption object.

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_font  [line 475]

  void o_font( $id, $action, [ $options = '']  )

an object to hold the font description

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_fontDescriptor  [line 559]

  void o_fontDescriptor( $id, $action, [ $options = '']  )

a font descriptor, needed for including additional fonts

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_fontEncoding  [line 610]

  void o_fontEncoding( $id, $action, [ $options = '']  )

the font encoding

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_image  [line 940]

  void o_image( $id, $action, [ $options = '']  )

an image object, will be an XObject in the document, includes description and data

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_info  [line 682]

  void o_info( $id, $action, [ $options = '']  )

define the document information

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_outlines  [line 445]

  void o_outlines( $id, $action, [ $options = '']  )

define the outlines in the doc, empty for now

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_page  [line 821]

  void o_page( $id, $action, [ $options = '']  )

a page object, it also creates a contents object to hold its contents

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_pages  [line 347]

  void o_pages( $id, $action, [ $options = '']  )

object which is a parent to the pages in the document

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_procset  [line 647]

  void o_procset( $id, $action, [ $options = '']  )

the document procset, solves some problems with printing to old PS printers

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
o_viewerPreferences  [line 259]

  void o_viewerPreferences( $id, $action, [ $options = '']  )

set the viewer preferences

Parameters:
   $id: 
   $action: 
   $options: 


[ Top ]
partEllipse  [line 1692]

  void partEllipse( $x0, $y0, $astart, $afinish, $r1, [ $r2 = 0], [ $angle = 0], [ $nSeg = 8]  )

draw a part of an ellipse

Parameters:
   $x0: 
   $y0: 
   $astart: 
   $afinish: 
   $r1: 
   $r2: 
   $angle: 
   $nSeg: 


[ Top ]
polygon  [line 1818]

  void polygon( $p, $np, [ $f = 0]  )

draw a polygon, the syntax for this is similar to the GD polygon command

Parameters:
   $p: 
   $np: 
   $f: 


[ Top ]
rectangle  [line 1843]

  void rectangle( $x1, $y1, $width, $height  )

draw a rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not

the coordinates of the upper-right corner

Parameters:
   $x1: 
   $y1: 
   $width: 
   $height: 


[ Top ]
reopenObject  [line 2505]

  void reopenObject( $id  )

open an existing object for editing

Parameters:
   $id: 


[ Top ]
restoreState  [line 2471]

  void restoreState( [ $pageEnd = 0]  )

restore a previously saved state

Parameters:
   $pageEnd: 


[ Top ]
saveState  [line 2447]

  void saveState( [ $pageEnd = 0]  )

this will be called at a new page to return the state to what it was on the

end of the previous page, before the stack was closed down This is to get around not being able to have open 'q' across pages

Parameters:
   $pageEnd: 


[ Top ]
selectFont  [line 1417]

  void selectFont( $fontName, [ $encoding = ''], [ $set = 1]  )

if the font is not loaded then load it and make the required object

else just make it the current font the encoding array can contain 'encoding'=> 'none','WinAnsiEncoding','MacRomanEncoding' or 'MacExpertEncoding' note that encoding='none' will need to be used for symbolic fonts and 'differences' => an array of mappings between numbers 0->255 and character names.

Parameters:
   $fontName: 
   $encoding: 
   $set: 


[ Top ]
setColor  [line 1655]

  void setColor( $r, $g, $b, [ $force = 0]  )

sets the colour for fill operations

Parameters:
   $r: 
   $g: 
   $b: 
   $force: 


[ Top ]
setEncryption  [line 1184]

  void setEncryption( [ $userPass = ''], [ $ownerPass = ''], [ $pc = array()]  )

set the encryption of the document can be used to turn it on and/or set the passwords which it will have.

also the functions that the user will have are set here, such as print, modify, add

Parameters:
   $userPass: 
   $ownerPass: 
   $pc: 


[ Top ]
setFontFamily  [line 2985]

  void setFontFamily( $family, [ $options = '']  )

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.

Parameters:
   $family: 
   $options: 


[ Top ]
setLineStyle  [line 1789]

  void setLineStyle( [ $width = 1], [ $cap = ''], [ $join = ''], [ $dash = ''], [ $phase = 0]  )

this sets the line drawing style.

width, is the thickness of the line in user units cap is the type of cap to put on the line, values can be 'butt','round','square' where the diffference between 'square' and 'butt' is that 'square' projects a flat end past the end of the line. join can be 'miter', 'round', 'bevel' dash is an array which sets the dash pattern, is a series of length values, which are the lengths of the on and off dashes. (2) represents 2 on, 2 off, 2 on , 2 off ... (2,1) is 2 on, 1 off, 2 on, 1 off.. etc phase is a modifier on the dash pattern which is used to shift the point at which the pattern starts.

Parameters:
   $width: 
   $cap: 
   $join: 
   $dash: 
   $phase: 


[ Top ]
setPreferences  [line 2607]

  void setPreferences( $label, [ $value = 0]  )

set the viewer preferences of the document, it is up to the browser to obey these.

Parameters:
   $label: 
   $value: 


[ Top ]
setStrokeColor  [line 1665]

  void setStrokeColor( $r, $g, $b, [ $force = 0]  )

sets the colour for stroke operations

Parameters:
   $r: 
   $g: 
   $b: 
   $force: 


[ Top ]
stopObject  [line 2533]

  void stopObject( $id  )

stop an object from appearing on pages from this point on

Parameters:
   $id: 


[ Top ]
stream  [line 1899]

  void stream( [ $options = '']  )

output the pdf code, streaming it to the browser

the relevant headers are set so that hopefully the browser will recognise it

Parameters:
   $options: 


[ Top ]
transaction  [line 3029]

  void transaction( $action  )

a few functions which should allow the document to be treated transactionally.

Parameters:
   $action: 


[ Top ]

Documentation generated on Tue, 24 Oct 2006 09:21:05 -0500 by phpDocumentor 1.3.1