Ab2d.ReaderSvg versions history


See related blog posts to get additional information about development history of the Ab2d.ReaderSvg.


New in version 8.0

  • Added support for .Net 5.0 and .Net 6.0.
  • Fixed using AutoSize property on SvgDrawing.
  • Added ClipToBounds property to ReaderSvg. When set to true and when AutoSize is set to false, then the content will be clipped to the area defined in the svg header.
  • Updated SvgViewbox and SvgDrawing to set ClipToBounds property on the InnerReaderSvg based on the value of the ClipToBounds on the SvgViewbox and SvgDrawing.
  • Fixed reading svg "use" elements that do not have and transformations applied.
  • Fixed reading marker elements that has markerWidth, markerHeight and viewBox attributes set. Before the size of the marker can be invalid.
  • Fixed positioning marker elements that use Shapes (Ellipse, Rectangle, etc. but not Path) to define their geometry.

New in version 7.1

  • Added support for .Net CORE 3.1 (only with NuGet distribution).
  • Performance optimizations that significantly reduced read time and can read some svg files a few times faster.
  • Added support for linked pattern (a pattern that has xlink:href set to another pattern).
  • Prevented throwing an exception when calling GetCustomPropertiesDataTable and the MakeNamesUnique was set to false and svg file defines objects with duplicate names.
  • Set ClipToBounds on the Canvas that is created from pattern only when the pattern has overflow set to hidden or scroll.
  • Allowed having WpfXamlWriterSettings.StartComment set to null or empty text.

New in version 7.0

  • Added support for multiple class name definitions in one css line (for example: ".A,.B{fill: green;}").
  • Added support for adding css style definitions after the class names was already defined (for example: ".A,.B{fill: green;} .A{stroke: red;}").
  • Correctly load css style definitions from style element even if it does not have type="text/css" attribute.
  • Improved css parser to allow having '-' and '_' in the css name.
  • Added BeforeWpfObjectCreatedCallback and AfterWpfObjectCreatedCallback to get callback before and after the WPF object is created from the svg element. The called method gets OuterXml of the svg element, its name (based on the NamedObjectsSource property) and parent WPF object. This allows reading custom properties from svg file.
  • Added support for StrokeDashArray and StrokeDashOffset when reading svg as geometry (this was already supported when the svg file was read as shapes).
  • Prevented problems when transformations are defined with unexpected spaces.
  • Added support for comma or semi-column in path data text - for example: d="M 100 100, L 300 100, L 200 300 z".
  • Fixed reading gradientUnits in gradient brushes when gradientUnits attribute is defined in a referenced gradient.

New in version 6.7

  • 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.

New in version 6.6

  • Added IsCorrectingNamesForWpf, MakeNamesUnique and GetCustomSvgElementNameCallback properties to ReaderSvg. The properties provide more control on how the names of the elements are created.
  • Prevented throwing null reference exception in case of invalid transformation in svg file

New in version 6.5

  • Improved positioning RadialGradientBrush inside Ellipse that is created from svg circle element and when userSpaceOnUse is used.
  • Added support for "transparent" color name.
  • Added support for alpha values in color with hex string ("#AAFFFFFF") and added support for specifying color with "rgba(aa,rr,gg,bb)."

New in version 6.4

  • Added support for textPath elements (positioning text on a path).
  • Added GetElementSvgText to get the svg text of the element with the specified id (can be used to read some additional svg properties that are not read by ReaderSvg).
  • Added support for dx and dy properties on the text element.
  • Fixed writing new line characters in XAML.
  • Added support for vertical text (glyph-orientation-vertical svg property).
  • Improved writing images in XAML that are now written in more clear XAML. Also fixed setting Source for images that are created from foreign objects.
  • Added support for reading number lists that end with comma - for example "12, 34, 56," - this prevented reading svg file in the previous version.
  • 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.

New in version 6.3

  • Added support for textPath elements (positioning text on a path).
  • Added GetElementSvgText to get the original svg text of the element with the specified id (can be used to read some additional svg properties that are not read by ReaderSvg).
  • 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.

New in version 6.2

  • Added support for using polygon as clip-path.
  • Improved transforming shapes and brushes.
  • Prevented applying opacity twice - to alpha value in color and to Opacity property on element.
  • Added support for "fill-opacity" and "stroke-opacity" attributes.
  • Fixed ResourceDictionaryWriter so that the ResolveResourceKeyCallback is called also for root keys.
  • Used black as default fill color (when fill is not specified).
  • Prevented stretching geometry under some circumstanes when svg file was read as geometry.

New in version 6.1

  • Changed reading transformation so that the type of transformation is preserved (rotate transform is read as RotateTransform and not as MatrixTransform as before). Added new property to ReaderSvg to control this behavior: ConvertTransformationsToMatrixTransform. You can set it to true for backward compatibility.
  • Removed setting some default values on TextBlock element: FontStyle="Normal" FontWeight="Normal" HorizontalAlignment="Center" VerticalAlignment="Bottom" (this creates cleaner XAML).
  • Fixed reading text that is rendered with outlines.
  • Improved using viewBox attribute.
  • Improved using svg and use elements when they use clipPath, transform and viewBox.
  • Improved TrueTransform when transforming LinearGradient and RadialGradient brushes.
  • Improved support for clipping when converting shapes to geometry.
  • Added "preview Images" option to ViewerSvg. Fixing some bugs in ViewerSvg application.
  • Improved transforming object's position and size to simplify creating XAML from parts of svg file.

New in version 6.0

  • Added support for custom rotation pivot point set in Inkscape (inkscape:transform-center-x and inkscape:transform-center-y attributes).
  • Added possibility to set the WPF name of the objects from the Inkscape's Label (inkscape:label attribute).
  • Improved clipping behaviour with adding suppor for UserSpaceOnUse value in svg clipPathUnits attribute.
  • Changing the way names are set to objects when a new Canvas is created to host the object's transformation. Now the object gets the original svg name. The created transformation Canvas gets the name that has "_transform" sufix. This behaviour can be controlled by SetSvgNameToParentTransformCanvas and TransformCanvasNameFormatString properties - see help for this properties for more info.

New in version 5.6

  • Improved RenderToBitmap when rendering to custom size bitmaps and when AutoSize was set to false when reading svg file (the problem was that all objects were scaled to the border of the image).
  • Added dpi parameter to RenderToBitmap method to specify custom dpi settings (instead of using default 96 value).
  • Fixed naming resources in ResourceDictionaryWriter.
  • Greatly improved ResourceDictionaryWriter application with adding more options and adding support to write Brushes as resources for svg files imported as Shapes (not only for Geometries).
  • Used new ZoomPanel with touch support in ViewerSvg and added an option to enable or disable touch rotate with ZoomPanel.

New in version 5.5

  • Added RenderToBitmap method to render the read svg image to bitmap. The method allows users to render to custom bitmap size and to specify custom background brush.
  • Added FlattenHierarchy method that flattens the hierarchy of the read svg objects so that all the objects are children on one root Canvas.
  • Correctly handle "stroke-width" attribute in text element. Also does not convert text to path when stroke is set to some value but stroke-width is set to 0.
  • Fixed using some very small values for stroke thickness and values written in scientific format (1.23E-12).
  • Improved ReaderSvg startup and reading performance with optimizing Regex objects creation.
  • Added SvgToPngConverter console application that shows how to read svg file and save it to png file.
  • Added WinForms sample that shows how to read svg files inside WinForms application.

New in version 5.4

  • Clip path now works on all elements and not just on Canvas.
  • Improved size measurement when AutoSize is set to true and some objects are hidden.
  • Added objects grouping optimizations to ReaderSvg - they can be controlled by new properties in ReaderSvg: OptimizeObjectGroups, FlattenHierarchies, TransformShapes
  • Improved transforming read objects with calling Transform method.
  • Updated SvgBounds after calling Transform method with updateLastReadViewbox set to true.
  • Prevented throwing exception in GetObjectsWithCustomProperties when svg file does not have any custom properties.
  • Added IgnoreRootElementSize property to GeometrySetting - added possibility to remove the transformations or RectangleGeometry based on the size or root element. This can produce nicer XAML.
  • Fixed using transformations on EllipseGeometry and RectGeometry when reading svg file as geometry.
  • Prevented writing "Canvas.Left" and "Canvas.Top" properties in XAML two times.
  • Improved reading geometries when rectangle or ellipse have both Canvas position (Canvas.Left or Canvas.Top) and transformation set.
  • Improved XAML writer to prevent writing Canvas.Left = "0" and Canvas.Top = "0" (zero values can be skipped).

New in version 5.3

  • Fixed reading text with gradient fill or stroke brush.
  • Prevent throwing exception when incorrect number text was used for numbers.
  • Invisible objects (Visibility != Visible) are not exported to geometry any more.
  • Shapes with Opacity set (Opacity < 1.0) are now correctly exported as geometries.

New in version 5.2

  • Added Ab2d.Common.ReaderSvg.TrueTransform class that can be used to transform the read objects.
  • Added Transform method to transform the read svg objects.
  • Added TransformFromPixelsToMM method (can be used to transform svg file saved in pixel units into mm units - for example for Insckape svg files).
  • Added SvgCreator property that specifies the application that was used to create svg file (it it can be determined - currently the supported applications are: Visio, CorelDraw, Adobe Illustrator, Inkscape).

New in version 5.1

  • Fixed writing Image.Stretch into xaml.
  • Fixed reading numbers defined with em unit (for example: "123.45em").
  • Added writing HorizontalAlignment and VerticalAlignment XAML when exporting Image (when using preserveAspectRatio svg element).

New in version 5.0

  • Change build target framework from .Net 3.0 to 3.5 Client Profile.
  • Added support for XAML export for Windows Store applications (Windows Runtime). This can be done with passing an instance of WinRtXamlWriterSettings class to GetXaml method.

New in version 4.9

  • Fixed exporting to XAML when the content of Text property contains curly brackets. Before parser wanted to use them for binding expression.
  • Fixed throwing ArgumentException when right or bottom value in object's bounds is negative.

New in version 4.8

  • Improved reading size of root svg object (improved support for viewBox and added support for preserveAspectRatio).
  • The GetXaml method now preserves the width and height in specified units (cm or inch).
  • Removed memory leak that occurred sometimes when reading embedded images.
  • Improved reading embedded images - they are now read faster and with lower memory usage.
  • Fixed problems when Path bounds were negative and IsSizeSetToPathElement in SilverlightXamlWriterSettings was set to true.
  • Prevented adding PresentationOptions:Freeze="True" text to XAML for Silverlight.
  • Added option to export for Silverlight 5.
  • Fixed reading svg file that contain links to images and were read without specifying the whole path (Read method was called only with svg file name without the full path).

New in version 4.7

  • Added NameFormatString to BaseXamlWriterSettings - it can be used to customize how the object names are written to xaml (custom prefixes and suffixes can be added to names).
  • Added support for preserveAspectRatio property on svg image elements (slice mode with Center and Max are not supported).
  • Improved commercial licensing code to prevent delay caused in RSACryptoServiceProvider under some circumstances.
  • Added Ab2d.ZoomPanel.LicenseHelper.EmbeddedLicenseAssembly property to speed-up looking for embedded license key in commercial version.

New in version 4.6

  • Improved design time support for SvgDrawing control - now the svg file is shown in design time (before the image in design time was shown only in SvgViewbox).
  • Added SvgFileLoading and SvgFileLoaded events to SvgViewbox and SvgDrawing controls.
  • Prevented locking referenced image files.

New in version 4.5

  • Added OverrideMiterLimit property to ReaderSvg. With OverrideMiterLimit it is possible to override the used miter limit value and correct the problems that can be caused by the different rendering of miter limit in svg and WPF.
  • Added SwitchElementProcessingType property to ReaderSvg. It defines how switch children will be processed - possible values: Disabled, ShowFirstDiscardOthers, ShowFirstHideOthers, ShowFirstCollapseOthers or ShowAll.
  • Fixed positioning and sizing of use and embedded svg elements.

New in version 4.4

  • Markers (arrows and other line endings) are now correctly show on line and polyline elements (before they worked only on path elements).
  • markerWidth and markerHeight are correctly handled.
  • Removed obsolete Ab2d.SvgViewbox control - the control has been obsolete for a few versions - Ab2d.Controls.SvgViewbox should be used instead. This also removes the need for Designer assemblies to remove the obsolete control from Designer ToolBox.

New in version 4.3

  • Added ProgressChanged event to ReaderSvg to get report progress when reading file.
  • Improved GetXaml method for Silverlight: Added workaround for displaying Paths in Silverlight in Visual Studio 2010 designer - set Width and Height to Path element.
  • Improved GetXaml method - now the images are written to xaml without need to specify ResolveImagePath delegate. The uri format can be specified with the new DefaultImageUriFormatString property in XamlWritterSettings.
  • Improved reading linked images (not embedded into svg file). Before an exception was thrown when the image file could not be located - now the image object is created but its Source is not set.
  • Fixed reading some svg files with embedded image that reported "Invalid length for a Base-64 char array." error (used custom base64 reader instead of .Net method to read the string).
  • Fixed problems with reading svg files from Microsoft Visio that have more than one layer with the same name defined.
  • Improved ResourceDictionaryWriter class to make it much more customizable. The AddFile and AddStream methods now work correctly. The usedSvgReader, geometrySettings and xamlWritterSettings fields are now protected so they can be changed in derived class. Also the methods CreateReaderSvg, CreateXamlWriterSettings, ReadSvgFile, ReadSvgStream, GetXaml, GetRootResourceKey and ResolveResourceKeyCallback are now protected and virtual so they can be overriden in derived class.
  • Added AddHiddenElements property that specifies if hidden elements are read. If the value of AddHiddenElements is true, than hidden elements are read and have their Visibility property set to Hidden or Collapsed (depends on using display or visibility attribute in svg file).

New in version 4.2

  • Improved performance - time to read some complex svg files is decreased by almost 300%.
  • Added OptimizeStyleProcessing property to ReaderSvg. By default its value is set to true to improved performace. But for some rarely used style declarations the optimized processing can produce wrong results - in those cases set the value to false.
  • Added support for text and tspan baseline-shift.
  • Now polyline and polygon are read as WPF's Polyline and Polygon elements (in previous version they were read as Path).
  • Fixed measuring size - improved for bigger stroke thickness on some shapes (when AutoSize property on ReaderSvg is true - by default).
  • Fixed SvgViewbox and SvgDrawing controls - they do not throw exceptions when Source is not set but some other property like AutoSize is set.

New in version 4.1

  • Improved GetXaml method to enable writing transformations as inner elements instead of attributes (because of visual designer in Visual Studio 2010 and Expression Blend for Silverlight projects) - added UseCanvasPositionForTranslateTransform and WriteTransformationsAsElement properties to BaseXamlWriterSettings class.
  • Added support for some svg files that define url references with "&quot;" - for example: style="stroke: url(&quot;#linearGradient4603&quot;)".
  • Added support for lengthAdjust attribute in text and tspan elements.

New in version 4.0

  • Added support for "marker" svg element - add support for arrows and other line start and end markers
  • Added support for "symbol" svg element - this also adds support for embedded fonts inside svg file
  • Added support for "clipPath" - object clipping
  • Added support for "use" element
  • Added support for xml:space="preserve" attribute - preserves the space before and after the text
  • Added support for textLength attribute in text and tspan elements
  • Fixed reading Rect data written with ',' instead of ' ' (for example '0,0,1,1' works now)
  • The Name property on the read objects is now set (so it is not needed to use NamedObjects dictionary or GetObjectName method). Setting Name can be turned off wuth SetNameProperty no ReaderSvg.
  • Improved the algorithm to correct the names read from svg file (now the name is not changed to lower case any more and also all letters are allowed and not only letters from 'a' to 'z').
  • Added FallbackBrush property to SilverlightXamlWriterSettings so it is possible to control which brush is used instead of VisualBrush that is not supported in Silverlight
  • Added GetLayerNames and GetElementsForLayerName methods to read layer information from svg file defined in Microsoft Visio
  • Added support to read embedded data from svg file created in Microsoft Visio - added the following methods: GetCustomProperties, GetObjectsWithCustomProperties, GetCustomPropertiesDataTable
  • Added NamedObjectsSource property to ReaderSvg to specify the source of the object names - for example for Microsoft Visio or other application that do not allow to set the svg's id attribute, the NamedObjectsSource can be set to NamedObjectsSourceType.Title or NamedObjectsSourceType.TitleIfExist.
  • Added NamedObjectsSource property to SvgViewbox and SvgDrawing

New in version 3.1

  • Added support for all types of svg patterns:
    before only TexturePatterns were supported, now other types of patterns are supported as well. All patterns are now converted into VisualBrush.
    NOTE: Silverlight does not support VisualBrush - Red brush is used instead.
  • Added support for complex Strokes and Pens - before Strokes and Pens can be only SolidColorBrush. Now also other types of Brushes are supported (LinearGradientBrush, RadialGradientBrush, VisualBrush, etc.).
  • Fixed using opacity on some svg elements.
  • Improved support for RadialGradient when gradientTransform was used.
  • Fixed getting the size of the root svg element when only width or only height is specified (when AutoSize is false).
  • Fixed using Ab2d.ReaderSvg inside WinForms applications.
  • Fixed licensing problems when used on 64-bit OS.

New in version 3.0

  • Added Geometry support:
    new ReadGeometry method with support for advanced geometry optimization and use of resources (Burshes and Pens are defined in resources).
    new ResourceDictionaryWriter class and sample SampleResourceDictionary aplication to simplify creating resources from the svg files
  • Added SvgDrawing control to show svg file as geometries in xaml
  • Added GetXaml method to get the xaml of the read objects (also used in ViewerSvg; it is much more accurate as System.Windows.Markup.XamlWriter.Save)
  • Added GetObjectName method - gets the name of the object. If object does not have a name defined returns null
  • Optimized the output xaml for Path element - now the properties with default values are no longer displayed. This in most cases removes the following properties: StrokeStartLineCap, StrokeEndLineCap, StrokeDashCap, StrokeLineJoin, StrokeMiterLimit, StrokeDashOffset
  • Added support for gradientTransform on radialGradient
  • Added support for known colors in xaml writter - known colors like Black, Yellow can now be written with its name instead of hex display (#FF000000). This feature is used by default but can be disabled with setting UseColorNames in XamlWriterSettings to false.
  • Fixed propagating text styles to child tspan elements (for example if text has underline decoration set, underline will be used also on the child tspan elements - if not overwritten by different text-decoraton)
  • The path is now automatically closed when the last segment ends on the same position as the start segment. Before if the paths were not manually closed, there could be some sharp edges on some parts of the path.
  • Greatly improved performance on svg files where path elements have a lot of segments.
  • Improved setting the size of returned Viewbox.
    If AutoSize is false the returned Viewbox has the size that is defined in the svg file. The previous version did not set the size correctly.
    If the svg width and height are specified in cm, mm or inches the output size in xaml is set in cm.
  • Added AutoSize property to SvgViewbox and SvgDrawing
  • Added BitmapImages property that contains all the bitmaps read with ReaderSvg (also contains images embedded into the svg file)
  • Added ReadPathAsPathGeometry property - If false (default) the path is read as StreamGeometry (better performance). If true the path is read as PathGeometry (worse performance but path can be modified).

New in version 2.3

  • Added AutoSize property. If its value is true (default - as previous version) the size of returned Canvas is calculated from the size of objects it contains. This is useful if you do not care whether the objects were drawn on the Letter or A4 page - you just need the returned object to be as big as its containg objects. If AutoSize is false the size defined in svg element is used for the size of returned Canvas. This is useful if you were working on a Letter page and would like to preserve the positions of objects inside the Letter area.
  • Improved measuring of objects when AutoSize is true (now transformed elements are correctly measured).
  • Improved ellipse - before svg ellipse was converted into Path WPF element - now it is converted into Ellipse WPF element.
  • Added reading elements inside svg link element (before the whole element was skipped). Linking is not supported, but its content is now rendered.
  • Added support for underline and line-through text decorations.
  • Improved processing of text and tspan svg elements.
  • Added help file.

New in version 2.2

  • Added support for FontWeight and Italic FontStyle
  • Added support for Rotate in Tspan (for Text on Path)
  • Fixed fill and stroke brush for Rectangle element
  • Removed RunWithDeveloperLicense Dialog (shown when commercial license is installed, but the application did not have an embedded license.licx file)

New in version 2.1

  • Fixed resolving external references in svgz files
  • Fixed positioning bitmap images
  • Adjusted LinearGradientBrush to show correctly in WPF
  • Added support for MappingMode in LinearGradientBrush
  • Added reading elements inside switch element (before switch was skipped)
  • Improved evaluation mode

New in version 2.0

  • Integrated licensing system - first commercial version.

New in version 1.7

  • Improved reading text - added support for nested tspan elements inside text.
  • Fixed reading text-anchor when defined in parent elements.
  • Improved reading svg files with missing xmlns declarations.
  • Improved performance when reading text. Also now more fonts are rendered correctly.
  • Fixed reading embedded images (sometime the bounds of the TextureBrush) were not read correctly.

New in version 1.6

  • Fixed reading number in exponent format (for example 1.234e-3) in transform element. This fixed the problems when some elements in the read image were placed on the wrong location and with the wrong size.

New in version 1.5

  • Added support for reading svgz (compresses svg) files.
  • Fixed reading some embedded images - sometimes "Invalid character in a Base-64 string." exception was thrown.

New in version 1.4

  • Added SvgViewbox.
  • Fixed closing paths (some paths did not close correctly).

New in version 1.3

  • Fixed reading text for svg files created in Inkscape.
  • Added SvgBounds property (bounds of the elements in svg). Set InnerWidth and InnerHeight as obsolete.
  • Improved read svg elements so they fit correctly into parent object. For example before some svg files produced Viewboxes that exceeded (or were smaller) the size of parent StackPanel. Now the Viewbox should fit into StackPanel.
  • Read FillRule to NonZero or EvenOdd.
  • Fixed some bugs that crashed the ReaderSvg.

New in version 1.2

  • In case text does not have any special stroke or fill set now a TextBlock is used to render text. In previous version all text were converted to paths with made simple texts very complex.
  • Added property UseSimpleText that forces the ReaderSvg to always use TextBlock to render text.
  • Improved reading of svg files.
  • Some small bugfixes.