Pavan's profilethe WPF way...BlogLists Tools Help

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)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.
    Pavan Podila has turned off comments on this page.
    No namewrote:
    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.
    Jan. 29
    Picture of Anonymous
    Michael Swanson wrote:
    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
    Nov. 1

    Trackbacks

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