Class

eZPDFTable

class eZPDFTable extends Cezpdf

Constants

NEWLINE

SPACE

TAB

PAGENUM

TOTAL_PAGENUM

HEADER_LEVEL

HEADER_LEVEL_INDEX

Properties

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

Methods

__construct(string $paper = 'a4', string $orientation = 'portrait')

Constructor

from Cezpdf
ezSetCmMargins($top, $bottom, $left, $right)

from Cezpdf
setFontSize($size)

from Cezpdf
setJustification($align)

from Cezpdf
justification()

from Cezpdf
fontSize()

from Cezpdf
ezColumnsStart($options = array())

from Cezpdf
ezColumnsStop()

from Cezpdf
ezInsertMode($status = 1, $pageNum = 1, $pos = 'before')

from Cezpdf
ezNewPage()

from Cezpdf
ezSetMargins($top, $bottom, $left, $right)

from Cezpdf
ezGetCurrentPageNumber()

from Cezpdf
ezStartPageNumbers($x, $y, $size, $pos = 'left', $pattern = '{PAGENUM} of {TOTALPAGENUM}', $num = '')

from Cezpdf
ezWhatPageNumber($pageNum, $identifier = false)

ezStopPageNumbers($stopTotal, $next, $i)

from Cezpdf
ezPRVTpageNumberSearch($lbl, $tmp)

from Cezpdf
ezPRVTaddPageNumbers()

from Cezpdf
ezPRVTcleanUp()

from Cezpdf
ezStream($options = '')

from Cezpdf
ezOutput($options)

from Cezpdf
ezSetY($y)

from Cezpdf
ezSetDy($dy, $mod = '')

from Cezpdf
ezPrvtTableDrawLines($pos, $gap, $x0, $x1, $y0, $y1, $y2, $col, $inner, $outer, $opt = 1)

ezPrvtTableColumnHeadings($cols, $pos, $maxWidth, $height, $decender, $gap, $size, $y, $optionsAll = array())

from Cezpdf
eZGetMaxWordWidth($size, $text)

from Cezpdf
ezPrvtGetTextWidth($size, $text)

from Cezpdf
ezShadedRectangle($x1, $y1, $width, $height, $col1, $col2, $direction = 'vertical')

Draw a shaded rectangle

from Cezpdf
ezProcessText($text)

from Cezpdf
ezText($text, $size, $options = array(), $test)

Function overriding the default ezText function for doing preprocessing of text

ezImage($image, $pad = 5, $width, $resize = 'full', $just = 'center', $border = '')

from Cezpdf
loadTemplate($templateFile)

from Cezpdf
execTemplate($id, $data = array(), $options = array())

from Cezpdf
ilink($info)

from Cezpdf
alink($info, $internal)

from Cezpdf
uline($info)

from Cezpdf
strike($info)

from Cezpdf
lineHeight($options = array())

Get current line height

from Cezpdf
rightMargin($yOffset = false)

from Cezpdf
leftMargin($yOffset = false)

from Cezpdf
setLimitedLeftMargin($startY, $stopY, $leftMargin)

from Cezpdf
setLimitedRightMargin($startY, $stopY, $rightMargin)

from Cezpdf
eZPDFTable(string $paper = 'a4', string $orientation = 'portrait')

Constructor

initFrameMargins()

yOffset()

Get the current Y offset

xOffset()

Get the current X offset

setYOffset($yOffset)

setXOffset($xOffset)

ezTable($data, $cols = '', $title = '', $options = '')

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

callAnchor($info)

Callback function to set anchor

callHeader($params)

Callback function to set header

callImage($info)

Function for insert image

callKeyword($info)

function for inserting keyword

callInsertTOC($info)

function for inserting TOC

callTOC($info)

Callback function for inserting TOC

callNewPage($info)

Callback function for creating new page

callIndex($info)

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

dots($info)

callFont($params)

Callback function to set font

fixWhitespace($text)

fixupTableCellText($text)

callRectangle($info)

callSetMargin($info)

callCircle($info)

callFilledRectangle($info)

callBlockFrame($params, $text)

callFrame($params, $text)

callLine($params, $text)

callDrawLine($info)

callFrameMargins($info)

ezInsertLine($params)

ezInsertBlockFrame($text, $textParameters)

ezInsertFrame($text, $textParameters)

callFrontpage($params, $text)

insertFrontpage($params, $text)

callTable($params, $text)

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

outputDocSpecification()

Loop through all document specification settings and print specified text

callTextBox($params, $text)

insertTextBox($params, $text)

callTextFrame($params, $text)

insertTextFrame($params, $text)

callText($params)

Callback function for adding text

pushStack($continous = true)

popStack()

addDocSpecification($text)

Function for adding text to doc specification

addDocSpecFunction($functionName, $parameters)

Function for adding function to doc specification

addToPreStack($options = array())

function for adding font specification to PreStack array

callFrameLine($info)

callStartPageCounter($info)

headerLabel($page, $level)

headerIndex($page, $level)

Details

in Cezpdf at line 33
public __construct(string $paper = 'a4', string $orientation = 'portrait')

Constructor

Parameters

string $paper
string $orientation

in Cezpdf at line 153
public ezSetCmMargins($top, $bottom, $left, $right)

Parameters

$top
$bottom
$left
$right

in Cezpdf at line 166
public setFontSize($size)

Parameters

$size

in Cezpdf at line 175
public setJustification($align)

Parameters

$align

in Cezpdf at line 184
public justification()

in Cezpdf at line 193
public fontSize()

in Cezpdf at line 200
public ezColumnsStart($options = array())

Parameters

$options

in Cezpdf at line 234
public ezColumnsStop()

in Cezpdf at line 246
public ezInsertMode($status = 1, $pageNum = 1, $pos = 'before')

Parameters

$status
$pageNum
$pos

in Cezpdf at line 266
public ezNewPage()

in Cezpdf at line 321
public ezSetMargins($top, $bottom, $left, $right)

Parameters

$top
$bottom
$left
$right

in Cezpdf at line 346
public ezGetCurrentPageNumber()

in Cezpdf at line 354
public ezStartPageNumbers($x, $y, $size, $pos = 'left', $pattern = '{PAGENUM} of {TOTALPAGENUM}', $num = '')

Parameters

$x
$y
$size
$pos
$pattern
$num

at line 2939
public ezWhatPageNumber($pageNum, $identifier = false)

Parameters

$pageNum
$identifier

in Cezpdf at line 423
public ezStopPageNumbers($stopTotal, $next, $i)

Parameters

$stopTotal
$next
$i

in Cezpdf at line 465
public ezPRVTpageNumberSearch($lbl, $tmp)

Parameters

$lbl
$tmp

in Cezpdf at line 489
public ezPRVTaddPageNumbers()

in Cezpdf at line 583
public ezPRVTcleanUp()

in Cezpdf at line 590
public ezStream($options = '')

Parameters

$options

in Cezpdf at line 598
public ezOutput($options)

Parameters

$options

in Cezpdf at line 606
public ezSetY($y)

Parameters

$y

in Cezpdf at line 620
public ezSetDy($dy, $mod = '')

Parameters

$dy
$mod

at line 1064
public ezPrvtTableDrawLines($pos, $gap, $x0, $x1, $y0, $y1, $y2, $col, $inner, $outer, $opt = 1)

Parameters

$pos
$gap
$x0
$x1
$y0
$y1
$y2
$col
$inner
$outer
$opt

in Cezpdf at line 683
public ezPrvtTableColumnHeadings($cols, $pos, $maxWidth, $height, $decender, $gap, $size, $y, $optionsAll = array())

Parameters

$cols
$pos
$maxWidth
$height
$decender
$gap
$size
$y
$optionsAll

in Cezpdf at line 768
public eZGetMaxWordWidth($size, $text)

Parameters

$size
$text

in Cezpdf at line 784
public ezPrvtGetTextWidth($size, $text)

Parameters

$size
$text

in Cezpdf at line 814
public ezShadedRectangle($x1, $y1, $width, $height, $col1, $col2, $direction = 'vertical')

Draw a shaded rectangle

direction is optional and set to vertical by default

\param x1
\param y1
\param width
\param height
\param col1
\param col2
\param direction ('vertical', 'horizontal', or angle)

Parameters

$x1
$y1
$width
$height
$col1
$col2
$direction

in Cezpdf at line 826
public ezProcessText($text)

Parameters

$text

at line 1534
public ezText($text, $size, $options = array(), $test)

Function overriding the default ezText function for doing preprocessing of text

Parameters

$text
$size
$options
$test

in Cezpdf at line 1026
public ezImage($image, $pad = 5, $width, $resize = 'full', $just = 'center', $border = '')

Parameters

$image
$pad
$width
$resize
$just
$border

in Cezpdf at line 1157
public loadTemplate($templateFile)

Parameters

$templateFile

in Cezpdf at line 1202
public execTemplate($id, $data = array(), $options = array())

Parameters

$id
$data
$options

Parameters

$info

Parameters

$info
$internal

in Cezpdf at line 1276
public uline($info)

Parameters

$info

in Cezpdf at line 1321
public strike($info)

Parameters

$info

in Cezpdf at line 1365
public lineHeight($options = array())

Get current line height

Parameters

$options

in Cezpdf at line 1398
public rightMargin($yOffset = false)

Parameters

$yOffset

in Cezpdf at line 1423
public leftMargin($yOffset = false)

Parameters

$yOffset

in Cezpdf at line 1452
public setLimitedLeftMargin($startY, $stopY, $leftMargin)

Parameters

$startY
$stopY
$leftMargin

in Cezpdf at line 1466
public setLimitedRightMargin($startY, $stopY, $rightMargin)

Parameters

$startY
$stopY
$rightMargin

at line 36
public eZPDFTable(string $paper = 'a4', string $orientation = 'portrait')

Constructor

This class is only used to encapsulate a table.

Parameters

string $paper
string $orientation

at line 56
public initFrameMargins()

at line 77
public yOffset()

Get the current Y offset

at line 85
public xOffset()

Get the current X offset

at line 96
public setYOffset($yOffset)

Parameters

$yOffset

at line 101
public setXOffset($xOffset)

Parameters

$xOffset

at line 157
public ezTable($data, $cols = '', $title = '', $options = '')

Parameters

$data
$cols
$title
$options

at line 1018
public eZCalculateColumnWidth($columnWidthArray, $options, $marginWidth, $minWidthArray, $totalWidth, $fixedSizeArray = array())

Parameters

$columnWidthArray
$options
$marginWidth
$minWidthArray
$totalWidth
$fixedSizeArray

at line 1094
public callAnchor($info)

Callback function to set anchor

Parameters

$info

at line 1104
public callHeader($params)

Callback function to set header

Parameters

$params

at line 1134
public callImage($info)

Function for insert image

Parameters

$info

at line 1315
public callKeyword($info)

function for inserting keyword

Parameters

$info

at line 1339
public callInsertTOC($info)

function for inserting TOC

Parameters

$info

at line 1359
public callTOC($info)

Callback function for inserting TOC

Parameters

$info

at line 1376
public callNewPage($info)

Callback function for creating new page

Parameters

$info

at line 1381
public callIndex($info)

Parameters

$info

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

Parameters

$sizeArray
$indentArray
$dots
$contentText
$level

at line 1464
public dots($info)

Parameters

$info

at line 1484
public callFont($params)

Callback function to set font

Parameters

$params

at line 1519
public fixWhitespace($text)

Parameters

$text

at line 1624
public fixupTableCellText($text)

Parameters

$text

at line 1636
public callRectangle($info)

Parameters

$info

at line 1718
public callSetMargin($info)

Parameters

$info

at line 1781
public callCircle($info)

Parameters

$info

at line 1853
public callFilledRectangle($info)

Parameters

$info

at line 1880
public callBlockFrame($params, $text)

Parameters

$params
$text

at line 1894
public callFrame($params, $text)

Parameters

$params
$text

at line 1905
public callLine($params, $text)

Parameters

$params
$text

at line 1913
public callDrawLine($info)

Parameters

$info

at line 1927
public callFrameMargins($info)

Parameters

$info

at line 1948
public ezInsertLine($params)

Parameters

$params

at line 1966
public ezInsertBlockFrame($text, $textParameters)

Parameters

$text
$textParameters

at line 2072
public ezInsertFrame($text, $textParameters)

Parameters

$text
$textParameters

at line 2203
public callFrontpage($params, $text)

Parameters

$params
$text

at line 2211
public insertFrontpage($params, $text)

Parameters

$params
$text

at line 2250
public callTable($params, $text)

Parameters

$params
$text

at line 2423
public extractFunction($text, $offSet, $functionName, $parameters, $type = 'ezCall')

Function for extracting function name and parameters from text.

\param text \param offset \param function name (reference) \param parameters array (reference)

\return end offset of function

Parameters

$text
$offSet
$functionName
$parameters
$type

at line 2446
public extractParameters($text, $offSet, $parameters, $skipFirstChar = false)

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

\param text \param offset \param parameters array (reference)

\return end offset of function

Parameters

$text
$offSet
$parameters
$skipFirstChar

at line 2479
public outputDocSpecification()

Loop through all document specification settings and print specified text

\return new Y offset

at line 2523
public callTextBox($params, $text)

Parameters

$params
$text

at line 2528
public insertTextBox($params, $text)

Parameters

$params
$text

at line 2552
public callTextFrame($params, $text)

Parameters

$params
$text

at line 2560
public insertTextFrame($params, $text)

Parameters

$params
$text

at line 2678
public callText($params)

Callback function for adding text

Parameters

$params

at line 2718
public pushStack($continous = true)

Parameters

$continous

at line 2750
public popStack()

at line 2777
public addDocSpecification($text)

Function for adding text to doc specification

param - text to add

Parameters

$text

at line 2790
public addDocSpecFunction($functionName, $parameters)

Function for adding function to doc specification

param - text to add

Parameters

$functionName
$parameters

at line 2809
public addToPreStack($options = array())

function for adding font specification to PreStack array

Possible $options setting: - justification - fontSize - fontName

Parameters

$options

at line 2858
public callFrameLine($info)

Parameters

$info

at line 2911
public callStartPageCounter($info)

Parameters

$info

at line 2963
public headerLabel($page, $level)

Parameters

$page
$level

at line 2993
public headerIndex($page, $level)

Parameters

$page
$level