Generate chart with JFreeChart and Apache PDFBOX

前端 未结 2 1480
旧时难觅i
旧时难觅i 2021-02-04 22:14

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 se

相关标签:
2条回答
  • 2021-02-04 22:35

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

    0 讨论(0)
  • 2021-02-04 22:37

    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.

    0 讨论(0)
提交回复
热议问题