I have a pdf document that has text annotation on every page within the pdf document
for example I want to sort them out based on an identical text content of annotation make the pages after each other
Best Regards .
This is quite a complex task. First of all you will need to collect the annotations into an array and then write your own sorting function that will sort it. Then you will need to write a recursive function that sorts the pages based on the new order of the array.
Alternatively you could export the pages and then re-combine them in the desired order. I prefer to do that then try to re-sort the file directly, but it's not that simple, either.