Issue: Flatten Annotations

Product: PDFTron.NETCore.Windows.x64

Product Version: 9.5.0

Please give a brief summary of your issue:
Version 9.5.0 introduced an issue and still exists in v10.0.0 (using pdfDoc.FlattenAnnotations() method)

Please describe your issue and provide steps to reproduce it:
We use two PDF libraries in our application iText and PDFTron to do pdf manipulations. We use PDFTron only to flatten annotations and iText for anything else. After doing PDF manipulations and flattening the file, the application uses iText lib to compress the file with what is called “Smart Mode” which basically removes duplicate pdf objects (font etc) from the file making it small in size.
This was working without any issues with PDFTron version but after version 9.5.0 it started throwing exception when it is compressed with “Smart Mode” of iText with “Index was outside the bounds of the array.” message.

Please provide a link to a minimal sample where the issue is reproducible:
This record involves 69 documents, currently I am using elimination approach to identify if there is some file that causes this problem. Once I find the file I will provide it here.


Thank you for contacting us about the issue you’re facing with pdfDoc.FlattenAnnotations(). To help us investigate this further, could you please provide us with the file that’s causing the exceptions? This will enable us to better narrow down the problem.

If you prefer to forward us the file using our Support portal, please click here to open a ticket. Alternatively, you can send us an email at

Hi @shakthi124,

I have created a ticket that includes all the information. Please let continue this thread in the ticket. Thanks.

After further investigation I find that this is not flattening annotation issue but saving document issue. It seems the PDFTron document save has some issues. The details are in the ticket.

[#49474] PDF Document Save issue (v9.5.0) : Apryse