Issue with underline and line-through in text decoration while converting svg to pdf

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
rich.dutt
Posts: 2
Joined: 2019-06-25T04:05:45-07:00
Authentication code: 1152

Issue with underline and line-through in text decoration while converting svg to pdf

Post by rich.dutt » 2019-06-25T04:39:29-07:00

Hi,

I am using Windows Binary Release dll: Magick.NET-Q16-x64, Version=7.14.0.0
OS: windows 10

Converted pdf file does not contain the text decoration as specified in svg. Although atlast a bit dash is visible, as if its removed over the alphabets and present at last. For better understatnding , attaching the pdf screenshotImage screenshot=> https://ibb.co/hgfx1Rh

Is there some specific MagickSettings which i need to set or something other which i might be missing? Apart from this anomaly, conversion happens smoothly.

Code: Select all

<g style="display: block;fill-opacity: 1;" clip-path="url(&quot;#PCC3&quot;)" transform="matrix(1 0 0 1 327.551 180.702)" data-pcc-mark="textmark-13">
        <clipPath id="PCC3" clipPathUnits="userSpaceOnUse">
          <rect x="0" y="0" width="116.789" height="50.1896" data-pcc-mark="textmark-13" />
        </clipPath>
        <g />
        <text font-family="Arial" font-size="12" font-style="normal" font-weight="normal" text-decoration="underline line-through" style="font-family: Arial; font-size: 12px; opacity: 1;fill-opacity: 1;" fill="rgba(255, 0, 0, 1)" text-anchor="start" x="2" y="12" data-pcc-mark="textmark-13" width="116.78907103825133" height="50.18961748633882">
          <tspan x="2">The name is bond, </tspan>
          <tspan x="2" dy="12">james bond</tspan>
        </text>
      </g>

Thanks.

rich.dutt
Posts: 2
Joined: 2019-06-25T04:05:45-07:00
Authentication code: 1152

Re: Issue with underline and line-through in text decoration while converting svg to pdf

Post by rich.dutt » 2019-06-27T03:25:39-07:00

On further investigation, if i pass the text-decoration under the <tspan> then it works fine. Eg. :

if above text element is edited like this:

Code: Select all

<text font-family="Arial" font-size="12" font-style="normal" font-weight="normal" text-decoration="underline line-through" style="font-family: Arial; font-size: 12px; opacity: 1;fill-opacity: 1;" fill="rgba(255, 0, 0, 1)" text-anchor="start" x="2" y="12" data-pcc-mark="textmark-3" width="116.78907103825133" height="50.18961748633882">
          <tspan x="2" text-decoration="underline line-through">The name is bond, </tspan>
          <tspan x="2" dy="12"text-decoration="underline line-through">james bond</tspan>
        </text>
Then it works fine.

But it should work same even when property is given only with parent element, right?

snibgo
Posts: 12157
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Issue with underline and line-through in text decoration while converting svg to pdf

Post by snibgo » 2019-06-27T04:40:27-07:00

What delegate is your IM using to rasterize the SVG? MSVG, RSVG or Inkscape?

Does your SVG rasterize as you expect in Inkscape? If not, I suspect your SVG is wrong. If it does, then I expect you are not using Inkscape as the delegate.

If you had shown a complete but minimal SVG, we could test it.
snibgo's IM pages: im.snibgo.com

Post Reply