|
eZ Publish
[4.2]
|
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. | |
| 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 () | |
eZPDFTable adds extra support for tables
Definition at line 39 of file class.ezpdftable.php.
| 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:
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 | inside 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
| 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 | inside 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
| info,standard | ezpdf 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 | |
| text | in 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 |
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
| counter | identifier |
Definition at line 2930 of file class.ezpdftable.php.
| eZPDFTable::callTable | ( | $ | params, |
| $ | text | ||
| ) |
Function for generating table definition. Called by ezGroup specification
| parameters | |
| text | in 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.
| text | |
| offset | |
| function | name (reference) |
| parameters | array (reference) |
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.
| text | |
| offset | |
| parameters | array (reference) |
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
| ColumnWidth | Array |
| Table | options |
| Total | Width |
| Margin | Width |
| minimum | Table width Array |
| Position | array ( for private use only ). |
Definition at line 1035 of file class.ezpdftable.php.
Referenced by ezTable().
| eZPDFTable::ezInsertBlockFrame | ( | $ | text, |
| $ | textParameters | ||
| ) |
Insert footer/header into PDF document
| text | |
| text | parameters |
Definition at line 1985 of file class.ezpdftable.php.
| eZPDFTable::ezInsertFrame | ( | $ | text, |
| $ | textParameters | ||
| ) |
Insert footer/header into PDF document
| text | |
| text | parameters |
Definition at line 2091 of file class.ezpdftable.php.
| eZPDFTable::ezInsertLine | ( | $ | params | ) |
Insert line onto every page
| line | parameters |
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 |
||
| ) |
| real | page number |
| pagecounter | identifier |
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.
| text |
Definition at line 1643 of file class.ezpdftable.php.
Referenced by ezTable().
| & eZPDFTable::fixWhitespace | ( | &$ | text | ) |
Definition at line 1538 of file class.ezpdftable.php.
Referenced by callFrame(), callInsertTOC(), callKeyword(), ezTable(), ezText(), and insertFrontpage().
| eZPDFTable::headerIndex | ( | $ | page, |
| $ | level | ||
| ) | [private] |
Get header label of content on specified page and specified level
| current | page |
| 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
| current | page |
| 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)
| size | array, element 0 define size of header level 1, etc. |
| indent,element | 0 define indent of header level 1, etc. |
| dots,if | true, generate dots between name and pagenumber |
| content | text |
| level,how | many 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.
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
| countinues | text, 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 | ) |
Definition at line 118 of file class.ezpdftable.php.
Referenced by callSetMargin(), dots(), ezInsertBlockFrame(), ezTable(), insertFrontpage(), insertTextBox(), and popStack().
| 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 | ( | ) |
Get the current Y offset.
Definition at line 94 of file class.ezpdftable.php.
Referenced by callAnchor(), callCircle(), callImage(), callInsertTOC(), callKeyword(), callRectangle(), callSetMargin(), insertTextFrame(), and pushStack().
| 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.