Re: Visualizing SVG files

Martin Goik <[email protected]> Fri, 17 Jan 2025 14:31:52 +0100
Newsgroups gmane.editors.xxe.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------AB0RsbwDNzESOqOZjQZ33ThN
Content-Type: multipart/alternative;
 boundary="------------oRipKNFBX00CPeMYHc4NB3GL"

--------------oRipKNFBX00CPeMYHc4NB3GL
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Dear Steve,

On 1/16/25 14:05, Steve Litt wrote:
> Martin Goik said on Wed, 15 Jan 2025 14:36:00 +0100
>
>> Hello,
>>
>> The Xmlmind distribution includes the Apache Batik Plugin  for
>> rasterizing SVG images.
>>
>> However I'm using Inkscape for SVG image creation. Unfortunately
>> Inkscape sometimes creates non-standard conformant SVG code. This code
>> does not cause any trouble with current browsers but Batik being very
>> picky frequently throws exceptions making Xmlmind image rendering a
>> pain.
> [snip]
>
> I'm pretty sure that if, when you save your Inkscape file, you save it
> as Plain SVG instead of Inkscape SVG, you won't have this problem. Of
Thanks for your advice in the first place! Using Inkscape for ages I was 
unaware of this option. More precisely: I did not expect to find 
something helpful in that menu other than e.g. exporting LaTeX or 
whatever non-SVG format being desired.

However your proposal does not solve my issue. One of the culprits 
causing trouble was this SVG file 
https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/-/blob/master/Doc/Sd1/Inheritance/Fig/figureCenter.svg 
. So I loaded it into Inkscape and saved it as plain SVG. Both current 
Xxe 10.10 and batik-squiggle 1.14 throw a
org.apache.batik.transcoder.TranscoderException . Similar files in that 
very same folder are being Batik rendered flawlessly for no apparent reason.

I then saved it again as plain SVG this time ticking the »Export as SVG 
1.1 ...« box to no avail.

The file had been created July 2022 thus likely by an older Inkscape 
version. My current Inkscape is 1.4 (e7c3feb100, 2024-10-09).
> course this means you must not use any Inkscape extensions to SVG,
> including multiline text. For multiline text I just make an x, give it
> the desired justification and right position, Ctrl+D it and move the
> copy straight down, then use Inkscape's Distribute to create the
> desired number of lines.

So far I'm not aware of using any non-standard SVG features in this file 
(But I likely do so anyway). In particular I do not see multi line text 
being present.

I narrowed down the problem ending up with just a single arrow causing 
the exception, see attached arrow.svg. This one also had had been saved 
as plain svg. I'm aware of (older?) Inkscape handling arrowheads 
strangely. But my SVG knowledge is just insufficient.

I then created a new Inkscape file from Scratch drawing just a straight 
line subsequently adding an arrow marker getting a very same result. 
Using Oracle JRE instead doesn't change anything. I feel like missing 
something terribly obvious.

BTW: Its not that I'm desperately searching for exotic examples causing 
trouble. Over the years I had had numerous related issues of this kind. 
For example when exporting UML Diagrams from Jetbrains IDE and embedding 
these into Inkscape. Sometimes the exceptions being thrown lead to a 
clue. I then edited the SVG by hand typically removing or modifying some 
attributes or element nodes. I could still edit the results in Inkscape 
keeping Batik happy at the same time. But this process is ways to 
cumbersome, unsafe and obviously kills productivity.

Martin

-- 
Martin Goik  Tel.  +49-711-8923-2164http://www.HdM-Stuttgart.de/~goik

For there is no folly of the beast of the earth which is not infinitely
outdone by the madness of men.                          Herman Melville

--------------oRipKNFBX00CPeMYHc4NB3GL
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Dear Steve,</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 1/16/25 14:05, Steve Litt wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:[email protected]">
      <pre wrap="" class="moz-quote-pre">Martin Goik said on Wed, 15 Jan 2025 14:36:00 +0100

</pre>
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">Hello,

The Xmlmind distribution includes the Apache Batik Plugin  for 
rasterizing SVG images.

However I'm using Inkscape for SVG image creation. Unfortunately 
Inkscape sometimes creates non-standard conformant SVG code. This code 
does not cause any trouble with current browsers but Batik being very 
picky frequently throws exceptions making Xmlmind image rendering a
pain.
</pre>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
[snip]

I'm pretty sure that if, when you save your Inkscape file, you save it
as Plain SVG instead of Inkscape SVG, you won't have this problem. Of</pre>
    </blockquote>
    <div class="moz-cite-prefix">Thanks for your advice in the first
      place! Using Inkscape for ages I was unaware of this option. More
      precisely: I did not expect to find something helpful in that menu
      other than e.g. exporting LaTeX or whatever non-SVG format being
      desired.</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">However your proposal does not solve my
      issue. One of the culprits causing trouble was this SVG file
<a class="moz-txt-link-freetext" href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/-/blob/master/Doc/Sd1/Inheritance/Fig/figureCenter.svg">https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/-/blob/master/Doc/Sd1/Inheritance/Fig/figureCenter.svg</a>
      . So I loaded it into Inkscape and saved it as plain SVG. Both
      current Xxe 10.10 and batik-squiggle 1.14 throw a <br>
    </div>
    <div class="moz-cite-prefix">org.apache.batik.transcoder.TranscoderException
      . Similar files in that very same folder are being Batik rendered
      flawlessly for no apparent reason.<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">I then saved it again as plain SVG this
      time ticking the »Export as SVG 1.1 ...« box to no avail.</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">The file had been created July 2022
      thus likely by an older Inkscape version. My current Inkscape is
      1.4 (e7c3feb100, 2024-10-09).<span style="white-space: pre-wrap">
</span></div>
    <blockquote type="cite"
      cite="mid:[email protected]">
      <pre wrap="" class="moz-quote-pre">course this means you must not use any Inkscape extensions to SVG,
including multiline text. For multiline text I just make an x, give it
the desired justification and right position, Ctrl+D it and move the
copy straight down, then use Inkscape's Distribute to create the
desired number of lines.</pre>
    </blockquote>
    <p>So far I'm not aware of using any non-standard SVG features in
      this file (But I likely do so anyway). In particular I do not see
      multi line text being present.</p>
    <p>I narrowed down the problem ending up with just a single arrow
      causing the exception, see attached arrow.svg. This one also had
      had been saved as plain svg. I'm aware of (older?) Inkscape
      handling arrowheads strangely. But my SVG knowledge is just
      insufficient.</p>
    <p>I then created a new Inkscape file from Scratch drawing just a
      straight line subsequently adding an arrow marker getting a very
      same result. Using Oracle JRE instead doesn't change anything. I
      feel like missing something terribly obvious.<br>
    </p>
    <p><span style="white-space: pre-wrap">BTW: Its not that I'm desperately searching for exotic examples causing trouble. Over the years I had had numerous related issues of this kind. For example when exporting UML Diagrams from Jetbrains IDE and embedding these into Inkscape. Sometimes the exceptions being thrown lead to a clue. I then edited the SVG by hand typically removing or modifying some attributes or element nodes. I could still edit the results in Inkscape keeping Batik happy at the same time. But this process is ways to cumbersome, unsafe and obviously kills productivity.</span></p>
    <p><span style="white-space: pre-wrap">Martin
</span></p>
    <p><span style="white-space: pre-wrap">
</span></p>
    <pre class="moz-signature" cols="72">-- 
Martin Goik  Tel.  +49-711-8923-2164  <a class="moz-txt-link-freetext" href="http://www.HdM-Stuttgart.de/~goik">http://www.HdM-Stuttgart.de/~goik</a>

For there is no folly of the beast of the earth which is not infinitely
outdone by the madness of men.                          Herman Melville 
</pre>
  </body>
</html>

--------------oRipKNFBX00CPeMYHc4NB3GL--

--------------AB0RsbwDNzESOqOZjQZ33ThN
Content-Type: image/svg+xml; name="arrow.svg"
Content-Disposition: attachment; filename="arrow.svg"
Content-Transfer-Encoding: base64

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+
CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8p
IC0tPgoKPHN2ZwogICB3aWR0aD0iMTIuMDg2ODEybW0iCiAgIGhlaWdodD0iMi40Njk0NW1t
IgogICB2aWV3Qm94PSIwIDAgMTIuMDg2ODEyIDIuNDY5NDUiCiAgIHZlcnNpb249IjEuMSIK
ICAgaWQ9InN2ZzEzODMxIgogICB4bWxucz0iaHR0cDovL3d3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Jva2Utd2lkdGg6MC40OTM4ODkiCiAgICAgICAgIHg9IjI1
IgogICAgICAgICB5PSIxNSIgLz48L3RleHQ+CiAgPC9nPgo8L3N2Zz4K

--------------AB0RsbwDNzESOqOZjQZ33ThN
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

--------------AB0RsbwDNzESOqOZjQZ33ThN--