Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Community Voice - Generating PDF files using CodeIgniter
#1

[eluser]Derek Allard[/eluser]
This week, our Community Voice author is Chris Monnat, known on the forums as mrtopher, who writes a helpful step by step guide to generating PDF files from CodeIgniter. Chris is a full time web application developer and part time entrepreneur. In addition to building web sites for the medical industry during the day, at night Chris also runs his own development company Left of Center Communications. He recently started a personal blog at http://www.chrismonnat.com where he keeps a record of his exploits and discusses, among other things, CodeIgniter.

Read the full article
#2

[eluser]a&w[/eluser]
Just curious if the author knew about www.tcpdf.org (TCPDF). Seems like it does a lot more (an easier) than the cited library of choice.
#3

[eluser]Crimp[/eluser]
dompdf is reduced to "dom" in the article and thus generates a 404.
#4

[eluser]Derek Allard[/eluser]
[quote author="Crimp" date="1217594455"]dompdf is reduced to "dom" in the article and thus generates a 404.[/quote]
Got that fixed up now Crimp. Thanks!
#5

[eluser]mrtopher[/eluser]
[quote author="a&w;" date="1217564053"]Just curious if the author knew about www.tcpdf.org (TCPDF). Seems like it does a lot more (an easier) than the cited library of choice.[/quote]

No, I wasn't aware of this library but it looks interesting. I will have to check it out.
#6

[eluser]a&w[/eluser]
One more thought just FYI, the author and forum for TCPDF is very active still. There are updates, enhancements, fixes on a frequent basis (sometimes a couple times a week). Other libraries like FPDF and the one you cited haven't had activity in years (as far as I could tell at a glance).
#7

[eluser]mrtopher[/eluser]
a&w;, your right. The development for the R&OS;library has stalled. As I said in the article, there are plenty of options out there for PDF libraries. I just chose to highlight the one that I use.
#8

[eluser]metalking[/eluser]
Hey guys !

Thanks for this very interesting article ! In fact, it came out just at the moment I needed it !

I'm experiencing some problems with this library with CI. Even with the most basic "Hello World!" code, the library returns an error (notice in fact) :

Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined index:
Filename: libraries/class.pdf.php
Line Number: 1934

Then, with the same error on these lines
Code:
Line Number: 2421
Line Number: 1631

Then,
Code:
A PHP Error was encountere
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /opt/lampp/htdocs/acbulle/system/libraries/Exceptions.php:164)
Filename: libraries/class.pdf.php
Line Number: 1916

And the same error on line 1917 and 1919

The PHP code is pretty basic :
Code:
$this->load->library('cezpdf');
$this->cezpdf->ezText('Hello World', 12, array('justification' => 'center'));
$this->cezpdf->ezStream();

The files are in the correct directories, the font directory is readable and writable...

What's wrong?
(I'm using CI 1.6.3)
Thanks !

PS: don't know if it's the right place to post, sorry if not.
#9

[eluser]a&w[/eluser]
metalking:

php is saying some variables haven't been declared while the error_reporting is set to alert you of warnings. You have two options: change the error_reporting in index.php to a lower level so it doesn't display the warnings or go into the problem files and make sure the variables in question are declared properly.

The other errors will go away once you fix that, it's just complaining that headers were already sent (ehco'ing the error message causes this error).
#10

[eluser]metalking[/eluser]
Thanks a&w;!

In fact, I don't know how to fix the missing variables because it is actually a library I downloaded. I doubt there is a problem with the library 'cause many people use it without any problem.
I'll try to lower the error_reporting level, but when another solution is possible, I'd prefer it, cause I need those reports for the development.

Thanks!

EDIT : Lol, the problem was this : I placed the "font" directory in a "static" subdirectory. I just moved it and now it works !
Thanks Wink




Theme © iAndrew 2016 - Forum software by © MyBB