Printing Word file from .NET Core Windows Service

I’m trying to print a Word file with GemBox Document from a Windows Service written in .NET Core 3.1. It works fine on my development machine but when deployed to a test server, the service hangs on the DocumentModel.Print method.

Hi David,

I’ll try to reproduce this problem and let you know what I found out.
If I’m unable to reproduce it, I’ll contact you again for more information.

Regards,
Mario

Hi David,

We were able to reproduce this issue.
When printing locally or on server with a user interactive mode then it works, but when trying to print from service on server then it never finishes.

Unfortunately, we were unable to find out the reason for it.
At the moment we don’t have any clues as to why this Windows Service limitation is imposed nor what needs to be set or configured to enable it to work.

Initially we suspected that the problem could be with WPF, because GemBox.Document uses enhanced printing services, but that doesn’t seem to be the case.

Apologize for the inconvenience, I’m afraid that currently, we don’t have any solution for this.
Please note that we’ll update this topic in the future if we find a solution or any additional information.

Regards,
Mario

We have investigated this issue thoroughly, but I’m afraid we didn’t find a solid solution (one that would work with any printer).

However, note that the .NET team was able to resolve this in .NET 5.0, see this comment.
Unfortunately, the fix was not backported to 3.1.

Regards,
Mario