user2791739
user2791739

Reputation: 217

XSLFO no page-break on first page

I have an XSLFO document with a couple of block elements that have page-break-inside="avoid". Also there is a title-Element before each block-element with keep-with-next.within-page="always".

So basically I have paragraphs with a title and title and paragraph should always be on the same page and there shouldn't be a page-break inside the paragraphs.

The problem is that there are some blocks that have too much content for one page. If the content only overflows the region-body but not the entire page, no page-break occurs, so the block is still on one page. However, there are blocks where the text overflows the entire page and in that case, there is a page-break-before. One such block element with too much content should be on the first page of the document. However, there is a page-break and it is on the second page of the document.

So in essence, my problem is that there should be no page-breaks within the block-elements (the pargraphs), title and paragraph should always be on the same page AND there should be no page-break before the very first block-element, even if it overflows the entire page. The content should always start on the first page and there should be no empty pages at all.

Thanks for your help and suggestions!

Upvotes: 0

Views: 417

Answers (1)

Andreas
Andreas

Reputation: 1250

The spec says:
Keep conditions are imposed by the "within-page", "within-column", and "within-line" components of the "keep-with-previous", "keep-with-next", and "keep-together" properties. The refined value of each component specifies the strength of the keep condition imposed, with higher numbers being stronger than lower numbers and the value always being stronger than all numeric values.
Have you tried different values? Maybe you could change page-break-inside="avoid" into keep-together="<your value here>" to use tuned values.
Edit: See spec http://www.w3.org/TR/2006/REC-xsl11-20061205/#keepbreak

Upvotes: 0

Related Questions