Creating a Batch of PDFs With a Script
Outputting a PDF from a well-created InDesign file is quite painless. Outputting many PDFs from many well-created InDesign files is painless too, but it can take up a lot of your time.
Thankfully, there is a script that makes an otherwise tedious task only take a moment – Batch convert from Peter Kahrel.
In this article, the focus will be on producing PDFs from InDesign files, but Peter’s script does a lot more than that. It can also output IDML, EPS, PNG, RTF, XML, JPG, and packaged files from InDesign, INX/IDML, as well as old QuarkXPress, and PageMaker files.
Peter’s site does a great job of explaining how the script works, but there are some things that are worth mentioning before diving in feet-first to use the script.
First, I can’t stress the term “well-created” often enough. If you don’t have a Document fonts folder in the same directory as the InDesign file, it is possible to create PDFs with incorrect fonts. Justin Putney of Ajar Productions has a script that will package just the fonts used in your InDesign documents, relieving you of having to package a file just to make a Document fonts folder.
Likewise, if links have been moved, edited, or are missing, this can again result in incorrect PDFs.
Also, as Peter mentions, there is an option in the script’s dialog box called “View PDFs after exporting”. I would highly recommend deselecting this option, unless you want Adobe Acrobat to open dozens (or possibly hundreds) of PDF files as they are created.
Changing Layer Visibility With a Second Script
There is also a checkbox that allows you to run a script on each file prior to output. This can be very handy if your files require a final touch-up prior to outputting the PDFs.
For example, you might have a set of files containing a layer that has to be hidden prior to making PDFs. An additional script could be created and used with the Batch convert script to hide the layer. Using a text editor like Notepad, TextEdit, or TextWrangler, copy and paste in the following text:
//DESCRIPTION:single serving script to hide a layer called "Position"
app.activeDocument.layers.item("Position").visible = false;
Change both instances of the layer name from Position to the name of the layer you want to hide.
Then save the file as makelayerhidden.jsx
Now, run the Batch convert script, and in the dialog box, select the option to run an additional script, and choose your newly created makelayerhidden.jsx.
Note that this will produce PDFs with the desired layer hidden, but unless you also select the option to Save changed documents on closing, the next time you open your INDD files, the layer will again be visible.
Mapping Spot Colors With a Second Script
Another reason why you might want to use a second script is to map a customer’s spot color to a known Pantone color. In the example below, the customer’s spot color is “FIRE ENGINE RED,” but the spot color it has to match is Pantone 485, and that is not currently in the InDesign files. The script is:
//DESCRIPTION:Map color FIRE ENGINE RED to PANTONE 485 C if it isn't there app.activeDocument.importAdobeSwatchbookSpotColor ("PANTONE 485 C"); myInk = app.activeDocument.inks.item("FIRE ENGINE RED"); myInk.aliasInkName ="PANTONE 485 C";
These are only two simple examples. The Batch convert script’s ability to run another script before output can save hours of production time.
It is worth noting that this is not the only script that can run other scripts. Here are a few that I’ve found useful.
- For those wanting to apply many scripts to many InDesign files, Kasyan Servetsky has a script that will do just that.
- Loic Aigon has a user interface that allows a similar batch process script to be performed on one file.
- Rorohiko has its own version of an “InDesign Action Palette” called Action recorder. At the time of writing it is still in the Beta phase.
And finally, while you can download the Batch convert script for free, consider using the Make a Donation button on Peter’s site if you use the script and find it worthwhile. Support great scripters and their work!