0

I'm using Adobe InDesign Server CC and I want to do datamerging. It does merging well, the only problem is that Indesgin Server is SO SLOW. Here is my code:

var source = File(app.scriptArgs.getValue("sourceIndd"));       //.indd file
var destination = File(app.scriptArgs.getValue("destination"));
var sourceData = File(app.scriptArgs.getValue("sourceData")); //csv file with data be placed into placeholders
var resolution = app.scriptArgs.getValue("resolution");

 var doc = app.open(source,OpenOptions.DEFAULT_VALUE);

 doc.dataMergeProperties.selectDataSource(sourceData);
 doc.dataMergeOptions.linkImages = true;
 doc.dataMergeProperties.mergeRecords();    

 app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.low; 
 app.jpegExportPreferences.exportResolution =parseInt(resolution) ;  
 app.jpegExportPreferences.antiAlias =true;
 app.documents.item(0).exportFile(ExportFormat.JPG, destination);
 doc.close();

This code is used for preview generating so QUALITY IS NOT IMPORTANT. Does anybody know how I can speed this up? Or maybe there is another away to export previews?

Mark Amery
  • 143,130
  • 81
  • 406
  • 459

1 Answers1

0

Do you know which of those steps is slow? To find out, measure individual execution times and write them to a log file. $.hiresTimer provides the best way to measure times, it is reset to 0 after each access.

Your operating system may also have means to measure performance, for example OSX has ways to sample processes down to function calls through the Activity Viewer or the Instruments application provided with the developer tools.

There are so many things that can go wrong, so without a testing environment you can only guess. Is the server loaded with slow startup scripts and configured to restart after each job? Is the job initiated locally, or via network?

If it is really in the quoted script, the problem could be a slow shared volume or a defective local one, overflowing directories and so forth. For either the source document, the source data, the linked images, or the output location. The source document might carry an unnecessary history baggage which you can strip with an IDML roundtrip. Do you use bad fonts? There could be a problem with the actual images (super complex PDF, EPSF or Illustrator file). If it is the export command rather than the data merge, you can for example play around with resolutions and other export options, use down-sampled copies of images etc. As I wrote, just guesswork without a look.

Dirk
  • 666
  • 3
  • 6
  • Thanks Dirk! The line that takes the most time is "doc.dataMergeProperties.mergeRecords();". Also the template I'm using does not have several ".eps" files, Indesign Server says "Link missing. ; file:C/Users..." Can this cause the problem? And also there is a problem with font("Missing Font Arial Narrow Italic"). – Stanislav Chernychko Jun 27 '14 at 11:08