2

I'm trying to print a report (just text in columns) from my Silverlight 4 application. The only way I know about is to use PrintDocument and set the PageVisual to a framework element showing the report. However, this results in an insanely large print job (like 120 MB). This is not what my customer wants. Is there any other solution?

3 Answers 3

2

The problem with Silverlight 4 is that everything you go to print is produced as a rasterized image at 600 DPI. This explains the large job size you are seeing. This is also why text from Silverlight can look very fuzzy compared to what you'd expect from your output. Silverlight 5 will address this with Postscript vector-based printing, but for now you are facing the reality that without third-party solutions you are effectively stuck with the out of the box limitations or using HTML.

If you are willing to generate the report from HTML being served server-side you may have the best solution considering what you're doing. In that case you would at least not have to worry about complexities like pagination as part of printing from Silverlight.

A good third-party solution for reporting, but perhaps more than what you need, is to use Reporting Services coupled with this product: http://www.perpetuumsoft.com/Silverlight-Viewer-for-Reporting-Services.aspx?lang=en

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks. I think we will wait for the Silverlight 5-feature. For now we have implemented our own PDF-solution that saves the report on the desktop and then the user have to open and print it himself.
Was this an out-of-browser app or did you use windowless mode to pull a PDF from a server-side solution?
This is an OOB-app. We used PDFSharp to create a PDF on the server and returned the stream to the client.
So they are opening an actual PDF generated server-side and that print job is 120 MB+?
1

One easy solution is to print web page directly from browser (I assume this is not what you want).

I think the PrintDocument and PageVisual is the only way how to print from inside of SL.

I did some printing even with large visual structures, but I haven't checked how large my print job is, so I can't tell you if it is normal or not.

Anyway, you can try not to print directly the element you want to print, but made some other lightweight one which will serve only for printing purposes and fill it with same data and print that lightweight element.

Comments

-1

You can convert your text into picture and then print picture.. mb this will help you

http://www.andybeaulieu.com/Home/tabid/67/EntryID/161/Default.aspx http://www.snowball.be/Printing+In+Silverlight+3+Yes+We+Can.aspx

1 Comment

Actually Silverlight is doing that anyway. Silverlight 4 prints nothing but rasterized images at 600 DPI.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.