hi i want to include images to pfd files that i create using cezpdf library. the following is my code:

$image=$this->cezpdf->ezImage(site_url("system/images/logo.jpg"));
$this->cezpdf->ezImage( $image,0,0,320 );

but it fails to load the image.can sobebody help me on this?

On ezImage() you are specifing an url, maybe you need to set an absolute path, like: /var/www/your_website/system/images/logo.jpg bye :)

need to add a background image of a4 size on a single page n not on rest of the pages ..... unable to do it can anybody help me ...that background image is appearing on all the pages ... :(( herez a code:

function otherPage(){
//sc_pdf_image ('D:\\xampp\htdocs\lovewithpdf\images\cutebaby.jpg', 4, 5, 190, 20,'jpg');
$options['img']="D:\\xampp\htdocs\lovewithpdf\images\cutebaby.jpg";
$pdftwo = new Creport('a4','portrait','image',$options);

$pdftwo->ezNewPage();
$pdftwo->ezSetDy(-10);


}
$options['img']="D:\\xampp\htdocs\oct\images\A4-book1.jpg";

$pdf = new Creport('A4','portrait','image',$options);
$pdf->selectFont($mainFont);
//main page content
$pdf->setColor(1,1,1); 
$pdf->addText(350,500,36,'Name:');
$pdf->setColor(1,0,.5); 
$size = "26";
$pdf->addText(350,450,36,$userName);


$pdf->ezSetDy(-10);
$pdf->openHere('Fit');

otherPage();

$pdf->ezNewPage();
$pdf->addText(250,350,36,"after function call");
//$pdf->ezNewPage();
$pdf->ezStream();

Try this:

$options['img']= array(
    'D:\\xampp\htdocs\oct\images\A4-book1.jpg' => array('obj'=>2),
    'D:\\xampp\htdocs\oct\images\A4-book1.jpg' => array('obj'=>4)
);

Where 2 and 4 are the page numbers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.