问题
I am being tasked with creating a Windows application in VB.Net, and one of the requirements is to read data from an MSSQL database, and put in certain values into a PDF form. How can I achieve putting data into a pre-existing PDF file using VB.Net? Also, is it possible to put the PDF file in as a resource instead of calling it externally?
回答1:
You may be able to take advantage of a 3rd party component like iTextSharp which is a PDF library. It's written in C#, but could be added to your existing solution as a separate project, or compiled and referenced as a library.
This library specifically references the ability to fill in PDF forms and should fit the bill for filling in your pre-existing PDF form programatically.
回答2:
Docotic.Pdf library can be used for filling PDF forms.
There are samples for the library (C# and VB.NET versions available) that show how to:
- Fill existing form
- Find control by name
And you might find Write data from a database to PDF blog entry useful in your case, too.
Disclaimer: I am one of the developers of the library.
来源:https://stackoverflow.com/questions/16726266/fill-in-pdf-forms-from-vb-net-application