5 Replies Latest reply on Mar 13, 2012 7:07 AM by fjdog

    Template generating script crashes acrobat x application

    fjdog

      Hi,

       

      I am fairly new to acrobat scripting. I have been beating my head against the wall on this one and have come to ask the collective. The following script works if numberPages is set to 1 (one new page is generated based on the template). When I change numberPages to 2 or more, the application crashes. Any suggestions?

       

      This is on acrobat x, windows 7

       

      Thanks,

      Roland

       

       

      var mypath = "Template1.pdf";

      numberPages = 1;
      this.insertPages({cPath: mypath, nPage: -1});

      t = this.createTemplate({cName:"signoff", nPage:0 });
      t.hidden = true;

      // spawns number of pages
      for (i = 0; i < numberPages; i++){
        t.spawn(i, true, false);
      }