fo:external-graphic后不需要的边距 [英] Unwanted margin after fo:external-graphic

查看:36
本文介绍了fo:external-graphic后不需要的边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

图像后出现1毫米的边距.我的XML:

A margin of 1 mm appears after an image. My XML:

<fo:block-container position="absolute" width="47.6mm" height="160mm" font-family="Verdana">
    <fo:block-container position="absolute" height="25mm" space-after="3mm">
        <fo:block>
            <fo:external-graphic src="release heading.svg" />
        </fo:block>
        <fo:block font-size="7pt" text-align="start" color="#6f696d" display-align="center" start-indent="0mm" background-color="#efefef">
             <fo:table border-collapse="collapse">
                  ...  
             </fo:table>
        </fo:block>
    </fo:block-container>

它看起来像这样:

我不要白线.

我试图将content-height ="100%"设置为无效:

I tried to set content-height="100%", to no avail:

<fo:external-graphic content-height="100%" src="release heading.svg" />

如果我在图像和图块周围绘制边距,则很明显,边距位于两者之间:

If I draw margins around the image and the block, it is clear that the margin is between the two:

<fo:block border-style="solid" border-width="thin" border-color="black">
    <fo:external-graphic content-height="100%" src="release heading.svg" border-style="solid" border-width="thin" border-color="black"/>
</fo:block>

但是我该如何摆脱呢?

推荐答案

我刚刚在FOP论坛上找到了答案.

I just found the answer on a FOP forum.

未指定line-height属性,但计算为1.2 * font-size.因此图块比图像高.

The line-height property is not specified, but calculated to 1.2 * font-size. So the block is higher than the image.

如果我在块上将font-size设置为0:

If I set font-size to 0 on the block:

<fo:block font-size="0pt">
    <fo:external-graphic content-height="100%" src="release heading.svg"/>
</fo:block>

...该行消失.

这篇关于fo:external-graphic后不需要的边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆