Lost information after reading Svg #1193
Replies: 8 comments
-
|
@mrbean-bremen still looking for help... :( |
Beta Was this translation helpful? Give feedback.
-
|
Sorry, I'm long out of this... still looking for a new maintainer (see #1111). Maybe @H1Gdev has an idea. |
Beta Was this translation helpful? Give feedback.
-
|
I've never had this issue before, so I don't think I'll be able to find the cause right away...
|
Beta Was this translation helpful? Give feedback.
-
|
Hey @H1Gdev
I tried SVG.NET 3.4.0 and 3.4.7. Both had the same issue.
I think all elements which have these attributes (width, height, transforms,...) are faulty. Some are correctly represented like polygon and path, but they don't use these attributes at all. Heres an analysis from ChatGPT about the differences in 2 SVGs (1 correct from VisualStudio, 1 faulty from the installation):
Additional or Divergent Elements in File 2: Summary: |
Beta Was this translation helpful? Give feedback.
-
|
Today I tried passing a XMLReader with different settings I also tried Unfortunately it did not help. But maybe it rules out sth. for you so I wanted to share this info @H1Gdev |
Beta Was this translation helpful? Give feedback.
-
|
solved it : it was the missing System.Numerics.Vectors.Dll in the installation folder. |
Beta Was this translation helpful? Give feedback.
-
|
but there is still some mystery behind. It works with the System.Numerics.Vectors.Dll now. But if I paste all DLLs in an older installation (I created several with different options, some can seen above) it still doesn't work. I don't have the ambition to investigate it any longer, because it works now and I already spent way too much time for this issue, but if this happens again to someone else : Then make sure that System.Vectors.Dll is in your installation folder. |
Beta Was this translation helpful? Give feedback.
-
|
I, too, ran into this issue. In my case, the issue was a failure to load the The two exception types I've observed are
Here's the stack trace I observed in one instance: To direct .Net to use the actual version I have installed, I added the |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Description
When I read a SVG with your library in Debug or Release mode from within Visual Studio everything works fine.
However after building an installation and trying it without Visual Studio some SVG data gets lost.
The input SVG is exactly the same. The elements read from that via
SvgDocument.Open(svgFilePath);or
SvgDocument.FromSvg<SvgDocument>(File.ReadAllText(svgPath));don't represent all the information of the SVG.
Below you can see some examples (example data). It's just the beginning of the document to show you the problem.
[A] is the SvgContent read via SvgNet in Visual Studio (Debug or Release), plotted via svgDoc.GetXML(). [B] is the exact same Svg Input read from the installation. As you can see the transforms, width, height, stroke-width and x,y values are missing.
I already checked the following:
If I read the elements in the installation via XmlDocument and log the InnerXML to a textfile the transforms etc. are displayed correctly.
I have no clue what I am missing or doing wrong.
Example data
[A] SVG Content read in Visual Studio (DEBUG or RELEASE)
[B] the same SVG Content read from the installation
Used Versions
NET Framework 4.8
SVG.net Version 3.4.7
Win 11
Visual Studio 2022 Professional.
Beta Was this translation helpful? Give feedback.
All reactions