You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Wayne Elliott <wp...@iinet.net.au> on 2002/03/30 01:44:33 UTC
When a page is not a page
A picture paints a thousand words...
-----------------------------------
| ............... : .............. |
| ............... : .............. |
| ............... : .............. |
| ............... : .............. |
| ............... : .............. |
| ............... : .............. |
| ............... : .............. |
| ............... : .............. |
| ............... : .............. |
| ............... : .............. |
| ............... : .............. |
| ............... : .............. |
| 1 : 2 |
-----------------------------------
The picture above represents a single sheet of A4 (Letter)
paper. However it also represents two pages in a book, and
if the page is folded down the dotted line it even starts to
look like a book. My problem is this; I need the page number
sequence as displayed in the picture - ie. 2 pages per page (sheet)
I have no trouble laying out the text flow correctly using
stuff like
<fo:simple-page-master master-name="content"
page-height="{$pageheight}mm"
page-width="{$pagewidth}mm"
margin-left="{$marginleft}mm"
margin-right="{$marginright}mm"
margin-top="{$margintop}mm"
margin-bottom="{$marginbottom}mm">
<fo:region-before extent="10mm"/>
<fo:region-after extent="10mm"/>
<fo:region-body margin-top="10mm"
margin-bottom="10mm"
column-count="2"
column-gap="20mm"/>
</fo:simple-page-master>
and I defined a static region for the page number values
using the following
<fo:static-content flow-name="xsl-region-after"
font-family="serif"
font-size="9pt">
<fo:table table-layout="fixed">
<fo:table-column column-width="120mm"/>
<fo:table-column column-width="120mm"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block text-align="center">
<fo:page-number/> <!-- 2x -->
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="center">
<fo:page-number/> <!-- 2x + 1 -->
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:static-content>
but I do not know how to get the <fo:page-number/> to play
the game and give me more than one page number per page.
Perhaps I am wrong in my approach and there is a way of
specifying two page regions per page/sheet, but I have
not found it yet.
Any ideas?
WPE
Re: When a page is not a page
Posted by Tim Landscheidt <ti...@tim-landscheidt.de>.
Wayne Elliott <wp...@iinet.net.au> writes:
> [...]
> Perhaps I am wrong in my approach and there is a way of
> specifying two page regions per page/sheet, but I have
> not found it yet.
I would choose a totally different approach: Layout your
book with one page per page (:-)) and post-process the PDF
(oder Postscript) with another tool. For this particular
problem, there are many, very mature tools "ready to use".
You also gain the advantage that if you circulate the PDF
or Postscript file, the user can read your document "page
per page" and isn't irritated why the command "Go to page
#7" takes him to page #12.
Tim
Re: When a page is not a page
Posted by Wayne Elliott <wp...@iinet.net.au>.
Well here's the thing I guess. I think it is a significant
ommision that the FOP spec fails to supported paper that can
be folded, even if this sort of paper is no longer in vogue.
Still this is the case in point.
Now if I were in the business of making W3C recommendations
(i.e teaching my grandmother to suck eggs) I migght (at this
juncture in my infant learning curve) suggest
1) deprecating
<[fo:]page-number/>
in favour of
<[fo:]page-pseudo-number/>
or
<[fo:]page-not-really-a-number-just-pretending/>
2) reworking <[fo:]page-number/> to return (I don't know, maybe)
a _number_.
3) introduce fo:column-number, span-number, flow-number and
wing-number (which would all return _numbers_) - the latter
being most useful in annotating paper planes.
4) introducing
<[fo:]page-number-enhanced/>
which would include the more common use atrributes like
linear-function-to apply_to_number="2x-1"
<!-- for linear transformations - default = x -->
base-of-numeric-system="5"
<!-- for other numeber systems" default = 10 -->
angle-in-degrees-to rotate-number-by="90"
<!-- for people who read in bed -->
(Notice I have correctly avoided any hint of "terseness" in my
naming conventions.)
Can anyone think of any other useful enhancements?
Well I guess its back to the drawing board for now.
WPE (tongue in cheek)
P.S
How may FOP programmers does it take to change a lightbulb?
Only one, however please note that <fo:light-bulb> does not
actually return any light, but does a neat light shade.
----- Original Message -----
From: "Arved Sandstrom" <Ar...@chebucto.ns.ca>
To: <fo...@xml.apache.org>
Sent: Saturday, March 30, 2002 10:47 AM
Subject: RE: When a page is not a page
> Here is the thing. XSLT and XSL-FO are independent. XSL-FO has no more
> special meaning to XSLT than does MathML or DocBook or SVG. XSLT
understands
> its own elements (including extensions of course). It understands no
others.
>
> <fo:page-number/> (or as Ken Holman points out, <page-number/> in the
> http://www.w3.org/1999/XSL/Format namespace, since we may assign any
prefix
> we like, or none) is not acted on by the XSL-FO formatter to produce a
> number until after XSLT is done. Period.
>
> And note that <fo:page-number/> never actually _is_ a number, and in fact
> the formatter is not required to even generate a stringified page-number.
>
> This is what the XSL Recommendation allows or does not allow you to do. If
> you feel that there is a compelling use case for being able to do what you
> want to do, I'd suggest writing it up and submitting it to the
> www-xsl-fo@w3.org list.
>
> Hope this clears things up.
>
> Regards,
> Arved Sandstrom
>
> -----Original Message-----
> From: Wayne Elliott [mailto:wpe@iinet.net.au]
> Sent: March 29, 2002 10:15 PM
> To: fop-user@xml.apache.org
> Subject: Re: When a page is not a page
>
>
> Thanks for the tips guys. However <fo:page-number/> does
> not like being treated like a number, as it does not assign
> to a variable numerically. This was surprising. The following
> snippet
>
> <fo:block space-after="5mm" text-align="justify">
> - <fo:page-number/>
> - <xsl:variable name="curpage"><fo:page-number/></xsl:variable>
> <xsl:value-of select="$curpage"/>
> - <xsl:value-of select="$curpage * 2"/>
> - <xsl:value-of select="floor($curpage) * 2"/>
> - <xsl:value-of select="column-number"/>
> - <xsl:value-of select="(2 * $curpage) + 1"/>
> - <xsl:number/>
> </fo:block>
>
> produces the following output
>
> On page (sheet) 1.
>
> - 1 - - NaN - NaN - - NaN - 1
>
> On sheet 2.
>
> - 2 - - NaN - NaN - - NaN - 1
>
> i.e On sheet n.
>
> - n - - NaN - NaN - - NaN - 1
>
> Expected for sheet n was
>
> - n - n - 2n - 2n - 2n? - 2n+1- 1?
>
> Not sure why page-number behaves non-numerically. Perhaps it
> is something to do with the number formatting, e.g 1 = i = a
> etc. Perhaps there is a low level function that can extract
> the number part from fo:page-number?
>
> What I really need is a way of determining the number of the
> current column, based on column count and page number,but
> this also eludes me.
>
> WPE
>
> ----- Original Message -----
> From: "Matthew L. Avizinis" <ml...@gleim.com>
> To: <fo...@xml.apache.org>
> Sent: Saturday, March 30, 2002 9:42 AM
> Subject: RE: When a page is not a page
>
>
> > I believe this will not work as Wayne intends.
> > Page numbers will be generated sequentially starting with the
> > initial-page-number.
> > So, this might work better:
> >
> > <fo:page-sequence initial-page-number="0">
> >
> > then
> >
> > <xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
> >
> > then
> >
> > Then <xsl:value-of select="(2 * $currentpage) + 1"/> for the left page
> > number
> > and <xsl:value-of select="(2 * $currentpage) + 2"/> for the right page
> > number
> > hth,
> >
> > Matthew L. Avizinis <ma...@gleim.com>
> > Gleim Publications, Inc.
> > 4201 NW 95th Blvd.
> > Gainesville, FL 32606
> > (352)-375-0772 ext. 101
> > www.gleim.com <http://www.gleim.com>
> >
> >
> > > -----Original Message-----
> > > From: David Wood [mailto:obsidian@panix.com]
> > > Sent: Friday, March 29, 2002 8:03 PM
> > > To: fop-user@xml.apache.org; fop-user@xml.apache.org
> > > Subject: Re: When a page is not a page
> > >
> > >
> > > Just speculating, but have you tried putting the page-number
> > > element inside
> > > a variable?
> > >
> > > i.e.:
> > >
> > > <xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
> > >
> > > Then <xsl:value-of select="$currentpage * 2"/>, etc...
> > >
> > > I haven't tried this, but it's just what pops into my head...
> > >
> > > -David
> > >
> > > At 08:44 AM 3/30/2002 +0800, Wayne Elliott wrote:
> > > >A picture paints a thousand words...
> > > >
> > > > -----------------------------------
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | 1 : 2 |
> > > > -----------------------------------
> > > >
> > > >The picture above represents a single sheet of A4 (Letter)
> > > >paper. However it also represents two pages in a book, and
> > > >if the page is folded down the dotted line it even starts to
> > > >look like a book. My problem is this; I need the page number
> > > >sequence as displayed in the picture - ie. 2 pages per page (sheet)
> > > >
> > > >I have no trouble laying out the text flow correctly using
> > > >stuff like
> > > >
> > > > <fo:simple-page-master master-name="content"
> > > > page-height="{$pageheight}mm"
> > > > page-width="{$pagewidth}mm"
> > > > margin-left="{$marginleft}mm"
> > > > margin-right="{$marginright}mm"
> > > > margin-top="{$margintop}mm"
> > > > margin-bottom="{$marginbottom}mm">
> > > >
> > > > <fo:region-before extent="10mm"/>
> > > >
> > > > <fo:region-after extent="10mm"/>
> > > >
> > > >
> > > > <fo:region-body margin-top="10mm"
> > > > margin-bottom="10mm"
> > > > column-count="2"
> > > > column-gap="20mm"/>
> > > >
> > > >
> > > >
> > > > </fo:simple-page-master>
> > > >
> > > >and I defined a static region for the page number values
> > > >using the following
> > > >
> > > > <fo:static-content flow-name="xsl-region-after"
> > > > font-family="serif"
> > > > font-size="9pt">
> > > >
> > > > <fo:table table-layout="fixed">
> > > > <fo:table-column column-width="120mm"/>
> > > > <fo:table-column column-width="120mm"/>
> > > > <fo:table-body>
> > > > <fo:table-row>
> > > > <fo:table-cell>
> > > > <fo:block text-align="center">
> > > > <fo:page-number/> <!-- 2x -->
> > > > </fo:block>
> > > > </fo:table-cell>
> > > > <fo:table-cell>
> > > > <fo:block text-align="center">
> > > > <fo:page-number/> <!-- 2x + 1 -->
> > > > </fo:block>
> > > > </fo:table-cell>
> > > > </fo:table-row>
> > > > </fo:table-body>
> > > > </fo:table>
> > > >
> > > > </fo:static-content>
> > > >
> > > >but I do not know how to get the <fo:page-number/> to play
> > > >the game and give me more than one page number per page.
> > > >
> > > >Perhaps I am wrong in my approach and there is a way of
> > > >specifying two page regions per page/sheet, but I have
> > > >not found it yet.
> > > >
> > > >Any ideas?
> > > >
> > > >WPE
> >
> >
>
>
RE: When a page is not a page
Posted by "Matthew L. Avizinis" <ml...@gleim.com>.
Precisely. I thought I just said that. You're just more eloquent... :-)
> -----Original Message-----
> From: Arved Sandstrom [mailto:Arved_37@chebucto.ns.ca]
> Sent: Friday, March 29, 2002 9:48 PM
> To: fop-user@xml.apache.org
> Subject: RE: When a page is not a page
>
>
> Here is the thing. XSLT and XSL-FO are independent. XSL-FO has no more
> special meaning to XSLT than does MathML or DocBook or SVG. XSLT
> understands
> its own elements (including extensions of course). It understands
> no others.
>
> <fo:page-number/> (or as Ken Holman points out, <page-number/> in the
> http://www.w3.org/1999/XSL/Format namespace, since we may assign
> any prefix
> we like, or none) is not acted on by the XSL-FO formatter to produce a
> number until after XSLT is done. Period.
>
> And note that <fo:page-number/> never actually _is_ a number, and in fact
> the formatter is not required to even generate a stringified page-number.
>
> This is what the XSL Recommendation allows or does not allow you to do. If
> you feel that there is a compelling use case for being able to do what you
> want to do, I'd suggest writing it up and submitting it to the
> www-xsl-fo@w3.org list.
>
> Hope this clears things up.
>
> Regards,
> Arved Sandstrom
>
> -----Original Message-----
> From: Wayne Elliott [mailto:wpe@iinet.net.au]
> Sent: March 29, 2002 10:15 PM
> To: fop-user@xml.apache.org
> Subject: Re: When a page is not a page
>
>
> Thanks for the tips guys. However <fo:page-number/> does
> not like being treated like a number, as it does not assign
> to a variable numerically. This was surprising. The following
> snippet
>
> <fo:block space-after="5mm" text-align="justify">
> - <fo:page-number/>
> - <xsl:variable name="curpage"><fo:page-number/></xsl:variable>
> <xsl:value-of select="$curpage"/>
> - <xsl:value-of select="$curpage * 2"/>
> - <xsl:value-of select="floor($curpage) * 2"/>
> - <xsl:value-of select="column-number"/>
> - <xsl:value-of select="(2 * $curpage) + 1"/>
> - <xsl:number/>
> </fo:block>
>
> produces the following output
>
> On page (sheet) 1.
>
> - 1 - - NaN - NaN - - NaN - 1
>
> On sheet 2.
>
> - 2 - - NaN - NaN - - NaN - 1
>
> i.e On sheet n.
>
> - n - - NaN - NaN - - NaN - 1
>
> Expected for sheet n was
>
> - n - n - 2n - 2n - 2n? - 2n+1- 1?
>
> Not sure why page-number behaves non-numerically. Perhaps it
> is something to do with the number formatting, e.g 1 = i = a
> etc. Perhaps there is a low level function that can extract
> the number part from fo:page-number?
>
> What I really need is a way of determining the number of the
> current column, based on column count and page number,but
> this also eludes me.
>
> WPE
>
> ----- Original Message -----
> From: "Matthew L. Avizinis" <ml...@gleim.com>
> To: <fo...@xml.apache.org>
> Sent: Saturday, March 30, 2002 9:42 AM
> Subject: RE: When a page is not a page
>
>
> > I believe this will not work as Wayne intends.
> > Page numbers will be generated sequentially starting with the
> > initial-page-number.
> > So, this might work better:
> >
> > <fo:page-sequence initial-page-number="0">
> >
> > then
> >
> > <xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
> >
> > then
> >
> > Then <xsl:value-of select="(2 * $currentpage) + 1"/> for the left page
> > number
> > and <xsl:value-of select="(2 * $currentpage) + 2"/> for the right page
> > number
> > hth,
> >
> > Matthew L. Avizinis <ma...@gleim.com>
> > Gleim Publications, Inc.
> > 4201 NW 95th Blvd.
> > Gainesville, FL 32606
> > (352)-375-0772 ext. 101
> > www.gleim.com <http://www.gleim.com>
> >
> >
> > > -----Original Message-----
> > > From: David Wood [mailto:obsidian@panix.com]
> > > Sent: Friday, March 29, 2002 8:03 PM
> > > To: fop-user@xml.apache.org; fop-user@xml.apache.org
> > > Subject: Re: When a page is not a page
> > >
> > >
> > > Just speculating, but have you tried putting the page-number
> > > element inside
> > > a variable?
> > >
> > > i.e.:
> > >
> > > <xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
> > >
> > > Then <xsl:value-of select="$currentpage * 2"/>, etc...
> > >
> > > I haven't tried this, but it's just what pops into my head...
> > >
> > > -David
> > >
> > > At 08:44 AM 3/30/2002 +0800, Wayne Elliott wrote:
> > > >A picture paints a thousand words...
> > > >
> > > > -----------------------------------
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | ............... : .............. |
> > > > | 1 : 2 |
> > > > -----------------------------------
> > > >
> > > >The picture above represents a single sheet of A4 (Letter)
> > > >paper. However it also represents two pages in a book, and
> > > >if the page is folded down the dotted line it even starts to
> > > >look like a book. My problem is this; I need the page number
> > > >sequence as displayed in the picture - ie. 2 pages per page (sheet)
> > > >
> > > >I have no trouble laying out the text flow correctly using
> > > >stuff like
> > > >
> > > > <fo:simple-page-master master-name="content"
> > > > page-height="{$pageheight}mm"
> > > > page-width="{$pagewidth}mm"
> > > > margin-left="{$marginleft}mm"
> > > > margin-right="{$marginright}mm"
> > > > margin-top="{$margintop}mm"
> > > > margin-bottom="{$marginbottom}mm">
> > > >
> > > > <fo:region-before extent="10mm"/>
> > > >
> > > > <fo:region-after extent="10mm"/>
> > > >
> > > >
> > > > <fo:region-body margin-top="10mm"
> > > > margin-bottom="10mm"
> > > > column-count="2"
> > > > column-gap="20mm"/>
> > > >
> > > >
> > > >
> > > > </fo:simple-page-master>
> > > >
> > > >and I defined a static region for the page number values
> > > >using the following
> > > >
> > > > <fo:static-content flow-name="xsl-region-after"
> > > > font-family="serif"
> > > > font-size="9pt">
> > > >
> > > > <fo:table table-layout="fixed">
> > > > <fo:table-column column-width="120mm"/>
> > > > <fo:table-column column-width="120mm"/>
> > > > <fo:table-body>
> > > > <fo:table-row>
> > > > <fo:table-cell>
> > > > <fo:block text-align="center">
> > > > <fo:page-number/> <!-- 2x -->
> > > > </fo:block>
> > > > </fo:table-cell>
> > > > <fo:table-cell>
> > > > <fo:block text-align="center">
> > > > <fo:page-number/> <!-- 2x + 1 -->
> > > > </fo:block>
> > > > </fo:table-cell>
> > > > </fo:table-row>
> > > > </fo:table-body>
> > > > </fo:table>
> > > >
> > > > </fo:static-content>
> > > >
> > > >but I do not know how to get the <fo:page-number/> to play
> > > >the game and give me more than one page number per page.
> > > >
> > > >Perhaps I am wrong in my approach and there is a way of
> > > >specifying two page regions per page/sheet, but I have
> > > >not found it yet.
> > > >
> > > >Any ideas?
> > > >
> > > >WPE
> >
> >
RE: When a page is not a page
Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
Here is the thing. XSLT and XSL-FO are independent. XSL-FO has no more
special meaning to XSLT than does MathML or DocBook or SVG. XSLT understands
its own elements (including extensions of course). It understands no others.
<fo:page-number/> (or as Ken Holman points out, <page-number/> in the
http://www.w3.org/1999/XSL/Format namespace, since we may assign any prefix
we like, or none) is not acted on by the XSL-FO formatter to produce a
number until after XSLT is done. Period.
And note that <fo:page-number/> never actually _is_ a number, and in fact
the formatter is not required to even generate a stringified page-number.
This is what the XSL Recommendation allows or does not allow you to do. If
you feel that there is a compelling use case for being able to do what you
want to do, I'd suggest writing it up and submitting it to the
www-xsl-fo@w3.org list.
Hope this clears things up.
Regards,
Arved Sandstrom
-----Original Message-----
From: Wayne Elliott [mailto:wpe@iinet.net.au]
Sent: March 29, 2002 10:15 PM
To: fop-user@xml.apache.org
Subject: Re: When a page is not a page
Thanks for the tips guys. However <fo:page-number/> does
not like being treated like a number, as it does not assign
to a variable numerically. This was surprising. The following
snippet
<fo:block space-after="5mm" text-align="justify">
- <fo:page-number/>
- <xsl:variable name="curpage"><fo:page-number/></xsl:variable>
<xsl:value-of select="$curpage"/>
- <xsl:value-of select="$curpage * 2"/>
- <xsl:value-of select="floor($curpage) * 2"/>
- <xsl:value-of select="column-number"/>
- <xsl:value-of select="(2 * $curpage) + 1"/>
- <xsl:number/>
</fo:block>
produces the following output
On page (sheet) 1.
- 1 - - NaN - NaN - - NaN - 1
On sheet 2.
- 2 - - NaN - NaN - - NaN - 1
i.e On sheet n.
- n - - NaN - NaN - - NaN - 1
Expected for sheet n was
- n - n - 2n - 2n - 2n? - 2n+1- 1?
Not sure why page-number behaves non-numerically. Perhaps it
is something to do with the number formatting, e.g 1 = i = a
etc. Perhaps there is a low level function that can extract
the number part from fo:page-number?
What I really need is a way of determining the number of the
current column, based on column count and page number,but
this also eludes me.
WPE
----- Original Message -----
From: "Matthew L. Avizinis" <ml...@gleim.com>
To: <fo...@xml.apache.org>
Sent: Saturday, March 30, 2002 9:42 AM
Subject: RE: When a page is not a page
> I believe this will not work as Wayne intends.
> Page numbers will be generated sequentially starting with the
> initial-page-number.
> So, this might work better:
>
> <fo:page-sequence initial-page-number="0">
>
> then
>
> <xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
>
> then
>
> Then <xsl:value-of select="(2 * $currentpage) + 1"/> for the left page
> number
> and <xsl:value-of select="(2 * $currentpage) + 2"/> for the right page
> number
> hth,
>
> Matthew L. Avizinis <ma...@gleim.com>
> Gleim Publications, Inc.
> 4201 NW 95th Blvd.
> Gainesville, FL 32606
> (352)-375-0772 ext. 101
> www.gleim.com <http://www.gleim.com>
>
>
> > -----Original Message-----
> > From: David Wood [mailto:obsidian@panix.com]
> > Sent: Friday, March 29, 2002 8:03 PM
> > To: fop-user@xml.apache.org; fop-user@xml.apache.org
> > Subject: Re: When a page is not a page
> >
> >
> > Just speculating, but have you tried putting the page-number
> > element inside
> > a variable?
> >
> > i.e.:
> >
> > <xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
> >
> > Then <xsl:value-of select="$currentpage * 2"/>, etc...
> >
> > I haven't tried this, but it's just what pops into my head...
> >
> > -David
> >
> > At 08:44 AM 3/30/2002 +0800, Wayne Elliott wrote:
> > >A picture paints a thousand words...
> > >
> > > -----------------------------------
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | 1 : 2 |
> > > -----------------------------------
> > >
> > >The picture above represents a single sheet of A4 (Letter)
> > >paper. However it also represents two pages in a book, and
> > >if the page is folded down the dotted line it even starts to
> > >look like a book. My problem is this; I need the page number
> > >sequence as displayed in the picture - ie. 2 pages per page (sheet)
> > >
> > >I have no trouble laying out the text flow correctly using
> > >stuff like
> > >
> > > <fo:simple-page-master master-name="content"
> > > page-height="{$pageheight}mm"
> > > page-width="{$pagewidth}mm"
> > > margin-left="{$marginleft}mm"
> > > margin-right="{$marginright}mm"
> > > margin-top="{$margintop}mm"
> > > margin-bottom="{$marginbottom}mm">
> > >
> > > <fo:region-before extent="10mm"/>
> > >
> > > <fo:region-after extent="10mm"/>
> > >
> > >
> > > <fo:region-body margin-top="10mm"
> > > margin-bottom="10mm"
> > > column-count="2"
> > > column-gap="20mm"/>
> > >
> > >
> > >
> > > </fo:simple-page-master>
> > >
> > >and I defined a static region for the page number values
> > >using the following
> > >
> > > <fo:static-content flow-name="xsl-region-after"
> > > font-family="serif"
> > > font-size="9pt">
> > >
> > > <fo:table table-layout="fixed">
> > > <fo:table-column column-width="120mm"/>
> > > <fo:table-column column-width="120mm"/>
> > > <fo:table-body>
> > > <fo:table-row>
> > > <fo:table-cell>
> > > <fo:block text-align="center">
> > > <fo:page-number/> <!-- 2x -->
> > > </fo:block>
> > > </fo:table-cell>
> > > <fo:table-cell>
> > > <fo:block text-align="center">
> > > <fo:page-number/> <!-- 2x + 1 -->
> > > </fo:block>
> > > </fo:table-cell>
> > > </fo:table-row>
> > > </fo:table-body>
> > > </fo:table>
> > >
> > > </fo:static-content>
> > >
> > >but I do not know how to get the <fo:page-number/> to play
> > >the game and give me more than one page number per page.
> > >
> > >Perhaps I am wrong in my approach and there is a way of
> > >specifying two page regions per page/sheet, but I have
> > >not found it yet.
> > >
> > >Any ideas?
> > >
> > >WPE
>
>
Re: When a page is not a page
Posted by Wayne Elliott <wp...@iinet.net.au>.
Thanks for the tips guys. However <fo:page-number/> does
not like being treated like a number, as it does not assign
to a variable numerically. This was surprising. The following
snippet
<fo:block space-after="5mm" text-align="justify">
- <fo:page-number/>
- <xsl:variable name="curpage"><fo:page-number/></xsl:variable>
<xsl:value-of select="$curpage"/>
- <xsl:value-of select="$curpage * 2"/>
- <xsl:value-of select="floor($curpage) * 2"/>
- <xsl:value-of select="column-number"/>
- <xsl:value-of select="(2 * $curpage) + 1"/>
- <xsl:number/>
</fo:block>
produces the following output
On page (sheet) 1.
- 1 - - NaN - NaN - - NaN - 1
On sheet 2.
- 2 - - NaN - NaN - - NaN - 1
i.e On sheet n.
- n - - NaN - NaN - - NaN - 1
Expected for sheet n was
- n - n - 2n - 2n - 2n? - 2n+1- 1?
Not sure why page-number behaves non-numerically. Perhaps it
is something to do with the number formatting, e.g 1 = i = a
etc. Perhaps there is a low level function that can extract
the number part from fo:page-number?
What I really need is a way of determining the number of the
current column, based on column count and page number,but
this also eludes me.
WPE
----- Original Message -----
From: "Matthew L. Avizinis" <ml...@gleim.com>
To: <fo...@xml.apache.org>
Sent: Saturday, March 30, 2002 9:42 AM
Subject: RE: When a page is not a page
> I believe this will not work as Wayne intends.
> Page numbers will be generated sequentially starting with the
> initial-page-number.
> So, this might work better:
>
> <fo:page-sequence initial-page-number="0">
>
> then
>
> <xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
>
> then
>
> Then <xsl:value-of select="(2 * $currentpage) + 1"/> for the left page
> number
> and <xsl:value-of select="(2 * $currentpage) + 2"/> for the right page
> number
> hth,
>
> Matthew L. Avizinis <ma...@gleim.com>
> Gleim Publications, Inc.
> 4201 NW 95th Blvd.
> Gainesville, FL 32606
> (352)-375-0772 ext. 101
> www.gleim.com <http://www.gleim.com>
>
>
> > -----Original Message-----
> > From: David Wood [mailto:obsidian@panix.com]
> > Sent: Friday, March 29, 2002 8:03 PM
> > To: fop-user@xml.apache.org; fop-user@xml.apache.org
> > Subject: Re: When a page is not a page
> >
> >
> > Just speculating, but have you tried putting the page-number
> > element inside
> > a variable?
> >
> > i.e.:
> >
> > <xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
> >
> > Then <xsl:value-of select="$currentpage * 2"/>, etc...
> >
> > I haven't tried this, but it's just what pops into my head...
> >
> > -David
> >
> > At 08:44 AM 3/30/2002 +0800, Wayne Elliott wrote:
> > >A picture paints a thousand words...
> > >
> > > -----------------------------------
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | 1 : 2 |
> > > -----------------------------------
> > >
> > >The picture above represents a single sheet of A4 (Letter)
> > >paper. However it also represents two pages in a book, and
> > >if the page is folded down the dotted line it even starts to
> > >look like a book. My problem is this; I need the page number
> > >sequence as displayed in the picture - ie. 2 pages per page (sheet)
> > >
> > >I have no trouble laying out the text flow correctly using
> > >stuff like
> > >
> > > <fo:simple-page-master master-name="content"
> > > page-height="{$pageheight}mm"
> > > page-width="{$pagewidth}mm"
> > > margin-left="{$marginleft}mm"
> > > margin-right="{$marginright}mm"
> > > margin-top="{$margintop}mm"
> > > margin-bottom="{$marginbottom}mm">
> > >
> > > <fo:region-before extent="10mm"/>
> > >
> > > <fo:region-after extent="10mm"/>
> > >
> > >
> > > <fo:region-body margin-top="10mm"
> > > margin-bottom="10mm"
> > > column-count="2"
> > > column-gap="20mm"/>
> > >
> > >
> > >
> > > </fo:simple-page-master>
> > >
> > >and I defined a static region for the page number values
> > >using the following
> > >
> > > <fo:static-content flow-name="xsl-region-after"
> > > font-family="serif"
> > > font-size="9pt">
> > >
> > > <fo:table table-layout="fixed">
> > > <fo:table-column column-width="120mm"/>
> > > <fo:table-column column-width="120mm"/>
> > > <fo:table-body>
> > > <fo:table-row>
> > > <fo:table-cell>
> > > <fo:block text-align="center">
> > > <fo:page-number/> <!-- 2x -->
> > > </fo:block>
> > > </fo:table-cell>
> > > <fo:table-cell>
> > > <fo:block text-align="center">
> > > <fo:page-number/> <!-- 2x + 1 -->
> > > </fo:block>
> > > </fo:table-cell>
> > > </fo:table-row>
> > > </fo:table-body>
> > > </fo:table>
> > >
> > > </fo:static-content>
> > >
> > >but I do not know how to get the <fo:page-number/> to play
> > >the game and give me more than one page number per page.
> > >
> > >Perhaps I am wrong in my approach and there is a way of
> > >specifying two page regions per page/sheet, but I have
> > >not found it yet.
> > >
> > >Any ideas?
> > >
> > >WPE
>
>
Re: When a page is not a page
Posted by Patrick Andries <pa...@videotron.ca>.
What is the status of the orphan and widow control?
If this is not yet implemented, have we got any timeline? How complex
could it be to implement for a seasoned developer (in man days)? When is
the next release of FOP scheduled?
Thanks
Patrick
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: When a page is not a page
Posted by Patrick Andries <pa...@videotron.ca>.
What is the status of the orphan and widow control?
If this is not yet implemented, have we got any timeline? How complex
could it be to implement for a seasoned developer (in man days)? When is
the next release of FOP scheduled?
Thanks
Patrick
RE: When a page is not a page
Posted by "Matthew L. Avizinis" <ml...@gleim.com>.
Right. So, you'll end up with NaN, which is what I get when I attempted
this before brain was engaged.
> -----Original Message-----
> From: J.Pietschmann [mailto:j3322ptm@yahoo.de]
> Sent: Sunday, March 31, 2002 5:40 AM
> To: fop-user@xml.apache.org
> Subject: Re: When a page is not a page
>
>
> Matthew L. Avizinis wrote:
> > Nope. Neither will work. Sorry. That's what I get for speaking b4
> > thinking.
> > Where's the variable going to get it's value from? Certainly
> not from the
> > <fo:page-number> instruction -- that's for the FOP processor to
> use not the
> > XSLT processor. You'll get NaN.
>
> No. The value is an RTF with a fo:page-number element as
> its only node below the root.
>
> J.Pietschmann
Re: When a page is not a page
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Matthew L. Avizinis wrote:
> Nope. Neither will work. Sorry. That's what I get for speaking b4
> thinking.
> Where's the variable going to get it's value from? Certainly not from the
> <fo:page-number> instruction -- that's for the FOP processor to use not the
> XSLT processor. You'll get NaN.
No. The value is an RTF with a fo:page-number element as
its only node below the root.
J.Pietschmann
RE: When a page is not a page
Posted by "Matthew L. Avizinis" <ml...@gleim.com>.
Nope. Neither will work. Sorry. That's what I get for speaking b4
thinking.
Where's the variable going to get it's value from? Certainly not from the
<fo:page-number> instruction -- that's for the FOP processor to use not the
XSLT processor. You'll get NaN.
> -----Original Message-----
> From: Matthew L. Avizinis [mailto:mla@gleim.com]
> Sent: Friday, March 29, 2002 8:43 PM
> To: fop-user@xml.apache.org
> Subject: RE: When a page is not a page
>
>
> I believe this will not work as Wayne intends.
> Page numbers will be generated sequentially starting with the
> initial-page-number.
> So, this might work better:
>
> <fo:page-sequence initial-page-number="0">
>
> then
>
> <xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
>
> then
>
> Then <xsl:value-of select="(2 * $currentpage) + 1"/> for the left page
> number
> and <xsl:value-of select="(2 * $currentpage) + 2"/> for the right page
> number
> hth,
>
> Matthew L. Avizinis <ma...@gleim.com>
> Gleim Publications, Inc.
> 4201 NW 95th Blvd.
> Gainesville, FL 32606
> (352)-375-0772 ext. 101
> www.gleim.com <http://www.gleim.com>
>
>
> > -----Original Message-----
> > From: David Wood [mailto:obsidian@panix.com]
> > Sent: Friday, March 29, 2002 8:03 PM
> > To: fop-user@xml.apache.org; fop-user@xml.apache.org
> > Subject: Re: When a page is not a page
> >
> >
> > Just speculating, but have you tried putting the page-number
> > element inside
> > a variable?
> >
> > i.e.:
> >
> > <xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
> >
> > Then <xsl:value-of select="$currentpage * 2"/>, etc...
> >
> > I haven't tried this, but it's just what pops into my head...
> >
> > -David
> >
> > At 08:44 AM 3/30/2002 +0800, Wayne Elliott wrote:
> > >A picture paints a thousand words...
> > >
> > > -----------------------------------
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | ............... : .............. |
> > > | 1 : 2 |
> > > -----------------------------------
> > >
> > >The picture above represents a single sheet of A4 (Letter)
> > >paper. However it also represents two pages in a book, and
> > >if the page is folded down the dotted line it even starts to
> > >look like a book. My problem is this; I need the page number
> > >sequence as displayed in the picture - ie. 2 pages per page (sheet)
> > >
> > >I have no trouble laying out the text flow correctly using
> > >stuff like
> > >
> > > <fo:simple-page-master master-name="content"
> > > page-height="{$pageheight}mm"
> > > page-width="{$pagewidth}mm"
> > > margin-left="{$marginleft}mm"
> > > margin-right="{$marginright}mm"
> > > margin-top="{$margintop}mm"
> > > margin-bottom="{$marginbottom}mm">
> > >
> > > <fo:region-before extent="10mm"/>
> > >
> > > <fo:region-after extent="10mm"/>
> > >
> > >
> > > <fo:region-body margin-top="10mm"
> > > margin-bottom="10mm"
> > > column-count="2"
> > > column-gap="20mm"/>
> > >
> > >
> > >
> > > </fo:simple-page-master>
> > >
> > >and I defined a static region for the page number values
> > >using the following
> > >
> > > <fo:static-content flow-name="xsl-region-after"
> > > font-family="serif"
> > > font-size="9pt">
> > >
> > > <fo:table table-layout="fixed">
> > > <fo:table-column column-width="120mm"/>
> > > <fo:table-column column-width="120mm"/>
> > > <fo:table-body>
> > > <fo:table-row>
> > > <fo:table-cell>
> > > <fo:block text-align="center">
> > > <fo:page-number/> <!-- 2x -->
> > > </fo:block>
> > > </fo:table-cell>
> > > <fo:table-cell>
> > > <fo:block text-align="center">
> > > <fo:page-number/> <!-- 2x + 1 -->
> > > </fo:block>
> > > </fo:table-cell>
> > > </fo:table-row>
> > > </fo:table-body>
> > > </fo:table>
> > >
> > > </fo:static-content>
> > >
> > >but I do not know how to get the <fo:page-number/> to play
> > >the game and give me more than one page number per page.
> > >
> > >Perhaps I am wrong in my approach and there is a way of
> > >specifying two page regions per page/sheet, but I have
> > >not found it yet.
> > >
> > >Any ideas?
> > >
> > >WPE
RE: When a page is not a page
Posted by "Matthew L. Avizinis" <ml...@gleim.com>.
I believe this will not work as Wayne intends.
Page numbers will be generated sequentially starting with the
initial-page-number.
So, this might work better:
<fo:page-sequence initial-page-number="0">
then
<xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
then
Then <xsl:value-of select="(2 * $currentpage) + 1"/> for the left page
number
and <xsl:value-of select="(2 * $currentpage) + 2"/> for the right page
number
hth,
Matthew L. Avizinis <ma...@gleim.com>
Gleim Publications, Inc.
4201 NW 95th Blvd.
Gainesville, FL 32606
(352)-375-0772 ext. 101
www.gleim.com <http://www.gleim.com>
> -----Original Message-----
> From: David Wood [mailto:obsidian@panix.com]
> Sent: Friday, March 29, 2002 8:03 PM
> To: fop-user@xml.apache.org; fop-user@xml.apache.org
> Subject: Re: When a page is not a page
>
>
> Just speculating, but have you tried putting the page-number
> element inside
> a variable?
>
> i.e.:
>
> <xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
>
> Then <xsl:value-of select="$currentpage * 2"/>, etc...
>
> I haven't tried this, but it's just what pops into my head...
>
> -David
>
> At 08:44 AM 3/30/2002 +0800, Wayne Elliott wrote:
> >A picture paints a thousand words...
> >
> > -----------------------------------
> > | ............... : .............. |
> > | ............... : .............. |
> > | ............... : .............. |
> > | ............... : .............. |
> > | ............... : .............. |
> > | ............... : .............. |
> > | ............... : .............. |
> > | ............... : .............. |
> > | ............... : .............. |
> > | ............... : .............. |
> > | ............... : .............. |
> > | ............... : .............. |
> > | 1 : 2 |
> > -----------------------------------
> >
> >The picture above represents a single sheet of A4 (Letter)
> >paper. However it also represents two pages in a book, and
> >if the page is folded down the dotted line it even starts to
> >look like a book. My problem is this; I need the page number
> >sequence as displayed in the picture - ie. 2 pages per page (sheet)
> >
> >I have no trouble laying out the text flow correctly using
> >stuff like
> >
> > <fo:simple-page-master master-name="content"
> > page-height="{$pageheight}mm"
> > page-width="{$pagewidth}mm"
> > margin-left="{$marginleft}mm"
> > margin-right="{$marginright}mm"
> > margin-top="{$margintop}mm"
> > margin-bottom="{$marginbottom}mm">
> >
> > <fo:region-before extent="10mm"/>
> >
> > <fo:region-after extent="10mm"/>
> >
> >
> > <fo:region-body margin-top="10mm"
> > margin-bottom="10mm"
> > column-count="2"
> > column-gap="20mm"/>
> >
> >
> >
> > </fo:simple-page-master>
> >
> >and I defined a static region for the page number values
> >using the following
> >
> > <fo:static-content flow-name="xsl-region-after"
> > font-family="serif"
> > font-size="9pt">
> >
> > <fo:table table-layout="fixed">
> > <fo:table-column column-width="120mm"/>
> > <fo:table-column column-width="120mm"/>
> > <fo:table-body>
> > <fo:table-row>
> > <fo:table-cell>
> > <fo:block text-align="center">
> > <fo:page-number/> <!-- 2x -->
> > </fo:block>
> > </fo:table-cell>
> > <fo:table-cell>
> > <fo:block text-align="center">
> > <fo:page-number/> <!-- 2x + 1 -->
> > </fo:block>
> > </fo:table-cell>
> > </fo:table-row>
> > </fo:table-body>
> > </fo:table>
> >
> > </fo:static-content>
> >
> >but I do not know how to get the <fo:page-number/> to play
> >the game and give me more than one page number per page.
> >
> >Perhaps I am wrong in my approach and there is a way of
> >specifying two page regions per page/sheet, but I have
> >not found it yet.
> >
> >Any ideas?
> >
> >WPE
Re: When a page is not a page
Posted by David Wood <ob...@panix.com>.
Just speculating, but have you tried putting the page-number element inside
a variable?
i.e.:
<xsl:variable name="currentpage"><fo:page-number/></xsl:variable>
Then <xsl:value-of select="$currentpage * 2"/>, etc...
I haven't tried this, but it's just what pops into my head...
-David
At 08:44 AM 3/30/2002 +0800, Wayne Elliott wrote:
>A picture paints a thousand words...
>
> -----------------------------------
> | ............... : .............. |
> | ............... : .............. |
> | ............... : .............. |
> | ............... : .............. |
> | ............... : .............. |
> | ............... : .............. |
> | ............... : .............. |
> | ............... : .............. |
> | ............... : .............. |
> | ............... : .............. |
> | ............... : .............. |
> | ............... : .............. |
> | 1 : 2 |
> -----------------------------------
>
>The picture above represents a single sheet of A4 (Letter)
>paper. However it also represents two pages in a book, and
>if the page is folded down the dotted line it even starts to
>look like a book. My problem is this; I need the page number
>sequence as displayed in the picture - ie. 2 pages per page (sheet)
>
>I have no trouble laying out the text flow correctly using
>stuff like
>
> <fo:simple-page-master master-name="content"
> page-height="{$pageheight}mm"
> page-width="{$pagewidth}mm"
> margin-left="{$marginleft}mm"
> margin-right="{$marginright}mm"
> margin-top="{$margintop}mm"
> margin-bottom="{$marginbottom}mm">
>
> <fo:region-before extent="10mm"/>
>
> <fo:region-after extent="10mm"/>
>
>
> <fo:region-body margin-top="10mm"
> margin-bottom="10mm"
> column-count="2"
> column-gap="20mm"/>
>
>
>
> </fo:simple-page-master>
>
>and I defined a static region for the page number values
>using the following
>
> <fo:static-content flow-name="xsl-region-after"
> font-family="serif"
> font-size="9pt">
>
> <fo:table table-layout="fixed">
> <fo:table-column column-width="120mm"/>
> <fo:table-column column-width="120mm"/>
> <fo:table-body>
> <fo:table-row>
> <fo:table-cell>
> <fo:block text-align="center">
> <fo:page-number/> <!-- 2x -->
> </fo:block>
> </fo:table-cell>
> <fo:table-cell>
> <fo:block text-align="center">
> <fo:page-number/> <!-- 2x + 1 -->
> </fo:block>
> </fo:table-cell>
> </fo:table-row>
> </fo:table-body>
> </fo:table>
>
> </fo:static-content>
>
>but I do not know how to get the <fo:page-number/> to play
>the game and give me more than one page number per page.
>
>Perhaps I am wrong in my approach and there is a way of
>specifying two page regions per page/sheet, but I have
>not found it yet.
>
>Any ideas?
>
>WPE