通过 Java2D 渲染矢量图形格式的开源库?
使用开源库将 Java2D 编码的图形渲染为矢量图形格式(例如 EPS、SWF、SVG、VML、PDF 和其他我可能尚未听说过的格式)有哪些选项?
Batik 是最广泛使用的 SVG 渲染库。 还有哪些其他选择?
iText 广泛用于渲染 PDF。 有没有一些功能较少但可能更简单的东西?
对于从Java2D渲染SWF(Flash),我发现从 Flagstone 软件转换 SWF 即使不直观,也非常有效。
哪些不太受欢迎的库或正在启动的项目值得关注?
What are my options for rendering graphics encoded by Java2D to vector graphics formats such as EPS, SWF, SVG, VML, PDF and others I might not have heard of yet with open source libraries?
Batik is the most widely-used library for rendering SVG. What other options are there?
iText is widely used for rendering PDF. Is there something less functional but possibly simpler?
For rendering SWF (Flash) from Java2D, I've found Transform SWF from Flagstone Software very effective, if not intuitive.
Which less-popular libraries, or projects starting out, would be worth looking at?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Batik 和 iText 都是很好的库。 我也尝试过 Apache PDFBox,但我认为它不支持 Java2D。
关于 iText,虽然它具有广泛的功能,但您仍然可以通过 PdfGraphics2D 类。 有关如何简单明了的简短示例,请参阅此链接。
以下是您可能想要探索的一些其他资源:
Batik and iText are both good libraries. I've also tried Apache PDFBox, but I don't think it has support for Java2D.
Regarding iText, although it has extensive capabilities, you can still use it for simple Java2D rendering tasks by way of the PdfGraphics2D class. For a short example of how straightforward this is, see this link.
Here are some other resources that you might want to explore:
如果您只想将 Java2D 保存为 PostScript,那么这非常简单,无需任何附加库:请参阅 http://weblogs.java.net/blog/cayhorstmann/archive/2009/10/08/how-draw-simple-diagrams -easy-way-java2d。 然后,您可以使用 ps2eps 将输出转换为 EPS,或使用 ps2pdf 将其转换为 PDF。
If all you want to do is save your Java2D to PostScript, that's really easy without any add-on libraries: See http://weblogs.java.net/blog/cayhorstmann/archive/2009/10/08/how-draw-simple-diagrams-easy-way-java2d. You can then use ps2eps to turn the output into EPS, or ps2pdf to turn it into PDF.