Forum How do I...?

Is there a list of which SVG tags Prince supports?

David J Prokopetz
Hi.

I'm having a bit of trouble getting Prince to work with SVG files generated by Adobe Illustrator, and I was wondering: is there a list of which particular SVG tags and features are supported by Prince anywhere? It's difficult to know which compatibility modes to use, because I don't know which tags and attributes are "allowed".

Thanks.
mikeday
The list of supported SVG elements, attributes and properties for Prince 5.1 may be found in the SVG documentation.

The latest alpha version of Prince 6.0 adds support for a number of new elements including defs, symbol, use, linearGradient, radialGradient and "a". Further documentation for Prince 6.0 will be available closer to its release.
joelmeador
Super old thread resurrection!

I was trying to get linear gradients to work in prince. They are not listed on the SVG documentation page as I would expect based on your comment, Mike.

Are they actually supported?

Edit: and here's the SVG I was trying to get working
<svg width="120" height="120"  viewBox="0 0 120 120"
     xmlns="http://www.w3.org/2000/svg" version="1.1"
     xmlns:xlink="http://www.w3.org/1999/xlink" >

  <defs>
    <linearGradient id="MyGradient">
      <stop offset="5%"  stop-color="green"/>
      <stop offset="95%" stop-color="gold"/>
    </linearGradient>
  </defs>

  <rect fill="url(#MyGradient)"
        x="10" y="10" width="100" height="100"/>
</svg>
mikeday
They do work, and we need to update the documentation. However, at the moment they will only work in XML/XHTML documents, not HTML documents. This is because the HTML parser lowercases all the element names, with no special treatment for SVG, which corrupts mixed-case names like "linearGradient". Our forthcoming HTML5 parser will fix this issue.
joelmeador
Thanks, Mike!
mikeday
Prince 9 is now available, and the new HTML parser handles nested SVG inside HTML correctly, and preserves mixed case element and attribute names.