Silverlight XPS: Source code

Note: the XPS viewer is a proof-of-concept and doesn't provide correct XPS rendering. See Document Toolkit for a fast, feature-rich and 100% client-only XPS viewer that does render properly.

Last week I demonstrated my version of a Silverlight XPS viewer for Silverlight 2. Here's the source code and some thoughts.

  • First of all, since the viewer employs TextBlock instead of Glyphs elements, it is likely that the position and content of generated text elements are incorrect. This basically renders the client-only XPS viewer useless for any production environment. I am working on an actual solution.
  • TIFF images in XPS documents are not supported
  • XPS documents created with the Microsoft XPS Document Printer Driver do not work. Unzip and rezip might fix this.
  • The builtin FontParser does not support TrueType font collections (ttc files)
  • Various hardcoded XPS format assumptions may cause your XPS files to not render at all.

Download the source code. Do whatever you want to do with it. No warranty whatsoever. Use at your own risk.

Published: January 19, 2009

2 Comments

  1. Eylon Yogev said: says:

    Are you planning to release the Silverlight Spy code as well?

    We (the community of silverlight developers) would be very to get it.

  2. Koen said: says:

    Eylon: there are no plans to release the source code of Silverlight Spy

 

Leave a comment

Comments are closed for this post