Skip to main content
Inspiring
October 3, 2017
Answered

Newbie help:reordering a PDF

  • October 3, 2017
  • 2 replies
  • 637 views

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 has been closed for replies.
Correct answer try67

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.

2 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 3, 2017

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.

ed_101Author
Inspiring
January 30, 2018

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

Legend
October 3, 2017

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?