Click to See Complete Forum and Search --> : Changing a print driver setting in .NET?


Armantrout
March 25th, 2003, 01:23 AM
Hello,

Using VB.NET or C#, how can I programmatically change the current page length setting in a print driver?

I need to change the actual setting in the printer preferences, as the typical .NET PrinterSettings and DefaultPageSettings options will not work for this application. I assume that I’ll need to go through the Windows API or use the DevMode structure, but there is little to no documentation that I could find about this as it is done in .NET.

Any and all tips will be much appreciated.

Regards,

--Josh

pareshgh
March 25th, 2003, 11:53 AM
hello ,
looks like if its not possible by .NET class methods then you will need to interact with Win32API functions which are

1) PrintDlgEx function

you can recall the interface for the printer driver settings. and implement the own. for that you need to make the dll first and then wrap it around .NET. that would be the best.

Reffer MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/CommonDialogBoxLibrary/AboutCommonDialogBoxes/PrintPropertySheet.asp)

there are articles inside when you look at it.

check out MSDN for further details
there may be ready sample for your initial work too. you should also check CodeGuru site for VC++ sample section which is great.

Thank you,
Paresh