Fix for Simple XPS Silverlight Viewer for Silverlight 2

by lichen 11/23/2008 10:05:00 PM

Silverlightt 2 broke David Anson's Simple XPS Silverlight Viewer. The cause was that Glyphs.FontUri can longer load fonts from resources other than an assembly. Fortunately, silverlight applications can download other assemblies. So the fix is to package all the fonts used by an xps document into a separate downloadable XAP file. This solution is not optimal because:

  1. Silverlight 2 appears to have trouble opening the xps file generated by xps writer. One has to unzip and rezip for Silverlight 2 to open it. See the comments in the middle of this page for more information.
  2. One has to create an XAP file for each xps file to package all fonts used by the XAP file.

If you are willing to accept these limitations, yes, it is possible to view XPS in Silverlight 2. See the demo here. The source code may be downloaded here.

Currently rated 4.0 by 2 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Silverlight 2

Comments

1/15/2009 10:46:15 AM

Dhams

Thanks buddy... Really good effort. Smile

I am also working same kind of stuff.

You sample code really going to help me.

Dhams in

4/20/2009 8:10:53 PM

trackback

Trackback from simonguest.com

Displaying XPS Documents in Silverlight

simonguest.com

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

7/5/2009 11:10:05 PM

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  July 2009  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

Pages

    Recent posts

    Recent comments

    Authors

    Tags

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2009

    Sign in