Duplicate pages

Post Reply
youngy4130
Newbie
Posts: 16
Joined: Wed Apr 13, 2016 2:42 pm

Duplicate pages

Post by youngy4130 »

After searching around a bit I've seen this asked before but it doesn't look to have the answer I'm looking for.

Trying to duplicate pages in a PDF a variable number of times, the variable number is coming from an XML. Looks like JS is the best option.

I'm trying to use the .insertPages function but it doesn't seem to work... Anyone have any ideas or suggestions?

Thanks.
sander
Advanced member
Posts: 276
Joined: Wed Oct 01, 2014 8:58 am
Location: The Netherlands

Re: Duplicate pages

Post by sander »

You want it with scripting? I made this once in my beginning Switch days, haven't failed once :) If you want I can comment it, all done without scripting :)

Image
freddyp
Advanced member
Posts: 1022
Joined: Thu Feb 09, 2012 3:53 pm

Re: Duplicate pages

Post by freddyp »

Impressive Sander, but how about this solution? ;)
Screen Shot 2017-06-23 at 13.48.48.png
Screen Shot 2017-06-23 at 13.48.48.png (55.18 KiB) Viewed 14809 times
Both your and my solution duplicate pages like this 1234,1234,1234, but perhaps it has to be 111,222,333,444 or still something else? The apps handle it all and in a much simpler way.
sander
Advanced member
Posts: 276
Joined: Wed Oct 01, 2014 8:58 am
Location: The Netherlands

Re: Duplicate pages

Post by sander »

Well, like I said it's one of my first Switch touches, now I'm wondering why I'm injecting and deleting haha, should rework it once :) It can be done better but hey, if it ain't broken.. ;)
It's not really only duplicating, it is a sheet filler and one card becomes the orderform via PitStop, one of the arrows hold some logic to check if the sheet is filled to move along.
Fist
Member
Posts: 27
Joined: Mon Aug 31, 2015 2:49 pm

Re: Duplicate pages

Post by Fist »

sander wrote:You want it with scripting? I made this once in my beginning Switch days, haven't failed once :) If you want I can comment it, all done without scripting :)

Image
Sander, Would like to know how it works. Looking for this kind of solution.

Regards

Fist
cwswitch
Member
Posts: 78
Joined: Fri Feb 24, 2017 12:25 am

Re: Duplicate pages

Post by cwswitch »

I'm curious how you got on here.

I'd like to have a PDF and a string of numbers like this example

Code: Select all

Input 
We’d have a multi page PDF and a string of numbers. 
 
Output 
The PDF pages would be duplicated as noted by the numbers. 
 
Example IN 
5 page PDF 
Text file containing 3 9 7 1 3 
 
Example OUT 
23 page PDF with pages; 
11122222222233333334555 
The number of pages in the PDF and the number of copies in the text file would be custom to each job so would require variables I believe.
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Duplicate pages

Post by jan_suhr »

You have to use PDF Toolkit for this and run it with Execute Command. Then you have to construct a shellscript or BAT-file that contains the commands to make your new PDF. PDF Toolkit uses the cat command for it.
https://www.pdflabs.com/docs/pdftk-man- ... est-op-cat

You can use my free APP Execute Command Friend to dynamically create the shellscripts from Switch variables.

Jan
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
sander
Advanced member
Posts: 276
Joined: Wed Oct 01, 2014 8:58 am
Location: The Netherlands

Re: Duplicate pages

Post by sander »

Hmm, I was in the assumption I did post both on the forum as well as a private message to Fist.

His question is to duplicate the 57th page of a pdf and inject it after each of the other 56 pages. I don't use this flow but I adjusted a flow made earlier: https://we.tl/ujEPpm5lFM
Based on topic over here: viewtopic.php?f=12&t=1236&p=4253

I bet it will get your started if you want a Switch only solution :)
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Duplicate pages

Post by jan_suhr »

It can be done with my App Duplicate PDF Pro that Freddy suggested early in this thread.


Jan
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
cwswitch
Member
Posts: 78
Joined: Fri Feb 24, 2017 12:25 am

Re: Duplicate pages

Post by cwswitch »

We purchased and use Quite Hot Imposing with Switch and if I could talk to it with a script I would be so happy and so productive.

They say it can be used that way but that they can't support you in doing so as they are not script writing people.

Would I be able to use your command friend to run Quite Hot Imposing in a similar way do you think?
jan_suhr wrote:You have to use PDF Toolkit for this and run it with Execute Command. Then you have to construct a shellscript or BAT-file that contains the commands to make your new PDF. PDF Toolkit uses the cat command for it.
https://www.pdflabs.com/docs/pdftk-man- ... est-op-cat

You can use my free APP Execute Command Friend to dynamically create the shellscripts from Switch variables.

Jan
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Duplicate pages

Post by jan_suhr »

I don't know how the scripting for Quite Imposing works but if you can send a script file to it I think that my app "Execute Command Friend" could work.

It will let you create a dynamic shell script from Switch variables that can be used by an application that needs a script to run.

Jan
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
Post Reply