2 Replies Latest reply on Aug 27, 2008 5:13 AM by (Ellen_Heitman)

    Need scripting help!

      I am using InDesign CS3 version 5.0. Here's what I need to do:

      I will be receiving a PDF file from a client containing 14 or so pages. These pages need to be placed in an InDesign document containing 28 in a very specific way: for instance, the first page of the received PDF needs to go to the 27th page of the InDesign document, the second PDF page to the 23rd InDesign page, etc. (We need other images to be placed between those we receive from the client.) This pattern will remain the same for each document we receive.

      As you can see, manually placing these pages would be extremely tedious and time-consuming. I want to automate this process. Is there a way I can configure Adobe Acrobat Professional (I'm using 8.0.0) and InDesign to accomplish this? Any plug-ins out there that would help me?

      Thanks in advance for any suggestions.
        • 1. Re: Need scripting help!
          Loic.Aigon Adobe Community Professional
          Could it help ?

          var pdfpath = "" //Your path
          
          var pdffile = File(pdfpath);
          var placepdfarr = [1,2,3]; //decline the pdf pages to be placed
          var placedpgs = [27, 22, 12]; //decline the pages where to place the PDF pages
          var doc = app.activeDocument;
          var docpg = doc.pages;

          for(i=0; i<placepdfarr.length; i++)
          {
             var pg = placedpgs[i];
             var myframe = docpg[pg].pageItems.label("frame");
             //assuming frame is a label given to the frame in which you want to place the page
             // You can also create the frame for each page &/or define properties such as fitting options.
             app.pdfPlacePreferences.pageNumber = placepdfarr[i];
             myframe.place(pdffile);
          }

          This is a very basis but let you know if it's nearing what you are seeking for.
          Loic

          [Edit: Loic, I formatted your code a little bit--Ole]
          • 2. Re: Need scripting help!
            Level 1
            Thanks so much for your reply! I will give this a shot...