Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Duplicate pages many times
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Duplicate pages many times

 Post Reply Post Reply
Author
FM Prepress View Drop Down
New Member
New Member
Avatar

Joined: 28 Dec 2012
Location: Portland, OR
Points: 2
Post Options Post Options   Quote FM Prepress Quote  Post ReplyReply Direct Link To This Post Topic: Duplicate pages many times
    Posted: 28 Dec 2012 at 5:58pm
The artist provides me with a multiple page PDF. (Sometimes 50+ pages.)
My task is to duplicate each page a variable number of times.
For instance, page 1 needs two copies, page 2 needs 12 copies, page 3 needs 50 copies.
I'll end up with a several hundred page PDF.
When there's just one or two duplicates, that's easy. When there's a lot of duplicates the "drag-and-drop sidebar thumbnails" method gets kludgy.
My question:
Is there a method or plug-in that allows me to efficiently make many copies of individual pages? I'm imagining something that has an input like:
Page X duplicate Y times

First post. Thanks for the opportunity to ask!
Regards,
Tim
Back to Top
Sponsored Links


Back to Top
khkremer View Drop Down
New Member
New Member


Joined: 17 Dec 2012
Location: Rochester, NY
Points: 23
Post Options Post Options   Quote khkremer Quote  Post ReplyReply Direct Link To This Post Posted: 28 Dec 2012 at 6:16pm
Tim, 

you can do this with JavaScript. Take a look at the JavaScript reference for the insertPages() function at http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/JS_API_AcroJS.88.499.html
If you don't have any programming experience, this may be a bigger task than you may want to take on. If you do have some programming experience, or are willing to learn, it's certainly doable. 

Let me know how familiar with JavaScript you are, and I will provide more information. 

Karl Heinz Kremer
PDF Acrobatics Without a Net

khk@khk.net
http://www.khkonsulting.com
Back to Top
FM Prepress View Drop Down
New Member
New Member
Avatar

Joined: 28 Dec 2012
Location: Portland, OR
Points: 2
Post Options Post Options   Quote FM Prepress Quote  Post ReplyReply Direct Link To This Post Posted: 28 Dec 2012 at 6:20pm
Thanks for the quick response, Karl. I'll dig in to this.
Regards,
Tim
Back to Top
khkremer View Drop Down
New Member
New Member


Joined: 17 Dec 2012
Location: Rochester, NY
Points: 23
Post Options Post Options   Quote khkremer Quote  Post ReplyReply Direct Link To This Post Posted: 28 Dec 2012 at 7:11pm
Which version of Acrobat do you have? I have some instructions for you that will work with Acrobat XI Pro:

If the "Tools" pane is not visible, click on the "Tools" button to activate it, then open the "Action Wizard" category and click on "Create New Action...". Open the "More Tools" section and move the "Execute JavaScript" tool to the right side. 
Click on "Specify Settings" to open the JavaScript editor and paste in the following code:

/* Copy Multiple Pages */

var pageConf = [
    [ 1, 1 ],    // page 1 - 1 copy
    [ 2, 2 ],    // page 2 - 1 copy
    [ 3, 3 ],    // page 3 - 1 copy
    [ 4, 4 ],    // page 4 - 1 copy
    [ 5, 1 ],    // page 5 - 1 copy
    [ 6, 1 ],    // page 6 - 1 copy
    [ 7, 1 ],    // page 7 - 1 copy
    [ 8, 1 ],    // page 8 - 1 copy
    [ 9, 1 ],    // page 9 - 1 copy
    [10, 1 ],    // page 10 - 1 copy
    [11, 1 ],    // page 11 - 1 copy
    [12, 12 ]     // page 12 - 1 copy
];

// create a new PDF file
var newDoc = app.newDoc();    // create a new document with one page

for (var i=0; i<pageConf.length; i++)
{
    for (var j=0; j<pageConf[1]; j++)
        newDoc.insertPages(newDoc.numPages - 1, this.path, pageConf[0]-1);
}

// we are done - remove the first page that was added when we created the new document
newDoc.deletePages(0);
// end of script

Make sure that "Prompt User" is checked, this will allow you to modify the settings when you execute the action. Save the action and give it a try. 
When the action executes, it will show the JS editor so that you can make any last minute changes (e.g. specify the number of copies to use for each page). You can modify the script to fit your needs for a particular document. 

Once the script finishes, you need to save the new document. 
Let me know if this works for you. 
Karl Heinz Kremer
PDF Acrobatics Without a Net

khk@khk.net
http://www.khkonsulting.com
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 28 Dec 2012 at 7:28pm
Also, though it may be overkill for your task, the Quite Imposing Plus plug-in has a duplicate pages function (under Page Tools) since version 3.
Back to Top
rkayd View Drop Down
New Member
New Member


Joined: 02 Feb 2017
Points: 1
Post Options Post Options   Quote rkayd Quote  Post ReplyReply Direct Link To This Post Posted: 02 Feb 2017 at 8:30pm
Is this JS supposed to work with Acrobat X? I've tried it and all it does is create an new file with a blank page and duplicate the original file exactly (with no duplicated pages). I used this code for the duplication settings:

    [ 1, 50 ],    // page 1 - 1 copy
    [ 2, 50 ],    // page 2 - 1 copy
    [ 3, 50 ],    // page 3 - 1 copy
    [ 4, 50 ],    // page 4 - 1 copy
    [ 5, 50 ],    // page 5 - 1 copy
    [ 6, 50 ],    // page 6 - 1 copy
    [ 7, 50 ],    // page 7 - 1 copy
    [ 8, 50 ],    // page 8 - 1 copy
    [ 9, 50 ],    // page 9 - 1 copy
    [10, 50 ],    // page 10 - 1 copy
    [11, 50 ],    // page 11 - 1 copy
    [12, 50 ],    // page 2 - 1 copy
    [13, 50 ],    // page 3 - 1 copy
    [14, 50 ],    // page 4 - 1 copy
    [15, 50 ],    // page 5 - 1 copy
    [16, 50 ],    // page 6 - 1 copy
    [17, 50 ],    // page 7 - 1 copy
    [18, 50 ],    // page 8 - 1 copy
    [19, 50 ],    // page 9 - 1 copy
    [20, 50 ],    // page 10 - 1 copy
    [21, 50 ],    // page 1 - 1 copy
    [22, 50 ],    // page 2 - 1 copy
    [23, 50 ],    // page 3 - 1 copy
    [24, 50 ],    // page 4 - 1 copy
    [25, 50 ],    // page 5 - 1 copy

I got the original 25 page file but it should be 1250 pages.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.09
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.032 seconds.