Location: PHPKode > projects > pdfDOM > pdfdom-0.5/tests/image.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.imagecontainer.php");
include($root_path ."classes/class.textcontainer.php");
include($root_path ."classes/class.table.php");

$root = new pdPage();

/* Standard image */
$image = new pdImageContainer();
$image->coordinates->setXYWH(10,10,50,50);
$image->setImage("example.jpg");
$image->setBorder(1);
$root->addContainer($image);

/* Stretched image, with scale mode */
$image2 = new pdImageContainer();
$image2->coordinates->setXYWH(70,10,100,50);
$image2->setImage("example.jpg");
$image2->setBorder(1);

$root->addContainer($image2);

/* Stretched image, with stretch mode */
$image3 = new pdImageContainer();
$image3->coordinates->setXYWH(10,70,100,50);
$image3->setImage("example.jpg");
$image3->setImageMode("stretch");
$image3->setBorder(1);

$root->addContainer($image3);

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

$_pdfDom_PDF->setDisplayMode("fullpage");
$_pdfDom_PDF->output();	
?>
Return current item: pdfDOM