eZPublishCommunityProject(LegacyStack)  2013.9
eZPDFTable Class Reference

eZPDFTable adds extra support for tables More...

+ Inheritance diagram for eZPDFTable:
+ Collaboration diagram for eZPDFTable:

Public Member Functions

 addDocSpecFunction ($functionName, $parameters)
 Function for adding function to doc specification. More...
 
 addDocSpecification ($text)
 Function for adding text to doc specification. More...
 
 addToPreStack ($options=array())
 function for adding font specification to PreStack array More...
 
 callAnchor ($info)
 Callback function to set anchor. More...
 
 callBlockFrame ($params, $text)
 
 callCircle ($info)
 
 callDrawLine ($info)
 
 callFilledRectangle ($info)
 
 callFont ($params)
 Callback function to set font. More...
 
 callFrame ($params, $text)
 
 callFrameLine ($info)
 
 callFrameMargins ($info)
 
 callFrontpage ($params, $text)
 
 callHeader ($params)
 Callback function to set header. More...
 
 callImage ($info)
 Function for insert image. More...
 
 callIndex ($info)
 
 callInsertTOC ($info)
 function for inserting TOC More...
 
 callKeyword ($info)
 function for inserting keyword More...
 
 callLine ($params, $text)
 
 callNewPage ($info)
 Callback function for creating new page. More...
 
 callRectangle ($info)
 
 callSetMargin ($info)
 
 callStartPageCounter ($info)
 
 callTable ($params, $text)
 
 callText ($params)
 Callback function for adding text. More...
 
 callTextBox ($params, $text)
 
 callTextFrame ($params, $text)
 
 callTOC ($info)
 Callback function for inserting TOC. More...
 
 dots ($info)
 
 extractFunction (&$text, $offSet, &$functionName, &$parameters, $type='ezCall')
 Function for extracting function name and parameters from text. More...
 
 extractParameters (&$text, $offSet, &$parameters, $skipFirstChar=false)
 Function for extracting parameters from : separated key:value list callback functions. More...
 
 ezInsertBlockFrame ($text, $textParameters)
 
 ezInsertFrame ($text, $textParameters)
 
 ezInsertLine ($params)
 
 eZPDFTable ($paper='a4', $orientation='portrait')
 Constructor. More...
 
 ezPrvtTableDrawLines ($pos, $gap, $x0, $x1, $y0, $y1, $y2, $col, $inner, $outer, $opt=1)
 
 ezTable (&$data, $cols='', $title='', $options='')
 
 ezText ($text, $size=0, $options=array(), $test=0)
 Function overriding the default ezText function for doing preprocessing of text. More...
 
 ezWhatPageNumber ($pageNum, $identifier=false)
 
fixWhitespace (&$text)
 
 insertFrontpage ($params, $text)
 
 insertTextBox ($params, $text)
 
 insertTextFrame ($params, $text)
 
 insertTOC ($sizeArray=array(20, 18, 16, 14, 12), $indentArray=array(0, 4, 6, 8, 10), $dots=true, $contentText= '', $level=3)
 
 outputDocSpecification ()
 Loop through all document specification settings and print specified text. More...
 
 popStack ()
 
 pushStack ($continous=true)
 
 setXOffset ($xOffset)
 
 setYOffset ($yOffset)
 
 xOffset ()
 Get the current X offset. More...
 
 yOffset ()
 Get the current Y offset. More...
 
- Public Member Functions inherited from Cezpdf
 alink ($info, $internal=0)
 
 Cezpdf ($paper= 'a4', $orientation= 'portrait')
 
 execTemplate ($id, $data=array(), $options=array())
 
 ezColumnsStart ($options=array())
 
 ezColumnsStop ()
 
 ezGetCurrentPageNumber ()
 
 eZGetMaxWordWidth ($size, $text)
 
 ezImage ($image, $pad=5, $width=0, $resize= 'full', $just= 'center', $border= '')
 
 ezInsertMode ($status=1, $pageNum=1, $pos= 'before')
 
 ezNewPage ()
 
 ezOutput ($options=0)
 
 ezProcessText ($text)
 
 ezPRVTaddPageNumbers ()
 
 ezPRVTcleanUp ()
 
 ezPrvtGetTextWidth ($size, $text)
 
 ezPRVTpageNumberSearch ($lbl, &$tmp)
 
 ezPrvtTableColumnHeadings ($cols, $pos, $maxWidth, $height, $decender, $gap, $size, &$y, $optionsAll=array())
 
 ezPrvtTableDrawLines ($pos, $gap, $x0, $x1, $y0, $y1, $y2, $col, $inner, $outer, $opt=1)
 
 ezSetCmMargins ($top, $bottom, $left, $right)
 
 ezSetDy ($dy, $mod= '')
 
 ezSetMargins ($top, $bottom, $left, $right)
 
 ezSetY ($y)
 
 ezShadedRectangle ($x1, $y1, $width, $height, $col1, $col2, $direction= 'vertical')
 Draw a shaded rectangle. More...
 
 ezStartPageNumbers ($x, $y, $size, $pos= 'left', $pattern= '{PAGENUM}of{TOTALPAGENUM}', $num= '')
 
 ezStopPageNumbers ($stopTotal=0, $next=0, $i=0)
 
 ezStream ($options= '')
 
 ezText ($text, $size=0, $options=array(), $test=0)
 
 ezWhatPageNumber ($pageNum, $i=0)
 
 fontSize ()
 
 ilink ($info)
 
 justification ()
 
 leftMargin ($yOffset=false)
 
 lineHeight ($options=array())
 Get current line height. More...
 
 loadTemplate ($templateFile)
 
 rightMargin ($yOffset=false)
 
 setFontSize ($size)
 
 setJustification ($align)
 
 setLimitedLeftMargin ($startY, $stopY, $leftMargin)
 
 setLimitedRightMargin ($startY, $stopY, $rightMargin)
 
 strike ($info)
 
 uline ($info)
 
- Public Member Functions inherited from Cpdf
 addContent ($content)
 add content to the currently active object More...
 
 addDestination ($label, $style, $a=0, $b=0, $c=0)
 create a labelled destination within the document More...
 
 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 More...
 
 addInfo ($label, $value=0)
 add content to the documents info object More...
 
 addInternalLink ($label, $x0, $y0, $x1, $y1)
 add a link in the document to an internal destination (ie. More...
 
 addJpegFromFile ($img, $x, $y, $w=0, $h=0)
 add a JPEG image into the document, from a file More...
 
 addJpegImage_common (&$data, $x, $y, $w=0, $h=0, $imageWidth, $imageHeight, $channels=3)
 common code used by the two JPEG adding functions More...
 
 addLink ($url, $x0, $y0, $x1, $y1)
 functions which can be called to adjust or add to the document More...
 
 addMessage ($message)
 used to add messages for use in debugging More...
 
 addObject ($id, $options= 'add')
 after an object has been created, it wil only show if it has been added, using this function. More...
 
 addPngFromFile ($file, $x, $y, $w=0, $h=0)
 add a PNG image into the document, from a file this should work with remote files More...
 
 addText ($x, $y, $size, $text, $angle=0, $wordSpaceAdjust=0)
 add text to the document, at a specified location, size and angle on the page More...
 
 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. More...
 
 ARC4 ($text)
 ARC4 encrypt a text string. More...
 
 ARC4_init ($key='')
 initialize the ARC4 encryption More...
 
 checkAllHere ()
 should be used for internal checks, not implemented as yet More...
 
 closeObject ()
 close an object More...
 
 Cpdf ($pageSize=array(0, 0, 612, 792))
 
 currentFont ()
 Get current font. More...
 
 curve ($x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3)
 draw a bezier curve based on 4 control points More...
 
 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 More...
 
 encryptInit ($id)
 initialize the encryption for processing a particular object More...
 
 filledEllipse ($x0, $y0, $r1, $r2=0, $angle=0, $nSeg=8, $astart=0, $afinish=360)
 draw a filled ellipse More...
 
 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 More...
 
 filterText ($text)
 filter the text, this is applied to all text just before being inserted into the pdf document it escapes the various things that need to be escaped, and so on More...
 
 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. More...
 
 getFontDecender ($size=false)
 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 More...
 
 getFontHeight ($size=false)
 return the height in units of the current font in the given size More...
 
 getTextWidth ($size, $text)
 calculate how wide a given text string will be on a page, at a given size. More...
 
 line ($x1, $y1, $x2, $y2)
 draw a line from one set of coordinates to another More...
 
 md5_16 ($string)
 ARC4 functions A series of function to implement ARC4 encoding in PHP. More...
 
 newDocument ($pageSize=array(0, 0, 612, 792))
 intialize a new document if this is called on an existing document results may be unpredictable, but the existing document would be lost at minimum this function is called automatically by the constructor function More...
 
 newPage ($insert=0, $id=0, $pos= 'after')
 add a new page to the document this also makes the new page the current active object More...
 
 o_action ($id, $action, $options= '')
 an action object, used to link to URLS initially More...
 
 o_annotation ($id, $action, $options= '')
 an annotation object, this will add an annotation to the current page. More...
 
 o_catalog ($id, $action, $options= '')
 define the document catalog, the overall controller for the document More...
 
 o_contents ($id, $action, $options='')
 the contents objects hold all of the content which appears on pages More...
 
 o_destination ($id, $action, $options= '')
 Document object methods (internal use only) More...
 
 o_encryption ($id, $action, $options='')
 encryption object. More...
 
 o_font ($id, $action, $options= '')
 an object to hold the font description More...
 
 o_fontDescriptor ($id, $action, $options= '')
 a font descriptor, needed for including additional fonts More...
 
 o_fontEncoding ($id, $action, $options= '')
 the font encoding More...
 
 o_function ($id, $action, $options= '')
 Add object to hold Function properties Only partial support for type 0, 3 and 4. More...
 
 o_image ($id, $action, $options='')
 an image object, will be an XObject in the document, includes description and data More...
 
 o_info ($id, $action, $options= '')
 define the document information More...
 
 o_outlines ($id, $action, $options= '')
 define the outlines in the doc, empty for now More...
 
 o_page ($id, $action, $options='')
 a page object, it also creates a contents object to hold its contents More...
 
 o_pages ($id, $action, $options= '')
 object which is a parent to the pages in the document More...
 
 o_pattern ($id, $action, $options= '')
 Add object to hold pattern properties. More...
 
 o_procset ($id, $action, $options= '')
 the document procset, solves some problems with printing to old PS printers More...
 
 o_shading ($id, $action, $options= '')
 Add object to hold shading properties. More...
 
 o_viewerPreferences ($id, $action, $options= '')
 set the viewer preferences More...
 
 openFont ($font)
 open the font file and return a php structure containing it. More...
 
 openHere ($style, $a=0, $b=0, $c=0)
 specify where the document should open when it first starts More...
 
 openObject ()
 make a loose object, the output will go into this object, until it is closed, then will revert to the current one. More...
 
 output ($debug=0)
 return the pdf stream as a string returned from the function More...
 
 partEllipse ($x0, $y0, $astart, $afinish, $r1, $r2=0, $angle=0, $nSeg=8)
 draw a part of an ellipse More...
 
 polygon ($p, $np, $f=0)
 draw a polygon, the syntax for this is similar to the GD polygon command More...
 
 popTextState ()
 
 PRVT_getBytes (&$data, $pos, $num)
 extract an integer from a position in a byte stream More...
 
 PRVTadjustWrapText ($text, $actual, $width, &$x, &$adjust, $justification)
 do a part of the calculation for sorting out the justification of the text More...
 
 PRVTcheckTextDirective (&$text, $i, &$f, $final=0)
 wrapper function for PRVTcheckTextDirective1 More...
 
 PRVTcheckTextDirective1 (&$text, $i, &$f, $final, &$x, &$y, $size=0, $angle=0, $wordSpaceAdjust=0)
 checks if the text stream contains a control directive if so then makes some changes and returns the number of characters involved in the directive this has been re-worked to include everything neccesary to fins the current writing point, so that the location can be sent to the callback function if required if the directive does not require a font change, then $f should be set to 0 More...
 
 PRVTgetTextPosition ($x, $y, $angle, $size, $wa, $text)
 given a start position and information about how text is to be laid out, calculate where on the page the text will end More...
 
 pushTextState ($newState)
 
 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 More...
 
 reopenObject ($id)
 open an existing object for editing More...
 
 restoreState ($pageEnd=0)
 restore a previously saved state More...
 
 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 More...
 
 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. More...
 
 setColor ($cmykArray, $force=0)
 
 setColorRGB ($r, $g, $b, $force=0)
 sets the colour for fill operations More...
 
 setCurrentFont ()
 sets up the current font, based on the font families, and the current text state note that this system is quite flexible, a font can be completely different to a font, and even will have to be defined within the family to have meaning This function is to be called whenever the currentTextState is changed, it will update the currentFont setting to whatever the appropriatte family one is. More...
 
 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. More...
 
 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. More...
 
 setLineStyle ($width=1, $cap= '', $join= '', $dash= '', $phase=0)
 this sets the line drawing style. More...
 
 setPreferences ($label, $value=0)
 set the viewer preferences of the document, it is up to the browser to obey these. More...
 
 setStrokeColor ($cmykArray, $force=0)
 
 setStrokeColorRGB ($r, $g, $b, $force=0)
 sets the colour for stroke operations More...
 
 shadedRectangle ($x1, $y1, $width, $height, $options)
 Create shaded rectangle area. More...
 
 stopObject ($id)
 stop an object from appearing on pages from this point on More...
 
 stream ($options= '')
 output the pdf code, streaming it to the browser the relevant headers are set so that hopefully the browser will recognise it More...
 
 transaction ($action)
 a few functions which should allow the document to be treated transactionally. More...
 

Public Attributes

 $DocSpecification
 
 $DocSpecStack = array()
 
 $ezFrame
 
 $FrontpageID
 
 $KeywordArray
 
 $PageCounter
 
 $PreStack
 
 $TOC
 
const HEADER_LEVEL = '#level'
 
const HEADER_LEVEL_INDEX = '#indexLevel'
 
const NEWLINE = '<C:callNewLine>'
 
const PAGENUM = '#page'
 
const SPACE = '<C:callSpace>'
 
const TAB = '<C:callTab>'
 
const TOTAL_PAGENUM = '#total'
 
- Public Attributes inherited from Cezpdf
 $ez =array('fontSize'=>10)
 
 $ezPageCount =0
 
 $ezPages =array()
 
 $LeftMarginArray = array()
 
 $RightMarginArray = array()
 
 $y
 
- Public Attributes inherited from Cpdf
 $addLooseObjects = array()
 array contains infomation about how the loose objects are to be added to the document More...
 
 $arc4 = ''
 the ancryption array for the document encryption is stored here More...
 
 $arc4_objnum = 0
 the object Id of the encryption information More...
 
 $callback = array()
 array which forms a stack to keep track of nested callback functions More...
 
 $catalogId
 the objectId (number within the objects array) of the document catalog More...
 
 $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. More...
 
 $currentBaseFont = ''
 the current base font More...
 
 $currentColour
 current colour for fill operations, defaults to inactive value, all three components should be between 0 and 1 inclusive when active More...
 
 $currentContents
 object number of the currently active contents block More...
 
 $currentFont = ''
 a record of the current font More...
 
 $currentFontNum = 0
 the number of the current font within the font array More...
 
 $currentLineStyle = ''
 current style that lines are drawn in More...
 
 $currentNode
 
 $currentPage
 object number of the current page More...
 
 $currentStrokeColour
 current colour for stroke operations (lines etc.) More...
 
 $currentTextState = ''
 track if the current font is bolded or italicised More...
 
 $destinations = array()
 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 More...
 
 $encrypted = 0
 a flag to say if a document is to be encrypted or not More...
 
 $encryptionKey = ''
 the ancryption key for the encryption of all the document content (structure is not encrypted) More...
 
 $fileIdentifier = ''
 the file identifier, used to uniquely identify a pdf document More...
 
 $firstPageId
 the objectId of the first page of the document More...
 
 $fontFamilies = array()
 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. More...
 
 $fonts = array()
 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 More...
 
 $infoObject = 0
 the objectId of the information object for the document this contains authorship, title etc. More...
 
 $looseObjects = array()
 an array which contains information about the objects which are not firmly attached to pages these have been added with the addObject function More...
 
 $messages = ''
 messages are stored here during processing, these can be selected afterwards to give some useful debug information More...
 
 $nCallback = 0
 the number of callback functions in the callback array More...
 
 $nStack = 0
 number of elements within the object Id storage stack More...
 
 $nStateStack = 0
 number of elements within the state stack More...
 
 $numFonts = 0
 number of fonts within the system More...
 
 $numImages = 0
 number of images being tracked within the document More...
 
 $numObj = 0
 the current number of pdf objects in the document More...
 
 $numPages = 0
 number of page objects within the document More...
 
 $objects = array()
 this array contains all of the pdf objects, ready for final assembly More...
 
 $options = array( 'compression' => 1 )
 an array containing options about the document it defaults to turning on the compression of the objects More...
 
 $procsetObjectId
 the object Id of the procset object More...
 
 $stack = array()
 object Id storage stack More...
 
 $stateStack = array()
 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 More...
 
 $textStateStack = array( '' )
 
 $wordSpaceAdjust = 0
 used to track the last used value of the inter-word spacing, this is so that it is known when the spacing is changed. More...
 

Private Member Functions

 eZCalculateColumnWidth ($columnWidthArray, $options, $marginWidth, $minWidthArray, $totalWidth, $fixedSizeArray=array())
 
 fixupTableCellText ($text)
 
 headerIndex ($page, $level)
 
 headerLabel ($page, $level)
 
 initFrameMargins ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Cpdf
 compareCMYK ($cmykArray1, $cmykArray2)
 

Detailed Description

eZPDFTable adds extra support for tables

Member Function Documentation

eZPDFTable::addDocSpecFunction (   $functionName,
  $parameters 
)

Function for adding function to doc specification.

param - text to add

Referenced by callBlockFrame(), callFrame(), callFrontpage(), callLine(), callTable(), callTextBox(), and callTextFrame().

eZPDFTable::addDocSpecification (   $text)

Function for adding text to doc specification.

param - text to add

Referenced by ezText().

eZPDFTable::addToPreStack (   $options = array())

function for adding font specification to PreStack array

Possible $options setting:

  • justification
  • fontSize
  • fontName

Referenced by callFont(), callHeader(), and callText().

eZPDFTable::callAnchor (   $info)

Callback function to set anchor.

eZPDFTable::callBlockFrame (   $params,
  $text 
)

Function for adding footer definition to PDF document. creates call on stack for ezInsertFooter

Parameters
parametersinside ezGroup Tags
eZPDFTable::callCircle (   $info)

Draw filled circle

eZPDFTable::callDrawLine (   $info)

Draw line on current page in PDF document

eZPDFTable::callFilledRectangle (   $info)

Function for drawing filled rectangle in document

Parameters
params
eZPDFTable::callFont (   $params)

Callback function to set font.

eZPDFTable::callFrame (   $params,
  $text 
)

Function for adding footer definition to PDF document. creates call on stack for ezInsertFooter

Parameters
parametersinside ezGroup Tags
eZPDFTable::callFrameLine (   $info)

Draw line related to a frame.

eZPDFTable::callFrameMargins (   $info)

Function for setting frame margins. Frames are used to define for example footer and header areas

Parameters
info,standardezpdf callback function
eZPDFTable::callFrontpage (   $params,
  $text 
)

Function for inserting frontpage into document. Called by ezGroup specification

Parameters
parameters
textin ezGroup
eZPDFTable::callHeader (   $params)

Callback function to set header.

eZPDFTable::callImage (   $info)

Function for insert image.

eZPDFTable::callIndex (   $info)
eZPDFTable::callInsertTOC (   $info)

function for inserting TOC

eZPDFTable::callKeyword (   $info)

function for inserting keyword

eZPDFTable::callLine (   $params,
  $text 
)

Add line to all pages

eZPDFTable::callNewPage (   $info)

Callback function for creating new page.

eZPDFTable::callRectangle (   $info)

Function for drawing rectangle in document

Parameters
parameters
eZPDFTable::callSetMargin (   $info)

Set new margins

eZPDFTable::callStartPageCounter (   $info)

Start page counter in PDF document

Parameters
counteridentifier
eZPDFTable::callTable (   $params,
  $text 
)

Function for generating table definition. Called by ezGroup specification

Parameters
parameters
textin ezGroup
eZPDFTable::callText (   $params)

Callback function for adding text.

eZPDFTable::callTextBox (   $params,
  $text 
)

Insert text at specified position

eZPDFTable::callTextFrame (   $params,
  $text 
)

Callback function for adding text frame.

eZPDFTable::callTOC (   $info)

Callback function for inserting TOC.

eZPDFTable::dots (   $info)
eZPDFTable::extractFunction ( $text,
  $offSet,
$functionName,
$parameters,
  $type = 'ezCall' 
)

Function for extracting function name and parameters from text.

Parameters
text
offset
functionname (reference)
parametersarray (reference)
Returns
end offset of function

Referenced by ezText().

eZPDFTable::extractParameters ( $text,
  $offSet,
$parameters,
  $skipFirstChar = false 
)

Function for extracting parameters from : separated key:value list callback functions.

Parameters
text
offset
parametersarray (reference)
Returns
end offset of function

Referenced by callCircle(), callDrawLine(), callFilledRectangle(), callFrameLine(), callFrameMargins(), callImage(), callRectangle(), callSetMargin(), callStartPageCounter(), callTable(), callTOC(), and extractFunction().

eZPDFTable::eZCalculateColumnWidth (   $columnWidthArray,
  $options,
  $marginWidth,
  $minWidthArray,
  $totalWidth,
  $fixedSizeArray = array() 
)
private

Calculate Table column widths

Parameters
ColumnWidthArray
Tableoptions
TotalWidth
MarginWidth
minimumTable width Array
Positionarray ( for private use only ).
Returns
Array of fixed column sizes ( returned )

Referenced by ezTable().

eZPDFTable::ezInsertBlockFrame (   $text,
  $textParameters 
)

Insert footer/header into PDF document

Parameters
text
textparameters
eZPDFTable::ezInsertFrame (   $text,
  $textParameters 
)

Insert footer/header into PDF document

Parameters
text
textparameters
eZPDFTable::ezInsertLine (   $params)

Insert line onto every page

Parameters
lineparameters
eZPDFTable::eZPDFTable (   $paper = 'a4',
  $orientation = 'portrait' 
)

Constructor.

This class is only used to encapsulate a table.

eZPDFTable::ezPrvtTableDrawLines (   $pos,
  $gap,
  $x0,
  $x1,
  $y0,
  $y1,
  $y2,
  $col,
  $inner,
  $outer,
  $opt = 1 
)
eZPDFTable::ezTable ( $data,
  $cols = '',
  $title = '',
  $options = '' 
)

add a table of information to the pdf document $data is a two dimensional array $cols (optional) is an associative array, the keys are the names of the columns from $data to be presented (and in that order), the values are the titles to be given to the columns $title (optional) is the title to be put on the top of the table

$options is an associative array which can contain: 'cellData' => array( <coord> => array( 'size' => array( <width>, <height>), 'justification' => <left|right|center> ), <coord>....) All non specified coords will be threated with default settings. Coord is text, offset 0, ex: '5,6' Coord 'x,0' is table header 'showLines'=> 0,1,2, default is 1 (show outside and top lines only), 2=> lines on each row 'showHeadings' => 0 or 1 'repeatTableHeader' => 0 or 1, if set to 1, the table header will be repeated when a table stretches over multiple pages. ( default 0 ) 'shaded'=> 0,1,2,3 default is 1 (1->alternate lines are shaded, 0->no shading, 2-> both shaded, second uses shadeCol2) 'shadeCol' => (CMYK) array, defining the colour of the shading 'shadeCol2' => (CMYK) array, defining the colour of the shading of the other blocks 'fontSize' => 10 'textCol' => (CMYK) array, text colour 'titleFontSize' => 12 'rowGap' => 2 , the space added at the top and bottom of each row, between the text and the lines 'colGap' => 5 , the space on the left and right sides of each cell 'lineCol' => (r,g,b) array, defining the colour of the lines, default, black. 'xPos' => 'left','right','center','centre',or coordinate, reference coordinate in the x-direction 'xOrientation' => 'left','right','center','centre', position of the table w.r.t 'xPos' 'width'=> <number> which will specify the width of the table, if it turns out to not be this wide, then it will stretch the table to fit, if it is wider then each cell will be made proportionalty smaller, and the content may have to wrap. 'maxWidth'=> <number> similar to 'width', but will only make table smaller than it wants to be 'options' => array(<colname>=>array('justification'=>'left','width'=>100,'link'=>linkDataName),<colname>=>....) allow the setting of other paramaters for the individual columns 'minRowSpace'=> the minimum space between the bottom of each row and the bottom margin, in which a new row will be started if it is less, then a new page would be started, default=-100 'innerLineThickness'=>1 'outerLineThickness'=>1 'splitRows'=>0, 0 or 1, whether or not to allow the rows to be split across page boundaries 'protectRows'=>number, the number of rows to hold with the heading on page, ie, if there less than this number of rows on the page, then move the whole lot onto the next page, default=1

note that the user will have had to make a font selection already or this will not produce a valid pdf file.

eZPDFTable::ezText (   $text,
  $size = 0,
  $options = array(),
  $test = 0 
)

Function overriding the default ezText function for doing preprocessing of text.

Referenced by ezInsertBlockFrame(), and insertTextBox().

eZPDFTable::ezWhatPageNumber (   $pageNum,
  $identifier = false 
)
Parameters
realpage number
pagecounteridentifier

Referenced by callInsertTOC(), callKeyword(), ezInsertBlockFrame(), and ezInsertFrame().

eZPDFTable::fixupTableCellText (   $text)
private

Fixup table cell text. Removes ezCall tags, and first C:callNewLine if they exists.

Parameters
text
Returns
text without ezgroup/ezcall tags

Referenced by ezTable().

& eZPDFTable::fixWhitespace ( $text)
eZPDFTable::headerIndex (   $page,
  $level 
)
private

Get header label of content on specified page and specified level

Parameters
currentpage
level

Referenced by ezInsertBlockFrame(), and ezInsertFrame().

eZPDFTable::headerLabel (   $page,
  $level 
)
private

Get header label of content on specified page and specified level

Parameters
currentpage
level

Referenced by ezInsertBlockFrame(), and ezInsertFrame().

eZPDFTable::initFrameMargins ( )
private

Initialize footer and header frame margins. Called by constructor

Referenced by eZPDFTable().

eZPDFTable::insertFrontpage (   $params,
  $text 
)

Insert front page

eZPDFTable::insertTextBox (   $params,
  $text 
)
eZPDFTable::insertTextFrame (   $params,
  $text 
)

Callback function for adding text frame.

eZPDFTable::insertTOC (   $sizeArray = array( 20, 18, 16, 14, 12 ),
  $indentArray = array( 0, 4, 6, 8, 10 ),
  $dots = true,
  $contentText = '',
  $level = 3 
)

Create Table Of Contents (TOC)

Parameters
sizearray, element 0 define size of header level 1, etc.
indent,element0 define indent of header level 1, etc.
dots,iftrue, generate dots between name and pagenumber
contenttext
level,howmany header levels to generate toc form

Referenced by callTOC().

eZPDFTable::outputDocSpecification ( )

Loop through all document specification settings and print specified text.

Returns
new Y offset

Referenced by ezText().

eZPDFTable::popStack ( )

Pop Specification stack.

Referenced by ezInsertBlockFrame(), and insertTextBox().

eZPDFTable::pushStack (   $continous = true)

Add and build Stack for function calls and document specification Stack

Parameters
countinuestext, set to false to insert independent frames. DEfault true

Referenced by ezInsertBlockFrame(), eZPDFTable(), and insertTextBox().

eZPDFTable::setXOffset (   $xOffset)
eZPDFTable::setYOffset (   $yOffset)
eZPDFTable::xOffset ( )

Get the current X offset.

Referenced by callCircle(), callSetMargin(), insertTextFrame(), and pushStack().

eZPDFTable::yOffset ( )

Member Data Documentation

eZPDFTable::$DocSpecification
eZPDFTable::$DocSpecStack = array()
eZPDFTable::$ezFrame
eZPDFTable::$FrontpageID
eZPDFTable::$KeywordArray
eZPDFTable::$PageCounter
eZPDFTable::$PreStack
eZPDFTable::$TOC
const eZPDFTable::HEADER_LEVEL = '#level'
const eZPDFTable::HEADER_LEVEL_INDEX = '#indexLevel'
const eZPDFTable::NEWLINE = '<C:callNewLine>'
const eZPDFTable::PAGENUM = '#page'
const eZPDFTable::SPACE = '<C:callSpace>'
const eZPDFTable::TAB = '<C:callTab>'
const eZPDFTable::TOTAL_PAGENUM = '#total'

The documentation for this class was generated from the following file: