views:

40

answers:

3

I have an already pre-designed PDF, and I would like to fill the PDF with some database information. So I'm curious if I should save the PDF into JPG's and render them out with the data on top of the image and re-create a PDF.

Or is there a way to use the PDF already, and print data into the PDF that is already made?

I am trying to figure out the best solution to generating this type of PDF.

All thoughts would be greatly appreciated!

+1  A: 

You can read about PHP's PDF library here: http://php.net/manual/book.pdf.php

PHP also recommends these alternatives:

erisco
+1  A: 

PDF files support the use of interactive form fields, so the best method for adding information to a PDF from a database, is add form fields to your database and find a library that let's you fill out PDF forms programatically.

Rendering a PDF to an image just to write information on it and then converting it back to a PDF would mean that no text was selectable in the new PDF unless you OCR'd it, which isn't the most optimal way to do it.

Rowan
A: 

After a bit more digging, I was able to use Zend PDF within the framework to update the PDF quite easily. It was my first time using the Zend Framework, and found it quite useful. I suggest anyone trying to manipulate PDF's use Zend.

Just my .02 though. I appreciate your pointers though that were given.

Justin
Might want to mark this (or another answer) as the answer.
Mark