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

Free Support Forum - aspose.com

Issues with document flattening with annotations

Aspose library:
Aspose.pdf -> 21.9 (DotNet version) (We have recently upgraded from 20.3 as per your support recommendation)

• Document flattening doesn’t work for documents with more than 50 pages [SupportTicket].
• Annotation flattening for Highlight is inconsistent.

        Basically we are trying to create a pdf document with Aspose annotations applied on them. So we are creating an Annotation object and adding it on to annotations collection on a page object and perform annotation flattening.
        Code snippet below. With this, the Highlight annotation doesn’t get rendered correctly.

                    Eg.    var Annotation = AnnotatePage(pageSelected, clr, opacity, type, title, createdDate, subcoords);

And while trying other workaround, we observed that performing a Document flattening instead of Annotation flattening, renders the Highlight annotation as expected.
But this introduced another limitation, where if the document is more than 50 pages none of the annotations are being flattened on the document. It works fine for documents with less than 50 pages.

Original doc with Highlight annotation:
Snippet1.jpg (13.8 KB)

        Annotation.flatten() document:

o Highlight is not being applied
o Right section indicates there are no unflatten annotations
Snippet2.jpg (19.2 KB)

        Document.flatten() document:

o Annotations are retained, but none of them are flattened, as seen on the right comments section.
Snippet3.jpg (36.5 KB)

Expected result:
We expect all the annotation to be flattened on the document without any inconsistency, irrespective of number of pages on the document.

Additional Notes:
We were informed that these issues were addressed in the 21.9 version of Aspose libraries. Hence we have got it upgraded. But it still doesn’t seem to work. Please help.


Would you please share the sample PDF for our reference so that we can test the scenario in our environment and address it accordingly? Also, please share the ticket ID which was resolved in 21.9 version.

On the document (Doc_HighlightIssue.pdf), we have added some highlight annotation on first page, and when we did Annotation.Flatten(). Notice the highlights doesn’t show up after flattening (Doc_HighlightIssueFlattened.pdf).

On the document (Doc_50PlusPage.pdf), we have added some annotations on page number 101, and when we do Doc.Faltten(), none of the annotations are flattened and can be seen in comment section of adobe reader (Doc_50PlusPageFlattened.pdf).

Original docs are attached as well.

Doc_50PlusPage.pdf (64.0 KB)
Doc_50PlusPageFlattened.pdf (63.9 KB)
Doc_HighlightIssue.pdf (292.6 KB)
Doc_HighlightIssueFlattened.pdf (294.4 KB)
Original_Doc_50PlusPage.pdf (85.8 KB)
Original_Doc_HighlightIssue.pdf (290.2 KB)

I do not have the ticket id referencing the fix done in 21.9 release. I had looked up on one of the support page, which had mentioned as this issue was fixed. But unfortunately, I am unable to find the page again. Below are some of the historic tickets created for the same issue, looks like the issue hasn’t been addressed yet.


We were able to notice the similar issue in our environment while testing the case with Aspose.PDF for .NET 21.10. Therefore, a ticket as PDFNET-50822 has been logged in our issue management system for the sake of correction. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi @asad.ali, Do we have any update on PDFNET-50822 issue?


We are afraid that the earlier logged ticket is not yet resolved due to other issues in the queue. We will definitely investigate and resolve it on a first come first serve basis and let you know as soon as some significant progress is made towards its fix. Please spare us some time.

We apologize for the inconvenience.