How to silent print the PDF document using PDF Viewer in Console Application
Insert the following code snippet into the program's entry point to enable silent printing of the PDF document.
internal class Program
{
static void Main(string[] args)
{
//Load the PDF document
PdfLoadedDocument ldoc = new PdfLoadedDocument(@"../../Data/F# Succinctly.pdf");
PdfViewerControl viewer = new PdfViewerControl();
//Load the PDFLoadedDocument in the PDF viewer control
viewer.Load(ldoc);
Console.WriteLine("Printing started...");
//Silent printing the PDF document using the PDF viewer control
viewer.Print(false);
Console.WriteLine("Printing is done…");
}
}
A complete working sample to silent print the PDF document can be downloaded from GitHub.
See Also:
Printing PDF Files in WinForms
Conclusion
I hope you enjoyed learning how to silently print a PDF document using the PDF Viewer in a Console Application.
You can refer to our WinForms PDF Viewer feature tour page to learn about its other groundbreaking feature representations. You can also explore our WinForms PDF Viewer documentation to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarification, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!