Newbie help:reordering a PDF

Community Beginner ,
Oct 03, 2017

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.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript

Views

130

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Newbie help:reordering a PDF

Community Beginner ,
Oct 03, 2017

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.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript

Views

131

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 03, 2017 0
Most Valuable Participant ,
Oct 03, 2017

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 03, 2017 0
Most Valuable Participant ,
Oct 03, 2017

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 03, 2017 1
ed_101 LATEST
Community Beginner ,
Jan 30, 2018

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 30, 2018 0