且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用JFreeChart和Apache PDFBOX生成图表

更新时间:2023-09-29 20:01:10

PDXObjectImage的InputStream .org/repos/asf/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddImageToPDF.java"rel =" nofollow noreferrer> AddImageToPDF . 此处显示了典型的copyStream()实现.

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.