Populate PDF document with data from SQL
- Hello. I'm researching for the new VB project and hoping to get some answers. We have a lot of PDF documents and would like to save information filled in by the user in SQL database and then pre-populate the answers in multiple PDFs for printing. We'd also want user to digitally sign the pdf and store the signature in database. Ideally I'd like to create VB project with form that users would fill in and then information should "flow" into existing PDF. Then later I'd setup some reports based on user-filled information. We probably will purchase Adobe LifeCycle software to use with PDF. Please advise!
Todas las respuestas
- You may want to look at the IText product(s) from Bruno Lowagie - a free library that can do a lot with PDF's.
http://www.lowagie.com/iText/
If you are not familiar with PDF document structuring it can get kind of hairy - so you may want to research how to get to the form layer of the document. A coworker did exactly what you are describing and it took him about a week to get used to all the quirks... but he got it done. Hello Alla,
I searched on the web and found a .NET PDF library from the codeplex site,
http://pdflib.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=6238
I think it just fit your scenario,
1.It can read the PDF document,
2.You can add text onto PDF pages (fill information retrieved from the form)
3.You can add image onto the PDF (as signature)
Ji ZhouMSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marcado como respuestaJi.ZhouMSFT, Moderadormartes, 10 de noviembre de 2009 2:36
- Marcado como respuestaJi.ZhouMSFT, Moderadorlunes, 16 de noviembre de 2009 3:43
- Desmarcado como respuestaAlla2552 martes, 10 de noviembre de 2009 13:12
- Desmarcado como respuestaJi.ZhouMSFT, Moderadormartes, 17 de noviembre de 2009 1:48
- If it is PDF, an Image, a Doc document, it is all the same, there is no special kind of type for that in the DataBase.
They need to be converted to bytes.
That can sometimes with string and byte decoding and encoding, mostly it is done with the memorystream.
There are endless of samples on Internet, about that.
Search words memorystream and blob
Success
Cor - Thank you for the suggestions. I'll check out both sites that were suggested and let you know!
- - Checked IText - it uses Java language. Unfortunately - not familiar with Java. It also requires purchase of Java development kit. Don't think that management will approve it since nobody codes in it here..
- Checked PDF library - very interesting. I had to convert it to VS 2008 (it was 2005 code); was able to insert image into PDF, but there is no way to insert text! Not sure if I'll be able to use it - not enough ability.. But it was fun to play with.
I found another software - PF-PrintMerge and researching it at the moment. Not sure if it'll work with SQL server 2008 and Windows Vista/7. The rep said that they hadn't test it - works with prior versions for sure. So I might be out of luck!
Also found info about Acrobat Approval - did anybody use it and can advise? - Hi Alla,
My answer was primaly meant for the database part, did you check the codeplex link from Zhou for the PDF part, it looks prommising.
Success
Cor - Yes - I mentioned that I checked PDF library - that was from codeplex. Unfortunately it'll allow to insert image and annotations only, not text. So I can't insert the actual fields.
Hello Alla,
As comment from Mario in that codeplex project's download page,
http://pdflib.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=6238
"Nice free library for modifying PDF files. I use it to add text (creating on the fly image from it) to existing PDF files. May be interesting as a new library feature in a next release. "
I think if we want to add text, we can create fly image based on text first. Drawing text on image should not be a problem in VB.NET
http://dotnet-snippets.com/dns/draw-text-on-image-SID596.aspx
Have a nice day!Ji Zhou
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- I unmarked it as an answer because I also need to read signature back from PDF into SQL. I have no idea how to accomplish it. About text as an image - I'll check it out and let you know. Thank you for your help!
- Hello,
Most of the free libraries or samples for PDF manipulation are simple and straight. If you want some complex PDF manipulation from codes, you may consider some commercial libraries like this one. From its description, it seems support most of tasks you are trying to accomplish
http://www.pdf-technologies.com/
Or if you buy Adobe products, maybe a better place to consult this question is thier Acrobat SDK forums,
http://forums.adobe.com/community/acrobat/acrobat_sdk?view=discussions
Best regards,
Ji Zhou
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marcado como respuestaJi.ZhouMSFT, Moderadorlunes, 16 de noviembre de 2009 3:43
- Desmarcado como respuestaAlla2552 lunes, 16 de noviembre de 2009 13:23
- Plese don't mark it as answered before I have a chance to evaluate the suggestion! I already posted a question in Adobe - almost two weeks ago and got no answers at all!
I will take a look at the pdf link and let you know.. Currently I'm evaluating the software from www.pdfonline.com - by BCL technologies. Thanks, Alla

