Forum Moderators: coopster

Message Too Old, No Replies

Using PHP to create on the fly PDF files

...and also replaces variables--like a person's name

         

Storyman

10:26 pm on Oct 2, 2006 (gmt 0)

10+ Year Member



I'd like to find a PHP program that creates PDFs on the fly. Also, I'd like the capability of replacing variables within the document. The idea is to personalize the PDF as much as possible. (Ideally when it is personalized they will be less inclined to share.)

I've located programs ranging from free to $150 and one for mega bucks.

At this point I need recommendations and guidance on the best practice for this type of thing. If it makes any difference currently when the text file is outputted to PDF it weighs in at around 600KB. If possible I'd like to include graphics, but it is not a deal breaker. Finally, my preference is to include a TT font set within the PDF.

Any suggestions and/or advice is greatly appreciated.

[edited by: Storyman at 10:27 pm (utc) on Oct. 2, 2006]

eelixduppy

11:15 pm on Oct 2, 2006 (gmt 0)



A good placed to start: PDF Functions [php.net].

Another good place to look is phpclasses.org [google.com]

Best of luck!

RonPK

6:47 am on Oct 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are a few packages out there that allow you to format your document in HTML and have that converted to PDF. Needless to say that formatting a document in HTML is not that hard ;)

HTML_ToPDF is one, htmldoc is another. The downside is that these packages need to be installed on the server. Root access is required, which is unlikely in a shared hosting environment.

dreamcatcher

7:03 am on Oct 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



FPDF Library [fpdf.org] is also worth a look.

dc

henry0

12:30 pm on Oct 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Source Forge has a good system; sorry: no links I can find.

DrDoc

4:10 pm on Oct 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I second FPDF. I've used it many times, and included both TT fonts, images, etc. So far, there hasn't been a single instance where I have not been able to create the PDF I wanted.