1 Reply Latest reply on Apr 21, 2008 1:18 AM by (Robert_Tkaczyk)

    The duplicate command?

      Obviously i'm missing something, i'm trying to manipulate some code to place a sequence of pdf pages and include the option to duplicate the placed page on the spread for a "2 up imposition". (with an offset of 148.5mm)
      the code does the duplication but is stopping at

      var myFirstPage = myPDFPage.pdfAttributes.pageNumber;

      saying "Object does not support the property or method 'pdfAttributes'"

      Indesign CS2

      Can anyone help??

      code below

      function myPlacePDF(myDocument, myPage, myPDFFile){
      var myPDFPage;
      app.pdfPlacePreferences.pdfCrop = PDFCrop.cropMedia;
      var myCounter = 1;
      var myBreak = false;
      while(myBreak == false){
      if(myCounter > 1){
      myPage = myDocument.pages.add(LocationOptions.after, myPage);
      }
      app.pdfPlacePreferences.pageNumber = myCounter;
      myPDFPage = myPage.place(File(myPDFFile), [0,0]);

      // NEW COMMENTS

      myPDFPage = myPDFPage.duplicate();
      myPDFPage.move(undefined, [148.5,0]);

      // NEW End of comments

      if(myCounter == 1){
      var myFirstPage = myPDFPage.pdfAttributes.pageNumber;
      }
      else{
      if(myPDFPage.pdfAttributes.pageNumber == myFirstPage){
      myPage.remove();
      myBreak = true;
      }
      }
      myCounter = myCounter + 1;
      }
        • 1. Re: The duplicate command?
          Level 1
          in VB I do:

          Set myPDFPlacePref = myInDi.PDFPlacePreferences
          myPDFPlacePref.PageNumber = PageNumber
          myPDFPlacePref.PDFCrop = idCropMedia

          Set myFrame = myPage.Rectangles.Add

          On Error Resume Next
          Set myPDF = myFrame.Place(myDoc.Path + "myPDF.pdf")
          On Error GoTo 0

          If myPDFPlacePref.PageNumber <> PageNumber Then
          myFrame.Delete
          Exit Sub
          End If

          robin

          --
          www.adobescripts.com