Title Image

Don Xml's Grok This

The home of Don Demsak
Welcome to Don Xml's Grok This Sign in | Help
in Search

This Blog

Syndication

Site Sponsors

DonXml's All Things Techie

Two New XAML Tools For the Price of One

Working with Chris Sells on a project has certain “benefits” associated with it, and one of the big ones is his ability to find the right person in Microsoft that can help solve a problem.  When he asked for a batch version of the Svg2Xaml tool, I said no problem, except that the Windows Client Print Driver has a pop up window that is looking for a file name to save the fixed document XAML file, and I couldn’t figure out a way to get it not to require it.  Well, Chris was able to come up with a bit of code from Patrick Danino that we could use as a work around for now.  It’s not the prettiest of solutions, and I believe MS will be improving the APIs for WCPD, but for now if you are using a System.Drawing.Graphics class and want to save it to a fixed format XAML doc, this is the only way to do it.  Basically, you have to create your own PrintController that wraps the winspool Win32 dll, and it will save it to a file.  Not the best of solutions, but it will work.  Drawbacks are that it will only save it a file, not a stream (so you will need to use a temp file and convert it to a stream if that’s what you want), and the other major issue is that you can’t set Graphics object in the PrintPageEventArgs, only get it, and I don’t know of a way to clone a preexisting Graphics object to another preexisting Graphics object.  If you want the code, you can download the class, plus example code off the Svg2Xaml project on GotDotNet.

The second tool is the example code, a command line version of the Svg2Xaml tool.  It is a very basic tool, and only requires the SVG filename.  You can download the binaries from the Svg2Xaml GDN project, or pull down all the Svg2Xaml code, plus the Svg2Xaml Console App.

DonXML Demsak

Published Sunday, December 14, 2003 4:27 PM by donxml

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

TrackBack said:

December 14, 2003 4:32 PM

Wayne said:

For the atrociously ignornant among us, namely me, what's WCPD stand for?

Thanks.
December 14, 2003 8:33 PM

DonXML Demsak said:

I hate acronyms too, but in this case I made sure I gave the full name for WCPD (Windows Client Print Driver) prior to using the acronym. It's a mouthful, and typing it isn't any better, so I did resort to using an acronym.

December 15, 2003 4:24 AM

Leave a Comment

(required) 
(optional)
(required) 
Submit

About donxml

I’m an independent consultant, specializing in .Net solutions architecture, based out of New Jersey who also doubles as an evangelist for XML, Domain Driven Design, enterprise architecture and .Net. I do not work for Microsoft, the W3C or any other big company that you may know of (at least not yet). I’ve been an indie for over ten years, and although I’ve been tempted a couple times to take a job with companies like Microsoft, I’ve haven’t found something better than my current situation. I work mostly with the large pharmaceuticals that are based here in New Jersey, and usually find myself on long term contracts. Definitely not the prototypical indie consultant, but it lets me dedicate time to my non-income generating activities like the developer community stuff, plus financing open source projects like XPathmania and MVP-XML. If you would like to talk to me about doing some contract work, just contact me via the contact page. My rates vary widely, depending on lots of different variables, but mostly distance from Jersey, and type of work. Plus, I’ve been known to donate some of my code for various projects.
Powered by Community Server, by Telligent Systems