Simple Print Job
When printing, you can print to a specific printer or a default printer. Simple 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. The following code illustrates.
PrintJob printJob = new PrintJob(Printer.Default, pdfFilePath);
printJob.Print();
Dim MyPrintJob As New PrintJob(Printer.Default, pdfFilePath)
MyPrintJob.Print()
GitHub
Refer to the print-manager-dotnet-core project on GitHub for examples demonstrating how to use the DynamicPDF PrintManager for .NET. The following class illustrates using a default printer.
- SimplePrint.cs
- SimplePrint.vb