Export many PDFs at once… plus security

A recent question on Reddit’s InDesign subreddit was whether two PDFs could be exported at the same time from the same document, but have two different properties – one with trims and one without. The answer is yes, but via a custom script written for the task.

I use such a script on a daily basis so that I can prepare a PDF for client proofing via email; and a separate PDF that has trim and crops that is sent directly to a hot-folder that prints it for me.

I’d submitted my script as a solution (that can be downloaded from the scripts page), but then realised that this concept was not a new idea. Ariel Walden over at ID-Extras had already written a similar script within a blog post of his own.

Similarly, Peter Kahrel’s Batch Convert script can perform the same task, with the added advantage that it can also do this for all open InDesign documents;

Or if no documents are open, a specified folder (and subfolders if desired) of InDesign files.

Can’t make these secure

One feature that all three scripts have in common is that the exports are based on the PDF presets available on the user’s machine. One feature that can’t be added to a PDF preset is security – this can only be done when a request to export the document is made, as security settings aren’t saved into PDF presets.

This is a problem if there are lots of documents that need to be exported with security settings as it requires the user to enter the security details each time a PDF is exported.

I’ve made an additional script

For this purpose, I thought I would make a script that not only makes several PDFs, but can also add password security to one version. The script can be downloaded from the scripts page.

When the script is run, it will generate two PDFs using different PDF export settings, but one will have the suffix “_secure” added to the filename, and a dialog box will appear once the export is finished:


The script can also be adjusted by opening the script in any text editing application and making the necessary changes, such as.

Use the same password for every document

Look for the line

    openDocumentPassword = myPassOpen; // requires a password to open the document

and change the myPassOpen to the desired password in quotations. For example:

    openDocumentPassword = "OpenSesame"; // requires a password to open the document

Similarly, do the same thing for the line underneath, making sure that the open password and edit password are not the same.

    changeSecurityPassword = myPassWrite; // requires a password to change the document

change to

    changeSecurityPassword = "EditSesame"; // requires a password to change the document

then search for the lines


and swap the forward slashes in the lines around so that the lines now read like this.


Only require a password to edit the document

Look for the following line:

    openDocumentPassword = myPassOpen; // requires a password to open the document

and add two forward slashes to the start of the line.

//    openDocumentPassword = myPassOpen; // requires a password to open the document

Adding two forward slashes to a line in a javascript tells the script to ignore the rest of the line and go to the next line of code.

Don’t show the “done” message

The default script has a dialog at the end for showing what the opening and editing passwords are, but if you want to edit the script so it makes a PDF that applies security to edit the document but does not provide the password (e.g. for the purpose of handing PDFs over to parties who may seek to deconstruct them in other applications) then make the adjustment mentioned a moment ago to restrict passwording to editing only, and then search for the lines


and swap the forward slashes in the lines around so that the lines now read like this.


Add more PDF exports

Look for the line

app.activeDocument.exportFile(ExportFormat.pdfType, File(resultsFolder + "/" + app.activeDocument.name.split(".indd")[0] + ".pdf"), false, "[High Quality Print]");

make a copy of the line and make the appropriate changes:

  • Replace the “[High Quality Print]” to the desired PDF preset exactly as it is written in the PDF export dialog box and put it in quotes. For example, if your PDF preset is called My Export then type “My Export”
  • Replace the “.pdf” with a suffix that denotes that this is an additional PDF. For example, if the pdf is a high res print, perhaps replace this with “_hi-res.pdf” so that the resulting file has _hi-res.pdf at the end of its filename.

Otherwise if you are after specific changes to the script to suit your needs, contact me via the contact page.

Things to know about the script

Opening and editing passwords must be different

One condition of preparing a secure PDF from Adobe InDesign is that the password required to open the PDF must be different to the password to edit the PDF, so if editing the script to replace the randomly generated password to a known one, the opening and editing passwords must be different. If the passwords are the same, the PDF will be made without security.

PDF Standard in the preset must be set to “None”

PDFs that use a PDFX standards can’t have security applied to them as the security panel of the PDF export box is greyed out, preventing security to be applied. The standards dropdown box in the desired PDF preset must be set to None.

Only password security is applied

When exporting a PDF from InDesign, only password security can be applied, unlike Adobe Acrobat’s choices of security that it can offer (as shown below).

While password security may deter or prevent a layperson from editing the PDF, the security can be broken through some effort. Several websites offer services where users can drag and drop a PDF to the site, and within moments the PDF will have the PDF password removed.

Similarly, there are desktop applications that can also be purchased to remove the security (as one of their many features), such as PDFsam Visual.

How NOT to make annotations in a PDF

In early July, I prepared a video for my employer that demonstrated how to mark up a PDF correctly, primarily how to use the commenting tools. This came about as a direct result of the Adobe Acrobat team removing certain icons from the comment panel, meaning that many of my customers had to be re-trained on how to mark-up PDF proofs that they were sent. Since July 12, the Acrobat team has decided to return one of the icons it had removed from the comment panel, but still pushes for the use of the blue arrow tool to make additions, deletions or replacements of text. I’m happy that the icon has returned, but frustrated that it was removed in the first place.


This is important because PDF mark-ups can use the annotations workflow that works like this – simple comments are taken into Acrobat using the comments tool and then imported directly into InDesign using plug-in software available from DTPtools. Here is a link to a video of the workflow in action – it effectively takes the mark-ups that were made in the Acrobat file into the ID file, and these mark-ups can be accepted or rejected in a similar fashion to revisions made in Microsoft Word.

There will be occasions that alterations outside of the scope of the annotations workflow will have to be made, but I would encourage anyone who has been asked to mark-up a PDF for their printer to please read these suggestions:

Use the Adobe Acrobat Reader

Yes it is possible to mark-up a PDF in other software such as Preview (Mac) or in some browser plug-ins, but for the mark-ups to save and be interpreted correctly by the DTPtools annotations plug-in, please use the Adobe Acrobat Reader.

Mark-ups only please

That being said, please do not:

  • attempt to make the changes live in the PDF, but instead use the commenting tools only. This means staying clear of the typewriter tool and only using commenting tools, namely the blue arrow tool to make deletions, additions or replacements (or use the classic icons); highlight or sticky note.
  • open the file in Microsoft Word and save it back as a PDF. This can make it impossible to tell the distinction between the two files and will result in the artwork being set up again from scratch.
  • print the PDF and then mark it up in pen, scan it to a new PDF – this will quite clearly not work with the annotations workflow.
  • add or delete pages from the PDF. If pages need to be deleted, use the mark-ups to indicate this. Likewise, if pages need to be inserted, use the sticky-note tool to inform the operator that pages need to be inserted.

Good instructions

  • Delays and misunderstandings because of unclear instructions = $. This will result in a new proof that will no doubt contain misunderstood edits will need to be corrected, resulting in further proofs, chargeable time, delays and frustration.
  • Make sure your instructions are so clear that edits are easily understandable by anybody. Even if you have had a conversation with someone about the alterations to be made, never assume that the person making the alterations will be the person you had a conversation with.


When working in groups

  • Make a distinction between comments intended for collaborators and authors; and comments intended for a printer. Collaborators generally know what is being referred to, but prepress staff are making changes only, so make sure that the instructions for the printers are easily understandable. Any notes, such as opinions (e.g. I don’t like that font), or topic specific queries (e.g. need to fact-check this statement) really should be between collaborators and authors.
  • “Duelling banjos”. If collaborators can’t agree on specific alterations, don’t take it out on the prepress operator – they are doing what they are told to do in the PDF. If there is a dispute between authors about what does/does not need to appear in the publication, resolve that prior to submitting the PDF to the prepress operator for changes.
  • When collaborating, make sure each collaborator is either looking at the SAME PDF, or the same COPY of the PDF, and that changes are submitted at the same time rather than staggered. There is a great video that specifically deals with collaborating groups here.

Think about the practical application of the mark-ups

  • Have realistic expectations of the edits. For example, supplying a 5 page word file with the instructions “fit on 1 page” is unrealistic.
  • Understand the implications of changes. For example, pages that are designed to work as readers’ spreads will be jeopardised if an instruction to shuffle pages forces the spread to break… a segue to this issue…
  • Shuffling pages… Again this can be quite confusing, especially if LOTS of pages are being shuffled around. Remember that shuffling pages can also break pages that are meant to appear together, such as pages set up as readers spreads. Make sure that the new order of the pages is clear to avoid any confusion.

Ultimately, a well marked-up PDF proof can result in more reliable changes being made faster and on-time.

%d bloggers like this: