我正在尝试采用切片A4设计(在photoshop中设计)并在Apache FOP中重新创建。
以下是设计中的一个部分片段:
这就是我拍摄图像并将它们放在XML中时的样子:
referenceegoeshere
和amountgoeshere
下面的大白色间隙是由最后一个图像溢出引起的。
当我删除它时,我仍然可以看到图像间距:
设计以300dpi完成,切片图像仍为300dpi。
在Apache FOP的配置中,我也将DPI设置为300。
<fop version="1.0">
<strict-configuration>true</strict-configuration>
<strict-validation>true</strict-validation>
<base>./</base>
<font-base>./</font-base>
<source-resolution>300</source-resolution>
<target-resolution>300</target-resolution>
</fop>
这是我的完整FOP模板(图片在该位置不存在,我已将其重命名以保护客户的身份)
<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master
margin="0mm"
padding="0mm"
master-name="simple"
page-height="297mm"
page-width="210mm">
<fo:region-body margin="0" />
<fo:region-before extent="0"/>
<fo:region-after extent="0"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simple" color="#365f91">
<!-- Page Body Goes Here -->
<fo:flow flow-name="xsl-region-body">
<fo:block padding="0mm" margin="0mm">
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_01.jpg"/>
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_02.jpg"/>
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_03.jpg"/>
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_04.jpg"/>
</fo:block>
<fo:block padding="0mm" margin="0mm">
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_05.jpg"/>
</fo:block>
<fo:block padding="0mm" margin="0mm">
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_06.jpg"/>
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_07.jpg"/>
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_08.jpg"/>
</fo:block>
<fo:block padding="0mm" margin="0mm">
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_09.jpg"/>
</fo:block>
<fo:block padding="0mm" margin="0mm">
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_10.jpg"/>
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_11.jpg"/>
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_12.jpg"/>
</fo:block>
<fo:block padding="0mm" margin="0mm">
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_13.jpg"/>
</fo:block>
<fo:block padding="0mm" margin="0mm">
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_14.jpg"/>
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_15.jpg"/>
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_16.jpg"/>
</fo:block>
<fo:block padding="0mm" margin="0mm">
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_17.jpg"/>
</fo:block>
<fo:block padding="0mm" margin="0mm">
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_18.jpg"/>
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_19.jpg"/>
<fo:external-graphic src="http://www.mycee.com/image/20135-Test-Mockup-V1.0-01_20.jpg"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
我添加了一些背景颜色来说明图像之间的间距,它几乎就像图像周围没有任何间距时的透明边框。
如何摆脱图像周围添加的间距?
答案 0 :(得分:1)
最后弄清楚了,在每个块上添加font-size="0"
会消除图像周围的间距。
非常奇怪,但确实有效。