Free Support Forum - aspose.com

Fill form fields in PDF using C# with Aspose.PDF - Value is not being populated

Dear experts,

For some reason fields with certain identifiers are not displayed in the generated pdf. Here is a part of the code:

        Dim inForm As Form
....
inForm = New Form(Server.MapPath(ConfigurationManager.AppSettings("priceBookTemplate-" & custSeg).ToString))
....
inForm.FillField(tableField, strStdPriceCol)

image.png (1.8 KB)

The tableField variable contains “CUSTOMER_PRICEHEADING”, which is the identifier of the field on the picture. In the generated pdf nothing is displayed there. I suspected it was because multiple fields of the documents have the same identifier, so I renamed only one of the fields and changed the code accordingly. But it did not help. Please advise how this can be solved.

@dpreznik

Would you kindly make sure to use Aspose.PDF for .NET 20.1 and in case issue still persists, please share your sample PDF document along with sample code snippet which you are using to fill form fields. We will test the scenario in our environment and address it accordingly.

@asad.ali Hi Ali,

I updated the Aspose.pdf, and it did not help. How can I send you the pdf privately?

@dpreznik

You may please share the PDF in a private message by clicking over username and pressing Blue Message Button.

@dpreznik

Thanks for sharing the file privately.

We have tested the scenario using Aspose.PDF for .NET 20.1 and following code snippet. We were unable to notice any issue as the values were populated in the resultant PDF document:

[C#]

var form = new Facades.Form(File.Open(dataDir + @"DS-0102-0220_L&M Pricebook.pdf", FileMode.Open));
form.FillField("CUSTOMER_PRICEHEADING", "test");
form.FillField("CUSTOMER_PRICEHEADING2", "test");
form.Save(File.Create(dataDir + @"output.pdf"));

We have shared the file with you privately. Would you please check it and share a sample console application which is able to reproduce the issue in our environment. We will again test the scenario in our environment and address it accordingly.

1 Like

@asad.ali
Thank you very much. It was my mistake. The fields were flattened before populating.

@dpreznik

It is good to know that your issue has been resolved. Please keep using our API and in case you face any issue, please feel free to let us know.

1 Like