Subject: RE: page numbers and fo From: Sebastian Rahtz <sebastian.rahtz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 2 Jun 2000 11:59:26 +0100 (BST) |
Pawson, David writes: > Taking the wet towel off, > That would give me no page number on the first page. > fine for onepagers > bust for two pagers, which require page number on first page also? > Set up the page sequence to use a numbered page master for the first page. Consider the worked example that follows (everyone else can hit Delete at this point if they dont want to read lines of XSL FO). If you, or any XSL FO guru, spots an error, PLEASE tell me. I spent a long time on this, and I want it to be right. Sebastian <fo:layout-master-set> * first define 3 page master, simple1, left1 and right1 <fo:simple-page-master master-name="simple1" page-width="211mm" page-height="297mm" margin-top="75pt" margin-bottom="100pt" margin-left="80pt" margin-right="150pt"> <fo:region-body margin-bottom="24pt" margin-top="24pt" /> <fo:region-after extent="25pt" /> <fo:region-before extent="25pt" /> </fo:simple-page-master> * note that we explicitly name the regions in here, so that we can * assign static content properly later <fo:simple-page-master master-name="left1" page-width="211mm" page-height="297mm" margin-top="75pt" margin-bottom="100pt" margin-left="80pt" margin-right="150pt"> <fo:region-body margin-bottom="24pt" margin-top="24pt" /> <fo:region-after region-name="xsl-region-after-left" extent="25pt" /> <fo:region-before region-name="xsl-region-before-left" extent="25pt" /> </fo:simple-page-master> <fo:simple-page-master master-name="right1" page-width="211mm" page-height="297mm" margin-top="75pt" margin-bottom="100pt" margin-left="80pt" margin-right="150pt"> <fo:region-body margin-bottom="24pt" margin-top="24pt" /> <fo:region-after region-name="xsl-region-after-right" extent="25pt" /> <fo:region-before region-name="xsl-region-before-right" extent="25pt" /> </fo:simple-page-master> * OK, now define some page master sequences. first, a twosided one, * where we alternate left and right masters depending on odd-or-even <fo:page-sequence-master master-name="twoside1"> <fo:repeatable-page-master-alternatives> <fo:conditional-page-master-reference master-name="first1" page-position="first" /> <fo:conditional-page-master-reference master-name="right1" odd-or-even="odd" /> <fo:conditional-page-master-reference master-name="left1" odd-or-even="even" /> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> * now a one-sided version, where we use the "simple1" master for all * but the first page <fo:page-sequence-master master-name="oneside1"> <fo:repeatable-page-master-alternatives> <fo:conditional-page-master-reference master-name="first1" page-position="first" /> <fo:conditional-page-master-reference master-name="simple1" /> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> Got that straight? anyone else read that far? Now we can actually *use* these beasts, eg the following starts a new page sequence in twosided mode with appropriate static content for left and right <fo:page-sequence hyphenate="true" language="US" initial-page-number="1" master-name="twoside1"> <fo:static-content flow-name="xsl-region-after-right"> <fo:block text-align="end" font-size="10pt"> <fo:page-number /> </fo:block> </fo:static-content> <fo:static-content flow-name="xsl-region-after-left"> <fo:block text-align="justify" font-size="10pt"> <fo:page-number /> <fo:leader rule-thickness="0pt" /> </fo:block> </fo:static-content> <fo:static-content flow-name="xsl-region-before-right"> <fo:block text-align="center" font-size="10pt"> TEI Lite: An Introduction to Text Encoding for Interchange</fo:block> </fo:static-content> <fo:static-content flow-name="xsl-region-before-left"> <fo:block text-align="center" font-size="10pt">Lou Burnard and C. M. Sperberg-McQueen</fo:block> </fo:static-content> <fo:static-content flow-name="xsl-region-before-first" /> <fo:static-content flow-name="xsl-region-after-first"> <fo:block font-size="10pt"> <fo:leader text-align="center" rule-thickness="0pt" /> <fo:page-number /> </fo:block> </fo:static-content> <fo:flow flow-name="xsl-region-body" font-family="Times Roman" font-size="10pt">...</fo:flow> </fo:page-sequence> Did someone say that XSL FO was wordy? Of course, don't bother to try the above in FOP or XEP, cos they don't implement this version of the language :-} Sebastian XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: page numbers and fo, Pawson, David | Thread | RE: page numbers and fo, Pawson, David |
RE: Automatic Omnimark to XSLT conv, Pawson, David | Date | RE: XSL Performance, Kay Michael |
Month |