We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Print Word document from ASP.NET

Is it possible to print Word documents from a ASP.NET Webapplication (Webform) without using the Print method from the class Aspose.Words.Rendering.AsposeWordsPrintDocument, because it’s very slow.

I also like to set the printserver and configuring the papertray programmatically.

I’m using the latest edition of the Aspose.Word.dll. The application is running on Windows Server 2003 and .NET 3.5

Hello

Thanks for your request. You can try printing your Document on a Server via the XpsPrint API:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-print-a-document-on-a-server-via-the-xpsprint-api.html

Best regards,

Thanks for the quick response.
From what I’ve red the XpsPrint Api isn’t available on Windows Server 2003. (correct me if I’m wrong)
If this is the case, are there any solutions left?

Hello

Thanks for your inquiry. XpsPrint API is available on Windows 7, Windows Server 2008 R2 and also on Windows Vista, provided the Platform Update for Windows Vista is installed.

But, what do you mean “very slow”, could you please attach any test document which will allow me to reproduce the problem on my side?

Best regards,

Attached an example of a document I tried to print.
It takes a while before the small winform appears and the printer start to print. The same thing happens when I cancel the print job by pussing the button in the winform.

If its all about memory and cpu, just say so because I was testing on a development machine.

When you are going to reproduce the problem, could you post me the details of the test machine and the time it took to print the document I attached.

Hello

Thanks for your inquiry. I cannot reproduce the problem on my side. It takes 0,921875 sec to load and send your document to printer. I use the following code for testing:

// Open document

DateTime start = DateTime.Now;

Document doc = new Document(@“Test\00092131.doc”);

PrinterSettings settings = new PrinterSettings();

settings.PrinterName = “hp LaserJet 1010 Series Driver”;

doc.Print(settings);

Console.WriteLine((DateTime.Now - start).TotalSeconds);

My environment is Intel Core Duo E8400, 4 GB of RAM, Windows XP x86.

Best regards,