1 Reply Latest reply on Oct 8, 2009 9:53 AM by A Vit

    Place PDF pages inline

    A Vit Level 1

      I'm using data merge to create a multi-page PDF of formatted records.

       

      I need a way to place these generated pages into a text flow so that they flow around other content in the layout. Is there an existing script that does such a thing? i.e. instead of getting a cursor to create a new graphic frame, it would automatically create more graphic frames within the text flow.

       

      Thanks,

      Andrew Vit

        • 1. Re: Place PDF pages inline
          A Vit Level 1

          Turned out to be pretty straightforward to write, borrowed some from one of the sample scripts:

           

          function placePdfPagesInline(pdf, insertion) {
               var pageCounter = 1;
               var breakFlag = false;
          
               while(breakFlag == false){
                    app.pdfPlacePreferences.pageNumber = pageCounter;
                    var currentInlineFrame= insertion.place(pdf)[0];
                    if(pageCounter == 1){
                         var firstPage = currentInlineFrame.pdfAttributes.pageNumber;
                    }
                    else{
                         if(currentInlineFrame.pdfAttributes.pageNumber == firstPage){
                              breakFlag = true;
                         }
                    }
                    pageCounter = pageCounter + 1;
               }
          
          }