Showing posts with label FOP. Show all posts
Showing posts with label FOP. Show all posts

Wednesday, May 03, 2006

Problems with keep-together.within-page="always" for preventing Page-Breaks

I know this Blog has more to do with xsl:fo than with Java but I had another Problem with my Stylesheet.
I wanted to add keep-together.within-column="always" to a <fo:table> tag but it did'nt keep the block together. So I googled and found out , that you have to add
keep-with-next="always" to your <fo:table-row> tag
For example :
<fo:table-row keep-with-next="always">

Wednesday, March 22, 2006

Page XX of XX with xsl-fo

If you want the Page-number in a XSL you use <fo:page-number>
but what if you want the pagenumber followed by the total pagenumber ?
the trick is to add <fo:page-number-citation ref-id="endofdoc"/> with the tag
<fo:block id="endofdoc"/> at the end of the stylesheet.

Tuesday, March 21, 2006

Prevent Pagebreak with xsl-fo

If you want to prevent Pagebreak within a fo:table-row you have to add the following attribute to your row:
<fo:table-row column="always">
Other possible values than "always" are:
  • auto ... no restrictions for page break
  • Integer-Values ... e.g. 3. No Pagebreak if there is no other, stronger pagebreak requirement
keep-together. can also be used with
  • within-column for pagebreak in one line
  • within-page for pagebreak in one page
the Attribute can be added to
  • fo:basic-link
  • fo:block
  • fo:block-container
  • fo:inline
  • fo:inline-container
  • fo:list-block
  • fo:list-item
  • fo:list-item-body
  • fo:list-item-label
  • fo:table
  • fo:table-and-caption
  • fo:table-caption
  • fo:table-row