Skip to main content
Feb 15, 2017 5:40 PM UTC
Answered

Insert PDF after a selected page

I've built an action (using action wizard) in Acrobat XI Pro that inserts a single-page PDF file into another with this code:

this.insertPages({cPath:"/C/Scanning Temp Storage/Blank Red Page.pdf"});

I would like to find a way to have that page inserted after a selected page. So, varies from document to document.

I used to have this action working the way I want it, but it got broken after I had to migrate my customized actions from one Windows user to another.

Thanks for any help!

This topic is closed to new replies. Start a new post to keep the conversation going.
Joel Geraci
Joel GeraciCorrect answer
Community Expert
Feb 15, 2017 5:46 PM UTC

Your code would become...

this.insertPages({nPage: this.pageNum, cPath:"/C/Scanning Temp Storage/Blank Red Page.pdf"});

... to insert after the current page. This generally means the page that you see selected in the Pages view. I'm not sure what a selected page would mean.

4 replies

Joel Geraci
Community Expert
Joel GeraciCommunity ExpertCorrect answer
Community Expert
Feb 15, 2017 5:46 PM UTC

Your code would become...

this.insertPages({nPage: this.pageNum, cPath:"/C/Scanning Temp Storage/Blank Red Page.pdf"});

... to insert after the current page. This generally means the page that you see selected in the Pages view. I'm not sure what a selected page would mean.

Translate
Feb 15, 2017 5:49 PM UTC

This was exactly what I was looking for! Thanks

I knew about the nPage function, but I didn't know what the modifier for a current page would be.

Thanks again!

Translate
try67
Community Expert
Community Expert
Feb 15, 2017 5:43 PM UTC

By "selected page", do you mean the current page that is being viewed? If not, what do you mean, exactly?

Translate
Feb 15, 2017 5:44 PM UTC

Yep - has a blue "halo" when viewed in the page thumbnails tab.

Translate