5 Replies Latest reply on Nov 30, 2015 11:24 AM by try67

    newDoc.closeDoc(true) not closing

    JTPG1

      Hi, I'm writing some basic code to combine pdfs (similar to below). It was running fine, each document would saved and closed before the next newDoc start.  But after the Actobat update a couple weeks ago closeDoc doesn't close the documents until the end of the line.  Basically, I have 40+ newly created document opened while the code is running, it slowed down my run dramatically. Is there a way for me to work around this?  I’m new to JS, any advice is greatly appreciated Thank you!!

       

      // Create a new PDF document:

         var newDoc = app.newDoc();

        

         // Insert doc1.pdf:

         newDoc.insertPages({

            nPage: -1,

            cPath: "/c/temp/doc1.pdf",

         });

        

         // Insert doc2.pdf:

         newDoc.insertPages({

            nPage: newDoc.numPages-1,

            cPath: "/c/temp/doc2.pdf",

         });

        

         // Save the new document:

         newDoc.saveAs({

            cPath: "/c/temp/myNewDoc.pdf";

         });

        

         // Close the new document without notifying the user:

         newDoc.closeDoc(true);