CodeIgniter Forums
export to PDF - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter Archived (from EllisLab) (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: export to PDF (/thread-46737.html)



export to PDF - El Forum - 11-13-2011

[eluser]vile[/eluser]
Hi,

I have tried these PDF generators:

1. TCPDF- doesn't support css class. Styles will work if inline.
2. DOMPDF - Supports CSS class. Doesn't have Unicode support. Already tried load_font to convert ttf to amf but still Chinese char are not displayed properly.
- Also tried (installed) PDFlib, watermark appears in pdf but characters are not displayed properly.

Any suggestion in PDF generator that can do the functionality of TCPDF and DOMPDF?
Thanks in advance.


export to PDF - El Forum - 05-14-2012

[eluser]Tudip Technologies[/eluser]
+1 for mpdf. It works pretty much out of the box with CI.
Small blog entry explaining the hello world:

http://tudip.blogspot.com/2012/05/mpdf-with-codeigniter.html


export to PDF - El Forum - 09-15-2014

[eluser]pexmar[/eluser]
Hey,

thank you for this great Tutorial!
I've got a little problem with this code. When I do a image on the HTML-Site, the converter doesn't converts it into the pdf. It shows the red cross (like if Internet Explorer tells you, this image does not exist).
The HTML View is working well, it shows the image.

Can somebody help me please?

Thank you in advance !

Best regards


export to PDF - El Forum - 09-15-2014

[eluser]CroNiX[/eluser]
How are you entering the SRC for the image?


export to PDF - El Forum - 09-15-2014

[eluser]pexmar[/eluser]
Hey,

my image-Tag looks like
Code:
<img src="&lt;?php echo site_url('images'); ?&gt;/logo.jpg" alt="" />
I also tried with the absolute path, like
Code:
<img src="http://www.........de/images/logo.jpg" alt="" />
.
Doesn't work either.

best redards


export to PDF - El Forum - 09-15-2014

[eluser]CroNiX[/eluser]
Did you look at the mpdf manual? I don't use that library personally, but their docs show images WITHOUT the full url, like "/images/logo.jpg" (not http://...).

http://mpdf1.com/manual/index.php?tid=245

Also try using mpdf's debugging features. It might have something useful.


export to PDF - El Forum - 09-15-2014

[eluser]pexmar[/eluser]
Oh, thats great. It works! Thank you very much!!!