We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to silent print the PDF document in the ASP.NET Classic by using Service?

Platform: WinForms |
Control: PdfViewer

At present, there is no support for silent printing of the PDF document in the ASP.NET. However, you can achieve this by a workaround by using PdfViewer.Windows dll. In the following example, a Service reference is created and the PDF document is printed silently through the default printer.


//Create an instance of PdfDocumentView.
PdfDocumentView view = new PdfDocumentView();
//Load the document in the viewer as stream.
view.Load(new MemoryStream(filestreamarray));
//Silently print the document through the default printer.

The following code example in Default.aspx.cs accesses the PrintService method in the Service reference.


//Create an object reference for the Serviceclient.
var client = new ServiceReference1.Service1Client("BasicHttpBinding_Service1");
if (System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName).Equals(".pdf"))
    //Get the stream of the file uploaded.
    Stream fileStream = FileUpload1.PostedFile.InputStream as Stream;
    MemoryStream memoryStream = new MemoryStream();
    byte[] byteArray = memoryStream.ToArray();
    //Call the PrintService method in the service with filestream array as the parameter.

Sample Link:



2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile