我试图在XSL:FO中的表格中添加图像,但图像没有反映在PDF中。
<fo:table-cell border-style="solid" border-color="black" border-width="0.4pt" number-columns-spanned="1" text-align="center" display-align="center">
<fo:block font-family="isocpeur" line-height="12pt" font-size="12pt" font-weight="bold" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">
<fo:external-graphic
content-width="scale-down-to-fit"
content-height="scale-down-to-fit"
scaling="uniform"
src="src\com\createpdf\image\LOGO.png"/>
</fo:block>
</fo:table-cell>
您已指定相对路径。 FO处理器根据XSLFO文件所在的目录评估此路径。要消除歧义,请使用绝对路径(即以驱动器号,C:\ folder \等开头)
您尚未指定图像的大小。我怀疑content-width="scale-down-to-fit"
需要大小来扩展。
<fo:external-graphic width="1cm"...
什么是症状/您在PDF中看到了什么?在Antennahouse Formatter中,如果找不到图像,它将放置一个占位符。这有助于缩小问题范围。