12/02/2007

Silverlight and Printing

I am still hot on Silverlight 1.1. One big limitation I have just found - it does not print. That is if the browser page is printed, the content of the control will be printed too - but as a bitmap, not vector. To understand how big a limitation that is, consider the resolution of a monitor - 72 dpi (dot per int) vs normal lazer or ink-jet printers - 600, sometimes 300 dpi.

One other problem - it shall only print the visible part. Say your control shows a bar chart that is bigger then your page - then you have in-control scroll bars.

By the way at the time of this writing Silverlight 1.1 alpha does not have a built-in scroll bar. I had to find one created in VB for text blocks and rewrite it in C# and extend for canvas)

Back on subject - printing the page would print only the visible part. What a bummer.

A workaround is to send to server, bake up a PDF, send it back, and ask user to print.
Another possiblity would be to create a VML or SVN, depending on what browser you have IE or FireFox, but that is all so much overhead.

There is a thread on Silverlight forums where people vote for including printing capability to the SL control. I voted. Hope it helps.

No comments: