0

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?

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by cereal
0

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 :)

Edited by cereal: n/a

0

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();

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.