c0r0n3r
December 9th, 2009, 12:42 PM
Hello everybody,
I'm working on this problem a while now but I haven't found any solution...
The main problem is that I would like to select a tray to send the file to, but all solutions I've found (VB6 or VB.NET) are only changing temporary trays and the File is sent trough a DLL and thus printed on the default tray.
If anyhow possible I'd like to realize this without having to change the system default printer tray (If that is even possible - I didn't find any way to do that either :/).
Currently I'm using the RawPrinterHelper (winspool.drv functions) to send the File.
Source:
Dim pd As New PrintDocument
Dim p As New PaperSource
Dim x As New PageSettings
' 263 Manual Feed Tray 1
'262 Tray 1
'261 Tray 2
pd.PrinterSettings.PrinterName = "HP LJ"
For Each p In pd.PrinterSettings.PaperSources
If p.RawKind = 262 Then Exit For
Next
pd.DefaultPageSettings.PaperSource = p
RawPrinterHelper.SendFileToPrinter(pd.PrinterSettings.PrinterName, "c:\temp\456897.ps")
Me.Close()
Any ideas?
Best Regards and thanks for any help!
c0r0n3r
I'm working on this problem a while now but I haven't found any solution...
The main problem is that I would like to select a tray to send the file to, but all solutions I've found (VB6 or VB.NET) are only changing temporary trays and the File is sent trough a DLL and thus printed on the default tray.
If anyhow possible I'd like to realize this without having to change the system default printer tray (If that is even possible - I didn't find any way to do that either :/).
Currently I'm using the RawPrinterHelper (winspool.drv functions) to send the File.
Source:
Dim pd As New PrintDocument
Dim p As New PaperSource
Dim x As New PageSettings
' 263 Manual Feed Tray 1
'262 Tray 1
'261 Tray 2
pd.PrinterSettings.PrinterName = "HP LJ"
For Each p In pd.PrinterSettings.PaperSources
If p.RawKind = 262 Then Exit For
Next
pd.DefaultPageSettings.PaperSource = p
RawPrinterHelper.SendFileToPrinter(pd.PrinterSettings.PrinterName, "c:\temp\456897.ps")
Me.Close()
Any ideas?
Best Regards and thanks for any help!
c0r0n3r