Sunteți pe pagina 1din 5

MANUAL

There are 3 classes in this project alongside an auxiliar script file.


The classes are: FPDF, HTML2FPDF, PDF(site version).
The auxiliar script is: htmltoolkit.php.
The html2fpdf_site.php class (PDF) extends the html2fpdf.php class (HTML2FPDF) that extends
the fpdf.php class (FPDF).

FPDF Class
Check the site of this class for more info.
Attention! My project uses a modified FPDF class

HTML2FPDF Class
On top of the attributes and methods of the FPDF class, this class also has:
CLASSNAME: HTML2FPDF
EXTENDS: FPDF
CONSTANTS
define('HTML2FPDF_VERSION','3.0(beta)');
define('RELATIVE_PATH','');
define('FPDF_FONTPATH','font/');
IMPORTS
require_once(RELATIVE_PATH.'fpdf.php');
require_once(RELATIVE_PATH.'htmltoolkit.php');
ATTRIBUTES
TYPE NAME
(string) var $HREF;
(float) var $pgwidth;
(array) var $fontlist;
(bool) var $issetfont;
(bool) var $issetcolor;
(string) var $titulo;
(float) var $oldx;
(float) var $oldy;
(int) var $B;
(int) var $U;
(int) var $I;
(bool) var $tablestart;
(bool) var $tdbegin;
(array) var $table;
(array) var $cell;
(int) var $col;
(int) var $row;
(bool) var $divbegin;
(char) var $divalign;
(float) var $divwidth;
(float) var $divheight;
(bool) var $divbgcolor;
(bool) var $divcolor;
(int) var $divborder;
(bool) var $divrevert;
(int) var $listlvl;
(int) var $listnum;
(string) var $listtype;
(array) var $listoccur;
(array) var $listlist;
(array) var $listitem;
(bool) var $buffer_on;
(bool) var $pbegin;
(bool) var $pjustfinished;
(bool) var $blockjustfinished;
(bool) var $SUP;
(bool) var $SUB;
(bool) var $toupper;
(bool) var $tolower;
(bool) var $dash_on;
(bool) var $dotted_on;
(bool) var $strike;
(array) var $CSS;
(bool) var $cssbegin;
(array) var $backupcss;
(array) var $textbuffer;
(string) var $currentstyle;
(string) var $currentfont;
(array) var $colorarray;
(array) var $bgcolorarray;
(array) var $internallink;
(string) var $enabledtags;
(int) var $lineheight;
(string) var $basepath;
(array) var $outlineparam;
(bool) var $outline_on;
(string) var $specialcontent;
(array) var $selectoption;
(bool) var $usecss;
(bool) var $usepre;
(bool) var $usetableheader;
(bool) var $shownoimg;
METHODS
function HTML2FPDF($orientation='P',$unit='mm',$format='A4')
Return: An object (a class
OBS: Constructor
instance)
function setBasePath($str)
Return: void OBS: Inform the script where the html file is (full path - e.g. http:
function ShowNOIMG_GIF($opt=true)
OBS: Enable/Disable Displaying the no_img.gif when an image is not found. No-
Return: void
Parameter: Enable
function UseCSS($opt=true)
Return: void OBS: Enable/Disable CSS recognition. No-Parameter: Enable
function UseTableHeader($opt=true)
OBS: Enable/Disable Table Header to appear every new page. No-Parameter:
Return: void
Enable
function UsePRE($opt=true)
Return: void OBS: Enable/Disable pre tag recognition. No-Parameter: Enable
function Header($content='')
Return: void OBS: The header is printed in every page.
function Footer()
Return: void OBS: The footer is printed in every page!
function WriteHTML($html)
Return: void OBS: HTML parser
function OpenTag($tag,$attr)
Return: void OBS:

function CloseTag($tag)
Return: void OBS:

function printlistbuffer()
Return: void OBS: Prints all list-related buffered info
function printbuffer($arrayaux,$outofblock=false,$is_table=false)
Return: headache OBS: Prepares buffered text to be printed with FlowingBlock()
function Reset()
Return: void OBS: Resets several class attributes
function ReadMetaTags($html)
Return: void OBS: Pass meta tag info to PDF file properties
function ReadCSS($html)
Return: string OBS: CSS parser
function readInlineCSS($html)
Return: array OBS: Reads inline CSS and returns an array of properties
function setCSS($arrayaux)
Return: void OBS: Change some class attributes according to CSS properties
function SetStyle($tag,$enable)
Return: void OBS: Enables/Disables B,I,U styles
function DisableTags($str='')
OBS: Disable some tags using ',' as separator. Enable all tags calling this function
Return: void
without parameters.
function _tableColumnWidth(&$table)
Return: void OBS:

function _tableWidth(&$table)
Return: void OBS: Calculates the Table Width
function _tableHeight(&$table)
Return: void OBS: Calculates the Table Height
function _tableGetWidth(&$table, $i,$j)
Return: array(x,w) OBS:

function _tableGetHeight(&$table, $i,$j)


Return: array(y,h) OBS:

function _tableRect($x, $y, $w, $h, $type=1)


Return: void OBS:

function _tableWrite(&$table)
Return: void OBS: Main table function

PDF Class
On top of the attributes and methods of the HTML2FPDF class, this class also has:
CLASSNAME: PDF
EXTENDS: HTML2FPDF
CONSTANTS
define('RELATIVE_PATH','');
IMPORTS
require_once(RELATIVE_PATH.'html2fpdf.php');
ATTRIBUTES
METHODS
function PDF()
Return: A class instance OBS: Constructor
function InitLogo($src)
Return: void OBS: Insert Image Logo on 1st page
function PutTitle($titulo)
Return: void OBS: Insert Title on 1st page
function PutAuthor($autor)
Return: void OBS: Insert Author on 1st page
function Footer()
Return: void OBS: Insert footer on every page

S-ar putea să vă placă și