3 Replies Latest reply on Aug 9, 2011 1:36 PM by polohero06

    InDesign Server Merging mutiple .indd files into 1 layout file

    polohero06

      What is the best way to merge mutiple .indd files together using InDesign Server CS 5.5 scripting?

       

      Essentially what I want to do is:

      1. Have 1 .indd file that will be my layout (it will have rows of boxes each set to a specfic size).

      2. Have other .indd files that will have some text that is substituted.

      3. Take the substituted .indd files from step 2, and merge them into the boxes for my layout in step 1.

      4. Print the merged layout .indd to (from step 3) to a printer.

       

      I currently have a script that is working by opening each file (from step 2) using Copy and Paste to paste them into the layout indd file (from step 1) in InDesign CS 5.5 (not the Server version), but when I was evaluating InDesign Server CS 5.5 I noticed that it does not allow Copy and Paste in the scripting.

       

      Does anyone have any ideas of how I could achieve this same functionality in InDesign Server?

        • 1. Re: InDesign Server Merging mutiple .indd files into 1 layout file
          John Hawkinson Level 5

          The UI you want to emulate is a little bit hidden, it in the Pages (panel) > Move Pages that lets you copy pages directly from document to document.

          Ideally given app.document[0] and app.document[1], you'd use something like app.document[1].pages[0].duplicate(undefined, app.document[0]) except I seem to recall that doesn't work.

          So, the last implementation of this I had copied sections, created pages, and then iterated over pages and copied items. It worked OK in CS3 but later stopped working in CS5.

           

          So, well.

           

          I suppose you could also go crazy and do it in IDML. Good luck with that...

          • 2. Re: InDesign Server Merging mutiple .indd files into 1 layout file
            Mac_06 Level 2
            I currently have a script 
            that is working by opening each file (from step 2) using Copy and Paste to paste 
            them into the layout indd file (from step 1) in InDesign CS 5.5 (not the Server 
            version), but when I was evaluating InDesign Server CS 5.5 I noticed that it 
            does not allow Copy and Paste in the scripting.
            

             

            Yes, Copy paste won't come into picture while you are at server.

            You could duplicate page Item instead of page itself:

            Run it in looping statment and make duplicate all page items to destination document.

             

            app.documents.item(0).pages[0].pageItems[0].duplicate(app.documents[1].pages[0])
            

            or you could use for all page item in a page

            app.documents.item(0).pages[0].pageItems.everyItem().duplicate(app.documents[1].pages[0])
            

             

             

            John wrote:

             

            So, the last implementation of this I had copied sections, created pages, and 
            then iterated over pages and copied items. It worked OK in CS3 but later stopped 
            working in CS5.
            


            It does work in CS5 for me but duplicate whole page at last of destination docment.

             

            Mac

            • 3. Re: InDesign Server Merging mutiple .indd files into 1 layout file
              polohero06 Level 1

              I ended up solving it by looping through all the page items on the layout document, then calling

               

              // Place the substituted InDesign file onto the layout page item object.

              pageItem.place(filename);

               

              // Set the newly placed object to fit in the layout frame pageItem.

              pageItem.fit(FitOptions.proportionally);

               

              Thank you for your help though.