Page 1 of 1
Duplicate pages
Posted: Fri Jun 23, 2017 11:32 am
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.
Re: Duplicate pages
Posted: Fri Jun 23, 2017 12:22 pm
by freddyp
Re: Duplicate pages
Posted: Fri Jun 23, 2017 12:33 pm
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

Re: Duplicate pages
Posted: Fri Jun 23, 2017 1:57 pm
by freddyp
Impressive Sander, but how about this solution?

- Screen Shot 2017-06-23 at 13.48.48.png (55.18 KiB) Viewed 54404 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.
Re: Duplicate pages
Posted: Fri Jun 23, 2017 3:28 pm
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.
Re: Duplicate pages
Posted: Thu Jun 29, 2017 8:31 pm
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

Sander, Would like to know how it works. Looking for this kind of solution.
Regards
Fist
Re: Duplicate pages
Posted: Wed Jul 12, 2017 4:30 am
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.
Re: Duplicate pages
Posted: Wed Jul 12, 2017 8:23 am
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
Re: Duplicate pages
Posted: Wed Jul 12, 2017 11:58 am
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:
https://forum.enfocus.com/viewtopic.php ... 236&p=4253
I bet it will get your started if you want a Switch only solution

Re: Duplicate pages
Posted: Wed Jul 12, 2017 12:15 pm
by jan_suhr
It can be done with my App Duplicate PDF Pro that Freddy suggested early in this thread.
Jan
Re: Duplicate pages
Posted: Wed Jul 12, 2017 11:57 pm
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
Re: Duplicate pages
Posted: Thu Jul 13, 2017 10:11 am
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