Under review

batch processing?

David Stirling 1 year ago updated by Yaroslav Glushchenko 11 months ago 17

I need to process several hundred PDFs and currently I need to open each file in Imposition Wizard, generate an imposition, then close the file by clicking the close-widow. Are there any options for batch processing a group of PDFs either via hot folder, AppleScript/JavaScript, and/or Acrobat Actions?

Under review

Hello David,

It looks like you don't see the private reply I sent you, so here is the public copy:

You can start here: https://pressnostress.com/impositionwizard/tutorials/command-line/basic/ - basically there are command line parameters that let you impose a PDF file using a specific preset. You make a preset, then run IW for all the files with that preset. The way you run it depends on the software you use, you can probably use the built-in Automator or make a simple bash script - it depends.

Let me know if you need more help with this, I will need some information about the PDF files you have. Say if you can put them all into a single folder and make another one for output files, I can make a simple sample bash script that will do the job.


Hello Vitaly thank you for the response! I'm sorry I didn't see your reply via email; unfortunately I think my company's filter stopped it. I will review command-line info to see if I can automate this way.

HI !

Did you have succes in hot folder ?
can I get a copy of the script ?

unfortunately, I was not able to get it to work. I modified the shell script in the instructions to account for the differences in the new version of the app, but I couldn't get it to reference the preset correctly and eventually I had to just drop it and proceed manually processing because I was on a tight deadline. 

can you share this script ?
may be I can change and help.

What OS versions and script environments do you use?

I could assemble some example scripts for Bash, Windows console (cmd.exe) and Python.

Hi !

Windows console will be fine !

I'm on a Mac and also tried to run shell script as well as applescript to automate process but failed. Can anyone post a working script?

OK, the first one for Windows.

The script presumes the following input/output folder structure:

- C:\PDFs\Automation                    <- main automation

  - Input                                          <- input files

    - Step & Repeat, 5x6                 <- specific preset folder

      - preset.iwPreset                      <- prepared Imposition Wizard preset

      - Some.pdf                                <- files to process

      - Another.pdf

      - One more.pdf

    - Booklet, 4-up, A4                      <- second preset folder

       - preset.iwPreset                      <- again, prepared Imposition Wizard preset

       - Test.pdf                                  <- more input files

  - Output                                         <- here will be put imposed files

    - Some_Step & Repeat, 5x6.pdf <- processed files will look like that

    - Another_Step & Repeat, 5x6.pdf

    - One more_Step & Repeat, 5x6.pdf

    - Test_Booklet, 4-up, A4.pdf

Besides "preset.iwPreset" files everything else is variable, script has few line with input/output folder paths at the top, just change them to what's right for you. Also, there's extra variable in the script header with path to the "Imposition Wizard.exe", this one must point to the app.

After that all you need to do is run the script, it will take each PDF in the input (presets) folder and process them into the output folder.

The script has lots of comments, but editing it will still require "windows command prompt" knowledge and I must say Windows console is quite a mess in my opinion... Still, one should be able to use it as a start and modify according to own needs.

The script: sample.cmd

I will publish another one for macOS and bash terminal later. Also, documentation page will be updated with those samples explained in details, in will take some time though.

Thank you very much I´ll test !

And here is macOS bash script: sample.sh

The idea, file structure and everything is the same.

Those script are sort of an example how "Imposition Wizard" can be used with command line, we'll make a proper tutorial page to illustrate the matter.

Would it be possible to update the applescript shown here:  https://pressnostress.com/support/iw-help/automation.html

AppleScript was supported by the old "Imposition Wizard" for Mac, newer one is cross-platform and supports only general command line arguments. We're discussing possible ways to make this easier to users, so stay tuned.

In the meantime that "sample.sh" script above should work. All you need is to open it with text editor and change input and output folder paths. After that you can run it via Terminal (Applications -> Utilities -> Terminal) by command like "bash ~/Desktop/sample.sh" without quotes - assuming you have that script on your Desktop.

I've tried it, nothing happens. Do I not need to identify which preset somewhere?

Sorry, I'm not as familiar with command line as I am applescript.

You need to change paths in the script.

Line 10 defines "app" - that's path to the Imposition Wizard application. It's probably OK already, just check it.

Line 12 defines "source_pdfs" - path to the root folder (see my comment above regarding the Windows script - same folder structure applies)

Line 14 defines "output_pdfs" - path to the folder where processed PDFs must be saved

Once script is fixed with those paths, it should work. While running it will print some logs like "Scanning {folder name}" and "Processing {pdf name}". Still, you'll need to prepare those input folders with presets - please, read my first comment.

To make the presets - open the app, setup imposition and save it as preset via File -> Presets... menu. After that, click File -> Useful folders -> Presets to navigate to the presets directory, copy correct preset (it's just a file) and put it into the input folder.

I understand it might be frustrating - don't hesitate to ask questions.

I got it! 

I had the paths defined correctly, but misunderstood what you said above about the preset folder needing to be inside the input folder, also in the bash script I needed to rename "preset.iwPreset" to match the name of my actual preset. Brilliant - thank you for your patience!!

It's better to keep "preset.iwPreset" in the script and re-name your preset files in the folders. You will have a folder per each preset anyways, you can always have folder name to reflect the job name.

The point is that way you can have multiply folders with different presets like Booklet-8-up/preset.iwPreset, Step&Repeat-5x6/preset.iwPreset etc.

Still, those sample scripts are just examples, you're free to modify them according to your needs.