【发布时间】:2016-10-05 21:15:13
【问题描述】:
我使用以下代码以 PDF 格式显示 PNG 图像。我使用<fo:instream-foreign-object> 因为<fo:external-graphic> 不能满足我显示图像的要求。参考问题external graphic
<fo:instream-foreign-object width="50%" content-width="scale-to-fit">
<svg>
<image height="439px" width="1037px" xlink:href="test.png"/>
</svg>
</fo:instream-foreign-object>
通过上述使用,我无法获取文档中的图片。图像未正确放置在页面中,并且下一段中的文本覆盖在其顶部。 请提出如何实现它。
【问题讨论】:
-
缺少 svg 的命名空间 (
xmlns="http://www.w3.org/2000/svg")。 -
@potame 我在模板的开头添加了 svg 的命名空间。
-
您可以添加当前输出的屏幕截图吗?
-
@TonyGraham。不,由于安全问题,我不能这样做:(。下一段中的文字在图像上方
标签: xsl-fo apache-fop