Forum How do I...?

Controling the size of an SVG img

gwagner
I use Prince for creating (2-column) PDF from an HTML article that has lots of SVG diagrams included as img elements, like

<img src="./img/IntroUML4.svg" width="500"/>

In the PDF output, the SVG imgs' width settings get ignored and they are scaled to the width of the page when top-floated (or to the column width when column-top-floated).

I'm using prince-image-resolution: normal.

How can I control the size of the SVG img elements such that they don't get scaled?
mikeday
So you have the width="500" attribute on the img element, are there also any width/height attributes within the SVG file itself?
gwagner
Yes, the SVG also has width/height attribute settings, but changing them didn't have any effect.

The browser is using the img element's width/height attribute settings, or its style width/height settings. So, shouldn't this also be the bevior of Prince?

Edited by gwagner

mikeday
Would you be able to email me (mikeday@yeslogic.com) the document and image demonstrating the problem?