Print aspose documents to client printer

Hi I tried printing as aspose document using the code below

Aspose.Words.Document doc = new Aspose.Words.Document(documentstream);

                MemoryStream pdfstream = new MemoryStream();
                {
                    
                    doc.Save(pdfstream, Aspose.Words.SaveFormat.Pdf);
                    pdfstream.Position = 0;


                    PdfViewer viewer = new PdfViewer();
                    //Open input PDF file
                    viewer.BindPdf(pdfstream);
                    //Print PDF document
                    viewer.PrintDocument();

                    //Close PDF file
                    viewer.Close();
                    // Docuware.pdfstream = pdfstream;


                 
                }

I think it takes the printer in the server ? What needs to be changed to send the document to the client printer?

@nisharunstraight

You do not need to save document to PDF or use PdfViewer to print the document. Please use Document.Print method to print the whole document to the specified printer, using the standard (no User Interface) print controller.

Please check the following code example.

Document doc = new Document(MyDir + "Document.doc");
doc.Print("KONICA MINOLTA magicolor 2400W");

Document.Print method prints the whole document to a specified printer that is installed where you are using Aspose.Words.

Thanks for the reply, I wanted it to print to the clients machine,not the server

@nisharunstraight

Document.Print method prints the document to a specified printer that is installed on your system. Unfortunately, you can not send print to client’s machine using Aspose.Words.

Could you please share complete detail of your use case? We will then provide you more information about your query.