2 Replies Latest reply on Nov 10, 2009 11:53 PM by tobias.wantzen

    [JS CS3] Modify geometricBounds of Inline Frames in Overset Text

    tobias.wantzen Level 1

      Hello,

       

      I have the following setting:

      I recieve a XML file , which contains <image href="..."> tags. InDesign automatically inserts the correct images as an inline frame.

      The layout column are too small for the large images, so when placing the XML into the layout, the whole content is in the overset.

       

      Inline frames in the overset do not have any geometricBounds. Can I modify width & height of frames in overset text? And how do I do that?

       

      Thanks

      Tobias

        • 1. Re: [JS CS3] Modify geometricBounds of Inline Frames in Overset Text
          AdobeScripts Level 3

          hi Tobias,

           

          you need to add new TextFrame - big enough to fit biggest image - you can do this in one step or you can start from small TextFrame and in loop increase it's size

          in each step of the loop you need to check if pageItems.count > 0

           

          or maybe you can add attributes in XML file - so your images will be imported in correct size ... I don't know so you need to check this

           

          robin

           

          www.adobescripts.co.uk

          1 person found this helpful
          • 2. Re: [JS CS3] Modify geometricBounds of Inline Frames in Overset Text
            tobias.wantzen Level 1

            Thanks Robin!

             

            I helped myself with the following:

             

            [...]
            with(myElement){
                 // get img objects
                 var theImage = myElement.xmlContent;
                 var theImageFrame = theImage.parent;
                 theImageFrame.appliedObjectStyle = myDocument.objectStyles.item("Img_free");
            [...]
            

            The objectStyle "Img_free" sets the image frame from "inline" to "anchored frame". So the size of the image doesn't matter any more because its outside ("free") of the text. So everything flows into visibility and I can change whatever I want. (Yes, I must not do this with a object style, but it felt right to do so.)

            It's basically a similar way to your description. But I had hoped that there would be a somewhat "cleaner" way to do that. In my eyes it is more a workaround ...

            Any further suggestions?
            (How do people scripting InDesign Server do such things?)

            Thanks
            Tobias