2 Replies Latest reply on Mar 5, 2013 2:17 PM by FredDarnell

    rectangle.place (Placing Image) - InDesign vs InDesignServer

    FredDarnell

      Any help or suggestions or even guesses appreciated here. Thanks!

       

      I have a script that correctly places images in tagged rectangles via script in InDesign, the script then exports to PDF. All is well.


      When I run the same script with the same image path folder structure in InDesignServer, the exported PDF does not show the 'placed' images. I'm getting no errors in my console.


      Early in the script I have;

      myInDesign.imagePreview = True


      I place the images with;

      myRectangle.Place myFile, False

      myRectangle.fit 1668247152

      myRectangle.fit 1667591779

      for each myItem in myRectangle.items

           myItem.itemLink.unlink

      next



      I've tried it with and without the .unlink code (an attempt to force embedding of the images)


      In all other aspects the script works the same on ID as IDS. I'm starting my ID CS6 server with InDesignServer -previews


      I suspect I'm missing something with the PDF export preferences, but have no idea why it's working on ID and not on IDS.


      Any help greatly appreciated.

       

      (I have cross-posted this in the InDesign Forum. I will remove one or the other if answered)

        • 1. Re: rectangle.place (Placing Image) - InDesign vs InDesignServer
          puneet khabya

          Will it be possible for you to share the script??

          • 2. Re: rectangle.place (Placing Image) - InDesign vs InDesignServer
            FredDarnell Level 1

            I'm not able to post all the code, but here's a stripped down version with all the important parts... The only line that differs from ID vs ID Server is the first line...

             

            'Set myInDesign = CreateObject("InDesignServer.Application")
            Set myInDesign = CreateObject("InDesign.Application")

            Set myDocument = myInDesign.Open(strTemplateFilename )
            Set myPage = myDocument.Pages.Item(1)
            set myPageItems = myPage.PageItems
            set myRectangles = myPage.Rectangles

            myInDesign.imagePreview = True

            myInDesign.findTextPreferences = Nothing
            myInDesign.changeTextPreferences = Nothing

            ' change some text
            myInDesign.findTextPreferences.findWhat = "[" & strattrname & "]"
            myInDesign.changeTextPreferences.changeTo = strattrvalue
            myDocument.changeText()

             

            ' change the image in the targeted rectangle
            for each myRectangle in myRectangles
              if myRectangle.Label = strattrname then
               myRectangle.Place strWorkingPath & strattrvalue, False
               myRectangle.fit 1668247152
               myRectangle.fit 1667591779
               for each myItem in myRectangle.items
                myItem.itemLink.unlink
               next
              end if
            next  

             

            ' save the document as a template (this will be sent to the printer)
            myDocument.Save strINDTOut, True

             

            ' perform a mailmerge of one record
            Set myDataProperties = myDocument.DataMergeProperties
            myDataProperties.SelectDataSource(strMergeSample)
            myDataProperties.DatamergePreferences.RecordsPerPage = 1684886386
            myDataProperties.DatamergePreferences.RecordNumber = 1

             

            ' export the one record merge document to PDF for sending preview

            myDataProperties.export strPDFOut

             

            It works fine in ID, leaves the images empty(blank) when performed in IDServer. Both are up-to-date current versions - although IDS is still in 90 trial period.

             

            Any help appreciated.