1 Reply Latest reply on Feb 4, 2012 9:55 PM by gkaiseril

    Inserting alternating pages

    QzvQFgKEr

      I have one document "docA" that contains the odd pages of an original file and another document "docB" that contains the even pages of the original file. I want to recreate the original file. I only know VBA, so I've been trying to translate VBA into JavaScript, but it hasn't worked. The steps I want are as follows:

       

           1. A dialog box to prompt the user to select docA and docB

       

           2. pagecount = number of pages in docB

       

           3. for i = 1 to pagecount

      x = i * 2 - 1

      insert page i from docB after page x from docA

              next i

       

      What I have so far:

       

      docA = ?

      docB = ?

       

      var pagecount = docB.numpages();

       

      for ( int i = 1; i <= pagecount; i++) {

                      int x = i * 2 - 1

                      docA.insertPages({

                                      nPage: ?

                                      cPath: ?

                                      nStart: ?

                      });

      }

       

      On that same note, is there a guide that outlines the very basic elements of the various functions, what the nPage means for example. I have the manual from Adobe, but it jumps straight into examples without ever explaining the function.