Skip to main content
February 15, 2017
Answered

Insert PDF after a selected page

  • February 15, 2017
  • 2 replies
  • 1101 views

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

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.

2 replies

Joel Geraci
Community Expert
Joel GeraciCommunity ExpertCorrect answer
Community Expert
February 15, 2017

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.

February 15, 2017

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!

try67
Community Expert
Community Expert
February 15, 2017

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

February 15, 2017

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