Skip to main content
Participant
October 7, 2009
Question

Place PDF pages inline

  • October 7, 2009
  • 1 reply
  • 447 views

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

This topic has been closed for replies.

1 reply

A_VitAuthor
Participant
October 8, 2009

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;
     }

}