If I use IDML happens if the speed improvements?
Yes. Opening IDML should be faster than placing xml...
I will post the result.
Some more ideas below. Of course any of them could also make it worse. Experimentation will show, I just don't know.
- Do you invoke the process from outside (e.g. SOAP) per document? Try to pile up a list of multiple jobs and process them from one run.
- Of course you already know about those additional parameters to app.doScript - see the OMV section of ESTK help on UndoModes for details.
- If the number of templates is limited and your modifications are not too destructive, you could keep the document open for reuse, and just fill in other XML.
- Alternatively try a full undo, or revert to saved, rather than instantiating templates.
- Dependent on the amount of data, try the ExtendScript XML object rather than XMLElement / import.
- If your script can run in a permanent target engine (other than "main"), you need not load it every time. Be careful with memory leaks, though.
- How complicated is the static/unchanged part of the template? Maybe that part of the document is faster as placed and eventually even embedded PDF, or EPS.
- Are there images that you could pre-scale and crop once rather than let InDesign do it? Also revisit their color spaces to match your PDF export settings.
- Minimize your template, strip all unused fonts, styles, swatches.
- Watch out for the flattener (output preview).
- On the Mac, use Instruments from the Developer tools, and there the Sampler. It allows to watch the server while it is running. That should give some statistics where it is really spending most time.
- Use $.hiresTimer for measurements.
How can I could keep the document open for reuse ?
In my case, whenever arrived the request open template(indt) and fill xml data and close all document.
1 person found this helpful
if you want to reuse the document, just don't close it. you can fetch your document instance by name for example. if you do so, keep in mind you are creating a new document every time you 'open' the indt. so better use a normal indd doc in this case with a fix name.
this is just one way to do it.
Then I will use indd for reuse and indt for instance template.