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 "Hahn Kurt (CHA)" <ku...@etat.ge.ch> on 2002/07/01 11:22:26 UTC

RE: keep-with-next and keep-together: Another question

Hi,
I've posted a couple of questions about the keep-and-break properties during
last week, but I'm still
not sure whether it's my code that's wrong or whether these properties
simply don't work (at least not in every case). For example, consider the
following snippet (the rows contain an embedded table each, they're not
displayed here): 

<fo:table-row keep-with-next="always" font-weight="bold" font-size="10pt"> 
  <!-- "keep-with-next.within-page" doesn't work either here -->
</fo:table-row> 

<fo:table-row keep-together="always" font-weight="normal" font-size="10pt">
</fo:table-row> 

In one part of my PDF, the first one of these rows stands at the end of a
page, and so gets separated from the next one. By writing
keep-with-next="always", I thought that in case the next row wouldn't fit on
the same page, both rows would appear on the next page, but nothing like
this. 

This isn't an isolated case, throughout the document, there are instances
where the keep condition obviously isnt applied...

Any help?

Kurt
-----Message d'origine-----
De : Peter Sparkes [mailto:peter@didm.co.uk]
Envoyé : lundi, 1. juillet 2002 10:55
À : fop-user@xml.apache.org
Objet : RE: keep-with-next and keep-together


Hi

Thank you both for your help.

I have used Matt's suggestion re table and a one-pixel-wide,
half-a-page-tall clear image.

It works fine.

Thanks again

Peter

-----Original Message-----
From: Matt Savino [mailto:matt@synergizethis.com]
Sent: 01 July 2002 05:33
To: fop-user@xml.apache.org
Subject: Re: keep-with-next and keep-together


You might try making a table with two columns and two rows. Make the
first (or last) column one pixel-wide and have each row of that column
contain a one-pixel-wide, half-a-page-tall clear image. This is an HTML
trick, please let me know if it works on FOP. (I've attached the image,
you'll need to resize it.)

-Matt


"J.Pietschmann" wrote:
>
> Peter Sparkes wrote:
> > Hi,
> >
> > I have a repeating <block> of data. Each instance of the block is of
varying
> > size but under half a page. I want to put two blocks on every page, with
> > each block in its own half of the page and varying amounts of white
space
> > between the two blocks.
> >
> > However, I can't get it to work: The two blocks close up on each other
and
> > where there is room part of a third block appears on the page.
>
> Apart from a working keep-with-prev this would need
> a block layout algorithm able to compute a variable
> amount of space depending on constraints. None of this
> is currently implemented, and even if it were, the
> result is not quite predictable.
> A more robust way would be to use a two row table of
> 100% page height and display-align="after" on the
> second row, but this isn't implemented either.
>
> You can try a somewhat ugly footnote hack:
>        <fo:block break-before="page">top </fo:block>
>        <fo:block>
>          <fo:footnote><fo:inline></fo:inline>
>            <fo:footnote-body>
>              <fo:block>bottom </fo:block>
>            </fo:footnote-body>
>          </fo:footnote>
>        </fo:block>
>
> HTH
> J.Pietschmann


Re: Different fo:flow for alterate pages

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Peter Sparkes wrote:
> Please, is there anyway to do this i.e. by having a separate <fo:flow
> flow-name="xsl-region-body" > for the left and right hand pages.


If you mean the content of a file A goes onto odd
pages and of another file B goes onto even pages:
the XSLFO spec does not provide a possiblity for this.
If the source files have a page structure, you can
prepare the pages at the XSLT level. Otherwise, I'd
make two consecutive flows and use some postprocessing,
for example with iText, to reshuffle the pages and get
correct the page numbers.

J.Pietschmann


RE: Different fo:flow for alterate pages

Posted by Peter Sparkes <pe...@didm.co.uk>.
Thanks for the help. I am going to try it at the XSLT level.

Peter

-----Original Message-----
From: J.Pietschmann [mailto:j3322ptm@yahoo.de]
Sent: 03 July 2002 20:01
To: fop-user@xml.apache.org
Subject: Re: Different fo:flow for alterate pages


If you mean the content of a file A goes onto odd
pages and of another file B goes onto even pages:
the XSLFO spec does not provide a possiblity for this.
If the source files have a page structure, you can
prepare the pages at the XSLT level. Otherwise, I'd
make two consecutive flows and use some postprocessing,
for example with iText, to reshuffle the pages and get
correct the page numbers.

J.Pietschmann

-----Original Message-----
From: Oleg Tkachenko [mailto:olegt@multiconn.com]
Sent: 03 July 2002 14:04
To: fop-user@xml.apache.org
Subject: Re: Different fo:flow for alterate pages


Peter Sparkes wrote:

> I am using <fo:repeatable-page-master-alternatives> and flowing data onto
> left and right hand pages and that works fine.
>
> The data on the left and right hand pages come from a large set of xml
files
> which have identical DTDs but different instances. I am using xslt to
> generate the flow objects, a combination of fo:table(s) and fo:block(s). I
> want to make the fo:table and fo:block formatting on the right hand page a
> mirror image of the left hand page.
>
> Please, is there anyway to do this i.e. by having a separate <fo:flow
> flow-name="xsl-region-body" > for the left and right hand pages.
You can define different body-class regions for odd and even pages using
region-name property, but you cannot define more than one fo:flow for a
particular fo:page-sequence.
So I believe the only thing you can do is to emulate such mirroring by
manual
page breaks, alignment etc.

--
Oleg Tkachenko
Multiconn International, Israel




Re: Different fo:flow for alterate pages

Posted by Oleg Tkachenko <ol...@multiconn.com>.
Peter Sparkes wrote:

> I am using <fo:repeatable-page-master-alternatives> and flowing data onto
> left and right hand pages and that works fine.
> 
> The data on the left and right hand pages come from a large set of xml files
> which have identical DTDs but different instances. I am using xslt to
> generate the flow objects, a combination of fo:table(s) and fo:block(s). I
> want to make the fo:table and fo:block formatting on the right hand page a
> mirror image of the left hand page.
> 
> Please, is there anyway to do this i.e. by having a separate <fo:flow
> flow-name="xsl-region-body" > for the left and right hand pages.
You can define different body-class regions for odd and even pages using 
region-name property, but you cannot define more than one fo:flow for a 
particular fo:page-sequence.
So I believe the only thing you can do is to emulate such mirroring by manual 
page breaks, alignment etc.

-- 
Oleg Tkachenko
Multiconn International, Israel


Different fo:flow for alterate pages

Posted by Peter Sparkes <pe...@didm.co.uk>.
Hi

I am using <fo:repeatable-page-master-alternatives> and flowing data onto
left and right hand pages and that works fine.

The data on the left and right hand pages come from a large set of xml files
which have identical DTDs but different instances. I am using xslt to
generate the flow objects, a combination of fo:table(s) and fo:block(s). I
want to make the fo:table and fo:block formatting on the right hand page a
mirror image of the left hand page.

Please, is there anyway to do this i.e. by having a separate <fo:flow
flow-name="xsl-region-body" > for the left and right hand pages.

Peter



Re: keep-with-next and keep-together: Another question

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Hahn Kurt (CHA) wrote:
> This isn't an isolated case, throughout the document, there are instances
> where the keep condition obviously isnt applied...

If a keep-with condition would cause a table not to
fit on a page, applying the condition is disabled
in order to avoid an infinite loop. I'm not sure
whether it is disabled for the table only or for
the whole rest of the document, in either case it
is possible to get odd effects.
The redesigned FOP will not have this problem.

J.Pietschmann