Quick graphic_component example
Tue, 03/18/2008 - 19:58 — john
includes.php:
zone_default.php:
test.tpl:
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>
- john's blog
- Login or register to post comments
