Welcome Guest, Not a member yet? Register   Sign In
Generating PDF files ezpdf
#1

[eluser]Zied[/eluser]
Hi!
I used this tutorial

http://codeigniter.com/news/codeigniter_...deigniter/

to generate pdf file but when i use addJpegFromFile() or addFromFile() i have problem
Code:
$this->cezpdf->addFromFile("images/image.jpg",100,600);
$this->cezpdf->addJpegFromFile('images/image.jpg',199,100,200,0);
When i change the code to
Code:
$this->cezpdf->addJpegFromFile(base_url().'images/image.jpg',199,100,200,0);

the file is created but without images.
I need to put same images in my document.
thinks
#2

[eluser]tastatura[/eluser]
i am also having problem with Images and EzPDF. Did you find any solution?
#3

[eluser]Zied[/eluser]
I changed it, i use now Dompdf, and it's very easy and very good
#4

[eluser]Unknown[/eluser]
I know this is a slightly old thread... But I found the solution.

addJpegFromFile requires a "file" not a "url"...

So for example, here is my code:
Code:
$image = $_SERVER{'DOCUMENT_ROOT'} . "/images/my_image.jpg";
      if (file_exists( $image))
      $CI->cezpdf->addJpegFromFile($image,x,y,w);

If you pass a URL (like an img src) it will always fail. It took me forever to figure this out, but what made it clear was when I used the file_exists() function and it always failed... I remembered "duh, it's looking for a file on the server".

I hope this helps someone.




Theme © iAndrew 2016 - Forum software by © MyBB