Posts tagged "document reuse"

AEM Assets workflow for automatic PDF generation from InDesign files

Many of my Enterprise customers ask how they can use Adobe Experience Manager (AEM) to automate the production of common derivative files from their InDesign files. Derivative files, you ask? InDesign files often represent the “source of truth” for many business documents, from manuals to data sheets to publications and many more types. These documents must be transformed from InDesign into something else (hence the term derivative) in order to be made available on a web site, for instance. The usual method is to export a PDF from InDesign and then upload the PDF as a new asset into the repository. This puts added burden on the author of the InDesign file as well as introducing the possibility of error due to incorrectly set PDF job options. This gets even more complicated if the author must make versions suitable to send to a commercial printer as well as a version that’s optimized for reading online as a PDF. This article provides techniques to automate the production of a web-optimized and print-optimized PDF from any InDesign file that appears in AEM Assets.

This article assumes that you have access to Adobe Experience Manager Assets and InDesign Server. In this example, I use AEM 6.1 and InDesign CC Server 2015, but the technique should work with AEM 5.6.1 and higher and ID Server CS6 and higher. You need to ensure that you have configured your AEM Author environment to work with InDesign server according to the documentation found here. The foundation of any successful integration (beyond configuration!) is the combination of Scripts, Workflow Models, and Workflow Launchers.

You can download a package that contains the scripts and a workflow model you can use today. When you install the package, you will have new scripts located at /etc/dam/indesign/scripts and /etc/workflow/scripts. You will also see a new Workflow Model located at /etc/workflow/models/dam/. The Workflow Launcher must be reconfigured, since I didn’t want to disrupt your existing workflows after you install the package.


Scripts tell AEM or external applications what to do, and they form the basis of any InDesign Server-based solution. There are two sets of scripts used here: one set for InDesign Server to generate the PDFs and the other for AEM to move the resulting files. First, let’s look at the JavaScript to tell InDesign Server what we want it to do and how we want it to respond to the request.

There are a number of InDesign Server scripts included in the basic AEM installation, and I’ve modified /etc/dam/indesign/scripts/PDFExport.jsx to request specific kinds of PDF from InDesign Server.  In addition, the script writes the new PDF files into the InDesign file’s /renditions node. These two scripts are located at /etc/dam/indesign/scripts/PDFExport_Print.jsx and at /etc/dam/indesign/scripts/PDFExport_Web.jsx. I could have easily combined these two operations into one script, but I wanted to leave you the option to easily enable or disable each one according to your requirements. You can also combine them yourself or make them fancier, responding to properties you set on the InDesign file in AEM (via XMP) and read out with InDesign Server. Here is the code for PDFExport_Web.jsx, which is almost identical to PDFExport_Print.jsx. The difference is in the value of pdfExportPreset in line 31, the filename set in line 56, and the function return value set in line 57.

// Export any Indesign document as PDF

//==== get soap arguments ====
if (app.scriptArgs.isDefined("credentials")) {
 var credentials = app.scriptArgs.getValue("credentials");
} else {
 throw "CQ host credentials argument is missing";
if (app.scriptArgs.isDefined("cqHost")) { 
 var host = app.scriptArgs.getValue("cqHost");
} else {
 throw "cqHost argument is missing";
if (app.scriptArgs.isDefined("resource")) { 
 var resourcePath = app.scriptArgs.getValue("resource");
} else {
 throw "resource argument is missing";

try {
 //==== create a temporary folder under InDesign server tmp directory to fetch and export ====
 // added randomness to the folder name
 var exportFolder = new Folder("tmp-" + (new Date().getTime() - Math.floor((Math.random()*10000)+1) ));
 fileName = resourcePath.substring (resourcePath.lastIndexOf ('/'), resourcePath.lastIndexOf ('.'));
 var sourceFile = new File(exportFolder.fullName + fileName + '.indd');
 var outputFile = new File(exportFolder.fullName + fileName + '_web.pdf');
 var pdfExportPreset = "[Web Preset]" // Set your PDF Web-ready Export Preset (joboption) here.
 // You can use any joboption file installed in InDesign Server

 app.consoleout('Fetching resource from CQ: '+resourcePath);
 fetchResource (host, credentials, resourcePath, sourceFile);

 var document =;

 with (app.pdfExportPreferences) {
 viewDocumentAfterExport = false;
 var myPDFExportPreset = app.pdfExportPresets.item(pdfExportPreset);
 document.exportFile(ExportFormat.pdfType, outputFile,myPDFExportPreset);

 // close the document
 //==== remove the original resource and send the export back to CQ ====

 //==== send file to CQ ====
 var target = resourcePath.substring (0, resourcePath.lastIndexOf ('/')) + "/renditions";
 app.consoleout('Posting this file to CQ: '+outputFile);
 app.consoleout('Posting to location: ' + target);
 putResource (host, credentials, outputFile, fileName + '_web.pdf', 'application/pdf', target);
 returnValue = "PDF for Web exported and posted successfully";
} finally {
 //==== remove the temp folder ====
app.consoleout('Finished PDF for Web export using '+pdfExportPreset+' joboptions');

To use these scripts, you need to have a PDF Joboptions file installed in InDesign Server to export your PDF. When you install the package, you will find a new folder at /content/dam/InDesign Server joboptions that contains two PDF Export Presets for InDesign Server. Move these two files to Applications/Adobe InDesign CC Server 2015/Resources/Adobe PDF/settings/mul and then restart InDesign Server to load the new settings.

Now that we have the InDesign Server pieces in place, let’s look at the AEM script. This is an ECMA script, which is very much like JavaScript, and it’s located at /etc/workflow/scripts/move-pdf-renditions.ecma. I’ve written it as a function that’s called twice, once for each PDF rendition, so it’s easy to add or remove other renditions as you see fit. This script will be called from the Workflow Model, which we’ll look at next. Here’s the script code.

var renditionExtension = "pdf";
var mimeType = "application/pdf";

var workflowData = graniteWorkItem.getWorkflowData();


function movePDF (renditionPostfix) {
 if (workflowData.getPayloadType() == "JCR_PATH") {
 var path = workflowData.getPayload().toString();
 var resourceResolver = graniteWorkflowSession.adaptTo(;
 var resource = resourceResolver.getResource(path);
 if (resource !== null) {
 var asset =;
 if (asset !== null) {
 var name =, ".");
 var renditionName = name + "_" + renditionPostfix + "." + renditionExtension;
 var rendition = asset.getRendition(renditionName);
 if (rendition !== null) {
 var renditionResource = resourceResolver.getResource(rendition.path);
 var stream = renditionResource.adaptTo(;
 var targetPath = asset.adaptTo( + "/" + renditionName;
 var assetManager = resourceResolver.adaptTo(;
 assetManager.createAsset(targetPath, stream, mimeType, true);
 } else {
 log.debug("rendition " + renditionName + " cannot be found on asset " + path);
 } else {
 log.debug("Item is not an asset: " + path);
 } else {
 log.debug("Item does not exist: " + path);

Workflow Model

There will be a new Workflow Model in your Workflows list called DAM Update Asset with PDF move located at /etc/workflow/models/dam/update_asset_pdf/. It is similar to and derived from the standard DAM Update Asset workflow that comes with every AEM installation. I have changed one existing step (Media Extraction) and added a new step (a Process step called “Move PDFs from Renditions”).

These two workflow steps are different from the standard DAM Update Assets workflow

These two workflow steps are different from the standard DAM Update Assets workflow

The Media Extraction step is designed to convert InDesign documents to other formats required by AEM Assets for a number of key functionalities. These include generating sub-assets (images that are embedded within the InDesign file), page images, extraction of text, and metadata synchronization, among other things. Media Extraction sends the script (and a pointer to the InDesign file) as its payload to InDesign Server. InDesign Server then runs the script and returns something to AEM. It is important that you do not remove any of the existing scripts that Media Extraction launches, but you can always add additional steps. Here, we added two additional scripts to the workflow step: PDFExport_Print.jsx and PDFExport_Web.jsx

The Print and Web PDF Export scripts have been added to the Media Extraction Workflow Step.

The Print and Web PDF Export scripts have been added to the Media Extraction Workflow Step.

Immediately after Media Extraction, I added a new Process step that executes an ECMA script in AEM. For many users, they will access AEM Assets via their desktop using the AEM Assets Companion tool or the Creative Cloud Desktop tool, so this workflow ensures that they get the renditions they need in a place that’s easy to find. Also, users of AEM Assets will be able to search for these PDFs like any other asset under management. This script copies the PDFs from /renditions as new assets adjacent to the InDesign file. It is best to leave the PDFs in /renditions so that they can be used by components that might offer the PDF as a download, for instance.


The new Process step executes an ECMA script that copies the new PDF files so that they are accessible on the desktop.

Workflow Launcher

Lastly, it is necessary to change the Workflow Launcher that is triggered whenever a file appears in the repository or whenever a file is modified in the repository. I did not include this change in the package so that you can install the package with no impact on your running system. When you are ready and have tuned the scripts for your workflow, then you can enable the Workflow in the Workflow Launcher panel.

In your AEM Author instance, click on Tools>Workflow>Launchers or visit http://localhost:4502/libs/cq/workflow/admin/console/content/launchers.html (of course, point at your Author instance!). Select the /content/dam(/.*/)renditions/original that has no condition on it (see screenshot below) and click on View Properties, and then on Edit.

Select the proper Launcher and view its properties

Select the proper Launcher and view its properties

The Launcher is designed to run a workflow when a specific condition is met. This workflow looks for any file that appears in the repository and then runs the DAM Update Asset workflow on it. You need to change the workflow to DAM Update Asset with PDF Move and then Save the changes.

Change the workflow that is triggered by the Launcher

Change the workflow that is triggered by the Launcher

Once you’ve saved the Launcher, you are ready to test. Upload an InDesign document into AEM using your preferred method. You can use drag and drop in a Browser window, AEM Assets Companion, or CC Desktop Tool. If you happen to catch the InDesign Server console, you will see new entries that report on whether IDS was successful at exporting PDF renditions. In a short while, your new PDF  files will magically appear next to the InDesign file. Now, go ahead an edit that InDesign file and save it back to AEM Assets. Again, the workflow will run and new PDF files will replace the existing ones, ensuring that you always have access to the latest versions. And, since they are assets under management, you can always revert to earlier versions of the PDF by looking at the asset timeline in a browser.


This new workflow and the scripts that support it expose a new behavior for AEM Assets. While convenient for the user, since it automatically generates useful and necessary derivatives of the source InDesign asset, it enforces known good business processes by encapsulating approved PDF Export settings into he workflow. It also reduces errors by automating a task that otherwise would require several configuration steps in InDesign before they could export the PDF.

I hope that you find this useful, and that you use it as a starting point for further InDesign Server automation using AEM Assets.

Share on Facebook

Use Powerpoint presentations in Adobe DPS

Many of my Enterprise customers have asked for a way to bring PowerPoint content to DPS. While InDesign provides a robust design platform for creating interactive DPS experiences, InDesign isn’t always readily accessible to a salesperson or sales management who need to deploy presentations to their tablet-enabled sales force. In addition, they often have many years of approved presentation content in PowerPoint that is readily available. In order to use that content in DPS, a design team would usually rebuild the content in InDesign or perhaps use a third party tool to export the presentation to HTML and then import it to DPS. With the release of R32.1 of Adobe DPS, Enterprise DPS customers can now export their PowerPoint presentations directly to their DPS accounts using a new PowerPoint add-in. Learn more at the DPS Export Add-in Help Page.

The add-in is available for Windows 7 and higher customers who use PowerPoint 2010 or 2013 in 32bit mode. There is no Macintosh version, as PowerPoint for Mac does not have a add-in architecture similar to Windows. You can download a localized version of the add-in from here.

The add-in supports most animations and even video. The add-in installs the desktop Content Viewer, too, so you don’t need InDesign to proof your presentation before publishing it to the Folio Producer. The ease with which a business user can convert their presentations to DPS is shocking, and I believe that customers will be delighted with the results.

I’ve recorded a short video showing the add-in in action. View it on Youtube.

The add-in supports many of the interactive features in PowerPoint. Below is a table of supported interactive items.

Category Subcategory Content ACV Support Status
Static Content Tables Insert Table Yes
Draw Table Yes
Excel SpreadSheet Yes
Images Picture Yes
Clip Art Yes
Screenshot Yes
Photo Album Yes
Illustations Shapes Yes
SmartArt Yes
Chart Yes
Text Text Box Yes
Header & Footer Yes
WordArt Yes
Date & Time Yes
Slide Number No
Object Yes
Symbols Equation Yes
Symbol Yes
Interactive Content Hyperlink Existing File No
Web Page Yes
Place in This Document First Slide Yes
Last Slide Yes
Next Slide Yes
Previous Slide Yes
Slide Titles Yes
Custom Shows No
Create New Document No
Email Address Yes
Foliomaker does not support the hyperlinks in SmartArt graphic.
(Mouse Click)
Hyperlink to: Next Slide Yes
Previous Slide Yes
First Slide Yes
Last Slide Yes
Last Slide Viewed No
End Show No
Custom Show No
Slide Yes
Other PowerPoint Presentation No
Other File No
Run Program No
Run Macro No
Object Action No
Play Sound No
Highlight Click No
Video Video from File Yes
Video from Web Site No
Clip Art Video (GIF) No
Audio Audio from File (.mp3) Yes
Clip Art Audio (.wav) Yes
Record Audio No
Transitions No


Below is a list of supported animations.

Animation type Desktop & iPad ACV Support Status
Entrance Effects Appear No
Box Yes
Circle Yes
Dissolve In Yes
Peek In Yes
Random Bars Yes
Strips No
Wheel No
Blinds Yes
Checkerboard Yes
Diamond Yes
Fly In Yes
Plus No
Split No
Wedge No
Wipe Yes
Expand Yes
Swivel Yes
Fade Yes
Zoom Yes
Basic Zoom Yes
Float Down Yes
Grow & Turn No
Spinner Yes
Center Revolve Yes
Float up Yes
Rise up Yes
Basic Swivel Yes
Bounce Yes
Curve Up Yes
Flip Yes
Pinwheel No
Whip Yes
Boomerang Yes
Credits Yes
Drop Yes
Float Yes
Spiral In Yes
Emphasis Effects Fill Color Yes
Grow/Shrink Yes
Spin No
Font Color Yes
Line Color Yes
Transparency No
Bold Flash Yes
Complementary Color Yes
Contrasing Color Yes
Desaturate Yes
Object Color Yes
Underline Yes
Brush Color Yes
Complementary Color 2 Yes
Darken Yes
Lighten Yes
Pulse Yes
Color Pulse Yes
Shimmer Yes
Grow With Color Yes
Teeter Yes
Blink Yes
Wave Yes
Bold Reveal No
Exit Effects Blinds No
Checkerboard No
Diamond Yes
Dissolve Out Yes
Peek Out Yes
Random Bars Yes
Strips No
Wheel No
Box No
Circle Yes
Disappear No
Fly Out Yes
Plus Yes
Split No
Wedge No
Wipe No
Contract Yes
Swivel No
Fade Yes
Zoom Yes
Basic Zoom No
Float Down Yes
Shrink & Turn Yes
Spinner Yes
Center Revolve No
Float Up Yes
Sink Down Yes
Basic Swivel No
Bounce Yes
Curve Down Yes
Flip Yes
Pinwheel Yes
Whip Yes
Boomerang Yes
Credits Yes
Drop Yes
Float No
Spiral Out Yes
Motion Paths 4 Point Star Yes
6 Point star Yes
Circle Yes
Diamond Yes
Football Yes
Hexagon Yes
Parallelogram Yes
Right Triangle Yes
Teardrop Yes
5 Point Star Yes
8 Point Star Yes
Crescent Moon Yes
Equal Triangle Yes
Heart Yes
Octagon Yes
Pentagon Yes
Square Yes
Trapezoid Yes
Arc Down Yes
Arc Right Yes
Bounce Left Yes
Curvy Left Yes
Decaying Wave Yes
Diagonal Up Right Yes
Funnel Yes
Left Yes
S Curve 1 Yes
Sine Wave Yes
Spiral Right Yes
Stairs Down Yes
Turn Down Right Yes
Turn Up Right Yes
Wave Yes
Arc Left Yes
Arc Up Yes
Bounce Right Yes
Curvy Right Yes
Diagonal Down Right Yes
Down Yes
Heartbear Yes
Right Yes
S Curve 2 Yes
Spiral Left Yes
Spring Yes
Turn Down Yes
Turn Up Yes
Up Yes
Ziazag Yes
Bean Yes
Curved X Yes
Figure 8 Four Yes
Inverted Square Yes
Loop de Loop Yes
Peanut Yes
Pointy Star Yes
Vertical Figure 8 Yes
Curved Square Yes
Curvy Star Yes
Horizontal Figure8 Yes
Inverted Triangle Yes
Veutron Yes
Plus Yes
Swoosh Yes
Share on Facebook

I’ll be speaking at Adobe MAX this year!

I will be presenting a session on Variable Data Design at Adobe MAX this year. While I’ve presented at MAX previously, recently it’s been all DPS or AEM-related discussions. This talk digs deep to my roots in Data Driven Marketing and Variable Data Publishing. From the abstract:

Learn how to take personalized communications beyond email. Before email, there was data merge, which enables you to create personalized print materials using the design tools you already know and love. Whether for mailing campaigns, photo books, directories, business cards, or even t-shirts, you can use data merge to personalize your projects.

In this session, you’ll discover how to:

  • Unlock the potential of personalization in InDesign
  • Use Illustrator and Photoshop to generate personalized assets to use with InDesign
  • Manage personalization on a large scale with popular third-party variable data printing (VDP) solutions
Share on Facebook

Using Captivate 7 projects with DPS

I had posted a fix for using Captivate 6 HTML5 projects in DPS. In that article, I showed how to remove embedded browser check code so that your project would render without a browser check in DPS. However, in Captivate 7, removing the browser check script from the index.html file doesn’t do the job.  (If you have my DPS Examples app installed on your iPad, and you’re reading this blog on your iPad, then tap here to see examples of Captivate content running in a DPS folio.)

I asked the Captivate engineers if they had a trick up their sleeves, and this is what they delivered (thanks to Suresh Jayaraman and independently to Mayank Mahajan: if you see either of them, give them each a high five…)

  1. Open “AdobeCaptivate.ini” file present in Adobe Captivate installation folder .
  2. Add the following line of text at line 2 or line 3 of the “AdobeCaptivate.ini” file .
    • SuppressIncompatibleBrowserMessage = 1
  3. Publish the project to HTML 5

Now, the result is a folder with an index.html file. As I indicated in the earlier article, you can then make a Web Content overlay and point it at your index file. Another approach is to use the Captivate project as an HTML article rather than in a Web Content Overlay.

If you have portrait-only folio, rename the index.html file to index_v.html. If you have a landscape-only folio, rename the index.html file to index_h.html. If you have a dual-orientation folio, don’t change the name of the index.html file. In the Folio Builder panel of InDesign CC, click the “Add article” button and choose Import Article.

Add an article to your folio

Enter your article metadata and then browse to the folder that contains your Captivate project, and then click OK.

Import the HTML Article

InDesign will now seem to go into zombie mode, in which it will appear to be processing the HTML folder, but will never finish the task. The solution, which I outlined in another blog post, is to quit InDesign while it is hanging on the HTML import. Actually, what you need to do is to tell inDesign to quit, but don’t actually quit. Instead, wait, and InDesign will emerge from its coma and finish importing the HTML article.

Quit InDesign CC to complete the import

Then, you can politely tell the “Do you really want to quit?” dialog that you do not want to quit, and your HTML project from Captivate will now be safely in your folio, with no browser check. Once published, your user will need to push the “play” button on the Captivate project to start it, which is annoying to be sure. I hope the Captivate engineers will allow us one day to auto play a Captivate HTML5 project, if only in our DPS folios.

Share on Facebook

Using Edge Animate CC projects as HTML DPS articles with InDesign CC

Since its release (or pre-release…), designers have used Edge Animate to bring HTML5 animations to their DPS projects. While most designers place their projects into InDesign-based articles, some have asked how to use Edge Animate CC assets as HTML articles. Learn more about HTML articles in DPS Help. When they try to import the project after publishing it for Web from Edge Animate, however, they run into an issue with InDesign not being able to convert the HTML into an article. There is a workaround, at least for InDesign CC users. CS6 users won’t be able to use this workaround.

Edge Animate makes a single HTML file that references assets, CSS and Javascript files. This is good, because this is exactly the structure that DPS wants for an HTML article.  Your project needs to be called “index” for dual orientation articles, and  “index_h”, or “index_v” for single orientation articles. When you publish from Edge Animate, it makes a folder called “Web” in the “Publish” folder. In that folder will be a file called “index.html” (or “index_h.html” or “index_v.html”). From InDesign, open the Folio Builder panel, open your folio, and click the “Add Article” and choose “Import Article,” or choose “Import Article…” from the flyout menu. Fill in your article metadata, and then browse to the Web folder in the Publish folder of your Animate project. When you have everything set up for your article, click OK.

This is the point when things begin to go wrong. InDesign now attempts to convert the Animate project to a DPS article. You will discover that it will try for a very, very, very long time, although it will not finish the job. If you remove the file called “index_edgePreload.js” (or _h or _v), you will be able to upload the project, but it won’t work. It seems that InDesign must render the HTML in order to create a TOC image for the article, and it fails when it tries. It turns out that there is a way to force InDesign to complete the task, however.

Right after you click OK, quit InDesign. Seriously. Quit InDesign. Or, more correctly, ask InDesign to quit. At that point, you will see an alert box telling you that Folio Builder is busy “Building folio.” DO NOT click either of the buttons in the dialog box until you see the “Please Wait… Building Folio” alert appear and then disappear. Pay attention, because it might go by very quickly. When it’s gone by, click “No.”

Forcing an Edge Animate project to upload


Now, your Edge Animate project has been converted to an article and you can preview it in your browser or on your device. Timing is a consideration, of course. If you build an animation that is set to auto play, it is likely to play when you’re not looking at it, especially if it is not the article that opens when the folio opens. DPS will preload HTML articles adjacent to the article you are viewing, so those autoplay animations will animate and stop when you are not looking at them. If you place them onto an InDesign layout, then you have better control over when they play.

Share on Facebook