XAML batch conversion options
#1
In ViewerSvg, is there any way to specify "Root element" and other options such as size/position by using command line parameters?

-and is it possible to use the ReaderSvg library in .NET, so I can build my own batch conversion from SVG to XAML with Root Element=UserControl and specify size/position?

if that is the case, is there any sample source code available for demonstrating how to use the library to export to XAML with these options? I guess it requires access to the "Advanced XAMLWriter" class from code, but I need to know if that is available, before I purchase the library.
#2
You cannot specify Root element as parameter to ViewerSvg. ViewerSvg startup parameters are quite limited and support only most common use cases (to get a list of all parameters start ViewerSvg with ?).

But of course, you are welcome to create you own svg to xaml exporter with using Ab2d.ReaderSvg library.

The ReaderSvg object that is used to read svg files also support creating XAML from the read file with using GetXaml method.

This method can take an instance of Ab2d.Common.ReaderSvg.BaseXamlWriterSettings class (usually Ab2d.Common.ReaderSvg.WpfXamlWriterSettings) than has many properties to control how the XAML is created. It also has RootObject object property that can be set to "UserControl". It also allows you to specify the numbers format string, intent string, etc.

To see more about the WpfXamlWriterSettings check the ReaderSvg help file or see the http://www.ab4d.com/help/ReaderSvg/html/...ttings.htm

To see how to write XAML from svg with embedded images see the sample for GetXaml method:
http://www.ab4d.com/help/ReaderSvg/html/...Xaml_1.htm


Before you read the svg file with ReaderSvg, you can also set many properties on ReaderSvg object - for example AutoSize, FlattenHierarchies, etc (see http://www.ab4d.com/help/ReaderSvg/html/...derSvg.htm ).

After you have read the svg file with Read method you can also use Transform method to transform the data with adjusting the position and scale of the read objects.

I hope that this answers your question (I was not really sure what have you meant with specify size/position).

PS:
The ReaderSvg EULA allows you to create svg to xaml converter only for your internal use (inside the company) and do not allow you to create a publicly available application that would "compete with ViewerSvg".
Andrej Benedik
  


Forum Jump:


Users browsing this thread:
1 Guest(s)