Advertisements

Referencing pages of a multi-page PDF file during data merge… workaround

At the time of writing, there are three multi-page/artboard file formats that Adobe InDesign can import when placing a file via the File/Place function. These formats are:

  • PDF
  • Adobe Illustrator
  • Adobe InDesign

(While it is possible to create many artboards in Adobe Photoshop, it is not possible to import a specific Photoshop artboard into Adobe InDesign… – at the time of writing that is – but that is another article!)

When placing one of these three formats, it is possible to control several import functions using the show import dialog box, such as:

  • Which page (or pages) to import;
  • How the pages should be cropped;
  • Whether or not to place the pages with a transparent background; and
  • What layers to show and their visibility;

However, when importing these file types as variable images during a data merge, these options are unavailable and replaced with the following:

  • Only the first absolute page of the file is imported (not always the page numbered 1 as the first page can also be – for example – in roman numerals or start at a page other than one); and
  • Page cropping, transparency and layer visibility is determined by the same variables as the last file of that type to be placed into the artwork.

For now, there is no workaround to control the latter issues during a data merge, other than to be familiar with this behaviour and plan the merge accordingly. There is a workaround for importing pages beyond the first page of a PDF file… but not an Illustrator or InDesign file.

Workaround: Split the PDF

The term “workaround” is used loosely in this context. Unfortunately, the solution is to break the PDFs into single page records. This can be done within Acrobat using the split button from the organise pages panel.

This feature also allows multiple files to be split at once.

By default, the resulting files will maintain the same filename with the addition of _Partx prior to the filename, with x representing the absolute page number.

Otherwise, I’ve prepared an action that you can download here that will save the PDFs to the Documents folder of the machine running the action.

(Yes, I’m also aware that there are quite literally hundreds of websites out there that will split multi-page PDFs to single PDFs for free. However, the methods outlined above will do so without involving a third party).

The next part of the workaround involves the data itself, and I’ll be using Microsoft Excel to create formulas to make the numbering for the resulting pages. All variable images being referenced will also be in the same folder as the data file, meaning only the filename is required and not the full path and the filename.

For data where the page number is known

Add a column to the database that references the absolute PDF page number that needs to be imported.

Absolute vs Section numbers abridged:

Absolute numbers refers to a page number based on the total count of pages in the document, while section numbers refers to the page number that was applied using page numbering in the application that made the PDF.

For example, take a PDF that contains 20 pages with the first six pages being in roman numerals, and the remainder being in decimal numbers. These two different styles of numbering are section numbers, while absolute page numbers refer to the total count of pages. To reference page iv of the PDF, the absolute page number to reference is 4. To reference page 5 of the PDF, the absolute page number reference is 11.

In this example, the A column represents the PDF to reference, the B column represents the absolute page number, and C represents the result. To obtain this result, the following formula can be used:

=SUBSTITUTE(A2,".PDF","_Part"&B2&".pdf")

This formula will look at filename reference and substitute the .PDF portion of the filename for _Partx.pdf, where x represents the figure in the B column. Using this formula, only filenames with the PDF extension will be affected, while filenames in other formats will be unaffected.

For data where the page reference needs to increment by one more than the row above

The same formula can be used for the naming, but another formula is used to determine if the page reference should increase if the same base file is being referenced in the row directly above.

In this example, the N column represents the PDF to reference, the O column represents the absolute page number, and P represents the result. A 24 page file NS91912 is being merged and needs to have the page reference incremented by one so that the filenames are NS91912_Part1.pdf to NS91912_Part24.pdf. The following formula can be used to change the page reference:

=IF(N2=N1,O1+1,1)

This formula will look at the filename and determine that if the filename is different to the row above, put the number 1 in the cell, BUT if the filename is the same as the row above, take the page value from the cell above and add 1 to it into this cell.

In a perfect world

Again, this is a workaround – it will only work for PDFs and requires some upfront work to prepare. Ideally, if I had my way and could implement some improvements, I’d like to see:

  • Not just the ability to choose a specific page, but choose the correct trim box and layers as well. For example, a file reference such as myFile.pdf;1,trim;Layer1,Layer2 where 1 represents the absolute page number, trim represents what trim box to use, and Layer1,Layer2 represent the layers I would like to appear (or leave the layer bit blank if all layers should be visible).
  • The ability to perform a similar task for incoming INDD, AI or PSD files.
Advertisements

Document Presets vs New Page Sizes.xml: Adding page sizes

A recent forum post concerning adding page sizes to InDesign’s Document Setup highlighted two different ways to accomplish this task. This article will explain both methods, and the strengths and weaknesses of each method as while they both perform similar tasks, they are not the same and can complement each other.

First method: Saved Presets

Before beginning, it is worth noting that when making a new document in InDesign, users will be presented with one of two different interfaces. In the latest version of Creative Cloud, the default user interface looks like this:

There is also the Legacy interface that long-time InDesign users will be more familiar with:

To choose to use the Legacy user interface, go to the InDesign Preferences (Command+K for Mac, Control+K for Windows) and check the Use Legacy “New Document” Dialog checkbox on. Alternatively if the new default look is preferred, uncheck the dialog box.

Making a saved preset in the default “New Document” dialog

Go to the New Document dialog box (Command+N for Mac, Control+N for Windows) to show the user interface.

Once open, go to the right hand side of the dialog box and enter the measurements, orientation and other desired options.

To save the preset, click on the icon to the right of the Preset Details heading and a new prompt will appear to save the preset.

Once named and saved, the preset can now be accessed in the Saved portion of the user interface.

Be careful in this window as deleting a saved preset will remove it without prompting for a warning.

Making a saved preset in the Legacy dialog

Go to the New Document dialog box (Command+N for Mac, Control+N for Windows) to show the user interface.

Once open, enter the measurements, orientation and other desired options. To save the preset, click on the icon to the right of Document Preset dropdown and a prompt will appear to save the preset.

Once named and saved, the preset can now be accessed Document Preset dropdown of the user interface.

The preset can be deleted by clicking the trashcan in the top right corner of the dialog box, but unlike the default interface, a warning dialog is presented.

Managing saved presets

Regardless of the interface used to make the preset, they are managed by going to the File Menu, Document Presets, then Define. This will present a new dialog box:

From this dialog box, it is possible to save presets so that they can be shared with others as a .dcst file; load preset .dcst files that others have created, as well as make new presets, edit or delete existing presets. Again, a warning will be presented if a preset is to be deleted.

Note though that when making a new preset or editing an existing preset that the Legacy dialog box is used.

Second method: New Page Sizes.xml

This other method calls upon an XML file that InDesign references for custom-made sizes. On a Mac, it can be found here:

/Users/your_own_username/Library/Preferences/Adobe
InDesign/your_version_of_indesign/language_installed/Page Sizes/New Page Sizes.xml

e.g.
/Users/JohnCitizen/Library/Preferences/Adobe InDesign/Version 14.0/en_US/Page Sizes/New Page Sizes.xml

This file can be edited to add custom sizes. By default, the XML file looks like this:

The syntax to create a new page size looks like this:

The <Name> tags refer to the name of the page size that the user will see in the New Document dialogs. The <Width> and <Height> tags refer to the measurements and these measurements are in points. Each page name, width and height are wrapped in their own <PageSize> tag.

For this example, I’ve taken in all A, B, C, D paper sizes as well as some imperial sizes and saved the XML file.

Anyone interesting in having this file can do so by downloading it here.

When I now open the default New Document interface, the new options now appear in the Print portion:

And here is what it looks like in the Legacy user interface:

Distinctions between Document Presets and New Page Sizes.xml

  • The default user interface will allow users to add Document Titles to new documents and also allow users to see page sizes at a glance, as opposed to the Legacy interface where page size measurements are only visible once a preset or page size is selected from the dropdown.
  • Selecting Create Alternate Layout from the Pages panel will show a new dialog box that contains pages added via the New Page Sizes.xml file. These page sizes will be able to be selected from the dropdown, while page sizes made via the saved presets will be unavailable.
  • The New Page Sizes.xml will only add names of page sizes, widths and heights; while adding presets stores more information such as total number of pages, page orientation, page size (including pages that can be accessed from the New Page Sizes.xml), amount of columns, margin dimensions, bleed and slug settings, and whether to have facing pages or primary text frames.

Add a “Night” mode to InDesign

In the same way that different political or religious views can polarise a group of people, so can one specific InDesign feature: Light or Dark interface.

Introduced into InDesign CC in 2013, this change brought InDesign in line with other Creative Cloud products that had a dark interface. That said, I was not a fan and chose to remain a user of the light interface.

Many years later and Apple released the macOS Mojave with its Dynamic Desktop and Dark mode. The Dynamic Desktop feature shows a bright desktop during daylight hours and a dark desktop during the dark hours. In addition, popular apps also followed suit allowing users to switch from the usual view to a “night mode”.

In addition, I have found myself working late into the night on projects, and have found that a darker interface during these hours is easier on my eyes. That said, I still like to use a light interface when working in daylight hours.

With this in mind, I wondered if it was possible to create an InDesign startup script that – upon performing a common task such as opening a file – would check the time of day and if it was beyond a certain time of the day, would invoke the dark interface… and it was.

I’ve now added this script to the site and it can be downloaded from here or the scripts/download pages. As this is a startup script, it has to be added to the Startup Scripts folder (see Ole Kvern’s excellent instructions for doing so here).

The script can also be modified to suit by going into any text editor such as textedit or notepad and editing the following lines of the script:

if (hours <= 7 || hours >= 18)

This indicates the hours of the day. In the script, 7 = 7:00 am, and 18 = 6:00 pm.

app.generalPreferences.uiBrightnessPreference = 0.0;

This refers to how dark the interface should be. 0.0 is totally dark, 1.0 is bright, but values from 0.1-0.9 can be used as well.

app.generalPreferences.pasteboardColorPreference = 1; 

This refers to the color of the pasteboard. The number 1 will match the pasteboard color to the interface, whereas 0 will leave the pasteboard white.

So technically it’s not a night-mode per se, but for those who like the light interface until the night-time hours, this script may be something to consider.

Made it to Adobe Make-it 2017

Moments before the start of MAKE-IT 2017

Moments before the start of MAKE-IT 2017

Between August 2-3, the International Convention Centre in Sydney played host to the Adobe MAKE-IT conference, a gathering of close to 2,000 creatives and design professionals from Australia, New Zealand and beyond. While I was unable to attend the sessions on August 2 as the sessions were sold out, I was lucky enough to attend the conference on August 3 thanks to my employer – Openbook Howden Print & Design – providing me the leave at very short notice, for which I am truly grateful.

Speakers on the day of the conference included several creatives in differing fields including an animator using a variety of media; a conflict-zone photographer; a craft-based designer; a social media “disruptor” and author of the “Sharpie-art Workshop” book; and a self proclaimed “digital hipster”. Other speakers included several Adobe staff, including Adobe evangelists Paul Burnett and Photoshop guru Julieanne Kost.

While there were no jaw-dropping announcements about product releases or upgrades, Adobe did provide glimpses of ongoing upgrades and projects such as Project Felix, Adobe Character Animator, Adobe XD, Lightroom enhancements, Adobe Stock improvements, and a revamp of their Youtube site to make easier to follow tutorials.

The conference also provided me an opportunity to catch up with several speakers who had presented sessions the previous day, and whom I have met before at various CPN conferences such as PEPCON, The InDesign Conference and CreativePro Week.

20543749_10210971583943059_119809825686339762_o

Jesús Ramirez, Julieanne Kost, Mark Heaps, Karen Alsop and Colin Flashman at Adobe MAKE-IT 2017. Photo credit: Mark Heaps.

As someone who uses InDesign for most of their work, I was a little deflated that the software barely had a mention during the conference. Nevertheless, programs that were more familiar to the rest of the audience such as Photoshop, Illustrator and After Effects – applications I also use regularly – featured predominantly.

It was great to see so many people both in attendance and watching online, and hope that not only that the event can return next year, but with greater scope to be the “Mini-MAX” event for Australians who can’t necessarily make it to Adobe MAX in the USA.

%d bloggers like this: