File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing a pdf file in Java

 
Victor Gonzalis
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm trying to print a pdf file using flying saucer, the object PrintableCheck contains all the information of the transaction which needs to be printed. The code works perfectly fine but the problem is that it takes too long to pop up the print dialog.
Is there anything I can modify the below code to make it work faster?
Thanks in advance!

 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12024
25
Chrome Java Linux
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"too long" is not very precise. How long should it take? How long does it take?

More importantly, how do you know that this code is what is causing the slowdown? Unless you've run it through a profiler, you shouldn't even be thinking about optimizing this code...the real problem might be somewhere else.
 
Victor Gonzalis
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:"too long" is not very precise. How long should it take? How long does it take?

More importantly, how do you know that this code is what is causing the slowdown? Unless you've run it through a profiler, you shouldn't even be thinking about optimizing this code...the real problem might be somewhere else.


Thank you for the quick response, the time to pop up the dialog varies, sometimes it pops up within 30 sec, and sometimes it takes more than 7 minutes which is too long. When I clear the cache, the print dialog pops up quicker(3-30 seconds).
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This code creates a PDF, it doesn't open or print anything AFAICT. Which software do you use to print the PDF?
 
Victor Gonzalis
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:This code creates a PDF, it doesn't open or print anything AFAICT. Which software do you use to print the PDF?

Thank you for the answere I was under the impression that the below code triggers the printer. I use Microsoft XPS Document Writer (I have no idea about the software)

 
Victor Gonzalis
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Victor Gonzalis wrote:Hello,
I'm trying to print a pdf file using flying saucer, the object PrintableCheck contains all the information of the transaction which needs to be printed. ....



thank you all for your help, This question is resolved.!!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic