使用带有 apache fop 1.1 的 xsl-fo 在 PDF 文件中插入图像

问题描述 投票:0回答:0

我正在使用 Apache Camel + Apache FOP 通过 XSL 将 XML 转换为 PDF,该项目是使用 Maven + Java 8 构建的

当我尝试在 PDF 的页脚中插入徽标图像时,出现此错误:

fo:external-graphic 元素不允许使用“src”属性!

                            <fo:table-cell>
                                <xsl:attribute name="text-align">left</xsl:attribute>
                                    <fo:block>
                                        <fo:external-graphic  src="url(file:///home/someDir/resources/Logo.jpg)" />
                                    </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>
            </fo:flow>
        </fo:page-sequence>
    </fo:root>
xsl-fo apache-fop
© www.soinside.com 2019 - 2024. All rights reserved.