Hi All,

I am using Win32 APIs to set the orientation of Printer at runtime. I
get StackOverFlow in SetPrinterInfo method.

I tried to use the the System.Drawing.Printer.PrinterSettings class to
do the same. But could not get this done.

If anyone has tried using System.Drawing.Printer.PrinterSettings
class, can you pls post the some sample code.

Thanks
Nalini

Re: Setting Printer Orientation using System.Drawing.Printer.PrinterSettings by hirf-spam-me-here

hirf-spam-me-here
Thu Dec 11 09:57:53 CST 2003

* boini_nalini@yahoo.com (Nalini) scripsit:
> I am using Win32 APIs to set the orientation of Printer at runtime. I
> get StackOverFlow in SetPrinterInfo method.
>
> I tried to use the the System.Drawing.Printer.PrinterSettings class to
> do the same. But could not get this done.
>
> If anyone has tried using System.Drawing.Printer.PrinterSettings
> class, can you pls post the some sample code.

<http://www.mvps.org/dotnet/dotnet/samples/printing/downloads/PrintFramework.zip>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Re: Setting Printer Orientation using System.Drawing.Printer.PrinterSettings by boini_nalini

boini_nalini
Tue Dec 16 01:14:09 CST 2003

Thank you Wagner.
I have a different scenario. I have html pages,dwf files,jpg which
need to be printed at runtime. The type of file is decided only at
runtime, so I cannot use Graphics to for the same.

I think, the SetHDevMode of PrinterSettigns can help me, but did not
get it to work.

May be you can help me.

Thanks
Nalini

RE: Setting Printer Orientation using System.Drawing.Printer.PrinterSettings by bryanha

bryanha
Tue Dec 16 17:34:56 CST 2003

Hi Nalini,

You're trying to set the orientation for the page correct? If so you can
use the PageSettings class.

doc.PrinterSettings.DefaultPageSettings.Landscape = true;

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdrawingprintingpagesettingsclasstopic.asp

hope this helps.

Bryan Haber [MSFT]