0 Replies Latest reply on Mar 5, 2013 4:41 AM by hurix@123

    image placement

    hurix@123 Level 1

      Hi,

       

      I am having a problem to place the figure either top or bottom.

       

      I hvae a script to get figure in inline and it is place near citation, below is my code:

       

      var myDoc = app.activeDocument;

      var testElement = myDoc.xmlElements.item(0);

      var testElements = testElement.evaluateXPathExpression("//img");

       

      var path = document.filePath;

      for(var i = 0; i< testElements.length; i++)

      {

              attr=testElements[i].xmlAttributes.itemByName("src").value;

       

              if(attr.indexOf ("-fig") > 0)

              {

                      var testfigName = attr.split("-fig");

       

       

            //  alert (attr + testfigName[1]);

             var figName = testfigName[1].split (" ");

             var figureName = 'Fig' + figName[0] ;

       

       

       

         testElements[i].insertionPoints[0].place (File ("/Volumes/HPP/1_Delivery/Prepress/5_Production/Book/Sage_Books/P16230510_Sage_Books_XML/ Templates/ISLAMIC_STUDIES/FULLBOOK/GRAPHICS"+ '/' + figureName));

            }

        }

       

      After get image i have to place either top or bottom.

      If any one can get idea.

       

      Hurix

       

      Message was edited by: hurix@123