FO.NET icon indicating copy to clipboard operation
FO.NET copied to clipboard

Page breaks

Open AlexProfi opened this issue 7 years ago • 2 comments

Hello When I use very big content of xml nodes I get page break screenshot_2018-11-15_12-24-14

AlexProfi avatar Nov 15 '18 09:11 AlexProfi

Any solution to this yet? I haver a similar problem with larger documents.

BradRobertsDLA avatar Apr 22 '19 14:04 BradRobertsDLA

There aren't enough details in the original question... and there is no sample of the FO output. But, in case this helps, I had an issue with page breaks at one point also, but I solved it with the "keep-together" attribute. However, this attribute only works (in this version of FONet) when applied to a table row, therefore all content must be output within the table cell of the table row that has the attribute set as follows:

		<!-- KEEP THE CONTENT TOGETHER TO ADDRESS PAGE BREAK ISSUES IN FORMATTING WHEN MULTIPLE PAGES ARE GENERATED...
			Note:  http://fonet.codeplex.com/workitem/1552
			Keep-together is implemented in FO.NET. I use it heavily. It only works when set as an attribute
			on a table-row. To make use of this, one can create "blind tables," which are tables created solely
			for the keep-together.
			http://xmlgraphics.apache.org/fop/faq.html#keep-with
		-->
		<fo:table>
			<fo:table-column />
			<fo:table-body>
				<fo:table-row keep-together="always">
					<fo:table-cell>
						LARGE BLOCK OF CONTENT MUST GO HERE . . . 
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>

I accomplished this with an XSLT Function that wraps my content dynamically as follows:

	<xsl:template name="keepBlockContentTogether">
		<xsl:param name="content" />

		<!-- KEEP THE CONTENT TOGETHER TO ADDRESS PAGE BREAK ISSUES IN FORMATTING WHEN MULTIPLE PAGES ARE GENERATED...
			Note:  http://fonet.codeplex.com/workitem/1552
			Keep-together is implemented in FO.NET. I use it heavily. It only works when set as an attribute
			on a table-row. To make use of this, one can create "blind tables," which are tables created solely
			for the keep-together.
			http://xmlgraphics.apache.org/fop/faq.html#keep-with
		-->
		<fo:table>
			<fo:table-column />
			<fo:table-body>
				<fo:table-row keep-together="always">
					<fo:table-cell>
						<xsl:copy-of select="$content" />
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
	</xsl:template>

Hope this might help!

cajuncoding avatar Apr 22 '19 21:04 cajuncoding