Subject: Re: [xsl] Strategies for complex page numbering in PDF's. From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Tue, 01 Feb 2011 18:17:47 -0500 |
I have a question about custom page numbering ("point pages") when creating a PDF. I'm using XSLT to create XSL-FO from an XML instance. My XSLT processor is Saxon 9 and my XSL-FO processor is RenderX (4.18).
What I need to do is be able to change the page numbering once it reaches a certain point. (The page number that is in the footer (static-content).)
Lets say I have a book that has multiple chapters in it. Each one of these chapters has a chapter number. This chapter number is what the page numbering is based on.
For example, if the chapter number is 2000, the first page of the chapter would be 2001.
This is fine up until the 998'th page (the chapter has to end on an even page). For example, if chapter 2000 had 1,002 pages the page numbering of the last 6 pages would be:
2997, 2998, 2999, 3000, 3001, 3002
This is incorrect since there might be a chapter 3000.
What I need to do is be able to change the page numbering after the 998'th page. Using my chapter 2000 with 1,002 pages example, the numbering should be:
2997, 2998, 2998.1, 2998.2, 2998.3, 2998.4.
This is what I'm doing now:
* I'm using <fo:page-number> in my fo:static-content.
* I'm setting the starting page number (chapter number + 1) using the initial-page-number attribute in the fo:page-sequence element.
If I have to I can manipulate the intermediate file that XEP (RenderX) creates,
but I think it could get messy and I'm not sure how reliable that would be.
Also, updating the Table of Contents would probably end up being a nightmare. (The intermediate file produced by XEP is the post-processed XSL-FO; it has the page numbers already generated.)
Does anyone have any suggestions on strategies I can use to accomplish this? I thought I read somewhere that I could use a maximum-repeats attribute in the page-sequence-master element (like maximum-repeats="998") and then use a different master page, but I have no idea how to do that.
-- Contact us for world-wide XML consulting & instructor-led training Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Strategies for complex page n, Dan Haley | Thread | Re: [xsl] Strategies for complex pa, Dan Haley |
[xsl] Strategies for complex page n, Dan Haley | Date | Re: [xsl] Strategies for complex pa, Tony Graham |
Month |