Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight/C# web application - send PDF to client's printer without opening

I am working on a Silverlight web application that creates PDF documents. We want our clients to print these PDF documents but we do not want them to see it or save it locally.

Is there a way to send PDF data directly to client's printer without opening it in client's browser?

Please advice.

like image 321
AlterWorld Avatar asked Aug 28 '09 14:08

AlterWorld


2 Answers

No -- Silverlight 3 does not support printing natively.

You can usually get some things done in the browser using Javascript, but that won't let you directly send a PDF the way you're discribing.

It's possible to write a seperate app that lives on the client machine and then integrate with that... For an internal line-of-business app that could be a good solution, but the obvious drawback is that you're stepping outside of Silverlight's multi-platform bubble.

Here's an article that might be worth looking at: http://jonas.follesoe.no/PrintingInSilverlight2UsingCSSAndASPNETAJAX4.aspx (the comments are also interesting, and some of them talk about working with PDFs)

Update: Silverlight 4 now supports this.

like image 190
Brian MacKay Avatar answered Sep 27 '22 23:09

Brian MacKay


No. Silverlight does not have access to any printer resources directly, only via javascript print functions.

like image 22
blowdart Avatar answered Sep 28 '22 01:09

blowdart