New version of Ab2d.ReaderSvg and ViewerSvg

by abenedik 20. August 2010 17:55

The best svg reader for WPF and svg to xaml converter for WPF and Silverlight is now even better.

This release focuses mostly on making work with Ab2d.ReaderSvg easier. Now it is possible to get progress report when reading svg files (there are also two interesting samples about this). It is now easier to use GetXaml method when the read svg file has embedded images. Also the ResourceDictionaryWriter class (helper class to create ResourceDictionaries from svg files) is now greatly improved. With new protected fields and protected virtual methods it is now very customizable.

The reading engine also has some improvements. It fixes some of the special issues that were reported by error reporting in ViewerSvg. The number or error reports is now very low and this tells that the reading engine is already very good and can handle really most of svg files.

The problems with showing the exported xaml in Visual Studio 2010 designer for Silverlight are now gone. With the new version the GetXaml method sets Width and Height to Path element when it is called to create xaml for Silverlight. This is a workaround for a bug in Visual Studio - please vote for the bug on Microsoft Connect so it will be fixed as soon as possible.

The samples have also been updated. There are now a few more samples and they are now available for both Visual Studio 2008 and 2010.

The following is a list of all changes in Ab2d.ReaderSvg:

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



As always the ViewerSvg application has also been improved.

As with Paste2Xaml the ViewerSvg can now also change the size of read elements to any custom size. This is not done with only adding a ScaleTransform to the root element (as in previous versions) but now the positions, sizes and other values are changed to fit into the new size.

The improvements in Ab2d.ReaderSvg are also reflected in ViewerSvg. There is now an option to read or skip reading hidden elements. The export dialog also has some new settings - see the following is a screenshot:

ViewerSvg export dialog


As usual the new version can be downloaded from User Account page (for commercial users) or from my Downloads page (for evaluation version).

Tags: , , ,


Giant leap forward in reading metafiles for WPF and Silverlight

by abenedik 30. July 2010 23:22

Giant leap forward?

Check out the size of this blog post and you will see that I could not describe the new release of Ab2d.ReaderWmf and Paste2Xaml with any other words.


Both Ab2d.ReaderWmf and Paste2Xaml have been greatly improved. Ab2d.ReaderWmf is a library to import Windows metafiles (wmf) and Enhanced Metafiles (emf) into WPF application. Paste2Xaml is an application that is using Ab2d.ReaderWmf libraray and can be used to convert metafiles from files or clipboard into xaml for WPF and Silverlight.

First let me describe the new features of Ab2d.ReaderWmf library. Then I will describe the improvements of Paste2Xaml than besides new things from Ab2d.ReaderWmf also has some other great new features.

New features of Ab2d.ReaderWmf 5.0 at a glance
(major improvements are described below in more details):

Major improvements:

  • Improved reading detailed images from EMF+ records. Reading is now much faster. With added EmbeddedImagesData collection it is possible to get original image byte arrays with image format (png, jpg, etc.). It is also possible to skip reading EMF+ records with new ReadEmfPlusRecords.
  • Optimizing gradients defined in metafiles. Creating one Rectangle or Polygon with real LinearGradientBrush instead of numbers of Polygon that are defined in metafile. Optimizing gradients can be controlled with CombineGradientPolygons property.
  • Reading character spacing information that can be used to position each character in text. This functionality can be enabled or disabled by ProcessCharacterSpacing property.
  • Controlling the size of read metafile with CustomContentWidth, CustomContentHeight properties.

Improvements for Silverlight (when using with Paste2Xaml to create xaml for Silverlight; Ab2d.ReaderWmf  cannot be used in Silverlight projects):

  • Improved GetXaml method for Silverlight: added workaround for displaying Paths in Silverlight in Visual Studio 2010 designer - set Width and Height to Path element.
  • In Silverlight projects it is not possible to define PathGeometry’s data as string that would work in Silverlight and in Visual Studio 2010 designer. Therefore PathGeometry is now written as collection of PathFigures instead of data string.
  • Each PathGeometry is analyzed and if possible it is converted into RectangleGeometry.

Other fixes and improvements:

  • Fixed problems when running on 64-bit OS.
  • Fixed reading images that have width or height value defined as negative numbers - now the images are correctly mirrored.
  • Added IsClipboardMetafileAvailable, GetFromClipboard, GetGeometryFromClipboard methods to simplify getting metafiles from clipboard.
  • Added RemoveEmptyTextBlocks property - useful when copying from office documents to skip lots of empty TextBlock elements.
  • Added ProgressChanged event that can be used to get progress notifications while reading metafile. Please note that in order to show changes with the progress bar, it should be shown on another thread and not on the thread where the ReaderWmf is working. I am going to write a blog post about it based on the solution used in Paste2Xaml.
  • Improved ResourceDictionaryWriter class.  The AddFile and AddStream methods now work correctly. It is also possible to overwrite some of the methods to set some additional settings - for example number of decimals or using SilverlightXamlWriterSettings to create ResourceDictionary for Silverlight.
  • Some other improvements and fixes to improve reading metafiles that were sent as error report or feedback.

Now let me describe each of the major improvements in more detail.

Reading detailed images from EMF+ records:

Because normal metafile records do not enable storing images with transparencies they usually contain only lower quality images. The higher quality images are usually stored in EMF+ part of the metafiles.

The previous version of Ab2d.ReaderWmf library introduced possibility to read images from EMF+ records. But processing of those images could sometimes be very slow and could produce very big images (for example 4000 x 3000).

After a lot of effort I am now proud to say that the new version can much more accurately and much faster read the details images. Actually it is possible to get the original bytes that are used to define the image and the image file format. For example if a PowerPoint slide is created with a jpg image, it is now possible to get the same jpg image from Ab2d.ReaderWmf. Those data can be get from EmbeddedImagesData collection.


Optimizing gradients

Because metafiles do not provide a way to define gradients, the linear gradients are usually defined by series of Polygons or Rectangles where each of them has slightly different color. So instead of one Rectangle with LinearGradienBrush we got many Polygons.

And the number of polygons was not the biggest problem. Much bigger problem was when those polygons were rendered by WPF or Silverlight. There were many lines shown between polygons – as there would be an empty space between them. This was caused by the way WPF and Silverlight handle antialiasing. I have reported this issue to Microsoft Connect but it does not look that it will be fixed - see here.

To overcome those problems the new version of Ab2d.ReaderWmf analyses the read polygons and rectagles and if possible convert them into single Rectangle or Polygon with real LinearGradienBrush.

So instead of tens of polygons:

<Polygon Points="496,1494 496,1506 1678,1506 1678,1494" Fill="#FF000082"/>
<Polygon Points="496,1506 496,1517 1678,1517 1678,1506" Fill="#FF020082"/>
<Polygon Points="496,1517 496,1533 1678,1533 1678,1517" Fill="#FF040083"/>
<Polygon Points="496,1533 496,1544 1678,1544 1678,1533" Fill="#FF060083"/>
<Polygon Points="496,1544 496,1560 1678,1560 1678,1544" Fill="#FF080083"/>
<Polygon Points="496,1560 496,1571 1678,1571 1678,1560" Fill="#FF0A0083"/>
<Polygon Points="496,1571 496,1587 1678,1587 1678,1571" Fill="#FF0C0084"/>
<Polygon Points="496,1587 496,1599 1678,1599 1678,1587" Fill="#FF0E0084"/>

We get:

<Rectangle Width="1182" Height="2316" Canvas.Left="496" Canvas.Top="1494">
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="#FF000082" Offset="0"/>
            <GradientStop Color="#FF68008E" Offset="0.3"/>
            <GradientStop Color="#FFB80067" Offset="0.6"/>
            <GradientStop Color="#FFFF0200" Offset="0.9"/>
            <GradientStop Color="#FFFF8200" Offset="1"/>

The rendered results are also much better:
Optimize gradients in ReaderWmf

Processing character spacing information

Texts in metafiles can have additional character spacing information that for each character in text define its offset. This can be used to create wider or more condensed text.

In WPF or Silverlight there is no such possibility except defining each character with its own TextBlock.

To create similar text sizes and also prevent dividing text, the new version of ReaderWmf can apply ScaleTransform to TextBlocks that need to display wider or more condensed text.

This functionality can be enabled or disabled with ProcessCharacterSpacing property.

Custom content Width and Height

By default the size of the read content is defined in the metafile. In this case the size is specified in GDI device units. This means that the size of read content is usually a few thousands x a few thousands (for example for A4 page copied from Microsoft Word the metafile size is 4253 x 4871).

Sometimes it can be unpractical to deal with sizes in thousands and font sizes in hundreds – for example when you need an 20 x 20 image.

In this case CustomContentWidth or CustomContentHeight can be set to specify how big the content size will be regardless of the size defined in metafile. In case only one of those properties is set, the aspect ratio of the read objects will be preserved.

To create a desired size, the Ab2d.ReaderWmf does not only add a RenderTransform to the root object but it actually changes all the positions, sizes and other data.

New features of Paste2Xaml application

Paste2Xaml main screen

The screenshot above shows the main user interface of the new Paste2Xaml application.

In the bottom right there are four new CheckBoxes. The first three are used to control some of the new features of Ab2d.ReaderWmf library. The last one is shown only when custom content size is remembered from previously read metafiles –details about Export dialog for more information about this.

Other improvements on the main screen are related to object selection and its manipulation.

On the upper left corner there is toolbox. The first button is used to toggle between selection and zoom mode. When it is unchecked, the zoom mode is controlled by other toolbox buttons. Note that Paste2Xaml is using ZoomPanel control that can be also bought from This means that you can have the same zooming functionality in your own WPF application (prices start from only $69 for single developer license).

When in selection mode it is possible to select individual objects with clicking with the mouse over the shown elements. It is also possible to hold the left mouse button down and move the mouse over objects – this is useful to preview how the objects are defined.

When an object is selected the three new buttons above objects TreeView become enabled.

The first one can be used to rename the selected object.

When the next button is clicked a Context Menu is opened. From there it is possible to convert the selected TextBlock or Rectangle into TextBox or ComboxBox.

This can be used to design forms form WPF or Silverlight applications in Microsoft Word, Excel or some other drawing application. Then you can select all objects in the form and copy and paste them into Paste2Xaml. There you can simply convert some predefined text elements or rectangles into TextBoxes or ComboBoxes and export the form into xaml. It is also recommended that you rename some elements and change the size of the form in the Export dialog (more about this later).

The last button above the TreeView can be used to delete the selected object.

A feature that is not so important but is very nice is a progress bar that is shown when bigger metafiles are loaded. It is using a new ProgressChanged event on ReaderWmf. I am going to write a blog post about it based on the solution used in Paste2Xaml.

Paste2Xaml Export dialog screen

The Export dialog also has some new parts.

There is a new Images tab where it is possible to preview the embedded images.

In the options part there are now new options to control the number of displayed decimals. In previous version the xaml was created with all numbers (except some transformations) displayed as integer number. This was enough because all the numbers in metafiles are also defined as integer numbers. But with the new version it is possible to change the size of the read objects – there integer numbers would not be enough. Note the xaml writer used by ReaderWmf removes the ending 0 decimals – for example “12.340000” is written as “12.34”.

The most important new feature of Paste2Xaml can be controlled by the Change Size options. There it is possible to enter new width or height and change the size of the read elements. As with CustomContentWidth and CustomContentHeight properties in Ab2d.ReaderWmf the change affects all the positions, sizes and other data of read objects. This is very useful to bring the size of the read elements into common sizes for WPF and Silverlight applications.

To change the size first select the “Width” or “Height” radio button, than enter the desired value and click “Change size”.

If you would like to use the same custom size with other metafile also, check the “Remember custom size for other metafiles” CheckBox. This will immediately save the setting (settings will be preserved when the Paste2Xaml is closed). When this checkbox is checked and the Export dialog will be closed there will be a new “Use custom width / height” CheckBox on the main screen. It is used to see what custom size will be used to read the metafile and also to remove the saved custom size settings.

That is about it.

I hope you will find the new features useful.

As usual the new version can be downloaded from User Account page (for commercial users) or from my Downloads page (for evaluation version).

Tags: , ,


Improved performance of new version of ReaderSvg library

by abenedik 1. June 2010 15:33

The biggest improvement of the new version of ReaderSvg is improved performance.

To prepare the new version a lot of time was spent in a profiler. I used some very complex files from some common applications that can save drawings into svg file.

It was quickly clear that the most of the CPU cycles were spend to solve svg's style inheritance. A lot of the time was also used to resolve many possibilities to define styles in svg file (svg styles, css, attributes, ect.).

For example if we have a complex hierarchy, the root group element can define stroke thickness for the path element that is 10 children away. The process of getting the correct style declarations was before not optimal and is now much faster.

The SVG Specification allows some very complex stlye declararions that are very rarely used. The code that tries to support all the possibilities is much quite complex and takes significant time to execute. I have analyzed the svg files I have (really a lot of them - lots of them from users feedback) and found out that almost all of them are using only simple style declarations. So I have decided that by default only simple style declarations would be processed. But if needed the complex style processing can be used by setting the new OptimizeStyleProcessing property on ReaderSvg to false.

For example the following style declaration is by default not processed correctly (but magically it is read correctly with setting OptimizeStyleProcessing to false):

   <style type="text/css"><![CDATA[
            .mummy circle, .mummy rect, .mummy polygon { fill: green}
            .mummy > .thischild { fill: red }
            .primus + .secundus { fill: red }
            .mummy circle:first-child { fill: red}


Improved performance is not the only improvement. There is more:

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

As usual the existing customers can download the new version from their User Account page. Others can download a 60-days trial version from my Downloads page.

Tags: , , ,


Improved design time support for Visual Studio 2010 and Blend

by abenedik 23. April 2010 20:22

We are all very excited about the new Visual Studio 2010.

Among other great new features there is also a new visual designer for Silverlight projects. But the new designer still has some problems. One of them was reported by "ttiggemann" on my forum and is related to xaml created from svg file with ViewerSvg.

The problem is that RenderTransfrom that is written as attribute is not well formed for the designer.

For example the following line is reported as incorrect:

<Canvas RenderTransfrom="1.5 0 0 1.5 100 50">

Such xaml is compiled successfully and also runs correctly shown in the Silverlight application.

The workaround for the designer is to change the attribute into element:

        <MatrixTransform>1.5 0 0 1.5 100 50</MatrixTransform>


The same problems occur in Expression Blend.


To support this case the Ab2d.ReaderSvg library and the ViewerSvg applications have been changed.

In Ab2d.ReaderSvg library there are now additional properties in BaseXamlWriterSettings that can be passed to GetXaml method. The WriteTransformationsAsElement can be set to true to write RenderTransfroms as elements instead of attributes. This property is by default set to false for xaml for WPF and to true for Silverlight xaml.

The xaml is now furher optimized by converting the transformation that only translate the objects into Canvas.Left and Canvas.Top properties.

For example the following:

<Path RenderTransfrom="1 0 0 1 100 50" ...

is now by default changed into:

<Path Canvas.Left="100" Canvas.Top="50" ...

This behavior is controlled by new UseCanvasPositionForTranslateTransform property on BaseXamlWriterSettings class.


The new properties are also reflected in ViewerSvg. This is the screenshot of the new export dialog (new options are marked with red):

ViewerSvg export dialog


Besides new settings for displaying transformations, there are also two additional new settings.

Now it is possible to control if the default xaml namespace is added to the xaml (useful when exporting as Canvas, Viewbox, etc.)

Also by default the number of displayed decimals is now unlimited - because in most cases the xaml is compiled so the number of decimals in xaml does not affect the size of the final product.


Unfortunately the RenderTransform is not the only problem. The xaml with changed transformations is still not shown in the Visual Studio 2010 designer.

The reason for this is a bug in VS. It does not show Path elements that are children of a Canvas. Frown

For example the following xaml is not shown in the designer:

<Canvas Width="400" Height="300">
    <Path Fill="Red" Stroke="Black" StrokeThickness="2" Data="M10,10 L300,10 300,100 10,100z"/>
    <Path Stroke="Blue" StrokeThickness="2">
            <LineGeometry StartPoint="10 10" EndPoint="100 100"/>

I have already submitted the problem to Microsoft Connect and it is already confirmed as a bug. Hopefully there will be a fix for it available soon. Please vote for the bug here and help programmers to decide what to fix first.


But the good news is that the new xaml export options fix the problems with the visual designer in Expression Blend.


Besides changes in generated xaml there are also two other improvement in the new ReaderSvg:

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


As usual the new version can be downloaded from User Account page (for commercial users) or from my Downloads page (for evaluation version).

Tags: , ,


New major update of ReaderSvg with additional support for Microsoft Visio released

by abenedik 29. March 2010 09:22


I am happy to announce that a new major update for Ab2d.ReaderSvg library has been released.

ViewerSvg, a svg to xaml converter for WPF and Silverlight, has also been improved.


The new version 4.0 brings many new features and improvements. The most important new features are support for svg marker element (adds support for arrows and other line start and end markers) and svg symbol element (adds support for embedded fonts and other symbols).

But I am the most excited about the additional support for svg files created in Microsoft Visio. One step for improved Visio support was the implementation of marker elements (for connection line arrows). Another change was that now the names of read objects can be get from svg id attribute (as in most svg files) or from svg title element (used by Visio). This means that the names of the objects that were defined in Microsoft Visio are preserved when the svg file is read.

But I did not stop there. I have also added support for layers defined in Visio and for reading custom properties and attached data.

Some time ago I have found a demonstration on how to connect data to Visio diagram. I was amazed with how easy is to do this and how good the results look like. The demonstration can be seen here:

The demonstration ends with the statement: "the possibilities are endless".

Now imagine that it is also possible to get the Visio diagram with embedded data and animate it, add mouse events to the diagram elements and make other modification of the diagram in a WPF or a Silverlight application.

This is very easy to do with ViewerSvg or Ab2d.ReaderSvg library.

With ViwerSvg it is possible to convert diagrams from svg file to xaml file. It also possible to export the embedded data into xml serialized DataTable. It is easy to use the xaml and the xml (DataTable) to create WPF or Silverlight applications.

With using Ab2d.ReaderSvg in WPF application it is possible to open the svg file directly in the application. The embedded data and the data about layers can be accessed from the application (note that layers data cannot be exported from ViewerSvg and therefore cannot be used in Silverlight applications).

The new version of ReaderSvg comes with new samples that demonstrate various uses of diagram data and layers. The following screenshots show one scenario:

Creating Network diagram in Microsoft Visio:

Network diagram in Visio

Network diagram opened in ViewerSvg with previewing the embedded data:

Network diagram in ViewerSvg

Network diagram svg file opened in WPF application with Ab2d.ReaderSvg:
Network diagram in WPF


To see more screenshots and complete list of features check out the new ViewerSvg and the Ab2d.ReaderSvg pages.


Here is a full list of changes in Ab2d.ReaderSvg v4.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

The following is a list of changes in ViewerSvg application:

  • Added support for showing custom properties defined in svg file
  • Improved selection of objects
  • Added Export image button - export selected element into bitmap image
  • Added batch convertion of svg files to XAML for Silverlight


The 60-day evaluation version can be downloaded from my Downloads page. (If you already have an evaluation version, please uninstall it before installing the new version)

The existing customers can get the new version from their Users Account page (note that the commercial version is now different from the evaluation version available from my Downloads page)

Tags: , ,


Major update for Ab2d.ReaderWmf published

by abenedik 10. February 2010 22:20

I am proud to announce that a major update for Ab2d.ReaderWmf library was released.

Ab2d.ReaderWmf library can read Windows metafiles (wmf), Enhanced Metafiles (emf) or get metafile content from clipboard and convert the read objects into WPF elements or export the read objects into XAML for WPF or Silverlight.

The library went through thorough refactoring and is now much faster (this is especially useful with big metafiles that are exported from AutoCad). It can also read metafiles much more accurately.

Existing users that tried to convert Microsoft Office 2007 elements into XAML were probably not satisfied with the quality of the bitmap images that were part of the exported elements. This is now fixed because the new version of Ab2d.ReaderWmf can read the high quality images that are embedded into EMF+ records that are used with Office 2007.

The following two images show the difference:

Export from Excel with old ReaderWmf
Export from Excel with new ReaderWmf

There are also some other improvements and fixes. Here is the fill list of changes:

  • Greatly improved performance when reading metafiles.
  • Greatly improved reading and pasting objects from Microsoft Office 2007 - images are now read from EMF+ part of the matafile and are much better quality than images stored in EMF part of the metafile.
  • Added support for Pie and Chord elements.
  • Added support for stretched text (condensed, widened).
  • Fixed licensing issues on 64 bit Windows.
  • Fixed importing text rotated by 180 degrees.
  • Added ReadGeometry methods without geometry settings parameters that use default NoOptimization geometry settings (simplified use of ReadGeometry).
  • Improved support for clipping.
  • Changed calculation of MinLineWidthFactor (see help for more info).
  • Imporved GetXaml - now know colors are by default displayed by their name (Black, Red, etc.). This can be turned off by setting UseColorNames property on XamlWriterSettings.
  • Separate evaluation and commercial version.


Paste2Xaml application was also improved.

Now it has support for batch exporting metafiles into XAML for Silverlight (before only export for WPF was available).

The following two screenshots show Paste2Xaml in action (the first showing Excel Graph that was pasted into the application and the other drawing created in AutoCad and exported to metafile):

Paste2Xaml with graph pasted from MS Excel

Drawing created in AutoCad and exported as metafile



Existing customers of Ab2d.ReaderWmf and Paste2Xaml should get the new version from their User Account page (login credentials were provided in the email that was send to you after purchasing the product).

Other users who are still evaluating the product or would like to try it, can get the evaluation version from my Downloads page.

Tags: , ,


New version of Paste2Xaml application available

by abenedik 2. January 2010 16:38

A new version of Paste2Xaml application is available.

It fixes some problem with the previous version. It can be downloaded from my Downloads page.


Here is a short description of the application.

As its name suggests, it can be used to copy vector graphics from almost any 2D vector drawing application and simply paste it into Paset2Xaml. There it can be exported into XAML than be used for WPF and Silverlight. The application can be also used to open Windows Matafiles (wmf) or Enhanced Metafiles (emf) and convert them into XAML.

It is internally using Ab2d.ReaderWmf library that can be also used in your application to read metafiles at runtime.


The following example is showing the Paste2Xaml screenshot after the graph from Excel 2003 has been pasted into the application.

Paste2Xaml with Excel graph


For creating xaml from Excel graphs I recommend using Excel 2003. The Excel 2007 usually does not put the graph as vector data into the clipboard. Instead it renders the graph into bitmap and stores graph as image into the clipboard. This usually happens for 3D graphs or when special effects are used (shadows, etc.). Simple 2D graphs are pasted as vector elements. But for 3D graphs, Excel 2003 is recommended.


There is also a Silverlight tutorial on how to create animated graph from Excel - check it out here.


The following are screenshots of metafiles converted to xaml and show in IE (click on image to see it in full size):

Word art from Microsoft Word 2003

Formated cells from Microsoft Excel 2007

Calendar created in Microsoft Visio 2003

Database schema created in Microsoft Visio 2003

Meeting Room schema created in Microsoft Visio 2003

Electrical equipment schema created in Microsoft Visio 2003

Brainstorm diagram created in Microsoft Visio 2003

Sample from Microsoft Office free Clip Arts

Sample from Microsoft Office free Clip Arts

Sample from Microsoft Office free Clip Arts

Sample from Microsoft Office free Clip Arts

Sample from Microsoft Office free Clip Arts

Tags: , , ,