Null reference exception when flattening fields

When we try to flatten the fields in the attached PDF document, a null reference exception is thrown by Aspose. Is there a problem with the document? Can something be done so that we can flatten the fields in this document?





Repro code:



Dim Document as New Aspose.Pdf.Document(SourceFileName)



Dim Form as New Aspose.Pdf.Facades.Form(Document)



Form.FlattenAllFields() ’ Exception happens on this call







Note: we asked about a similar issue a couple of years ago, which can be found here: Unable to flatten field in PDF document created by Nuance. While we never received any response that the issue was fixed, I tried it out using the latest version of Aspose.Pdf and the issue appears to be resolved. Perhaps a fix for another bug fixed that one as well? Either way, it’s a different issue - that one failed when trying to save the document after flattening the fields, while this one fails while doing the flattening itself.





Thanks for any help you can provide with this.





– Michael Whalen

Hi Michael,


Thanks for using our API’s.

I have tested the scenario and have managed to reproduce same problem. For the sake of correction, I have logged it as PDFNET-41248 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

Is there any chance of getting an update on this issue? My clients affected by this are requesting an update, so any information on it would be appreciated. Thanks.



Michael Whalen

Hi Michael,


Thanks for your patience.

I am afraid the earlier reported issue is pending for review and is not yet resolved. However I have shared your concerns with product team and they will start evaluating it as per their development schedule and as soon as we have some definite updates regarding its resolution, we will let you know.

Please be patient and spare us little time.

Our client is again asking if there is any update on this particular issue. Thank you for any information you can provide.



– Michael Whalen

Hi Michael,


Thanks for your patience.

I am afraid the earlier reported issue is not yet resolved. However I have intimated the product team to try accommodating this issue in their development schedule and as soon as we have some definite updates regarding its resolution, we will let you know.

We are really sorry for this delay and inconvenience.