I want to batch print from the webclient while running the application from the windows service. In order to do this I save my .pdf BLOB to a tempFile on the server and then I print it silently to Acrobat using:
application.executeProgramInBackground(‘"’+acrobat_location+‘"’, ‘/p’, ‘/h’, ‘/t’, ‘"’+tempFile+‘"’, thePrinter);
The code executes fine when the application server is run by opening the .bat file in the application_server directory. However, when I run the application server from the service all else runs well but this particular line of code does not result in the tempFile being sent to thePrinter.
It does not throw an error message or write anything to the servoy log or the windows event log. The client does not crash or even stall. If I run the service under a local administrator account it does not solve the problem. If I run the service under the system account and check off the box to allow the service to interact with the desktop it throws an error from Acrobat saying that I need to install a printer. thePrinter is installed and it all works fine if I start the application server with the .bat file instead of starting if from the service.
My question is what can I do to make this work while running the application_server from the service?
Thanks for your help
John McCann
Windows 2008 Server
MS SQL
Java 1.7 (64 bit)
Servoy 6.1
So you’re actually printing on the server from the web client?
Anyway, what is contained in your acrobat_location? It seems it is a relative path. But when you run as a service the home directory is not /application_server/ so I suppose you have a path problem.
Patrick,
Thanks for your reply.
“So you’re actually printing on the server from the web client?”
Yes I am as I could not find a way to batch print from the web client without printing from the server. The program is deployed in a intranet with all printers defined on the server so this works for us.
"Anyway, what is contained in your acrobat_location? "
It is the correct absolute path to the acrobat executable. The problem is not the path because when I allow the system to interact with the desktop of the server I can see that acrobat has opened the .pdf but gives an error indicating that no printer is installed. I do not understand why acrobat knows about thePrinter when the service is run from the .bat file but does not know about thePrinter when run from the service.
Any ideas of how to get this to work when running the application server from the service?
Thanks
John McCann
Windows 2008 Server
MS SQL
Java 1.7 (64 bit)
Servoy 6.1
A service doesn’t usually have the same kind of access to desktop resources a user would have.
You said you’ve run from a local admin account… Is the printer installed for that local account as well?
Yes the printer is installed on the local account. I have researched it a bit more. I think it is an issue with acrobat and windows services more so than Servoy. I am still looking for a solution.