eZ Publish  [4.2]
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 39 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 2809 of file class.ezpdftable.php.

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

eZPDFTable::addDocSpecification ( text)

Function for adding text to doc specification.

param - text to add

Definition at line 2796 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 2828 of file class.ezpdftable.php.

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

eZPDFTable::callAnchor ( info)

Callback function to set anchor.

Definition at line 1111 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 1899 of file class.ezpdftable.php.

eZPDFTable::callCircle ( info)

Draw filled circle

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

eZPDFTable::callDrawLine ( info)

Draw line on current page in PDF document

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

eZPDFTable::callFilledRectangle ( info)

Function for drawing filled rectangle in document

Parameters:
params

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

eZPDFTable::callFont ( params)

Callback function to set font.

Definition at line 1503 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 1913 of file class.ezpdftable.php.

eZPDFTable::callFrameLine ( info)

Draw line related to a frame.

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

eZPDFTable::callFrameMargins ( info)

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

Parameters:
info,standardezpdf callback function

Definition at line 1946 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 2222 of file class.ezpdftable.php.

eZPDFTable::callHeader ( params)

Callback function to set header.

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

eZPDFTable::callImage ( info)

Function for insert image.

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

eZPDFTable::callIndex ( info)

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

eZPDFTable::callInsertTOC ( info)

function for inserting TOC

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

eZPDFTable::callKeyword ( info)

function for inserting keyword

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

eZPDFTable::callLine ( params,
text 
)

Add line to all pages

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

eZPDFTable::callNewPage ( info)

Callback function for creating new page.

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

eZPDFTable::callRectangle ( info)

Function for drawing rectangle in document

Parameters:
parameters

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

eZPDFTable::callSetMargin ( info)

Set new margins

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

eZPDFTable::callStartPageCounter ( info)

Start page counter in PDF document

Parameters:
counteridentifier

Definition at line 2930 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 2269 of file class.ezpdftable.php.

eZPDFTable::callText ( params)

Callback function for adding text.

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

eZPDFTable::callTextBox ( params,
text 
)

Insert text at specified position

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

eZPDFTable::callTextFrame ( params,
text 
)

Callback function for adding text frame.

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

eZPDFTable::callTOC ( info)

Callback function for inserting TOC.

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

eZPDFTable::dots ( info)

Definition at line 1483 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 2442 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 2465 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 1035 of file class.ezpdftable.php.

Referenced by ezTable().

eZPDFTable::ezInsertBlockFrame ( text,
textParameters 
)

Insert footer/header into PDF document

Parameters:
text
textparameters

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

eZPDFTable::ezInsertFrame ( text,
textParameters 
)

Insert footer/header into PDF document

Parameters:
text
textparameters

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

eZPDFTable::ezInsertLine ( params)

Insert line onto every page

Parameters:
lineparameters

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

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

Constructor.

This class is only used to encapsulate a table.

Definition at line 53 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 1081 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 174 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 1553 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 2958 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 1643 of file class.ezpdftable.php.

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

Definition at line 3012 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 2982 of file class.ezpdftable.php.

Referenced by ezInsertBlockFrame(), and ezInsertFrame().

eZPDFTable::initFrameMargins ( ) [private]

Initialize footer and header frame margins. Called by constructor

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

Referenced by eZPDFTable().

eZPDFTable::insertFrontpage ( params,
text 
)

Insert front page

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

eZPDFTable::insertTextBox ( params,
text 
)

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

eZPDFTable::insertTextFrame ( params,
text 
)

Callback function for adding text frame.

Definition at line 2579 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 1441 of file class.ezpdftable.php.

Referenced by callTOC().

eZPDFTable::outputDocSpecification ( )

Loop through all document specification settings and print specified text.

Returns:
new Y offset

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

Referenced by ezText().

eZPDFTable::popStack ( )

Pop Specification stack.

Definition at line 2769 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 2737 of file class.ezpdftable.php.

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

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

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

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

eZPDFTable::xOffset ( )

Get the current X offset.

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

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

eZPDFTable::yOffset ( )

Member Data Documentation

eZPDFTable::$DocSpecification

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

eZPDFTable::$DocSpecStack = array()

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

eZPDFTable::$ezFrame

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

eZPDFTable::$FrontpageID

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

eZPDFTable::$KeywordArray

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

eZPDFTable::$PageCounter

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

eZPDFTable::$PreStack

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

eZPDFTable::$TOC

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

const eZPDFTable::HEADER_LEVEL = '#level'

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

const eZPDFTable::HEADER_LEVEL_INDEX = '#indexLevel'

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

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

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

const eZPDFTable::PAGENUM = '#page'

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

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

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

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

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

const eZPDFTable::TOTAL_PAGENUM = '#total'

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


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