Articles in this section

How to silent print the PDF document using PDF Viewer in Console Application

To achieve silent printing of a PDF document using the WinForms PDF Viewer within a console application, invoke the Print method of the PdfViewer, passing 'false' as an argument to disable the print dialog, ensuring the document prints silently.


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

PDF Viewer User Guide

 

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 forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied