I have tested the scenario using Aspose.Pdf for .NET 10.3.0 in Windows application and I have also observed that PDF file is being printed in few seconds. However concerning to the issue while printing file with Windows Service, I think its something related to how your service is implemented or some scanning or filtering is being performed upon your service.
Can you please share some details/sample project which can help us in replicating the issue in our environment. We are sorry for your inconvenience.
Just to be clear, we have logged the lines of code to get the time they needed to finish. We also thought there was something wrong in our web service first. But after we logged the executing times we saw that almost the whole executiontime is used by the PrintDocumentWithSettings - method.
However, we identified that the user account has something to do with it. The windows service is running under another account and in this account the printing takes the long time.
If we can be sure what settings help for this issue we will post it here.
We will be waiting for further information from your side so that we can try replicating the issue in our environment. In case you need any related assistance, please do let us know.
How did you determine that the account had something to do with it? I am also running into this issue. I’ve tried changing the service to run under different accounts and it is still slow to print.
I think I found out our issue but I need to do more testing.
I logged into the server that the service is hosted on, using the credentials the service is running under. Then I added the printers (Devices and Printers–>Add Printer) that we print to. After doing that the service printed in seconds. If I then removed the printer, it took 4-5 minutes to print.
So I’m guessing without the printer added it has to query the printer and possibly download drivers each time (we are printing to network printers). I’m not exactly sure what the delay is.
When a printer is not installed and you have referenced a printer inside your code, the system will search for respective printer and in case its not installed, it might be attempting to download its drivers and no drivers are found, an error will be generated. You may consider testing the scenario by removing internet/network connect over system running service and see whats the behavior (the API triggers the file print but if no respective printer drivers are found, an error will be thrown).
Thanks for sharing the feedback. We are pleased to hear that your problem is resolved. Please continue using our API’s and in the event of any further query, please feel free to contact.