Skip to main content
September 7, 2016
Question

how to move pages within a pdf document using javascript based on the contents properties of an annotation.content property object

  • September 7, 2016
  • 1 reply
  • 615 views

Hi,

I have a pdf  document that has text annotation on every page within the pdf document

and I want to sort them out based on the getannotat.content property with javascript code

for example I want to sort them out based on an identical text content of annotation  make the pages after each other

how do I perform such thing with javascript ?

Best Regards .

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
September 7, 2016

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.