eZ Publish  [trunk]
eZPDFTable Class Reference

eZPDFTable adds extra support for tables More...

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

List of all members.

Public Member Functions

 addDocSpecFunction ($functionName, $parameters)
 Function for adding function to doc specification.
 addDocSpecification ($text)
 Function for adding text to doc specification.
 addToPreStack ($options=array())
 function for adding font specification to PreStack array
 callAnchor ($info)
 Callback function to set anchor.
 callBlockFrame ($params, $text)
 callCircle ($info)
 callDrawLine ($info)
 callFilledRectangle ($info)
 callFont ($params)
 Callback function to set font.
 callFrame ($params, $text)
 callFrameLine ($info)
 callFrameMargins ($info)
 callFrontpage ($params, $text)
 callHeader ($params)
 Callback function to set header.
 callImage ($info)
 Function for insert image.
 callIndex ($info)
 callInsertTOC ($info)
 function for inserting TOC
 callKeyword ($info)
 function for inserting keyword
 callLine ($params, $text)
 callNewPage ($info)
 Callback function for creating new page.
 callRectangle ($info)
 callSetMargin ($info)
 callStartPageCounter ($info)
 callTable ($params, $text)
 callText ($params)
 Callback function for adding text.
 callTextBox ($params, $text)
 callTextFrame ($params, $text)
 callTOC ($info)
 Callback function for inserting TOC.
 dots ($info)
 extractFunction (&$text, $offSet, &$functionName, &$parameters, $type='ezCall')
 Function for extracting function name and parameters from text.
 extractParameters (&$text, $offSet, &$parameters, $skipFirstChar=false)
 Function for extracting parameters from : separated key:value list callback functions.
 ezInsertBlockFrame ($text, $textParameters)
 ezInsertFrame ($text, $textParameters)
 ezInsertLine ($params)
 eZPDFTable ($paper='a4', $orientation='portrait')
 Constructor.
 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.
 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.
 popStack ()
 pushStack ($continous=true)
 setXOffset ($xOffset)
 setYOffset ($yOffset)
 xOffset ()
 Get the current X offset.
 yOffset ()
 Get the current Y offset.

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'

Private Member Functions

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

Detailed Description

eZPDFTable adds extra support for tables

Definition at line 17 of file class.ezpdftable.php.


Member Function Documentation

eZPDFTable::addDocSpecFunction ( functionName,
parameters 
)

Function for adding function to doc specification.

param - text to add

Definition at line 2785 of file class.ezpdftable.php.

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

Function for adding text to doc specification.

param - text to add

Definition at line 2772 of file class.ezpdftable.php.

Referenced by ezText().

eZPDFTable::addToPreStack ( options = array())

function for adding font specification to PreStack array

Possible $options setting:

  • justification
  • fontSize
  • fontName

Definition at line 2804 of file class.ezpdftable.php.

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

Callback function to set anchor.

Definition at line 1089 of file class.ezpdftable.php.

eZPDFTable::callBlockFrame ( params,
text 
)

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

Parameters:
parametersinside ezGroup Tags

Definition at line 1875 of file class.ezpdftable.php.

Draw filled circle

Definition at line 1776 of file class.ezpdftable.php.

Draw line on current page in PDF document

Definition at line 1908 of file class.ezpdftable.php.

Function for drawing filled rectangle in document

Parameters:
params

Definition at line 1848 of file class.ezpdftable.php.

eZPDFTable::callFont ( params)

Callback function to set font.

Definition at line 1479 of file class.ezpdftable.php.

eZPDFTable::callFrame ( params,
text 
)

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

Parameters:
parametersinside ezGroup Tags

Definition at line 1889 of file class.ezpdftable.php.

Draw line related to a frame.

Definition at line 2853 of file class.ezpdftable.php.

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

Parameters:
info,standardezpdf callback function

Definition at line 1922 of file class.ezpdftable.php.

eZPDFTable::callFrontpage ( params,
text 
)

Function for inserting frontpage into document. Called by ezGroup specification

Parameters:
parameters
textin ezGroup

Definition at line 2198 of file class.ezpdftable.php.

eZPDFTable::callHeader ( params)

Callback function to set header.

Definition at line 1099 of file class.ezpdftable.php.

eZPDFTable::callImage ( info)

Function for insert image.

Definition at line 1129 of file class.ezpdftable.php.

eZPDFTable::callIndex ( info)

Definition at line 1376 of file class.ezpdftable.php.

function for inserting TOC

Definition at line 1334 of file class.ezpdftable.php.

function for inserting keyword

Definition at line 1310 of file class.ezpdftable.php.

eZPDFTable::callLine ( params,
text 
)

Add line to all pages

Definition at line 1900 of file class.ezpdftable.php.

Callback function for creating new page.

Definition at line 1371 of file class.ezpdftable.php.

Function for drawing rectangle in document

Parameters:
parameters

Definition at line 1631 of file class.ezpdftable.php.

Set new margins

Definition at line 1713 of file class.ezpdftable.php.

Start page counter in PDF document

Parameters:
counteridentifier

Definition at line 2906 of file class.ezpdftable.php.

eZPDFTable::callTable ( params,
text 
)

Function for generating table definition. Called by ezGroup specification

Parameters:
parameters
textin ezGroup

Definition at line 2245 of file class.ezpdftable.php.

eZPDFTable::callText ( params)

Callback function for adding text.

Definition at line 2673 of file class.ezpdftable.php.

eZPDFTable::callTextBox ( params,
text 
)

Insert text at specified position

Definition at line 2518 of file class.ezpdftable.php.

eZPDFTable::callTextFrame ( params,
text 
)

Callback function for adding text frame.

Definition at line 2547 of file class.ezpdftable.php.

eZPDFTable::callTOC ( info)

Callback function for inserting TOC.

Definition at line 1354 of file class.ezpdftable.php.

eZPDFTable::dots ( info)

Definition at line 1459 of file class.ezpdftable.php.

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

Definition at line 2418 of file class.ezpdftable.php.

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

Definition at line 2441 of file class.ezpdftable.php.

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 )

Definition at line 1013 of file class.ezpdftable.php.

Referenced by ezTable().

eZPDFTable::ezInsertBlockFrame ( text,
textParameters 
)

Insert footer/header into PDF document

Parameters:
text
textparameters

Definition at line 1961 of file class.ezpdftable.php.

eZPDFTable::ezInsertFrame ( text,
textParameters 
)

Insert footer/header into PDF document

Parameters:
text
textparameters

Definition at line 2067 of file class.ezpdftable.php.

eZPDFTable::ezInsertLine ( params)

Insert line onto every page

Parameters:
lineparameters

Definition at line 1943 of file class.ezpdftable.php.

eZPDFTable::eZPDFTable ( paper = 'a4',
orientation = 'portrait' 
)

Constructor.

This class is only used to encapsulate a table.

Definition at line 31 of file class.ezpdftable.php.

eZPDFTable::ezPrvtTableDrawLines ( pos,
gap,
x0,
x1,
y0,
y1,
y2,
col,
inner,
outer,
opt = 1 
)

Reimplemented from Cezpdf.

Definition at line 1059 of file class.ezpdftable.php.

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.

Definition at line 152 of file class.ezpdftable.php.

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

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

Reimplemented from Cezpdf.

Definition at line 1529 of file class.ezpdftable.php.

Referenced by callIndex(), ezInsertBlockFrame(), insertFrontpage(), insertTextBox(), insertTOC(), and outputDocSpecification().

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

Reimplemented from Cezpdf.

Definition at line 2934 of file class.ezpdftable.php.

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

Definition at line 1619 of file class.ezpdftable.php.

Referenced by ezTable().

eZPDFTable::headerIndex ( page,
level 
) [private]

Get header label of content on specified page and specified level

Parameters:
currentpage
level

Definition at line 2988 of file class.ezpdftable.php.

Referenced by ezInsertBlockFrame(), and ezInsertFrame().

eZPDFTable::headerLabel ( page,
level 
) [private]

Get header label of content on specified page and specified level

Parameters:
currentpage
level

Definition at line 2958 of file class.ezpdftable.php.

Referenced by ezInsertBlockFrame(), and ezInsertFrame().

Initialize footer and header frame margins. Called by constructor

Definition at line 51 of file class.ezpdftable.php.

Referenced by eZPDFTable().

eZPDFTable::insertFrontpage ( params,
text 
)

Insert front page

Definition at line 2206 of file class.ezpdftable.php.

eZPDFTable::insertTextBox ( params,
text 
)

Definition at line 2523 of file class.ezpdftable.php.

eZPDFTable::insertTextFrame ( params,
text 
)

Callback function for adding text frame.

Definition at line 2555 of file class.ezpdftable.php.

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

Definition at line 1417 of file class.ezpdftable.php.

Referenced by callTOC().

Loop through all document specification settings and print specified text.

Returns:
new Y offset

Definition at line 2474 of file class.ezpdftable.php.

Referenced by ezText().

Pop Specification stack.

Definition at line 2745 of file class.ezpdftable.php.

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

Definition at line 2713 of file class.ezpdftable.php.

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

eZPDFTable::setYOffset ( yOffset)

Definition at line 91 of file class.ezpdftable.php.

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

Get the current X offset.

Definition at line 80 of file class.ezpdftable.php.

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


Member Data Documentation

eZPDFTable::$DocSpecification

Definition at line 3020 of file class.ezpdftable.php.

eZPDFTable::$DocSpecStack = array()

Definition at line 3023 of file class.ezpdftable.php.

eZPDFTable::$ezFrame

Definition at line 3016 of file class.ezpdftable.php.

eZPDFTable::$FrontpageID

Definition at line 3014 of file class.ezpdftable.php.

eZPDFTable::$KeywordArray

Definition at line 3011 of file class.ezpdftable.php.

eZPDFTable::$PageCounter

Definition at line 3012 of file class.ezpdftable.php.

eZPDFTable::$PreStack

Definition at line 3019 of file class.ezpdftable.php.

eZPDFTable::$TOC

Definition at line 3010 of file class.ezpdftable.php.

const eZPDFTable::HEADER_LEVEL = '#level'

Definition at line 25 of file class.ezpdftable.php.

const eZPDFTable::HEADER_LEVEL_INDEX = '#indexLevel'

Definition at line 26 of file class.ezpdftable.php.

const eZPDFTable::NEWLINE = '<C:callNewLine>'

Definition at line 19 of file class.ezpdftable.php.

const eZPDFTable::PAGENUM = '#page'

Definition at line 23 of file class.ezpdftable.php.

const eZPDFTable::SPACE = '<C:callSpace>'

Definition at line 20 of file class.ezpdftable.php.

const eZPDFTable::TAB = '<C:callTab>'

Definition at line 21 of file class.ezpdftable.php.

const eZPDFTable::TOTAL_PAGENUM = '#total'

Definition at line 24 of file class.ezpdftable.php.


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