Fill PDF form from database while opening a PDF using Aspose.PDF for .NET

Hello,

I have below requirements and i need your help on it

  1. Fill a PDF form from database while opening a PDF.
  2. Save PDF form fields as soon as PDF is saved.

Please let me know if this is possible with Aspose PDF. Also any code reference is greatly appreciated.

Thanks,
Sameer

@SameerD,

Thanks for contacting support.

Yes, this is possible. You should read values from database and fill fields with code like:

(doc.Form[fieldName] as Field).Value = fieldValue;

Also please visit this thread link as well for more details.

@Adnan.Ahmad Thank you for your response.

I will explain my requirement in detail.

I have a .net code which puts the data into database and retrieve as well. I want to plug in this code while opening a PDF form and while saving the PDF form as well. Can you please assist how to call this code while opening a PDF and saving it.

Thanks,
Sameer

@SameerD,

I like inform that you can fill PDF form using Aspose.PDF from database data, either retrieving data into some DataTable/DataView and assign values to form fields to Fill forms or Import FDF/XFDF/XML data into PDF form. Please check following documentation links for more details.

If there is still an issue than please share complete sample project so that we may investigate that further to help you out.