18 Mar 2008
the new graphic component allows you to use smarty templates to output to pdfs or images.
config.php:
//only necessary if you are creating images
define_once('graphic_image_fontfile', '/path/to/font.ttf');includes.php:
$zoop->addComponent('graphic');zone_default.php:
function pagePrintTest($p, $z)
{
$gui = &new SmartPdf();
//$gui = &new SmartImage(array('width' => 600, 'height' => 400));
$gui->assign('test', 'Hi this is something');
$gui->display('test.tpl');
}test.tpl:
<p style="font-family: Verdana; font-size: 16px; font-weight: bold; color: #006699">
This is a chart
</p>
<p>
{$test}
</p>
<table>
<tr>
<td>
item 1
</td>
<td>
item2
</td>
</tr>
</table>
Thank you!
Good to know.