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 Sonja Löhr <so...@arcor.de> on 2005/08/23 13:08:53 UTC
(re:) pagination and width=100%
Hi!
Some days ago we talked about the problem of wrong computation of
table-widths if a break between two pages occurs and the region-bodies (or
column-widths) of these to pages differ in width.
I use something like the following to keep the headline and first paragraph
of an article together. Actually, it is a bit more complicated because not
only "p"s may occur first, but that shouldn't make a difference.
<xsl:template match="article">
<!-- Headline and first paragraph -->
<fo:block font-size="11pt" space-after="0.6cm" >
<fo:table table-layout="fixed" width="100%">
<fo:table-column
column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row keep-with-next="always"
keep-together="always">
<xsl:apply-templates
select="headline" mode="content"/>
</fo:table-row>
<fo:table-row keep-together="always">
<fo:table-cell><xsl:apply-templates
select="p[1]"/></fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<xsl:apply-templates select="p[position() > 1]"/>
</fo:block>
</xsl:template>
The evil part is that one (shortened):
<fo:simple-page-master master-name="first" page-height="29.7cm"
page-width="21cm"
margin-top="0cm" margin-bottom="2.2cm" margin-left="2.5cm"
margin-right="2.5cm">
<fo:region-body margin-top="7cm" margin-bottom="0cm"
margin-left="7cm"/>
<fo:region-before precedence="true" region-name="first-before"
extent="7.5cm"/>
<fo:region-start region-name="first-start" extent="5.6cm"/>
</fo:simple-page-master>
The other fo:simple-page master objects don't have this region-start and
therefore don't have such a big left margin on their region-body. (There is
a box containing the the contents on on the left of the first page).
So what happens is that if there really has to be a page-break from page 1
to page2 when a new article starts, the headline-p1-table will have the
width of the first page's region-body.
After that headline-p1-table everything is fine.
Hmm, my customer was so sold on that content-box on the left side ;-), in
the end I will have to remove it...
Greetings and many thanks!
sonja
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: (re:) pagination and width=100%
Posted by Sonja Löhr <so...@arcor.de>.
> How often does it occur that a page break happens immediately
> after the headline? I'd probably remove the table altogether.
Unfortunately, quite often ;-(
If I do drop a "feature", then it would be the smaller region-body on
the first page.
> I'm afraid a table width isn't recomputed after a page break.
> This has something to do with how table columns are set up,
> the routine probably has to be called again after a page break,
> at least if an ipd change is detected.
What I did not yet try is removing the two table raws in favour of only
one with only the keep-together attribute. Perhaps the break occurs
between the two rows, and I actually don't need two to get my keep, do
I?
Regards,
sonja
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: (re:) pagination and width=100%
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Sonja Löhr wrote:
> Some days ago we talked about the problem of wrong computation of
> table-widths if a break between two pages occurs and the region-bodies (or
> column-widths) of these to pages differ in width.
>
> I use something like the following to keep the headline and first paragraph
> of an article together.
How often does it occur that a page break happens immediately
after the headline? I'd probably remove the table altogether.
> So what happens is that if there really has to be a page-break from page 1
> to page2 when a new article starts, the headline-p1-table will have the
> width of the first page's region-body.
I'm afraid a table width isn't recomputed after a page break.
This has something to do with how table columns are set up,
the routine probably has to be called again after a page break,
at least if an ipd change is detected.
You know the policy: no more hacking to the maintenance branch
code, and this one carries certainly more risk in breaking
important stuff.
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
RE: ) pagination and width=100%
Posted by Sonja Löhr <so...@arcor.de>.
Sorry, the code got really worse when sending the email.
I now caught the fo-output of a test-doc between two processing steps and
put some example images on my server, so you should be able to reproduce
everything, including the wrong table-width. It is attached here.
Bye!
sonja
> -----Original Message-----
> From: Sonja L�hr [mailto:sonjaloehr@arcor.de]
> Sent: Dienstag, 23. August 2005 13:09
> To: fop-users@xmlgraphics.apache.org
> Subject: (re:) pagination and width=100%
>
> Hi!
>
> Some days ago we talked about the problem of wrong
> computation of table-widths if a break between two pages
> occurs and the region-bodies (or
> column-widths) of these to pages differ in width.
>
> I use something like the following to keep the headline and
> first paragraph of an article together. Actually, it is a bit
> more complicated because not only "p"s may occur first, but
> that shouldn't make a difference.
>
>
> <xsl:template match="article">
> <!-- Headline and first paragraph -->
> <fo:block font-size="11pt" space-after="0.6cm" >
> <fo:table table-layout="fixed" width="100%">
> <fo:table-column
> column-width="proportional-column-width(1)"/>
> <fo:table-body>
> <fo:table-row keep-with-next="always"
> keep-together="always">
> <xsl:apply-templates
> select="headline" mode="content"/>
> </fo:table-row>
> <fo:table-row keep-together="always">
>
> <fo:table-cell><xsl:apply-templates
> select="p[1]"/></fo:table-cell>
> </fo:table-row>
> </fo:table-body>
> </fo:table>
> <xsl:apply-templates select="p[position() > 1]"/>
>
> </fo:block>
> </xsl:template>
>
>
> The evil part is that one (shortened):
>
> <fo:simple-page-master master-name="first" page-height="29.7cm"
> page-width="21cm"
> margin-top="0cm" margin-bottom="2.2cm"
> margin-left="2.5cm"
> margin-right="2.5cm">
> <fo:region-body margin-top="7cm" margin-bottom="0cm"
> margin-left="7cm"/>
> <fo:region-before precedence="true" region-name="first-before"
> extent="7.5cm"/>
> <fo:region-start region-name="first-start"
> extent="5.6cm"/> </fo:simple-page-master>
>
> The other fo:simple-page master objects don't have this
> region-start and therefore don't have such a big left margin
> on their region-body. (There is a box containing the the
> contents on on the left of the first page).
>
> So what happens is that if there really has to be a
> page-break from page 1 to page2 when a new article starts,
> the headline-p1-table will have the width of the first page's
> region-body.
> After that headline-p1-table everything is fine.
>
> Hmm, my customer was so sold on that content-box on the left
> side ;-), in the end I will have to remove it...
>
>
> Greetings and many thanks!
>
> sonja
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>