在 Java Swing 中打印发票和类似文档的工具是什么?

发布于 2024-09-01 11:47:36 字数 291 浏览 3 评论 0原文

我正在寻找一个在 Java Swing 中打印发票、收据和类似文档的好工具。我尝试过 JasperReports,但很难获得 动态布局 它正在为报告而设计。

我的要求是文档应直接发送到打印机,而不能保存到文件中。因此,一些首先创建 Office 文档或 PDF 文档的工具对我来说不是解决方案。

有什么建议吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

独自唱情﹋歌 2024-09-08 11:47:36

您可能想尝试一下Docmosis。您可以创建各种格式的动态文档,其优点是在模板(简单的 doc 或 odt 文件)中指定布局,并且可以基于数据动态管理内容。通过使用 Docmosis 条件字段或调整输入数据,您的链接引用的布局类型很容易实现。

仅就打印而言,Docmosis 允许您将生成的输出文档流式传输到任何地方。您可以将其流式传输到代码,然后将其直接发送到打印机。

You might want to give Docmosis a go. You can create dynamic documents in various formats with the advantage that layout is specified in a template (being a simple doc or odt file) and content can be dynamically managed based on data. The type of layout your link refers to is pretty easy to achieve by using Docmosis conditional fields or by adjusting your input data.

In terms of printing only, Docmosis lets you stream the resulting output document anywhere. You could stream it to code that will send it to a printer directly.

可是我不能没有你 2024-09-08 11:47:36

我建议使用 DynamicReports,这是一个基于 JasperReports 的开源项目。
您可以将报告直接发送到打印机。

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

七婞 2024-09-08 11:47:36

Java 中的打印围绕着一个相当简单但功能强大的 API,它为您提供了画布。从那里,您可以使用 Java2D API 轻松绘制任何信息,就像覆盖 PaintComponent() 函数一样。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文