• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Print Service question

 
xingxing Wang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey:

Did anybody use java print service before? Is it good one to print a HTML or PDF file programatically using its API? Any sample code?

Thank you in advance.
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd rather use some more advanced implementations of the printing API like those offered by some open source projects such as Jasper Reports or JFreeReport

Would that help you?
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PrintService is not the same as Jasper (and probably JFreeReport, which i dont know). Jasper is used to generate reports (in various formats as XLS, PDF, HTML, ...) while PrintService is used to get the data to the printer.
There is no direct support in java to print PDF even though there is a PDF doc flavor. (none that i am aware of)! you need a third party library (probably commercial) or go some extra miles (e.g. convert to PS first and then send this to the printer or use apache FOP to generate the PDF then you can also print it).

if you are looking for ways to generate PDF then there are some free solution that can be used like a printer where you print your document to a software printer which outputs PDF (i think iText is a solution for this)


pascal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic