Hi,
Environment: .Net 4.0, Aspose.pdf.10.3.0
I am unable to flatten a (attached example) pdf document by using the following code:
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(filename);This is the exception:
Aspose.Pdf.PageCollection pageCollection = pdfDocument.Pages;
Aspose.Pdf.Page pdfPage = pageCollection[1];
pdfDocument.Flatten();
{“Message”:“An error has occurred.”,
“ExceptionMessage”:“Object reference not set to an instance of an object.”,
“ExceptionType”:“System.NullReferenceException”,
“StackTrace”:" at Aspose.Pdf.InteractiveFeatures.Annotations.Annotation.\u001d\u0014(\u0003\u000e\u0013 , Page )\r\n
at Aspose.Pdf.Page.\u000e\u0010(\u0003\u000e\u0013 )\r\n
at Aspose.Pdf.Page.\b(Boolean )\r\n
at Aspose.Pdf.Document.()\r\n
at Aspose.Pdf.Document.Flatten()\r\n
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n at System.Threading.Tasks.Task.Execute()"}
The document is saved as PDF from a webpage using selectPDF tool. Can you please help with understanding how to resolve this issue?
Thank you,
Sireesha