What's the tool for printing invoices and similar documents in Java Swing?

I'm looking for a good tool to print invoices, receipts and similar documents in Java Swing. I tried JasperReports but it is quite difficult to get dynamic layout and it is for reports.

The requirement I have is that the document should be sent directly to the printer and should not be saved to a file. Therefore, some tools that create Office document or PDF document first are not the solution for me.

Any recommendations?

+2


a source to share


3 answers


Java printing revolves around a fairly simple yet powerful API that gives you a canvas. Fromthere you can easily paint any information using the Java2D API just like you would override the paintComponent () function.



0


a source


You might want to give Docmosis a go. You can create dynamic documents in a variety of formats with the advantage that the layout is specified in the template (which is a simple document or odt file) and the content can be dynamically manipulated based on the data. The type of layout your link is referencing is fairly easy to achieve using Docmosis conditional fields or by customizing your input.



From a print standpoint alone, Docmosis allows you to send the resulting output anywhere. You can pipe it into code that will send it directly to the printer.

+2


a source


I recommend using DynamicReports , open source and based on JasperReports. You can send the report directly to the printer.

+2


a source







All Articles