开发者

Generate chart with JFreeChart and Apache PDFBOX

开发者 https://www.devze.com 2023-03-28 05:16 出处:网络
I need to generate charts using JFreeChart and then export them to PDF using Apache PDFBOX. I don\'t want to use iText as it cannot be used in proprietary software.

I need to generate charts using JFreeChart and then export them to PDF using Apache PDFBOX. I don't want to use iText as it cannot be used in proprietary software.

开发者_JS百科I searched all over Google, but no luck! Has anyone done it?


Copy the OutputStream from your chosen writeChartAs*() method in ChartUtilities to the InputStream used to create a PDXObjectImage in AddImageToPDF. A typical copyStream() implementation is shown here.

Addendum: Alternatively, use piped streams to copy from output to input, as shown here and here.


You can try using JasperReports. They are a bit heavy, but working good.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号