Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /var/www/html/php_jh_pdf-1.1.0/class.jh_pdf_table-1.1.0.inc.php
php_jh_pdf -

jh_pdf_table

jh_pdf_base
   |
  +-- jh_pdf_table

Class for easy creation of tables in PDF documents

 

public class jh_pdf_table extends jh_pdf_base

Class for easy creation of tables in PDF documents
Somewhat simplifies the creation of table in PDF documents. All youhave to do is to set the coordinates and the width of the table andto define the columns. Cell contents are drawn via a documentedobject orientated interface, so classes for putting in your favouritecontents can easily be created.

 

Methods inherited from jh_pdf_base

setcolor

Public Method Summary

void

jh_pdf_table(float &$pdf, float &$ypos, float $firstxpos, float $lastxpos, mixed $lastypos, integer $defaultcolor)

Constructor
void

setheaderbgcolor(mixed $color)

Set the background color for the header
void

setbgcolors(array $colors)

Set the background colors for the rows
void

settopborderwidth(float $width)

Set the table's top border width
void

settopbordercolor(mixed $color)

Set the table's top border color
void

setafterheaderborderwidth(float $width)

Set the table's after-header border width
void

setafterheaderbordercolor(mixed $color)

Set the table's after-header border color
void

setbottomborderwidth(float $width)

Set the table's bottom border width
void

setbottombordercolor(mixed $color)

Set the table's bottom border color
void

setnewpagefunction( $func)

Set the end of page callback function
void

setcolspacingwidth(float $width)

Set the column spacing width
void

setcolspacingcolor(mixed $color)

Set the column spacing color
void

setrowspacingwidth(float $width)

Set the row spacing width
void

setrowspacingcolor(mixed $color)

Set the row spacing color
void

setverttableborderwidth(float $width)

Set the vertical table border width
void

setverttablebordercolor(mixed $color)

Set the vertical table border color
void

&addcolumn(string $heading, float $width, object [unknown] $headerjhpci, object [unknown] $normjhpci)

Add a column to the table
void

addrow(array $dataarray)

Put a row onto the PDF document
void

addcell(mixed $data)

Add a cell to the table
void

endtable()

Close the table on the current page

Private Method Summary

void

setdefaultcolparam()

Set built-in default column parameters
void

initialize()

Initialization stuff
void

drawcell(float $xpos, float $ypos, float $width, float $height, object cellparam $cellparam, $putdata)

Put a cell onto the PDF document
void

putheader()

Put the table header onto the PDF document
void

newpage()

Begin a new page
void

headerinitialize()

Warning: documentation is missing.

Private Field Summary

unknown

$pdf

unknown

$ypos

unknown

$firstypos

unknown

$width

unknown

$defaultcolor

unknown

$defaultcolparam

unknown

$colparam

unknown

$colspacingwidth

unknown

$colspacingcolor

unknown

$rowspacingwidth

unknown

$rowspacingcolor

unknown

$verttableborderwidth

unknown

$verttablebordercolor

unknown

$firstxpos

unknown

$lastypos

unknown

$linecount

unknown

$newpagefunction

unknown

$initialized

unknown

$headerinitialized

unknown

$hflowtext

unknown

$headerheight

unknown

$headerbgcolor

unknown

$bgcolors

unknown

$topborderwidth

unknown

$topbordercolor

unknown

$afterheaderborderwidth

unknown

$afterheaderbordercolor

unknown

$bottomborderwidth

unknown

$bottombordercolor

unknown

$hasheader

unknown

$rowbuffer

Public Method Details

jh_pdf_table

public void jh_pdf_table( float &$pdf, float &$ypos, float $firstxpos, float $lastxpos, mixed $lastypos, integer $defaultcolor )

  Constructor

Parameter
float &$pdf
Variable that stores the current
vertical position
float &$ypos
The left edge of the table
float $firstxpos
The right edge of the table
float $lastxpos
Last vertical position; if the
text block reaches beyond, the
new-page-function which is set
via setnewpagefunction() is
called
mixed $lastypos
The default foreground color
which will be used for elements
that have no color applied to
them
integer $defaultcolor
Warning: documentation is missing.
Returns void


setheaderbgcolor

public void setheaderbgcolor( mixed $color )

  Set the background color for the header
Sets the background color that is used for the header.

Parameter
mixed $color
The header background color
Returns void


setbgcolors

public void setbgcolors( array $colors )

  Set the background colors for the rows
Sets the background colors that are used for the rows. The colorsmust be passed as an array and the background colors will bealternating beginning with the first color in the arrayfor the first row an each page.

Parameter
array $colors
The colors for the table rows
Returns void


settopborderwidth

public void settopborderwidth( float $width )

  Set the table's top border width
Sets the width of the border which will be drawn on thebeginning of the table on each page.

Parameter
float $width
The width of the border in PDF pixels
Returns void


settopbordercolor

public void settopbordercolor( mixed $color )

  Set the table's top border color
Sets the color of the border which will be drawn on thebeginning of the table on each page.

Parameter
mixed $color
The color of the border
Returns void


setafterheaderborderwidth

public void setafterheaderborderwidth( float $width )

  Set the table's after-header border width
Sets the width of the border which will be drawn after thetable header on each page.

Parameter
float $width
The width of the border in PDF pixels
Returns void


setafterheaderbordercolor

public void setafterheaderbordercolor( mixed $color )

  Set the table's after-header border color
Sets the color of the border which will be drawn after thetable header on each page.

Parameter
mixed $color
The color of the border in PDF pixels
Returns void


setbottomborderwidth

public void setbottomborderwidth( float $width )

  Set the table's bottom border width
Sets the width of the border which will be drawn on theend of the table on each page.

Parameter
float $width
The width of the border in PDF pixels
Returns void


setbottombordercolor

public void setbottombordercolor( mixed $color )

  Set the table's bottom border color
Sets the color of the border which will be drawn on theend of the table on each page.

Parameter
mixed $color
The color of the border in PDF pixels
Returns void


setnewpagefunction

public void setnewpagefunction( $func )

  Set the end of page callback function
Sets a function which will be called when the end of thepage has been reached. It is entirely up to the this functionto put some final elements on the current page, create a newpage and put elements on it. The function must return thevertical position where the table should be continued.

Parameter
$func
Warning: documentation is missing.
Returns void


setcolspacingwidth

public void setcolspacingwidth( float $width )

  Set the column spacing width
Sets the width of a border which will be drawn betweenall the columns.

Parameter
float $width
The width of the inter-column border
Returns void


setcolspacingcolor

public void setcolspacingcolor( mixed $color )

  Set the column spacing color
Sets the color of a border which will be drawn betweenall the columns.

Parameter
mixed $color
The color of the inter-column border
Returns void


setrowspacingwidth

public void setrowspacingwidth( float $width )

  Set the row spacing width
Sets the width of a border which will be drawn betweenall the rows.

Parameter
float $width
The width of the inter-row border
Returns void


setrowspacingcolor

public void setrowspacingcolor( mixed $color )

  Set the row spacing color
Sets the color of a border which will be drawn betweenall the rows.

Parameter
mixed $color
The color of the inter-row border
Returns void


setverttableborderwidth

public void setverttableborderwidth( float $width )

  Set the vertical table border width
Sets the width of a border which will be drawn on the leftand the right side of the table.

Parameter
float $width
The width of the vertical table border
Returns void


setverttablebordercolor

public void setverttablebordercolor( mixed $color )

  Set the vertical table border color
Sets the color of a border which will be drawn on the leftand the right side of the table.

Parameter
mixed $color
The color of the vertical table border
Returns void


&addcolumn

public void &addcolumn( string $heading, float $width, object [unknown] $headerjhpci, object [unknown] $normjhpci )

  Add a column to the table
Adds a column to the table. You have to pass the data for thetable header, the width and JHPCI (JH PDF container interface)conformant objects which put the actual data on the PDFdocument.This method will return a colparam object by reference whichcan be used to modify the column parameters.

Parameter
string $heading
The data which will be put into the
header for this column, usually a text
string
float $width
The width of the column in PDF pixels
object [unknown] $headerjhpci
Instance of a JHPCI conformant class
which will be used for putting the
header data onto the PDF document
object [unknown] $normjhpci
Instance of a JHPCI conformant class
which will be used for putting the
row data onto the document
Returns void


addrow

public void addrow( array $dataarray )

  Put a row onto the PDF document
Puts a row onto the PDF document. If there is not enoughspace left on the page, the function set throughsetnewpagefunction() is called.

Parameter
array $dataarray
An array containing one element for
each column
Returns void


addcell

public void addcell( mixed $data )

  Add a cell to the table
Adds a cell to the table. Each added cell will fill up thecurrent row from the left to the right. If the row is complete,it will be output onto the PDF-document.Uncomplete rows will be output automatically when addrow() orendtable() is called.

Parameter
mixed $data
The data to put into the cell
Returns void


endtable

public void endtable( )

  Close the table on the current page
Draws the bottom border, the vertical table border, thecolumn spacing border and creates a new page.

Returns void


Private Method Details

setdefaultcolparam

private void setdefaultcolparam( )

  Set built-in default column parameters
Set the built-in default column parameters.

Returns void


initialize

private void initialize( )

  Initialization stuff
Adjusts the auto-width-column (if used) and calculatesthe horizontal position of each column. Gets called onthe first call of addrow().

Returns void


drawcell

private void drawcell( float $xpos, float $ypos, float $width, float $height, object cellparam $cellparam, $putdata )

  Put a cell onto the PDF document
Puts a cell onto the PDF document including cell border,cell padding and the actual cell data.

Parameter
float $xpos
The left starting position
float $ypos
The top starting position
float $width
The width of the cell
float $height
The height of the cell
object cellparam $cellparam
Object describing the cell
parameters
$putdata
Warning: documentation is missing.
Returns void


putheader

private void putheader( )

  Put the table header onto the PDF document
Puts the table header onto the PDF document.

Returns void


newpage

private void newpage( )

  Begin a new page
Calls endtable() to close the table and the function setthrough setnewpagefunction() to begin a new page.

Returns void


headerinitialize

private void headerinitialize( )

 

Warning: documentation is missing.

Returns void


Private Field Details

$pdf

private unknown $pdf

>><<



$ypos

private unknown $ypos

>><<



$firstypos

private unknown $firstypos

>><<



$width

private unknown $width

>><<



$defaultcolor

private unknown $defaultcolor

>><<



$defaultcolparam

private unknown $defaultcolparam

>><<



$colparam

private unknown $colparam

>><<



$colspacingwidth

private unknown $colspacingwidth

>><<



$colspacingcolor

private unknown $colspacingcolor

>><<



$rowspacingwidth

private unknown $rowspacingwidth

>><<



$rowspacingcolor

private unknown $rowspacingcolor

>><<



$verttableborderwidth

private unknown $verttableborderwidth

>><<



$verttablebordercolor

private unknown $verttablebordercolor

>><<



$firstxpos

private unknown $firstxpos

>><<



$lastypos

private unknown $lastypos

>><<



$linecount

private unknown $linecount

>><<



$newpagefunction

private unknown $newpagefunction

>><<



$initialized

private unknown $initialized

>><<



$headerinitialized

private unknown $headerinitialized

>><<



$hflowtext

private unknown $hflowtext

>><<



$headerheight

private unknown $headerheight

>><<



$headerbgcolor

private unknown $headerbgcolor

>><<



$bgcolors

private unknown $bgcolors

>><<



$topborderwidth

private unknown $topborderwidth

>><<



$topbordercolor

private unknown $topbordercolor

>><<



$afterheaderborderwidth

private unknown $afterheaderborderwidth

>><<



$afterheaderbordercolor

private unknown $afterheaderbordercolor

>><<



$bottomborderwidth

private unknown $bottomborderwidth

>><<



$bottombordercolor

private unknown $bottombordercolor

>><<



$hasheader

private unknown $hasheader

>><<



$rowbuffer

private unknown $rowbuffer

>><<




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta