Anyone used PDFlib before?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

Anyone used PDFlib before?

Post by Jr »

I just downloaded PDFlib to use with PHP4 and I can't seem to figure out how to get it to work. Do I need to install it on the server or something? I just don't exactly get what I'm supposed to do.

Thanks,
Jr-
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

If you're making PDF files from scratch you'll find FPDF is considerably easier and doesn't require any server configuration.. it's pure PHP.
User avatar
wwwapu
Forum Contributor
Posts: 197
Joined: Wed Apr 07, 2004 11:57 am
Location: Turku, Finland

Post by wwwapu »

FPDF actually works. This is great, I've been looking for something like this also.
With PHP 5 just change all var to private in fpdf.php Private properties section or you could get

Code: Select all

Strict Standards: var: Deprecated. Please use the public/private/protected modifiers
I have not looked it through well enough to say if something else should be changed.
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

Post by Jr »

make a PDF from scratch in PHP? Isn't that new to PHP5 stuff? If not, then that's actually what I want to do.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Jr wrote:make a PDF from scratch in PHP? Isn't that new to PHP5 stuff? If not, then that's actually what I want to do.
http://www.fpdf.org/

Click the "Wordsearch" link in my signature for an example of it in use. Running on PHP 4.3.

Or click here: http://ooer.com/wordsearch/digicams/digicams.pdf
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

Post by Jr »

Isn't there a way to do it without any of those things I would need to install?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

PDFLib needs to be compiled into PHP in order to make PDFs without wordmarks. FPDF seems to be a pretty common tool (as you've probably surmised from the comments).
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Jr wrote:Isn't there a way to do it without any of those things I would need to install?
FPDF isn't installed. It's just a PHP file you include with the include() function.
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

Post by Jr »

So I downloaded it... Do I just upload the files and require() them as needed to use the PDF functions?
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

My preferred method s to have PHP write LaTeX and then exec pdflatex, but then again, I love the control I can get from LaTeX. I've been pleasantly surprised that all hosters I've been with had had pdflatex/latex installed.... This method is not for everyone, but it can avoid the hassles of some of the other libraries if you already know LaTeX/TeX
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Jr wrote:So I downloaded it... Do I just upload the files and require() them as needed to use the PDF functions?
You read the tutorial that comes with it.
Post Reply