Free Support Forum - aspose.com

Printing Word Documents in ASP.Net

Hi, I need to print multiple Word documents in a web app, but the printer needs to be chosen by the user on client side.

1) How do I let the user choose his printing preferences?
2) How do I print the documents using the preferences chosen?
3) I also need to open the Word Document. How do I approach this?

Thanks

Hi Shah,


Thanks for your inquiry.
sjabeen:

I need to print multiple Word documents in a web app, but the printer needs to be chosen by the user on client side.
1) How do I let the user choose his printing preferences?
2) How do I print the documents using the preferences chosen?
Please note that Aspose.Words for .NET is a class library that enables your applications to perform a great range of document processing tasks. With Aspose.Words you can generate, modify, convert, render and print documents without utilizing Microsoft Word®.

The AsposeWordsPrintDocument class provides a default implementation for printing of a Document within the .NET printing framework. You can pass PrinterSettings to Document.Print method, this prints the document according to the specified printer settings, using the standard (no User Interface) print controller.

It would be great if you please share some more detail about your scenario (print document via browser).

sjabeen:

3) I also need to open the Word Document. How do I approach this?
Aspose.Words does not offer any UI or web control to open/edit documents via web browsers.


Thanks for the quick response.

The scenario is :

There is a set of word documents present on a shared location. I need to print these word documents using the printer installed on the client machine.

How do I get the Client's Printing Preferences as a user input ?

Also, How can we provide a Print Preview?

If it was Winform app, I could have used the PrintDialog, but how do we do this in an ASP.Net app?

Hi Shah,


Thanks for sharing the details. Aspose.Words does not offer any UI or web control for printing preferences via web browsers. However, with Aspose.Words, it is possible to create Document preview, for example by converting your document to image, XPS or SWF format. For example, try to run one of Aspose.Words demos and select SWF as a target format:
http://www.aspose.com/demos/.net-components/aspose.words/csharp/general/dinner-invitation.aspx
SWF produced by Aspose.Words also includes document viewer UI. So you need simply embed this SWF into your web page.

Please read the Document.Print method’s details from following documentation link. You can pass PrinterSettings to Document.Print method, this prints the document according to the specified printer settings, using the standard (no User Interface) print controller.
http://www.aspose.com/docs/display/wordsnet/Print+Method