Link to home
Start Free TrialLog in
Avatar of linuxrox
linuxroxFlag for United States of America

asked on

pdf creation

Hello there.  I've not ever created or edited a pdf using php and the pdf extension but i'm on a project i need to do this.
As it is I have a document which is in pdf format already and what i basically need to do is add data to it and recreate it.
So basically i'll have a PDF invoice type of document and what i'll need to do is have some POST data written to the PDF and have it recreated.  i'm not sure the best way of doing this but i wasn't sure if it was possible for php to open the already created PDF document and add data to it or if i had to somehow re-create the document from scratch.  if need be i can convert the PDF to jpg but i doubt that would be necessary.  there is only a small area on the pdf that new data must be added...like address information etc etc.  what i want to do is just recreate the pdf and then save the file to a new folder and it's path in my database for future retrieval.
any help with this is greatly appreciated!
thanks!
Avatar of CWS (haripriya)
CWS (haripriya)
Flag of India image

You can use PDFLib for generating PDF files.

Go through this artilce of how to create a PDF File.

http://www.sitepoint.com/article/generate-pdfs-php
ASKER CERTIFIED SOLUTION
Avatar of cristi_2112
cristi_2112
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of linuxrox

ASKER

I've looked at PDFLib but PDFLib is NOT free and quite expensive.  i know they have a Lite version but i've not been able to find the binary php .dll library for the lite version!  Also, remember i'm needing to open an existing pdf and write text to it.
cristi_2112: i'm not sure if that class on zend's site supports actually opening an existing pdf file for rewriting; which is what i really need.  i'll investigate further though.
thanks
PDFLib is a real nice tool for creating pdf files but as mentioned before it is not a free tool.  There is a free php class called ezpdf which will do exactly what you are trying to do; you can download ezpdf from http://ezcommunity.net/article/view/51/1/27

I hope this helps.
Oh, you need to re-write over an existing PDF file; the only thing I know of to write over existing PDF files is again, PDFLib.

I've been using PDFLib for quite awhile and it's a very good tool, it creates and writes over existing pdf's quite nicely.
Actually cristi_2112 's answer seems to fit the best.  there is an extention to fpdf that allows the reading in of an existing PDF and then you can modfiy it's contents and add text.

http://fpdi.setasign.de/

Yep, the zend tutorial is also very useful ;)
Thank Ya!  looks like I should be able to do what i'm needing without having to pay $400 or so!