Location: PHPKode > scripts > PHP DocWriter > php-docwriter/examples/ex3.php
<?php
require_once('../lib/include.php');
import('phpdocwriter.pdw_document');
import("phpdocwriter.pdw_textbox");

$sxw = new pdw_document;
$sxw->SetLanguage('en','EN');
$sxw->SetStdFont ("Times New Roman",10);
$sxw->Write('Lets draw some boxes...');
$sxw->Ln(2);

$tb1 = new pdw_textbox ($sxw, array ('w'=>15,'h'=>2,'x'=>1,'y'=>0.5));
$tb1->Write('Text Box 1');
$tb1->Insert();

$tb2 = new pdw_textbox ($sxw, array ('w'=>5.5,'h'=>5,'x'=>1,'y'=>3));
$tb2->Write('An image inside the text box...');
$tb2->Ln();
$tb2->Image(array('path'=>'logo.png','w'=>4.12,'h'=>1.92));
$tb2->Insert();

$tb3 = new pdw_textbox ($sxw,array ('w'=>9,'h'=>4,'x'=>7,'y'=>3));
$tb3->Write('Inserts links inside: ');
$tb3->AddLink ("PHP DocWriter","http://www.ciclope.info/~jmsanchez");
$tb3->Insert();


if (isset ($_REQUEST["format"]) && $_REQUEST["format"]!='') $sxw->SetExportFilter ($_REQUEST["format"]);
if (isset ($_REQUEST["zip"]) && ($_REQUEST["zip"] == 1)) $sxw->CompressOutput();
$sxw->Output();
?>
Return current item: PHP DocWriter