Pdf.document.flatten throwing object reference exception

Running version 22.8. Keep getting an object reference exception when trying to call pdf.document.flatten. We have several files that are throwing this exception

I suspect the issue may with the document itself. I am including a sample file.

Here is the stack trace:
at Aspose.Pdf.Document.#=zwRNHei10xYBO(Page #=ztTOrXy0=)
at Aspose.Pdf.Document.#=zClVFZuE=()
at Aspose.Pdf.Document.Flatten(FlattenSettings flattenSettings)
at Aspose.Pdf.Document.Flatten()
at MS.Core.Imaging.PDF.App.AsposeWrapper.ProcessHandler.GenerateTiffImages(List`1& files, Int32& pageCount, ColorDepth coloDepth, CompressionType compressionType) in C:\Source\SVN\MS\Core\Imaging\PDF\App\trunk\Source\MS.Core.Imaging.PDF.App.AsposeWrapper\ProcessHandler.cs:line 187

invoices wk 9-2023.pdf (4.2 MB)

@mdecaire

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54045

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

I am receiving the same error, not sure if it is the same issue or if different aspects of certain documents could cause the same error, so I am uploading a sample file here that exhibits that same error message, please let me know if it is covered in the same ticket or needs a new one. Is there any timeframe associated with the tickets?FormSample.pdf (4.9 MB)

@mdecaire

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54427

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as PDFNET-54427) have been fixed in Aspose.PDF for .NET 23.6.

The issues you have found earlier (filed as PDFNET-54045) have been fixed in Aspose.PDF for .NET 23.7.

Hi @aspose.notifier,
i’m facing same issue, below is the error i’m getting while flattening the fields in the PDF. i’ve checked with 24.2 as well, but getting the below error.

[#=zrqioYeoeEV9SrAkxSuXwlVRFoFoRSTIdcnlEp9Lh418zDkwv9Q==] Double #=zF$SzO8Y=() | Error in AsposePdfManager.FlattenAllPdfFields - System.InvalidCastException: Unable to cast object of type ‘#=zCSGqRHoKA8soenH3p5ChG$6imxRc3xUrKg==’ to type ‘#=zNyLJ8QjLERsSFWJ$3mviCYGmc9tNZH6AAA==’.
at #=zrqioYeoeEV9SrAkxSuXwlVRFoFoRSTIdcnlEp9Lh418zDkwv9Q==.#=zF$SzO8Y=()
at Aspose.Pdf.Operators.SelectFont.#=za_2Mies=(#=ztcU$RTg4dbztq6VbK8ZbCHFbaFi070ZE8eHjqW9thJ_g #=z84rCWX4=)
at Aspose.Pdf.Operator…ctor(Int32 #=zVTdo7Mo=, #=ztcU$RTg4dbztq6VbK8ZbCHFbaFi070ZE8eHjqW9thJ_g #=z84rCWX4=)
at Aspose.Pdf.Operators.TextOperator…ctor(Int32 #=zVTdo7Mo=, #=ztcU$RTg4dbztq6VbK8ZbCHFbaFi070ZE8eHjqW9thJ_g #=z84rCWX4=)
at Aspose.Pdf.Operators.TextStateOperator…ctor(Int32 #=zVTdo7Mo=, #=ztcU$RTg4dbztq6VbK8ZbCHFbaFi070ZE8eHjqW9thJ_g #=z84rCWX4=)
at Aspose.Pdf.Operators.SelectFont…ctor(Int32 #=zVTdo7Mo=, #=ztcU$RTg4dbztq6VbK8ZbCHFbaFi070ZE8eHjqW9thJ_g #=z84rCWX4=)
at Aspose.Pdf.Operator.#=zwAmyEXg=(Int32 #=zVTdo7Mo=, #=ztcU$RTg4dbztq6VbK8ZbCHFbaFi070ZE8eHjqW9thJ_g #=z84rCWX4=)
at Aspose.Pdf.Annotations.DefaultAppearance.#=zfW4XeCs=(#=zLu5jpm9jX4Tm8fXTeNLJYyAaSlbMgni8uA== #=zW2qbS5TLh$Utd5_$Bw==)
at Aspose.Pdf.Annotations.DefaultAppearance…ctor(#=zLu5jpm9jX4Tm8fXTeNLJYyAaSlbMgni8uA== #=zW2qbS5TLh$Utd5_$Bw==)
at Aspose.Pdf.Annotations.WidgetAnnotation.get_DefaultAppearance()
at Aspose.Pdf.Forms.TextBoxField.#=zh32E2wKQkToV(#=z6nLsQfU_JaOF #=zcNboDaU=, Annotation #=z8PqDbq0=)
at Aspose.Pdf.Annotations.WidgetAnnotation.#=zxTh7IXA=(Annotation #=z8PqDbq0=)
at Aspose.Pdf.Page.#=zplEfRhs=(Boolean #=z1tFhC$xzvn$fLkumFw==)
at Aspose.Pdf.Document.#=zlW0m4gs=()
at Aspose.Pdf.Document.Flatten(FlattenSettings flattenSettings)
at Aspose.Pdf.Document.Flatten()
at Aspose.Pdf.Facades.Form.FlattenAllFields()

@NPSwaroop

Can you please share your sample PDF document for our reference with the sample code snippet? We will test the scenario in our environment and address it accordingly.