Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/344.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 带图形(饼图/条形图)的FOP Pdf格式_Java_Xslt_Charts_Apache Fop - Fatal编程技术网

Java 带图形(饼图/条形图)的FOP Pdf格式

Java 带图形(饼图/条形图)的FOP Pdf格式,java,xslt,charts,apache-fop,Java,Xslt,Charts,Apache Fop,我从将近一个月的时间里一直在搜索使用ApacheFopPDF生成的图形。最后我问你们编码员,请帮帮我 <metrics> <duration>22s.531ms</duration> <failed>1</failed> <passed>2</passed> <skipped>6</skipped> <total>9</total&

我从将近一个月的时间里一直在搜索使用ApacheFopPDF生成的图形。最后我问你们编码员,请帮帮我

<metrics>
    <duration>22s.531ms</duration>
    <failed>1</failed>
    <passed>2</passed>
    <skipped>6</skipped>
    <total>9</total>
</metrics>

22s.531ms
1.
2.
6.
9

一旦您成功地使用任何您喜欢的图表库(如JFreeChart或类似的)创建了一个漂亮的图表,请查看以下关于如何将生成的图像嵌入pdf的示例:

<fo:block>
The image (
  <fo:external-graphic content-width="100pt" content-height="50pt" scaling="non-uniform" src="images/fop.jpg"/>
) has non-uniform scaling.
</fo:block>

<fo:block>
The image (
<fo:external-graphic content-width="50pt" content-height="100pt" scaling="non-uniform" src="images/fop.jpg"/>
) has non-uniform scaling.
</fo:block>

<fo:block>
The image (
<fo:external-graphic content-width="100pt" content-height="75pt" scaling="uniform" src="images/fop.jpg"/>
) has uniform scaling.
</fo:block>

<fo:block>
The image (
<fo:external-graphic content-width="75pt" content-height="100pt" scaling="uniform" src="images/fop.jpg"/>
) has uniform scaling.
</fo:block>

<fo:block>
The image (
<fo:external-graphic width="75pt" height="100pt" content-width="scale-to-fit" content-height="scale-to-fit" src="images/fop.jpg"/>
) is scaled to fit the viewport.
</fo:block>

形象(
)具有非均匀缩放。
形象(
)具有非均匀缩放。
形象(
)具有均匀的缩放比例。
形象(
)具有均匀的缩放比例。
形象(
)缩放以适合视口。

到目前为止您有什么?我想是xslt吧?还有一些xml吗?还有png格式的图表@简:谢谢你的回复。我不知道如何为它编写xslt。XML我将编辑问题并添加它,然后您可能根本不想启动fop,而是选择了像itext这样更简单的方法来制作pdf。谢谢您的建议。但我不被允许使用itextpdf。因为这是一项任务或因为法律问题而不被允许?可能仍然有一个(旧的)LGPL版本的itext。谢谢你@Jan。我会尝试使用它&让你知道。