Spawning Multiple Templates using XObject
I have two template pages that are spawned successfully 1 time each with this code I extracted from the SDK:
var a = this.templates;
for (i = 0; i < a.length; i++)
a[i].spawn(this.numPages, false, false);
Unfortunately the file size became rather large with multiple spawns, so I then tried to generate them as XObjects using the code also found in the SDK as it indicated it could reduce filesize; I tweaked the code below to only spawn one time by changing the 30 to a 1.
var t = this.templates;
var T = t[0];
var XO = T.spawn(this.numPages, false, false);
for (var i=0; i<30; i++) T.spawn(this.numPages, false, false, XO);
The problem I am having is that it only recognizes one of my two templates and never spawns the second one. I have tried several different things -- all found on the internet and in the SDK as I'm quite the learner at this -- and have been completely unsuccessful. Any guidance on what I am doing incorrectly would be greatly appreciated - thank you!
Bev
