We have a web app that needs to pick up documents from the
network and send them to one of a number of network printers.
This works fine, when the app is running locally, but
doesn't work when published to the web server because there are no printers
installed on the server.
Thanks for your inquiry. Please use the code mentioned in the following article to be able to print a word processing document from an ASP.NET using Aspose.Words and the XpsPrint API:
I've downloaded the code and plumbed it into my project, but I get the following error when trying to use the Xps API:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB7.5; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3) Timestamp: Tue, 27 May 2014 15:10:56 UTC
Message: Sys.WebForms.PageRequestManagerServerErrorException: The printer driver is unknown Line: 938 Char: 13 Code: 0
Any ideas?
It looks to me as though you can't print to a network printer without having the drivers installed on the server first, which is a shame as our infrastructure people are adamant that they will not install printer drivers on a web server (understandable, I guess!).
Thanks,
Paul.
PS. the error occurs when I try to print from both the server (Windows 2008 R2) AND my development PC (Windows 7). So perhaps there's a pre-requisite for the XpsPrint API to work?
Thanks for your inquiry. Please make sure that you have rights to print on this printer and it is accessible. You can try using the following code for testing. This code does not use Aspose.Words at all. So if it will not work, the problem is somewhere on your side.