Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Time out while printing  RSS feed

 
Raymond Esseldeur
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I've made a small webapplication (JSP and servlets) which sole function is to print pdf-files on request. To centralize printing, users print from one location whenever printers are available.

The amount of printjobs can vary from a single job to dozens. Even so the number of pages printed can vary from a single one up to some hundreds of pages.

Everything works well for the "small" jobs, but when I start printing multiple large files the first one is allright, but the second produces unreadable characters. I suppose I get some kind of session time out when printing the jobs as the jobs are handled one-by-one.

How do I solve this problem? I've thought about using a new thread for every printjob. Does anyone has any other sugesstions?

Thanks a lot and looking forward for your answers.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raymond,

Having a new session/thread for each job sounds sensible yes (or use a queuing technology such as JMS), but it sounds like you need to dig a little deeper to prove that it is the session timeout that is causing the problem....
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how your implementing the print functionality, but you could definately make some kind of queue.
I'm sure there is a printcomplete event or some way to keep track of the number of pages printed so far.

Justin
 
Raymond Esseldeur
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The appilcation is really simple: each pdf file is printed using the commandline feature of adobe reader: AcroRd32.exe /t "C:\test.pdf" "\\servername\printername"

I've tried to keep it simple and not spend too much time on it, seems I misjudged this one a bit
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!