yorke_gvg
New member
- Joined
- Jul 21, 2023
- Messages
- 1
- Programming Experience
- 1-3
I'm creating VB application where i want to print documents, but all of my documents have diffirent orientation, some of them are in Portret orientation and some of them are in Landscame.
I have a function where user can print bunch of files, like more then one which have different orientation.
This is the code which i use to set the settings of the printer programatically:
I can setup the orientation here: pageSettings.Landscape, but it will be only Landscape or only Portrait. I want to be automatically detected?
Is that possible?
If not, is there a way to check file orientation before print the file programatically with VB?
What I have tried:
I try to add auto to the: pageSettings.Landscape but it accepts only true/false.
I have a function where user can print bunch of files, like more then one which have different orientation.
This is the code which i use to set the settings of the printer programatically:
VB.NET:
Dim Printers As PrinterSettings.StringCollection
Printers = printerSettings.InstalledPrinters
Dim printerSettings As New PrinterSettings
printerSettings.DefaultPageSettings.PaperSize = pageSettings.PaperSize
printerSettings.DefaultPageSettings.PrinterResolution = pageSettings.PrinterResolution
printerSettings.DefaultPageSettings.Color = pageSettings.Color
printerSettings.DefaultPageSettings.Landscape = pageSettings.Landscape
printerSettings.DefaultPageSettings.PrinterSettings = printerSettings.DefaultPageSettings.PrinterSettings
printerSettings.DefaultPageSettings.PaperSource = pageSettings.PaperSource
I can setup the orientation here: pageSettings.Landscape, but it will be only Landscape or only Portrait. I want to be automatically detected?
Is that possible?
If not, is there a way to check file orientation before print the file programatically with VB?
What I have tried:
I try to add auto to the: pageSettings.Landscape but it accepts only true/false.
Last edited by a moderator: