1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Dim pd As New PrintDocument()
pd.PrinterSettings.PrinterName = GetDefaultPrinter()
'Check Imprimante en Couleur
If Not pd.PrinterSettings.SupportsColor Then
MessageBox.Show("printer can't print in Color ! Change Default Printer", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
Else
pd.DefaultPageSettings.Color = True
End If
'' Check Imprimante en recto Verso
If pd.PrinterSettings.CanDuplex = False Then
MessageBox.Show("printer can't print both sides !", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
Else
pd.PrinterSettings.Duplex = Duplex.Vertical
pd.DefaultPageSettings.PrinterSettings.Duplex = Duplex.Vertical
End If
report.PrintOptions.PrinterName = GetDefaultPrinter()
report.PrintOptions.PrinterDuplex = CrystalDecisions.Shared.PrinterDuplex.Vertical
report.PrintToPrinter(pd.PrinterSettings, pd.DefaultPageSettings, False) |
Partager