gpt4 book ai didi

image - 如何使用 xsl-fo 和 apache fop 0.95 显示固定的图像高度和宽度

转载 作者:行者123 更新时间:2023-12-03 21:16:13 24 4
gpt4 key购买 nike

我正在尝试修复使用 fop 0.95 生成的 pdf 中图像的高度和宽度。
这是用于它的代码

<fo:external-graphic src="s\image.png" height="2.00in" width="2.00in"/>

以下也不起作用
<fo:external-graphic src="s\image.png"  content-height="scale-to-fit" height="2.00in"  content-width="2.00in"/>

这些为我们提供了由宽度控制的图像。
总之,我试图拉伸(stretch)图像,而不是使用 fop 0.95 保持纵横比。有人知道吗?

最佳答案

These gives us the image that is governed by width . In summary I am trying to stretch the image rather than keeping the aspect ratio using fop 0.95.



默认情况下 fop 保持纵横比,而不管指定的图像高度和宽度。这意味着 fop 默认情况下会进行统一缩放。

要根据您的规范获得相当拉伸(stretch)的图像,您应该使用非均匀缩放。这边走:
<fo:external-graphic src="s\image.png"  content-height="scale-to-fit" height="2.00in"  content-width="2.00in" scaling="non-uniform"/>

这将显示高度为 2.00 英寸、宽度为 2.00 英寸的 image.png 图像。

希望这可以帮助。谢谢,

关于image - 如何使用 xsl-fo 和 apache fop 0.95 显示固定的图像高度和宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1957847/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com