More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  the WPF way...ProfileFriendsBlogMore Tools Explore the Spaces community

Blog

10/13/2006

XAML Exporter for Illustrator using the CS2 COM Type Library

Technorati tags: , , , ,

I guess the title for this blog post answers 90% of what I had to say ;)

Yes, I have spent the last few days working on using the scripting object model for Illustrator CS2 to export the artwork to WPF/XAML. The code is entirely in C# / .Net 2.0 and uses the Illustrator CS2 COM Type Library. Now you may be wondering why I did one more Illustrator-XAML exporter, when there is already one by Michael Swanson. Couple of reasons:

  • I wanted to add some export options for creating ControlTemplates, DataTemplates etc. as the top-level tag instead of Viewbox. That way I could just load them up in Expression Interactive designer and add animations, data-bindings etc.
  • The source code for Swanson's plugin was not available. It was in C++ and really a step back for me, after having spent a considerable amount to time in the C# world ;)
  • I also wanted to add a XAML preview and a simple XAML editor like XamlPad, all in the same application.
  • Moving forward, I would be adding some more features that are fine-tuned to the way in which we consume Illustrator artwork, in our company. We are building our own Designer - Developer workflow and to make that more seamless, the Exporter will need to have some more features.

I am also glad to announce that I will be making the code freely available on CodePlex. I have already setup the project here. Once I finish cleaning up the code I'll upload it. If people are really interested, I could speed up things a little ;)

Here are some screenshots of the Exporter. I am using a 3rd party component for the Ribbon UI. I'll be replacing that with a plain Winforms UI.

 

1. The artwork in Illustrator:

 

2. The application with the exporter XAML + preview. The editor is just like in XamlPad. You can edit and see the changes happen dynamically to the preview. I am using the TextEditor component from the SharpDevelop project, which gets me the Visual Studio style syntax highlighting, code-folding etc...

 

3. The preview zoomed in:

 

4. Some text

 

Here is a quick rundown of exported objects:

  • Strokes
  • Linear and Radial gradients
  • Text (single - line only)
  • Opacities
  • Visibility
  • Paths
  • Colors (CMYK, RGB, Spot, Gradients, Gray)
  • Layers, Groups, CompoundPaths
  • XAML comments
Comments (2)
  • View space
    (no name)
    1/29/2007 2:22 PM
    We have tried to use this tool on a Vista machine but it just won't work. It does work fine on our XP boxes - Thank You. I posted a the problem out on codeplex. Let me know if you have any suggestions on making it work on a Vista box.
  • Michael Swanson
    11/1/2006 4:06 AM
    Awesome! Awesome! Awesome! I don't want to overdo it, so I'll stop at three "awesomes." :-)
     
    FYI: I added your tool to my WPF Tools and Controls page: http://blogs.msdn.com/mswanson/articles/WPFToolsAndControls.aspx
Trackbacks

The trackback URL for this entry is:
http://pavanpodila.spaces.live.com/blog/cns!9C9E888164859398!172.trak
Weblogs that reference this entry
  • None