1 Reply Latest reply on Feb 20, 2014 3:29 AM by Loic.Aigon

    How to place the images in Indesign xml file by Javascript?

    hasvi Level 1

      How to place the images in Indesign xml file by Javascript?

      We got the Indesign xml file, how to give the image placement link by Indesign javascript? Please help me its urgent.

        • 1. Re: How to place the images in Indesign xml file by Javascript?
          Loic.Aigon Adobe Community Professional

          Hi,

           

          You can pass the image url as a href attribute=> file:///Users/me/Documents/my_pic.jpg directly within your xml. It just needs that you pass a local, static and valid url.

           

          If you want to add image later once the xml is flowed and so target specific nodes and inject images, it's a bit more complex. If the node is not part of the layout, you may try to reach the XMLElement objet and such an attribute, then layout the element.

          var x = some XMLElement

          x.xmlAttributes.add("href","file:///Users/m/Documents/my_pic.jpg" );

           

          If already placed, then you have to get the associated pageItem, then place your file into it.

          pagItm.place ( File ( "/Users/m/Documents/my_pic.jpg" ) );

           

          Hope that helps,

           

          Loic

          http://www.loicaigon.com