Print Options
The below example demonstrates how to send a particular PDF document to the printer while setting the document to print 2 copies, in color, actual size scaling and without annotations.
Note here that in order to set a certain option on a particular PrintJob you use the PrintOption's properties (i.e. printJob.PrintOptions.Color). If however you wanted to check if a particular printer supported a certain feature, this can be checked using the Printer's properties (i.e. printJob.Printer.Color).
Setting options on a print job (in the PrintOptions class) that are not supported by the specified printer will throw an exception. For example if you set your PrintJob.PrintOptions.Color to true but the specified printer does not support color, an exception will be thrown.
PrintJob printJob = new PrintJob(Printer.Default, "C:\\Temp\\DocumentA.pdf");
if (printJob.Printer.Color)
printJob.PrintOptions.Color = true;
printJob.PrintOptions.Copies = 2;
printJob.PrintOptions.Scaling = PageScaling.ActualSize; // Can also use AutoPageScaling or PercentagePageScaling objects
printJob.PrintOptions.PrintAnnotations = false;
printJob.Print();
Dim MyPrintJob As New PrintJob(Printer.Default, "C:\Temp\DocumentA.pdf")
If (MyPrintJob.Printer.Color) Then
MyPrintJob.PrintOptions.Color = True
End If
MyPrintJob.PrintOptions.Copies = 2
MyPrintJob.PrintOptions.Scaling = PageScaling.ActualSize ' Can also use AutoPageScaling or PercentagePageScaling objects
MyPrintJob.PrintOptions.PrintAnnotations = False
MyPrintJob.Print()