gpt4 book ai didi

image - 缩小以适合FOP中的图像

转载 作者:行者123 更新时间:2023-12-03 09:30:41 24 4
gpt4 key购买 nike

我正在使用FOP 1.0版创建PDF。在其中一个页面中,我想显示一张图像(2552 x 4200像素),如果它不完全适合页面,则将其缩小。据我在mailing list上看到的,推荐的执行方法如下:

<fo:external-graphic inline-progression-dimension.maximum="100%" 
content-height="scale-down-to-fit"
content-width="scale-down-to-fit"
src="..."/>

不幸的是,那仍然不能显示整个图像。图像的下部被切掉。谁能给我提示我可能做错了什么?

最佳答案

I found this page here explaining how scaling works with XSL-FO

本质上,这是我用来使其工作的代码段:

<fo:external-graphic
src="url('...')"
width="100%"
content-height="100%"
content-width="scale-to-fit"
scaling="uniform"
xsl:use-attribute-sets="img"/>

我发现 width="100%"是您自己尝试中缺少的部分。希望这对将来的访客有所帮助。

关于image - 缩小以适合FOP中的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6220316/

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