Location: PHPKode > projects > pdfDOM > pdfdom-0.5/tests/table.php
<?php
$root_path = "../";
define('FPDF_FONTPATH', $root_path."fpdf/font/");
include($root_path . "fpdf/fpdf.php");
include($root_path ."classes/class.coordinateobject.php");
include($root_path ."classes/class.container.php");
include($root_path ."classes/class.page.php");
include($root_path ."classes/class.textcontainer.php");
include($root_path ."classes/class.table.php");

$root = new pdPage();

$table = new pdTable();
$table->coordinates->setXYWH(50,50,105,105);
$table->setBorder(2);
$table->setColumnWidth(1, 30);
$table->setColumnWidth(2, 30);
$table->setColumnWidth(3, 30);
$table->setColumnWidth(4, 30);

$presetContainer = new pdTextContainer();
$presetContainer->setBorderBottom(0.1);
$presetContainer->setBorderRight(0.1);
$presetContainer->setPadding(1);

$table->setTemplateContainer(0, $presetContainer);

$table->setRow(1, "foo", "bar", "here", "blabla\nfoobar\ngugug\nfoo");
$table->setRow(2, "foo2", "bla", "bar2", "here");
$table->setRow(3, "foo", "bla", "bla2", "gugug");

$table->generate();
$root->addContainer($table);

$root->preRender();
$root->sizeCalc();
$root->render();

$_pdfDom_PDF->setDisplayMode("fullpage");
$_pdfDom_PDF->output();	

?>
Return current item: pdfDOM