且构网

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

缩小以适合 FOP 中的图像

更新时间:2023-11-10 19:56:10

我在这里找到了这个页面解释如何使用 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.