Skip to main content
tye77723552
Participating Frequently
May 25, 2018
Answered

Duplicating a Page Using an Action

  • May 25, 2018
  • 1 reply
  • 3049 views

Hello,

I have a 1 page PDF document and I need to duplicate the page so that there are two of the same pages within the document.  Is there a way to duplicate the page using an action?  I have to do it to a bunch of documents. I am hoping to make it an action so that I can add it to a custom feature as I need other actions done to the document.  I don't have any experience using javascript but if that's the only way to do it, does anyone have the code to make it work?  Thanks for your help!

This topic has been closed for replies.
Correct answer try67

Use this code:

this.insertPages(this.numPages-1, this.path, 0, 0);

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
May 25, 2018

Use this code:

this.insertPages(this.numPages-1, this.path, 0, 0);

tye77723552
Participating Frequently
May 25, 2018

Thank you!

As I mentioned, I'm not experienced using javascript.  Where exactly would I input this code?  I created a javascript action but it then brings me to the editor where it says, "Document Javascripts, All Javascripts, Document Actions." What do I do from there?  Thanks for your help.

try67
Community Expert
Community Expert
May 25, 2018

If you mean an Action from the Action Wizard then you need to add to it an "Execute JavaScript" command (from the "More Tools" section), and set it to execute this code. Make sure to un-tick the stupid "Prompt User" box underneath it and to add a Save command after it, as well.