如何根据 XSL-FO 中的页码显示一个或其他信息? [英] How to display one or the other information depending on the page number in XSL-FO?

查看:24
本文介绍了如何根据 XSL-FO 中的页码显示一个或其他信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 XSL-FO 创建 PDF.现在我有一个我只想在第一页上显示的标签,以及另一个我想在所有其他页面上显示的标签,例如

I'm using XSL-FO to create PDF's. Now I have a label that I want to display only on the first page, and another label that I want to display on all other pages, e.g.

Last month's balance

第 2 页 - n

Previous page's balance

整个 PDF 实际上只是一个简单的表格,因此这与位于数据之外的封面无关.我该怎么做?

The whole PDF is actually just a simple table, so this isn't about a cover page that stands outside of the data. How can I do it?

另见这个相关问题:如何在 XSL-FO 中的表格中总结每页的一些值?

推荐答案

这个可以使用 fo:marker 和 fo:retrieve-marker(来自 fo:static-content)来实现,或者借助 fo:page-sequence-master,为第一页 (@page-position="first") 和其他页面 (="rest") 提供不同的 fo:simple-page-master 条目.

This one can either be achieved using fo:marker and fo:retrieve-marker (from fo:static-content), or with the help of fo:page-sequence-master, that provides different fo:simple-page-master entries for the first page (@page-position="first") and other pages (="rest").

在后一种情况下,您需要以不同的方式命名不同简单页面母版上的静态区域,并在每个页面母版的 fo:page-sequence 中提供一个 fo:static-content.

In the latter case you would need to name static regions on different simple-page-masters differently, and provide an fo:static-content in the fo:page-sequence for each page master.

这篇关于如何根据 XSL-FO 中的页码显示一个或其他信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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