Re: Custom paper size when printing...

Chris Bordeman <[email protected]> Mon, 19 Nov 2007 08:50:43 -0600
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <[email protected]>
Lots of printer drivers don't do custom page sizes well, so the latter
is quite possible.

-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps
and controls [mailto:[email protected]] On Behalf Of
Gary Harpin
Sent: Monday, November 19, 2007 8:10 AM
To: [email protected]
Subject: [DOTNET-WINFORMS] Custom paper size when printing...

I have the need to automatical print to a custom paper size on a named
printer.

The code I have is basicaly as below:
---------------------------------------------------------------
...
PrintDocument prnDoc = new PrintDocument(); prnDoc.PrintPage += new
PrintPageEventHandler(OnPrintPage);
prnDoc.PrinterSettings.PrinterName = "Samsung ML-2010 Series";

PaperSize ps = new PaperSize("Custom", 600, 400);

prnDoc.DefaultPageSettings.PaperSize = ps;

prnDoc.Print();
...
----------------------------------------------------------------

On most of the printers available to me this code works as expected,
however on Samsung printers it dose not (it allways prints to A4).

Is this an error in my understanding of how to set custom paper sizes or
could it be an error in how the Samsung drivers work with the framework?


Thank you.                                                  

Regards,
Gary Harpin
 
________________________________

"...a computer is a stupid machine with the ability to do incredibly
smart things, while computer programmers are smart people with the
ability to do incredibly stupid things. They are, in short, a perfect
match.."  Bill Bryson

 

[No Disclaimer]