Home Forums DITA and XMetaL Discussion Changing default height and width for the image element (reference topics) Reply To: Changing default height and width for the image element (reference topics)

kmartin7

Reply to: Changing default height and width for the image element (reference topics)

Hi Derek,

We appreciate your response to this matter. I attempted to make changes to the *.js file in the following manner because our height and width attributes in the SVG node are always 100%, so I am trying to parse out the last two segments of the viewBox attribute in the root node. Here is my code so far (it does NOT work):

else {
    var svgNode = xmlDoc.selectSingleNode(“//svg”);
    //ActiveDocument.Host.Alert(xmlDoc.xml);
var viewBox = svgNode.getAttribute('viewBox');
var params = viewBox.split(' ');
var SVGwidth = parseFloat(params[2]);
var SVGheightt = parseFloat(params[3]);
    //var SVGwidth  = svgNode.getAttribute(“width”);
    //var SVGheight = svgNode.getAttribute(“height”);

Any ideas would be greatly appreciated.

Reply

Products
Downloads
Support