Major update of Ab2d.ReaderSvg brings better support for css styles and more

by abenedik 6. November 2018 17:00

I am happy to inform you that a new major version of Ab2d.ReaderSvg was just published.

The new version has a significantly better support for reading css styles. The new version of the Ab2d.ReaderSvg can now correctly read a css text with multiple class name definitions in one line. Also adding additional properties to already defined class names is now supported. Those two features are required to correctly read the following css definition:

.A, .B { fill: green; } 

.A { stroke: green; }

This update should greatly improve reading css styles from svg files. But because css styles can be incredibly complex, there are still cases that are not supported. Luckily, the main tools that can save to svg files usually do not use such complex css styles and therefore Ab2d.ReaderSvg should be able to read almost all the files.

 

An important new feature is also that ReaderSvg class now has two new delegates: BeforeWpfObjectCreatedCallback and AfterWpfObjectCreatedCallback. The first delegate is called before ReaderSvg creates a WPF object from the svg element. The delegate gets the xml text that is used to define the element. It can be used to create your own WPF object from the xml and pass that back to ReaderSvg. The other delegate is called after the WPF object is created by ReaderSvg. It gets the created WPF object and the xml text. This delegate can be used to read some additional properties from the xml and decorate or change the already created WPF object.

There are also some other improvements and fixes. The whole list can be seen on ReaderSvg versions history web page.

 

This shows that though the main focus of the AB4D company is on developing components for 3D visualization, the 2D tools and importers are still fully supported - most of the updates are based on the great feedback from the customers. So, if you get a svg file that is not correctly imported or you have a good feature request, please send me the svg file or a feature request.

Tags:

ReaderSvg

New version of Ab2d.ReaderSvg library published

by abenedik 17. November 2017 21:15

I would like to inform you that I have just published a new version of Ab2d.ReaderSvg library.

Ab2d.ReaderSvg is the best and most accurate SVG importer library for .Net and can convert SVG elements into WPF objects.

The following is a list of improvements and changes in this version:

  • Added SourceStream property to SvgViewbox and SvgDrawing. This allows reading SVG file from stream (for example to bind memory stream from a database to a SvgViewbox)
  • Improved support for generic font families: serif, sans-serif, monospace, times.
  • Set InnerReaderSvg and NamedObjects properties on ReaderSvg object before SvgViewbox.SvgFileLoaded event is fired (in the previous version those two properties were set after the event was fired and therefore it was not possible to read InnerReaderSvg and NamedObjects in the SvgFileLoaded event handler).
  • Prevented setting RenderTransformOrigin from inkscape:transform-center-x and inkscape:transform-center-y attributes when there is also a transform attribute set. This fix prevents applying an invalid transformation.
  • Fixed reading alpha value when color is specified as "rgba(r,g,b,a)" value.
  • Prevented foreignData elements defined in SVG file that are not supported (for example metafiles) to "hide" other standard SVG elements.
  • Added UseOnlyInstalledFontFamilies property to ReaderSvg. That property can be set to true to prevent creating FontFamily objects with font names that are not installed on the system.

Tags:

ReaderSvg

New version of svg reader for .Net applications published

by abenedik 8. March 2016 21:34

I am happy to announced that a new version of Ab2d.ReaderSvg is available.

textPath svg element shown in ViewerSvg

As shown in the image above, the ReaderSvg now supports textPath svg element that positions text on a referenced path element.

Another very interesting new feature is a new GetElementSvgText method that returns the original svg text of the element specified with its name. This way it is possible to read data from svg file that are not recognized by ReaderSvg. The following image shows svg text for the selected element in ViewerSvg:

Showing svg text from selected element in ViewerSvg

There are also some other great new features and fixes:

  • Added support for vertical text (glyph-orientation-vertical svg property).
  • Improved support for rounder corners on rectangles in case when only rx or only ry is specified - in this case the other value is set to the same value.
  • Fixed reading text decorations (Underline and Strikethrough).
  • Added support for reading metafiles embedded into image's base64 encoded string.
  • Added support for reading images in foreignObject created in Microsoft Visio.
  • Added ReadForeignObjects property to Ab2d.ReaderSvg that enables or disables reading foreignObject elements (enabled by default).
  • Added support for reading data from number lists that end with comma - for example the following string in svg file was not read: "12, 34, 56,".
  • Improved writing images in XAML. They are now written in more clear format. Also fixed setting Source for images that are created from foreign objects.
  • Fixed writing new line characters in XAML.

 

As alwasy, the customers can get the latets version from their User Account page. Others can try the new version with downloading the evaluation version.

And if yuo find a svg file that is not read correctly, please send it to me and I will my best to improve ReaderSvg.

Tags:

ReaderSvg