D.P.
D.P.

Reputation: 230

Silverlight printing size is too large

I've developed application using Silverlight, and now I need to implement printing, I've used PrintDocument class, it looks like this:

PrintDocument printDocument = new PrintDocument();
printDocument.PrintPage += new EventHandler<PrintPageEventArgs>(printDocument_PrintPage);
printDocument.Print("My docuement");

But I've faced with problem - it takes much time if there are 20-30 pages, and if I open printer's queue, it shows that printing size is about 1.2GB for 10 printed pages. I've tried to print canvas (800*1000) with only one textblock with simple text like "Test printing".

I'm using Silverlight 5.

Did anybody faced with such problem? Is there any way to avoid it?

Upvotes: 2

Views: 1739

Answers (1)

Emond
Emond

Reputation: 50692

My guess is that the content to be printed is send as a bitmap instead of a more efficient vector format.

This might be due to the driver. If the driver of the printer is not able to translate the Silverlight graphics into vectors, all it can do is print it as a bitmap.

I tried to force Silverlight into using Vectors but my printer didn't support PostScript. So I switched to a printer that does and suddenly it's just kilobytes.

I see only two ways to avoid bitmap printing:

  1. Get a PostScript printer or

  2. Create a printer friendly document (PDF, Word, text) on the server and allow the client to download and print it by hand.

Upvotes: 5

Related Questions