Problem batch printing from service in webclient

Questions and Answers on installation, deployment, management, locking, tranasactions of Servoy Application Server

Problem batch printing from service in webclient

Postby mccann1340410441 » Tue Aug 14, 2012 7:36 am

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
mccann1340410441
 
Posts: 5
Joined: Sat Jun 23, 2012 2:14 am

Re: Problem batch printing from service in webclient

Postby ptalbot » Tue Aug 14, 2012 9:18 pm

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 Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Problem batch printing from service in webclient

Postby mccann1340410441 » Thu Aug 16, 2012 5:50 am

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
mccann1340410441
 
Posts: 5
Joined: Sat Jun 23, 2012 2:14 am

Re: Problem batch printing from service in webclient

Postby ptalbot » Thu Aug 16, 2012 8:02 am

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?
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Problem batch printing from service in webclient

Postby mccann1340410441 » Tue Sep 25, 2012 4:13 am

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.
mccann1340410441
 
Posts: 5
Joined: Sat Jun 23, 2012 2:14 am


Return to Servoy Server

Who is online

Users browsing this forum: No registered users and 6 guests

cron