InDesign CS4 : Developer View

The recently released InDesign CS4 comes packed with a long bullet-list of new features. Here are a few that stand out from a Creative Suite developer’s perspective :

GREP pattern matching for styles

You can now set a style to apply to a range of text that matches a grep-style pattern. For instance you could use a pattern like :

'@/:[:space:]]+>@[a-zA-Z_.]+?.[a-zA-Z]{2,3}'

to automatically apply a specific style to anything that looked like an email address. I’m not sure what the intersection is between page layout designers and grep pattern wizards, but the nerd in me loves the idea.

Links architecture updated

The underlying architecture for linking to an externally placed image or text file in an InDesign document had really been neglected over the years since InDesign was first released. Almost all interesting workflow systems based on InDesign require implementing custom data link code to enable linking to images and text stored in a content or asset management system. Previously, these custom links were very hard to implement and introduced fragility and complexity to the final solution.

I’m happy to report that with CS4 they have rewritten this component and it appears they have focused on extensibility. It may be the case that many applications of custom links will now only have to provide a URL to the links manager. The new links manager makes no assumptions about a link being file system based making it easier to maintain the linked data in a database or other network resource. Its also now possible for custom links to add UI to the links panel.

The rewrite has also opened the door for some clever new applications for links as evidenced by the SDK example pluginsExtendedLinks and ExtendedLinks UI. These samples show how to use the new links APIs to link a range of text to a database using an ODBC connection. The obvious application being of course to pull in variable data, such as prices for a catalog, from an external source with automatic updating in the document content when that source data is upated.

Once again, Tim Cole has more info at his blog.

Custom palettes with Flash/FLEX

Creating UI has been on of the consistently painful areas in developing for InDesign. Compared to the ease of development offered by modern UI frameworks such as the Cocoa APIs on the MacOS, InDesign’s widget architecture feels almost as stone age as the old MacOS toolbox or Win32 APIs. This is especially true if you have to develop custom widgets that don’t already exist in the SDK’s catalog of controls.

CS4 brings an interesting new development technique that shows promise of easing the burden. It is now possible to use Flash and FLEX to create UI in a custom palette or dialog box. Not only is this a path to cross-platform UI, it is also possible to use the same UI components across other CS4 applications including Photoshop and Illustrator! Adobe has an excellent example that they demo often (I hope they will open source this soon) that adds Kuler integration in both InDesign and Illustrator using a .swf for all the palette user interface.

Even more relevant is that you can now get your game on, right inside an InDesign palette. Here is an example of running the Amoebas Flash example, an Asteroids clone, in its own custom InDesign palette :

InDesign palette

Live Preflight

One of the most high-profile user facing features in CS4 is the new Live Preflight. The premise of this feature is to provide active feedback in the document’s user interface that describes possible problems in the document that a designer would want to correct before sending the file off for print or to another stage in a workflow. The preflight engine runs in the background while the user works and checks for conditions that would indicate an error in the document. This feature can be a boon to catching common problems with transparency and overprint as soon as they happen during the creative process.

Of relevance to developers is that a plugin can provide custom rules to the engine. This will allow us to integrate custom business logic into the preflight feature for clients with complicated and strict output and design policies.

This article from the Adobe interface team on their Inspire web magazine has more info from my ex-colleague Tom McDonald about the design of the UI for this new feature.

IDML

Finally we come to what might be the most interesting new feature in InDesign CS4; IDML. IDML is the third and newest iteration of InDesign file formats that leverage XML. IDML looks to overcome many of the shortcomings of the previous XML document formats in InDesign history.

Way back in the days before the Creative Suite, I and several of my colleagues here at RogueSheep worked on InCopy 2.0, the copy-fitting and editorial companion to InDesign built on the same code base. For this release of InCopy we took the potentially bold step of implementing the file format using XML (called INCD), reasoning that developers building workflow solutions would appreciate an open format that could be modified outside of InDesign or InCopy. We set ourselves a goal to have high performance and marginal readability and mutability when designing the format. While I think the end result had many merits, it did suffer in that it was difficult to extend for both internal and external developers. Later, the InDesign team implemented a separate persistence of InDesign documents using XML. This format, INX, was geared towards backward compatibility. This became the mechanism for saving a document in a format compatible with an older version of the application. INX was much easier to extend than INCD, but suffered from readability and was difficult if not impossible to modify outside of the InDesign family of applications. It sometimes suffered from performance issues as well.

IDML is the first truly extensible file format in the InDesign family that may meet all of a developer’s requirements. Its extensible, readable and easily modified. Its entirely reasonable to create correct and usable InDesign documents and ‘chunks’ of layout in external applications or even by hand for the GUI adverse. The InDesign team apparently strived to equal or better the performance of INX with IDML, so it may be a winner in the performance category as well. One of my favorite parts is that the IDML file is a .zip archive that has several separate XML files for different components of the document.