This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, September 28, 2010 9:22:27 PM(UTC)
Groups: Registered
Posts: 7
Hi! We have a problem printing via Virtual printer from windows service running under Local System account. Is it possible at all?
Meanwile printing from service running under user account is ok.
Edited by moderator Thursday, November 17, 2016 7:18:13 PM(UTC)
| Reason: Not specified
#2
Posted
:
Wednesday, September 29, 2010 4:01:04 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
1. If you try to print form the same service and same user to a different (non-LEADTOOLS) printer, does it work?
2. If you change the "Allow service to interact with desktop" option for the service, does it affect it?
If not, please try to create a small test project (NOT your full application) that only shows how you print and send it to
support@leadtools.com with full details on how to reproduce the issue.
#3
Posted
:
Wednesday, September 29, 2010 10:31:17 PM(UTC)
Groups: Registered
Posts: 7
Seems any printing from win service under Local system dont work at all. At least i cant do it with any printer in Win 7. Have your's team any experience or knowlege about this subject? I cant find any clear answer even from google )))) Thanx in advance.
#4
Posted
:
Thursday, September 30, 2010 3:21:26 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
The following Microsoft article discusses some aspects related to printing from services, including information related to the service's logon account:
"How to Print from a Windows Service Using the Windows GDI APIs"
http://msdn.microsoft.com/en-us/windows/ff518439.aspx
#5
Posted
:
Thursday, September 30, 2010 3:34:56 AM(UTC)
Groups: Registered
Posts: 7
Ok thanx for the article. So answer for printing under Local System account is NO. )))))
#6
Posted
:
Thursday, September 30, 2010 6:07:08 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I found some information about this:
There are two ways to print from within a service:
1. Start the service under a Domain User, instead of LOCALSYSTEM, the service will be run under a given user instead of SYSTEM. You already know this part.
2. Instead of printing from the service itself (since we are facing problem when this is applied), the service could impersonate a user and execute another application that will print to the printer. The printing work will be done by this newly executed application since it will have the full interactive user resources and will cause no problem when printing to the printer.
Note: The printer you are using should be accessible to the Domain User you are logged into.
#7
Posted
:
Thursday, September 30, 2010 9:48:36 PM(UTC)
Groups: Registered
Posts: 7
Thanx for your kindness. We are in our team got the same conclusions about. Impersonation of the threads or running service under user accounts seems is only valid solutions.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.