Search code examples
javaswingprintinginvoices

What tool for printing Invoices and similar documents in Java Swing?


I'm looking for a good tool for printing Invoices, Receipts and similar documents in Java Swing. I have tried JasperReports but it is pretty hard to get a dynamic layout and it is designing for reports.

A requirement that I have is that the document should be sent directly to the printer and must not be saved to a file. So some tools that first creates an Office Document or a PDF document isn't a solution for me.

Any recommendations?


Solution

  • Printing in Java revolves around a fairly simple but powerful API that provides you with a canvas. Fromthere you can easily paint any information using the Java2D API in the same way you would override a paintComponent() function.