Page Size Lies

UPDATE 2021-10-08: Enfocus Pitstop has released an update that now resolves the error that was brought about by the update of Adobe Acrobat DC. However, I will leave the article posted for posterity.

Have you ever received a client’s InDesign file and sent it to PDF or print, only to measure the document and realise it is a different size to the one that was in InDesign’s document setup?

What could cause this issue to arise?

The page tool has been used

It is likely that at some stage between the initial creation of the file and receiving the file, at least one page size in the document has been changed using the page tool.

Preflight should tell me… right?

Well, that depends. If you are using either of InDesign’s default preflights (i.e. [Basic] or Digital Publishing) then preflight will not flag a warning.

I’ve discussed my frustrations with InDesign’s default preflights in Episode 19 over on the Colecandoo Youtube channel. However, if you are using a more comprehensive preflight such as the VIGC profiles, then this is detected as an issue:

More comprehensive preflights such as the VIGC profiles look for much more than InDesign’s default preflights e.g.:

As a side-note, the Document portion of the Preflight Profiles dialog box is also handy for authors who are making saddle stapled publications that must have page-counts in multiples of four (an issue I’ve faced several times) e.g.:

Or for larger offset publications where folded page signatures are likely to be prepared in minimum multiples of eight e.g.:

There are also scripts to highlight this

I’m working on a startup script that – upon export or print – should provide an alert dialog box warning that there are size discrepancies… but in the meantime there are some other scripts that work by providing alerts to a document’s page sizes, or a script hosted over on Kasyan Servetsky’s curated list that makes a list of the page sizes in a document (look for “Check all pages” once the link loads).

What I think would ultimately help everyone would be if the Document Setup window would change once page sizes in a document were no longer the same, such as this mockup e.g.:

Shortcut to rotate in fractions

A colleague of mine recently had a task of inserting lineart scans into an InDesign file and then rotating the images so that they were straight on the page.

During this process, he’d asked:

What’s the shortcut for rotating an image by a fraction of a degree?

While I can remember many of the shortcuts used in InDesign, I couldn’t remember a shortcut for this item, and after consulting my InDesignSecrets shortcut poster I realised that there isn’t one. There is a shortcut to increase the angle from 1 degree to 5, but not smaller increments… which I thought was something that people would have asked for by now.

For the task he was doing, he definitely needed one, otherwise the workflow was:

  1. Select the item to rotate;
  2. Go to the rotate tool;
  3. Type the fraction and click OK
  4. Check the result and if further adjustment was required, click back into the rotate tool and type a new fraction and try again until acceptable.

A shortcut would definitely make this easier.

Tomaxxi to the rescue

Luckily, one was easy to find online. Scripter Marijan Tompa (whom some may know by the name Tomaxxi) wrote an article on how to write such a script.

In my colleague’s case, the script only needed to be adjusted by changing the angle from 45 in Marijan’s example to 0.1 like so:

var myTrans = app.transformationMatrices.add({counterclockwiseRotationAngle:0.1});
var myObj = app.selection[0];
myObj.transform(CoordinateSpaces.pasteboardCoordinates, AnchorPoint.CENTER_ANCHOR, myTrans);

The script was saved as rotateAnticlockwise.jsx and added to the scripts. A second copy was made but this time adjusted from counterclockwise to clockwise like so:

var myTrans = app.transformationMatrices.add({counterRotationAngle:0.1});
var myObj = app.selection[0];
myObj.transform(CoordinateSpaces.pasteboardCoordinates, AnchorPoint.CENTER_ANCHOR, myTrans);<code>

This too was saved as rotateClockwise.jsx. and added to the scripts.

From here, my colleague could then go to the scripts palette and run the scripts as required.

Similarly, my colleague could make sure that scripts was checked from the quick apply menu.

And from here, go to quick apply by pressing Command + Return and typing the first few letters of the script. This choice would stay in the quick apply so need only be done once.

But the title of the article was a shortcut, so shortcuts had to be applied. That is easily done though by going to the Edit Menu and selecting Keyboard Shortcuts.

In the next dialog box, choose Scripts from the Product Area, navigate to the appropriate script, then place the cursor in the New Shortcut text field in the bottom right and press the keys to become the new shortcut. If the type beneath says [unassigned] it means it won’t interfere with other shortcuts, so click Assign. Do the same for both scripts, choosing different shortcuts for both.

Done. My colleague now had his shortcuts and could rotate the images without having to keep moving his cursor to the rotate panel and manually key in entries.

Given the scripts now had their own shortcuts, these were also visible in the scripts panel, just in case my colleague forgot what the shortcuts were.

But importantly because shortcuts were assigned, they could also be hot-keyed to his ergonomic mouse. Similarly, the commands could be hot-keyed to other inputs such as those discussed in a previous article.

On that note, I thought a shortcut like this would exist, given the amount of other shortcuts that allow for nudging/moving in smaller units. What are your thoughts? Let me know in the comments whether this is a specific use-case, or something to be pursued over at the InDesign suggestions.

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:

Adjustability

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

dialog.show();
//alert("Done");

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

//dialog.show();
alert("Done");

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

dialog.show();
//alert("Done");

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

//dialog.show();
alert("Done");

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.

Applying character styles over character styles

There may be occasions where more than one character style has to be applied to the same words, such as a highlight, italic, etc. I recently saw this request over at the InDesign requests page.

In the request, the requestor does hint at a way that this can already be achieved in InDesign, though it can be time consuming. Let’s start from the beginning and look at some text that has an italic character style applied to it.

But if I apply a separate highlight character style that I’ve also made…

The highlight appears but the italic is removed. Reapplying the italic character style to the word only changes the word back to italic and doesn’t preserve the underline.

One solution is to do a local override – that is to manually apply the appearance but without using a character style

Note the plus that appears to the right of the Paragraph Style 1 – this indicates a local override is present.

That works, but let’s say that the client asks for all italics to now be a tint of the colour initially used. That’s fine if character styles were applied as the italic style needs to be changed once in the properties of the character style. However, all the italics applied using local overrides will need to have their fills reapplied with the new settings.

Yes, the eyedropper tool and find/change can assist, but if character styles were applied, these additional steps would not be necessary.

In this circumstance, making a third style that has both the underline and italic would make sense.

In this case, it adds one more character style – not a big deal, but in a large document, the quantity of character styles can grow fast.

GREP Styles to the rescue

Take this chemical equation in a science textbook. It currently looks like this:

The subscripts in this equation have been applied with a character style that I’ve named sub. However, the author wants the reaction only in bold. If the equation is highlighted and then has a bold character style applied, this happens:

All of the subscript formatting of the numbers are lost.

I can then create a second style called “bold sub” that has bold and subscript properties and base the style on the bold formatting, but I then have to make sure I correctly apply the newly created style to the appropriate numbers… this now introduces a level of human error.

But what if I could apply the bold style and keep the subscripts? It is possible using GREP styles. Using the GREP code from this CreativePro post (look for Laurent Tournier’s post dated Oct 9 2010 in the comments) apply it to the paragraph style.

[editor’s note – I’ve adjusted mine to account for the naming of elements 113-118 as of 2018, so if you want that amended code, contact me via my contact page]

Now apply the paragraph style to the recently bolded text.

Brilliant! Note how the I-beam cursor is between two subscript numbers, yet the character style shows that this is bold only.

This technique can also be applied to other formatting where subscripts or superscripts need to be preserved, such as:

  • Ordinal Numbers
  • Numbers written with scientific notation
  • Squared or cubed measurements

It just requires the right GREP syntax. All of the above examples used GREP styles to format the subscripts and superscripts only. To learn this technique and others, apply to join the Treasures of GREP Facebook page.

Once again to illustrate the point, the author wants these six lines in bold. By highlighting the lines and applying the bold character style, the subscripts and superscripts stay in tact.

Nested styles

Similarly, this can also be achieved with Nested styles. Take the last two lines in the last example prior to applying the bold – if I want the ordinal number at the start of the line to be bold, I don’t have to write a GREP style but I can use a nested style such as the one below.

That will give me this result without applying any manual character styles to the text:

There are catches to this technique

The first catch is that the character styles must have the minimal amount of style changes only. That is the sub character style only changes the position of the character to subscript, so that is the only item that style will apply, while maintaining the rest of the paragraph style’s formatting.

The second catch is to be aware of the style hierarchy. The following list is in order of what style overrules another (from most to least dominant):

  • Local override
  • Local character style
  • Nested style
  • GREP style lowest in list in the paragraph style settings
  • GREP style highest in list in the paragraph style settings

There can be several advantages to layering character styles by using GREP styles:

  • Less character styles.
  • Time saving for commonly formatted items such as ordinal numbers.
  • Consistency based on GREP patterns for words.

Similarly, there can be drawbacks with this technique:

  • Looks for particular words or phrases, so not appropriate for instances where dozens of words or phrases may make more GREP styles than are manageable.
  • Applies to paragraph styles, if used over many paragraph styles, the GREP style needs to be applied repeatedly. Scripts can help with this, such as one I wrote on my scripts page, or GREP Editor from Peter Kahrel.
  • Can’t take a bold style and italic style and combine them – it can only apply additional attributes that weren’t there previously.
  • GREP styles (along with live preflight, page thumbnails, dynamic spellcheck and any other service that has to run while the document is being composed) can slow the processing speed of the machine, particularly on larger documents.
%d bloggers like this: