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

Free Support Forum - aspose.com

XPS Printing - Web Service

Hello,


I'd like to setup a web service to print Word document on server side.

I have read the article about Aspose/XPS printing (http://www.aspose.com/docs/display/wordsnet/How+to++print+a+document+on+a+server+via+the+xpsprint+api), it gets the job done in an application but not as web service.

When running into web service I call XPS API but always get and failed response.

My service is host by a specific user with administrator privileges.

So my questions are the following :
  • I could not found a thread about this type or architecture, is it possible at all ?
  • Any suggestion ?

Thanks

Hi Richard,

Thanks for your inquiry. Please note that the main goal of this article is to show how to print a word processing document from an ASP.NET or Windows Service application using Aspose.Words and the XpsPrint API.

Could you please share some detail about your scenario/environment in which you are printing the documents? Please also share the exception/issue detail which you are facing. We will then provide you more information about your query.

Hi Tahir,


when calling the XPS API I get the following error when calling CheckJobStatus :

"System.ComponentModel.Win32Exception (0x80004005): The operation attemped is not supported"

The web service is IIS hosted Windows 8.1/Server 2012 using an administrator account with “Enable 32 bits application” sets to true.

Nothing comes out of the printer and I cannot find more information about the error.

Does any configuration has to be done to expose the API ? Could it be the 32 bits ? Any idea ?

Thanks… !!

Hello Tahir,


I’ve find the problem… the “Enable 32 bits application”… !

Since some of our system drivers are 32 bits, do you think it would be possible to run the API in 32bits mode ?

Thanks a lot for your help, we’re really glad to move on with your products and support !

Best regard

Hi Richard,

Thanks for your inquiry. It is nice to hear from you that your problem has been solved.

RitchGreen:

Since some of our system drivers are 32 bits, do you think it would be possible to run the API in 32bits mode ?

You
can use Aspose.Words for .NET to build ASP.NET, Web Services, WinForms
or any other type of application for any .NET Framework version from 2.0
to 4.5. Perhaps, there is some issue at your side. You can use Aspose.Words under 32-bit and 64-bit applications.

Hello Tahir,


Sorry for the late answering, was on vacation, I got my problem solved and for your knowledge here is what happened.

The NET Web Service was being hosted under ISS in 32 bits (Feature is avalaible on IIS 7+). I had problem running the XPS API, not the Aspose API, your product is way better than some Microsoft products… :slight_smile:

So, accessing the XPS API from a 32 bits application on a 64 bits OS requires some configuration in the DCOMCONFIG, because the call looksup in 32 bits registry and cannot find the API.

So, if this can help anyone who faces such challenge, please take a look at the following ticket on Microsoft : ttps://connect.microsoft.com/VisualStudio/feedback/details/509905/pinvoke-to-xpsprint-fails-in-32-bit-app-pool

We are about to move with your products, thanks a lot

Best regards


Hi Richard,

Thanks for your feedback. It is nice to hear from you that you have
found the solution of your issue. We always appreciate positive feedback
from our customer. Please feel free to ask if you have any question
about Aspose.Words, we will be happy to help you.