XSL-FO:仅在奇数页上放置文本,跳过偶数页 [英] XSL-FO: place text on odd pages only, skip even pages

查看:43
本文介绍了XSL-FO:仅在奇数页上放置文本,跳过偶数页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文档,我想在其中将文本放置在奇数页上,并在偶数页上放置附图.我的页面定义如下所示:

I have a document where I want to place text on the odd pages, and an accompanying drawing on the even pages. My page definitions look like this:

<fo:simple-page-master master-name="page_even" page-height="210mm" page-width="297mm" margin="{$page-margin}">
    <fo:region-body region-name="body" margin-top="190mm" margin-bottom="20mm" margin-left="200mm" margin-right="97mm"/>
    <fo:region-before region-name="header-even" extent="190mm" precedence="true"/>
    <fo:region-after region-name="footer-even" extent="20mm" precedence="true"/>
    <fo:region-start region-name="outside" extent="15mm"/>
    <fo:region-end region-name="inside" extent="15mm"/>
</fo:simple-page-master>

<fo:simple-page-master master-name="page_odd" page-height="210mm" page-width="297mm" margin="{$page-margin}">
    <fo:region-body region-name="body" margin-top="20mm" margin-bottom="20mm" margin-left="15mm" margin-right="15mm" padding="0pt"/>
    <fo:region-before region-name="header-odd" extent="20mm" precedence="true"/>
    <fo:region-after region-name="footer-odd" extent="{20mm" precedence="true"/>
    <fo:region-start region-name="inside" extent="15mm"/>
    <fo:region-end region-name="outside" extent="15mm"/>
</fo:simple-page-master>

所以在偶数页上我有一个非常大的标题,我将在其中放置绘图.正文区域高 0 毫米,宽 0 毫米,因此该区域不应适合任何文本,并且应自动流向下一页.

So on the even pages I've got a really large header where I'll place the drawing. The body region is 0 mm high and 0 mm wide, so no text should fit in this region and it should automatically flow to the next page.

文本由放置在表格中的一些数据组成(宽 17 厘米,高 1.5 厘米).在奇数页上,大约有 10 个这些表格适合,第 11 个被移动到下一个可用页面.到现在为止还挺好.

The text consists of some data placed in a table (17 cm wide and 1.5 cm high). On the odd pages, about 10 of these tables fit, and the 11th gets moved to the next available page. So far, so good.

我的 XML 由这样的数据块组成:

My XML consists of data blocks in this vein:

<data id="3" name="blah" drawing="xyz">

我使用标记来提取绘图"属性的内容.偶数页头引用了这个标记,所以偶数页会减慢奇数页的第一个数据块中列出的绘图速度.

I use markers to extract the contents of the 'drawing' attribute. The even page header refers to this marker, so the even page slows the drawing listed in the first data block of the odd page.

渲染器(Antennahouse)仍然在每个偶数页上放置一张表格.表格放置在页脚的顶部,与页脚文本重叠.表格比它所在的区域大,所以它应该移到下一页,但这个逻辑在这里失败了.有一个重叠"属性,但这没有我需要的效果:无法指定根本不重叠",只是处理重叠的方法.

The renderer (Antennahouse) still places one table on each even page. The table is placed on top of the footer, overlapping the footer text. The table is larger than the region it is placed in, so it should be moved to the next page, but that logic fails here. There is an 'overlap' property, but this does not have the effect I need: there is no way to specify "don't overlap at all', just ways to handle the overlap.

推荐答案

page_even 中为 fo:region-body/@region-name 使用不同的名称,以便您的流不会流到偶数页上.

Use a different name for fo:region-body/@region-name in page_even so your flow won't flow onto even pages.

这篇关于XSL-FO:仅在奇数页上放置文本,跳过偶数页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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