Change the background highlight of PDF form fields in a document

During the CreativePro conference in New Orleans, a question was raised during Chad Chelius’ session about Designing forms in InDesign and Acrobat: how to change the background highlight colour of the fill-in forms within Adobe Acrobat. It is possible to change the value of that colour via the Highlight Colour from the preferences panel, but this is an application-wide change, and changing the colour in one form will change the colour for all documents that are opened thereafter.

fig1

This will also only change the colour on the viewer’s PDF, not the PDF itself.

Luckily, it is possible to change the colour via scripting that will affect the current form but leave others alone. Take the following example – in this form, I would like the background to be grey, rather than the default blue:

fig2

Open the PDF that needs the background to change and open the page thumbnails panel. Right click on the page and select the page properties item.

fig3

In the new dialog, go to the Actions tab at the top right, and then add two actions: on Page Open, run a javascript, and on page close, run a javascript.

fig4

Click on the Page Open Run a Javascript selection and click edit, and in the new window, type the following and click OK.

fig4A

Click on the Page Close Run a Javascript selection and click edit, and in the new window, type the following and click OK.

fig4B

Repeat adding the page level scripts for each page in the PDF. This example has one page, but for a four page PDF, this would need to be done on each page of the PDF.

Save and close the PDF. Open the PDF again and the background has now changed to gray.

fig5

The two javascripts work by saving the current application preferences into memory, and then changing the preferences until the document is closed, and then reloads the original preferences.

The background of any PDF form opened will now be gray until the PDF is closed, so close the PDF and open another PDF to confirm that the background returns to normal.

fig6

If you would like colours other than gray, the javascript syntax for the colour can be found here:

A similar technique is shown in this article in the Acrobat Users forums.

 

 

Advertisements

Data Merging to specific pages

I was recently faced with the following brief:

I have a database that need to be run through the Data Merge to Single Record script. Some of them need only page 1 and some need page 2. Is there a way to add another column in the database and let InDesign know if it should export page 1 or 2? 

My original thoughts were that this could not be done, but then I realised there is a new feature added in Adobe InDesign CC 2018.1 to the PDF export: Create Separate PDF Files.

mergemerge001

I decided to create a new PDF export style and ensured that the Create Separate PDF Files checkbox was turned on, and make sure that the numbering is based on page numbers.

mergemerge002

Wondering if this would work, I created the following scenario – thank you graphics to be emailed to contributors to this site, based upon three available contribution values. The InDesign file is 3 pages long, has two different page sizes, and is linked to a Data Merge of 1,000 records that has – among its fields – a field called “Variable” that has one of 3 values in the field – 5, 10 or 25. Page 1 is the five dollar campaign, page 2 is the ten dollar campaign, and page 3 is the twenty five dollar campaign.

mergemergesplash

For the sake of this demonstration, I’m going to try with records 1-25. Running the Data Merge to Single Record script available from the downloads or scripts pages of this site, I make sure that the variable field is part of the filename, but ensure that it is the last part of the filename:

mergemerge003

I let the script run, and then once complete, the Results folder appears as follows:

mergemerge004

So right now, there are myriad folders and files, so this looks like a complete mess and failure. However, using the search function at the top right of the finder window, I’m able to find what I’m after. I’d like to find all of the five dollar PDFs first, so I type in 5_01.pdf into the search field, ensuring I’m searching on the Result folder. Why 5_01.pdf? Well, the 5 was the variable in the variable field, and 01 was the page number associated in the InDesign file to the five dollar campaign.

mergemerge005

So this found 11 records. I’ll move those records into a folder elsewhere and look for the other PDFs in a similar fashion: 10_02.pdf and 25_03.pdf

I now have all the records required, and can remove the remaining records from the Results folder, so that’s great for creating single page PDFs by using one InDesign file for multiple campaigns.

Modifying the technique for JPG or PNG

If I want the files as JPG or PNG instead, I could use the Data Merge to Single Record script and merge to InDesign files without splitting the files into single records, and then use Peter Kahrel’s Batch Convert script to export to JPG or PNG.

It is then possible to perform a similar search that was used to separate the earlier campaigns.

Doing the modified technique in less steps

Or, if you want to run one script instead of two, perhaps consider having a look at the Data Merge to Single Records PRO version:

mergemerge010

Run the script and then perform the search that was used to separate the earlier campaigns.

If you’re interested in the Data Merge to Single Records PRO version, please contact me via the contact page.

Another Data Merge script: Data merge to batches

This latest script compensates for a feature that should be available in InDesign’s Data Merge feature, but simply doesn’t work.

The problem:

Take for example the following Data Merge file where we want to export a custom range, but prepare PDFs in batches of 50s for production purposes. Each record is one page long.

dmlots001

When the Data Merge feature is used in Adobe InDesign, it is possible to merge to several new InDesign files that contain a maximum amount of records per file. The same dialog box is present when merging directly to PDF as well.

dmlots002

Unfortunately, the Record Limit per Document checkbox may as well be there for decoration, because it doesn’t work. Instead of 13 PDFs being created with the maximum size of each PDF being 50 records long, a PDF the size of the complete merge file is created.

dmlots003

The workaround

It is possible to split the document into ranges 50 pages per PDF, but it has to be done in Acrobat. From here, click the Organize Pages button.

dmlots004

This will show the Organize Pages toolbar.

dmlots005

From here, click on the split icon to show the split pages portion of the toolbar.

dmlots005

With the split pages toolbar now visible, choose the appropriate split by dropdown and edit the amount required. In this case, we need “number of pages” and 50 pages.

dmlots005b

The files now need to be saved somewhere. Click the Output Options button to show the Output Options dialog.

dmlots005c

Select a destination for the files and any additional filenaming information and click OK.

dmlots006

Once back at the regular toolbar, click the big blue split button.

dmlots005

The task will run and then present a dialog box once it is complete.

dmlots007

On an example such as the one demonstrated, this isn’t an onerous task. However, if working in a production setting where PDF page lengths can be tens of thousands or longer, this is inconvenient and unacceptable.

The solution

Rather than use the Adobe Acrobat solution, I would prefer that the original dialog box worked correctly. One option is to let the Adobe InDesign Engineers know that it should be fixed. A link to the direct request can be found here.

Until it is fixed, I’ve written a free script specifically for this purpose.

dmlots008

Using the earlier example, the same settings will be keyed in.

dmlots009

Once keyed in, click OK. A progress bar will let you know how the merge is going.

dmlots010

An alert will let you know when the merge is complete. The files are then saved to the selected destination with no extra splitting required.

dmlots011

Interested in this script? It can be downloaded from here.

The wall planner script cometh!

In my last article “My Calendar Caffuffle“, I’d mentioned that I was working on a wall planner script for a Christmas release, but due to many factors I was unable to release this script and instead opted for a smaller script that – for many regulars to this site – didn’t really feel like much of a Christmas gift.

To this end, I felt like I let my supporters down and had to make sure that amends were made in the new year. On that note, I was able to work through the issues that held back the script, and I can now release the script free to the public:

01-ui

This script will create a twelve month planner based on a start month and year, and to an output size in millimetres. There are one of four ways to display the planner based whether the months should appear in rows or columns, and whether the planner should be condensed or expanded. For example:

02-orientations

Before you say “I don’t like the colour”, note that the script creates the necessary styles so that the wall-planner can be tailored to your needs:

03-styles

Don’t fancy starting the calendar in January? That’s no longer an issue either, the planner can start on any month:

04-midyear

So that’s the free version of the script that can be downloaded from the downloads page now.

Want more? Well, I’m also working on a pro-version of the wall-planner script that will have additional features such as:

  • highlight school days from known dates, a customised range, OR a text file;
  • add events from a text file that contains the dates and events;
  • (in expanded format) begin the planner on any day, not just Monday;
  • highlight cells based on Find/Change or GREP searches;
  • additional formatting options (appearance of months and days).

Screen Shot 2018-03-03 at 22.46.50

06-proresult

Lastly, speaking of pro-versions, I’ve also been busy improving my long-popular Data Merge to Single Record script for its pro-version release. Don’t panic, the free version will remain, but to access features shown in the dialog box below, the pro-version will be a paid release.

07-sneakpeek

If you’re interested in the pro-versions of the scripts mentioned in this article, please contact me through the contact page.

%d bloggers like this: