Forum Bugs

SVG from Corel Draw does not work in Prince

pdg37
Here's an SVG (exported from Corel Draw) that looks great in Firefox and Explorer with the Adobe SVG plugin but does not render well with Prince 6.0r8. It should be a yellow box with some dark lines; prince makes everything black and adds an extra line. Any suggestions?

The W3C SVG validator seems to be down right now, so I can't check whether it's a valid file. But even if it isn't, it would be nice if it could work!

I'll post the code below.

EDIT: Part of the problem seems to be that Prince doesn't recognize the style commands in the <style> tag - if I move these into style="..." attributes on the individual elements, it gets the colors right, but the extra line is still there, and the border of the yellow box only shows up on one of the four sides.

Thanks,
-Paul

Edited by pdg37

pdg37
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="1in" height="0.5in" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 1 0.5">
 <defs>
  <style type="text/css">
   <![CDATA[
    .fil0 {fill:#FFFFB0}
    .fil2 {fill:black;fill-rule:nonzero}
    .fil1 {fill:maroon;fill-rule:nonzero}
   ]]>
  </style>
 </defs>
 <g id="Layer_x0020_1">
  <metadata id="CorelCorpID_0Corel-Layer"/>
  <g id="_168219472">
   <g>
    <polygon id="_189917024" class="fil0" points="0.333965,0.401776 0.333965,0.0789291 0.648535,0.0789291 0.648535,0.401776 "/>
    <path id="_189917024" class="fil1" d="M0.333965 0.0747913l0.0041378 0.0041378 0 0.322846 -0.00827559 0 0 -0.322846 0.0041378 -0.0041378zm-0.0041378 0.0041378l0 -0.00413386 0.0041378 -3.93701e-006 -0.0041378 0.0041378zm0.322846 0l-0.0041378 0.0041378 -0.314571 0 0 -0.00827559 0.314571 0 0.0041378 0.0041378zm-0.0041378 -0.0041378l0.0041378 0 0 0.0041378 -0.0041378 -0.0041378zm0 0.331122l-0.0041378 -0.0041378 0 -0.322846 0.00827559 0 0 0.322846 -0.0041378 0.0041378zm0.0041378 -0.0041378l0 0.00413386 -0.0041378 3.93701e-006 0.0041378 -0.0041378zm-0.322846 0l0.0041378 -0.0041378 0.314571 0 0 0.00827559 -0.314571 0 -0.0041378 -0.0041378zm0.0041378 0.0041378l-0.0041378 0 0 -0.0041378 0.0041378 0.0041378z"/>
   </g>
   <g>
    <polygon class="fil2" points="0.176681,0.157571 0.333965,0.157571 0.333965,0.165846 0.176681,0.165846 "/>
   </g>
   <g>
    <polygon class="fil2" points="0.805819,0.165846 0.648535,0.165846 0.648535,0.157571 0.805819,0.157571 "/>
   </g>
   <g>
    <polygon class="fil2" points="0.176681,0.232079 0.333965,0.232079 0.333965,0.240354 0.176681,0.240354 "/>
   </g>
   <g>
    <polygon class="fil2" points="0.805819,0.240354 0.648535,0.240354 0.648535,0.232079 0.805819,0.232079 "/>
   </g>
   <g>
    <polygon class="fil2" points="0.176681,0.314858 0.333965,0.314858 0.333965,0.323134 0.176681,0.323134 "/>
   </g>
   <g>
    <polygon class="fil2" points="0.805819,0.323134 0.648535,0.323134 0.648535,0.314858 0.805819,0.314858 "/>
   </g>
  </g>
 </g>
</svg>
mikeday
The issue here appears to be several coordinates in the path expressed in scientific notation: "-3.93701e-006". This is valid SVG, but Prince currently doesn't parse it properly. We'll try and fix this for the next release.
pdg37
Thanks, that nearly fixes it for me. Do you also know why the styles don't get applied? They don't work if copied into an external style file, but everything gets the correct color if I replace the class="..." references by the appropriate style="..." parameters.
mikeday
Another limitation of Prince, sorry! I'll see if we can move this up the roadmap for earlier implementation.
pdg37
Okay! I think I can work around these two issues for now. Thanks for the help!

-Paul
mikeday
Both of these issues should be fixed in Prince 8.0, as it supports the SVG <style> element and scientific notation for numbers in SVG.