We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unable to modify form fields for this PDF

Hi,


We are using Aspose PDF 10.4 and for the attached PDF, are unable to replace form field values using Aspose.PDF.InteractiveFeatures.Forms namespace. Further investigation revealed that the textboxes inside this form are retrieved with their ReadOnly set to true as shown in the attached screenshot and so setting textboxes’ values seems to throw an exception.

Changing the ReadOnly to true just before assigning values seems to solve the problem but the appearance of the form gets distorted if we do so. Though this is not the approach we want to go with as this will impact other PDF form types as well.

txtField.ReadOnly = false;

Also the field values are only visible when we click on those fields if we go ahead with this approach of replacing values for this PDF.

Kindly suggest a suitable approach for this

Hi Chandan,


Thanks for your inquiry. I am afraid I am unable to fill form, I am getting NullReferenceException while setting field value even using Aspose.Pdf for .NET 10.4.0. I will appreciate it if you please share your sample code here, so we will look into it and guide you accordingly.

We are sorry for the inconvenience caused.

Best Regards,

Hi Tilal,


Yes we are getting the same NullReference exception as I have mentioned in my original post.The reason for this exception being thrown is that the text fields in this form are being retrieved in Read Only mode (Kindly refer screenshot of my original post) and so setting their values is throwing the Null Reference exception.For other PDFs the text fields are not retrieved in Read Only mode that allows us to replace the form field values successfully.

Attached is the screenshot of the exception we get when replacing the form field values which shows piece of the sample code as well.The text box being replaced here is Aspose.Pdf.InteractiveFeatures.Forms.TextBoxField.

What we intended to know is if this is an issue with Aspose PDF 10.4 for the PDF type that I provided in the original post. Kindly let us know if you find a workaround for replacing the form values if not so. Thanks!

Hi Chandan,


Thanks for your feedback. Yes Aspose.Pdf behavior for readonly form fields is as expected, for such field you need to reset readonly property to modify form field value. However I have noticed that after setting it to readonly using Aspose.Pdf for .NET even then API is not modifying the form field value. So I have logged a ticket PDFNEWNET-39283 for further investigation and rectification. We will notify you as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,

Hi Tilal,


We would like to know if there are any updates to this and if this issue has been resolved in a later Aspose PDF version.

Hi Chandan,


We are sorry for the inconvenience. I am afraid your reported issue is still not resolved, as our product team is busy in investigating/fixing other issues, reported earlier. We will notify you as soon as we made some significant progress towards issue resolution.

We are sorry for the inconvenience caused.

Best Regards,

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(4)