NYCPHP Meetup

NYPHP.org

[nycphp-talk] Working with PDF

Allen Shaw ashaw at polymerdb.org
Fri Jun 9 14:35:01 EDT 2006


Don't know if it fits what you're trying to do (or if it's an 
unnecessary Rube Goldberg solution), but here's what my system does:

We needed a system to take files edited in MS-Word (invitation letters, 
actually), pop in the various name and address fields for a recipient, 
and export the whole thing to a PDF file.  Support for some 
MS-Word-friendly format was crucial, as the invitation letters would 
change at least with every event, and often go through several versions 
for each event.

Our solution was to save the files in RTF, with placeholder tags typed 
right into the text; then use PHP to replace the tags with the right 
values and use Ted (http://www.nllgg.nl/Ted/) (a linux only RTF reader) 
to convert the files from RTF to PDF.  This way, the non-technical 
people who write the letters can spin away on their edits, and I can 
upload them as templates with little trouble.  (Trial and error showed 
me a few things to clean up each time from their sloppy MS-Word 
formmatting before uploading, though.)

It's not pure PHP like FPDF, but it gets us the features we needed.

- Allen


Aaron Fischer wrote:
> Greetings!
> 
> I'm beginning a project that will involve creating PDF documents.  So 
> far my research has turned up PDFlib 
> (http://us3.php.net/manual/en/ref.pdf.php) and FPDF (http://www.fpdf.org/).
> 
> So far it seems that FPDF will do what I need.  It has the added benefit 
> of being free (as opposed to PDFlib which would run at least $450).
> 
> Have folks used FPDF?  Would you recommend it? 
> 
> Are there are any other means to generate PDF that you would recommend?
> 
> If helpful, here's a brief project summary:
> I am developing an application that will allow nontraditional students 
> to apply for admission to our college.  The user will be able to create 
> an account and work on her application, saving and returning at any time 
> (data will be stored in MySQL).  The PDF aspect comes into play when the 
> applicant would like to preview the application with her data populating 
> the fields.  It will also be used for our support staff to print the 
> applications once they are completed.
> 
> Here's the blank application which would need to be created and 
> populated with student data (application is pages 2-4, instructions are 
> on page 1):
> http://www.smith.edu/admission/pdf/nontraditional_application05.pdf
> 
> Cheers,
> 
> -Aaron
> 
> 
> 
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> New York PHP Conference and Expo 2006
> http://www.nyphpcon.com
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
> 


-- 
Allen Shaw
Polymer (http://polymerdb.org)



More information about the talk mailing list