Copy link to clipboard
Copied
Hi,
I'm new to Javascript and acrobat. I've figured out how to merge my PDFs, but now am attempting to reorder them. The same pages will need to be moved to the same positions every time the PDF is updated (page 5 to 10, pages 11-14 to 67-70 etc.). What's the best way to do this? I've already consulted the API reference and still can't figure it out.
I've attempted the this.movePage command as well as creating a temporary folder to hold the pages that I need to move. No luck.
Thanks for your help.
Moving pages like that is very tricky, as the structure of the document changes after each move, which means you need to re-calculate the correct page numbers for the next step. I prefer to extract the different sections as separate files and then re-combine them in the correct order, instead.
Copy link to clipboard
Copied
Well... the movePage method of the document class is the right one. It might be this.movePage if "this" is a document.
What have you tried, what context was it in, and what happened?
Copy link to clipboard
Copied
Moving pages like that is very tricky, as the structure of the document changes after each move, which means you need to re-calculate the correct page numbers for the next step. I prefer to extract the different sections as separate files and then re-combine them in the correct order, instead.
Copy link to clipboard
Copied
Thank you! I ended up extracting the portions using the insert pages method to put the document together in order.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now