且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

缩小以适合FOP中的图像

更新时间:2023-11-10 20:27:22

我在此处发现此页面解释了如何使用XSL-FO进行扩展。

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

从本质上讲,这是我用来使其工作的片段:

Essentially, this is the snippet that I used to make it work:

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

我发现 width =100%是你自己尝试中缺失的一块。希望这有助于未来的访客。

I found that width="100%" was the missing piece in your own attempts. Hope this helps future visitors.