1

有没有办法将 Apache 配置为忽略存储在图像文件中的 DPI 元数据并改用特定值?或者可能是可以在<fo:external-graphic>元素上使用的属性?

图像使用以下方式呈现:

<fo:external-graphic src="{concat('url(', string(@href), ')')}"
                     xsl:use-attribute-sets="image">
  <xsl:call-template name="imageSizeAttributes"/>
  <xsl:call-template name="idAttribute"/>
  <xsl:call-template name="roleAttribute"/>
</fo:external-graphic>

我发现源图像的最佳 DPI 值为 110。如果我以 110 DPI 保存图像,那么它们会完美呈现。如果可能的话,我想简单地覆盖它,以便不使用存储在图像文件中的 DPI 值。

我尝试将以下内容添加到“.xconf”文件中,但这似乎根本没有任何区别:

<source-resolution>110</source-resolution>

我还尝试设置极值(0、72、200、300、600)以查看它们是否有任何影响,但它们没有。

4

2 回答 2

1

看来我需要将以下两行添加到我的“.xconf”文件中:

<source-resolution>110</source-resolution>
<target-resolution>110</target-resolution>

此外,似乎这些配置仅适用于不包含 DPI 元数据的图像文件。

这对我来说太棒了,因为 Adob​​e Photoshop 在使用其“保存为 Web 和设备”功能时不会保存图像 DPI。

于 2013-01-16T04:18:48.040 回答
0

在我的例子中,在source-resolutiontarget-resolution产生任何影响之前,需要将content-widthcontent-height设置为与widthheight相同的值。

于 2014-05-27T11:51:00.750 回答