Simple Print

When printing, you can print to a specific printer or a default printer. Examples of both are illustrated below.

Print to Specified Printer

The following example sends a PDF document to a specified printer. As the example illustrates, to print to a specific printer, replace the string "Printer Name" with the printer name you wish sending to the PDF document.

PrintJob printJob = new PrintJob("Printer Name", pdfFilePath);
printJob.Print();        
Dim MyPrintJob As New PrintJob("Printer Name", pdfFilePath)
MyPrintJob.Print()   

Print to Default Printer

Sending a PDF document to a defined default printer, without needing to know the actual name of the printer, is accomplished using the static method "Default" of the Printer class. This following code illustrates.

PrintJob printJob = new PrintJob(Printer.Default, pdfFilePath);
printJob.Print();        
Dim MyPrintJob As New PrintJob(Printer.Default, pdfFilePath)
MyPrintJob.Print()

In this topic