|
eZ Publish
[trunk]
|
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 17 of file class.ezpdftable.php.
| 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().
| eZPDFTable::addDocSpecification | ( | $ | text | ) |
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:
Definition at line 2804 of file class.ezpdftable.php.
Referenced by callFont(), callHeader(), and callText().
| eZPDFTable::callAnchor | ( | $ | info | ) |
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 | inside ezGroup Tags |
Definition at line 1875 of file class.ezpdftable.php.
| eZPDFTable::callCircle | ( | $ | info | ) |
Draw filled circle
Definition at line 1776 of file class.ezpdftable.php.
| eZPDFTable::callDrawLine | ( | $ | info | ) |
Draw line on current page in PDF document
Definition at line 1908 of file class.ezpdftable.php.
| eZPDFTable::callFilledRectangle | ( | $ | info | ) |
Function for drawing filled rectangle in document
| 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 | inside ezGroup Tags |
Definition at line 1889 of file class.ezpdftable.php.
| eZPDFTable::callFrameLine | ( | $ | info | ) |
Draw line related to a frame.
Definition at line 2853 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 1922 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 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.
| eZPDFTable::callInsertTOC | ( | $ | info | ) |
function for inserting TOC
Definition at line 1334 of file class.ezpdftable.php.
| eZPDFTable::callKeyword | ( | $ | info | ) |
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.
| eZPDFTable::callNewPage | ( | $ | info | ) |
Callback function for creating new page.
Definition at line 1371 of file class.ezpdftable.php.
| eZPDFTable::callRectangle | ( | $ | info | ) |
Function for drawing rectangle in document
| parameters |
Definition at line 1631 of file class.ezpdftable.php.
| eZPDFTable::callSetMargin | ( | $ | info | ) |
Set new margins
Definition at line 1713 of file class.ezpdftable.php.
| eZPDFTable::callStartPageCounter | ( | $ | info | ) |
Start page counter in PDF document
| counter | identifier |
Definition at line 2906 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 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.
| text | |
| offset | |
| function | name (reference) |
| parameters | array (reference) |
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.
| text | |
| offset | |
| parameters | array (reference) |
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
| ColumnWidth | Array |
| Table | options |
| Total | Width |
| Margin | Width |
| minimum | Table width Array |
| Position | array ( for private use only ). |
Definition at line 1013 of file class.ezpdftable.php.
Referenced by ezTable().
| eZPDFTable::ezInsertBlockFrame | ( | $ | text, |
| $ | textParameters | ||
| ) |
Insert footer/header into PDF document
| text | |
| text | parameters |
Definition at line 1961 of file class.ezpdftable.php.
| eZPDFTable::ezInsertFrame | ( | $ | text, |
| $ | textParameters | ||
| ) |
Insert footer/header into PDF document
| text | |
| text | parameters |
Definition at line 2067 of file class.ezpdftable.php.
| eZPDFTable::ezInsertLine | ( | $ | params | ) |
Insert line onto every page
| line | parameters |
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 |
||
| ) |
| real | page number |
| pagecounter | identifier |
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.
| text |
Definition at line 1619 of file class.ezpdftable.php.
Referenced by ezTable().
| & eZPDFTable::fixWhitespace | ( | &$ | text | ) |
Definition at line 1514 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 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
| current | page |
| level |
Definition at line 2958 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 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)
| 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 1417 of file class.ezpdftable.php.
Referenced by callTOC().
Loop through all document specification settings and print specified text.
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
| countinues | text, 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::setXOffset | ( | $ | xOffset | ) |
Definition at line 96 of file class.ezpdftable.php.
Referenced by callSetMargin(), dots(), ezInsertBlockFrame(), ezTable(), insertFrontpage(), insertTextBox(), and popStack().
| 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().
Get the current Y offset.
Definition at line 72 of file class.ezpdftable.php.
Referenced by callAnchor(), callCircle(), callImage(), callInsertTOC(), callKeyword(), callRectangle(), callSetMargin(), insertTextFrame(), and pushStack().
| 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.