Skip to main content
Inspiring
Oct 3, 2017 9:46 PM UTC
Answered

Newbie help:reordering a PDF

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.

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Oct 3, 2017 10:51 PM UTC

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.

3 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Oct 3, 2017 10:51 PM UTC

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.

Translate
ed_101Author
Inspiring
Jan 30, 2018 5:11 PM UTC

Thank you! I ended up extracting the portions using the insert pages method to put the document together in order.

Translate
Legend
Oct 3, 2017 9:53 PM UTC

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?

Translate