2

How can I print in Silverlight 4 without a print dialog showing all printers.

Many people say it not possible but they always talk when the app is running in the web browser.

In this case I'm out of browser and with elevated trust.

Any suggestions?

jaapaurelio
  • 274
  • 4
  • 16
  • I have answer this question here: http://stackoverflow.com/questions/6954276/printer-properties-silverlight-com-interop-and-out-of-browser Thanks. – jaapaurelio Aug 08 '11 at 08:11

3 Answers3

2

Even with elevated trust, you are still going to have to deal with the print dialog using the print API. I know a couple of people who have written POS systems in Silverlight and resorted to using COM interop to handle printing straight to a printer. Since you are OOB and in elevated trust, this might be a path for you to look into.

  • I'm using COM interop right now but I don't like. When I hit print button the print dialog appear and disappear in a millisecond but in that time I can see it. If I press Alt+Tab when dialog appear I can make the dialog not disappear and change options like number of copies. :/ – jaapaurelio Aug 03 '11 at 15:50
  • I've had to used COM Interop to print straight to a receipt printer using the .NET SDK provided by the vendor. I think this is the way to go. – Jonas Stawski Nov 04 '11 at 16:17
1

I have seen an article:

http://www.codeproject.com/KB/silverlight/SilverlightSilentPrinting.aspx

May be this could help

Thanks, FP

0

Silverlight 5 now has another (elevated-only) overload of the Print method that doesn't show the dialog.

John
  • 6,693
  • 3
  • 51
  • 90