DH Templates

How to I use PDF templates in PHP?

I have about 20 small PDF files (business card design templates) that I want to be able to populate with data from a MySQL database (name, phone number, etc) and output to the browser/save to the server. The format has to be PDF or another vector format suitable for direct to print use. I've been googling looking for a simple way to do it and am coming up short -- I can't just replace strings (ie using tags like %name%) in the document because of the way for the format works. Has anyone ever done anything like this before or do I have to hard-code the layout of each template into my application? Thanks. I know I can use PHP to generate PDFs from scratch, but I need to simply replace strings in a PDF file with data from a database, then display it to the user.

Public Comments

  1. The built-in PDF functions in PHP work exactly like the image functions: you can position layered data wherever you want in the PDF and dynamically generate it. http://us2.php.net/manual/en/ref.pdf.php
Powered by Yahoo! Answers