L
lcifers
I'm writing a batch printing app that will interface with other
applications to print their native documents. All of the documents will
be printed on the same size paper.
On the main form, where the files are selected, are two comboboxes, one
for the user to select the printer, the other for the user to select
the paper size. Does anyone know how I can get the paper size for a
given printer? I can get a list of paper sizes using this code:
Dim objPrint As New System.Drawing.Printing.PrinterSettings
Dim strPrinters As String
Dim printerformat As System.Drawing.Printing.PaperSize
For Each printer As String In objPrint.InstalledPrinters
Dim PrinterObj As New
System.Drawing.Printing.PrinterSettings
PrinterObj.PrinterName = printer
For Each printerformat In PrinterObj.PaperSizes()
Try
Me.cboPaperSizes.Items.Add(printerformat.PaperName)
Catch ex As Exception
End Try
Next
Next
but it returns some paper sizes that I can't even use for that printer
(for exmaple 11X17 when the printer only prints 8.5X11 max). Does
anyone know how I can get ONLY paper sizes that the printer can print?
Thanks.
- Luther
applications to print their native documents. All of the documents will
be printed on the same size paper.
On the main form, where the files are selected, are two comboboxes, one
for the user to select the printer, the other for the user to select
the paper size. Does anyone know how I can get the paper size for a
given printer? I can get a list of paper sizes using this code:
Dim objPrint As New System.Drawing.Printing.PrinterSettings
Dim strPrinters As String
Dim printerformat As System.Drawing.Printing.PaperSize
For Each printer As String In objPrint.InstalledPrinters
Dim PrinterObj As New
System.Drawing.Printing.PrinterSettings
PrinterObj.PrinterName = printer
For Each printerformat In PrinterObj.PaperSizes()
Try
Me.cboPaperSizes.Items.Add(printerformat.PaperName)
Catch ex As Exception
End Try
Next
Next
but it returns some paper sizes that I can't even use for that printer
(for exmaple 11X17 when the printer only prints 8.5X11 max). Does
anyone know how I can get ONLY paper sizes that the printer can print?
Thanks.
- Luther