I've been given a template document and we've already worked out how to add data with index tags.

I've figured out how to use the generate function on the index object to place the index on some of the pages. However, when I specify the page that is supposed to hold the index I don't see the index. The Index page does have a master page.

Here is a test script I'm working with for reference. I expect it to place the index title on the appropriate page.

var myDocument = app.open(File("/c/Template.indt"));

var indexPage = myDocument.pages.item(7);

var index = myDocument.indexes.add();

var layer = myDocument.activeLayer;
index.generate(indexPage, [1,0], layer, true, true);

var webexportpreset = app.pdfExportPresets.item("[Smallest File Size]");
myDocument.exportFile(ExportFormat.pdfType, new File("/c/test.pdf"), webexportpreset);

myDocument.close();
0

There are 0 best solutions below