Free Support Forum - aspose.com

Form Fields value Disappear after a second

Hi,

I am trying to fill the form-field values of a pdf. I am using the following code

String path = Server.MapPath(@"~\gftng.pdf");

String dest = Server.MapPath(@"~\ght.pdf");

Aspose.Pdf.License lc = new Aspose.Pdf.License();

lc.SetLicense(Server.MapPath(@"~\Aspose.Total.lic"));

Document pdfForm = new Document(path);

//call PrintField for every form field

foreach (Aspose.Pdf.InteractiveFeatures.Forms.Field field in pdfForm.Form)

{

field.Value = "100";

}

HttpResponse response = HttpContext.Current.Response;

Aspose.Pdf.PdfSaveOptions po = new Aspose.Pdf.PdfSaveOptions();

pdfForm.Save(response,dest, Aspose.Pdf.ContentDisposition.Inline,po);

response.End();

The field values are successfully visible bt they disappear after a second.

Can someone suggest?

Hi Palak,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.Pdf.

Please share your template and resultant PDF file with us so we can test your issue and figure out the issue.

Sorry for the inconvenience,

Hi,

Here is the PDF that we are using to prefill some of the fileds. Thanks.

Hi Palak,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the template file.

I am able to reproduce your mentioned issue using your template file. Your issue has been registered in our issue tracking system with issue id: PDFNEWNET-34419. You will be notified via this forum thread regarding any updates against your reported issue.

Sorry for the inconvenience,

Hi Palak,


Thanks for your patience. We have further investigated this issue and have found that information disappears from PDF form because there is a JavaScript code for page open event. So in order to resolve this issue, you need to remove actions from page. Please try using

doc.Pages[1].Actions.RemoveActions();

(support of removing page actions will be available from Aspose.Pdf for .NET 7.5.0)

For your reference, I have also attached the resultant PDF which I have generated over my end. Please take a look.

The issues you have found earlier (filed as PDFNEWNET-34419) have been fixed in Aspose.Pdf for .NET 7.5.0.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.