There are dozens of reasons why you could have performance leaks here. First of all, if you retrieve the 3500 pictures in a large array (getFiles maybe), it can takes time to go through the array depth. Second of all, the Basil code seems to do many operations (fitting, transforming…), its' not just about placing the image. All these actions multiplied by 3500 (plus I guess opening/closing/saving), that does a lot.
So what solutions are left ? First, try with smaller files set. Second of all, maybe ensure that variables are actually nullyfied and that you are using as little as possible global variables. Third of all, consider working with idml. Last of all, if the file placement is basic (no graphic effects), you may try to do that injection outside InDesign (i.e. PDF) thanks to PDF utilities or a PDF-VT tool.
Also, you may try to quit/restart InDesign every 50 processed documents (app.quit();) but I am not sure about the side effetcs of this one.
@Loic – yes, that all. Plus do the drawing, the rendering of the placed images after placing all.
There are some general view settings, you can manipulate, like showing no pixels, but a gray box with all placed images.
Look into the object LayoutWindow where you can find a bunch of properties you can set:
app.documents.layoutWindows.overprintPreview = false; app.documents.layoutWindows.viewDisplaySetting = ViewDisplaySettings.OPTIMIZED;
And: In advance make sure that ViewDisplaySettings.OPTIMIZED is defined in a way, that no image preview is rendered to the page. Just a gray box indicating an image is there.
That will speed up placing images dramatically.
Oh, just another one: Turn off Preflight!
I will try next week. I'm processing the pdf to tiff files now cause I have 13gig of vector data
After that I can also pre size the tiff's to a format closer to the placing target format.
One thing to add on Loic's comments.
Create the documents with no layout window by using setting the open or new document property to false.
app.documents.add(false); app.open(File("/c/blah.indd"), false);
This can make a big difference, it is an alternative approach to Uwe's
One another one may be used =
app.scriptPreferences.enableRedraw = false;
But to rebounce of what seems to be the source of the need :
…pdf to tiff files now cause I have 13gig of vector data
Are you sure it makes sense to choose raster other vector ? What are these PDF made of that you may want to flatten them ? And if it's just about flattening PDF to raster, I would definitively choose another approach. Have you noticed that next version of PitStop Server (13) will embed a PDF to Image functionnality ? It's likely that you get more performance there. You can also try with command line tools, search g…gle for command line PDF to Tiff utilities maybe ?
Since this question is related to the other thread about the options of saving TIFF files in PhotoShop, I double my answer from
See also the following thread in this forum:
mmmathur | Dec 16, 2014 4:41 PM
Here I quote OP (original poster): "It helped me reducing INDD file generation time by half."