Is there a way in XSL-FO to define a single page layout? meaning that all content should be on a single page. Basically the page should be as long as the content, which is dynamic.
I'm using Apache FOP.
Any help will be appreciated.
Is there a way in XSL-FO to define a single page layout? meaning that all content should be on a single page. Basically the page should be as long as the content, which is dynamic.
I'm using Apache FOP.
Any help will be appreciated.
You want a formatter that supports page-height="indefinite"
. (See https://www.w3.org/TR/xsl11/#page-height)
I don't know any formatter that supports page-height="indefinite"
. AH Formatter doesn't (https://www.antenna.co.jp/AHF/help/v70e/ahf-fo11.html#page-height). FOP says 'not yet' (https://xmlgraphics.apache.org/fop/compliance.html#fo-property-page-height). RenderX don't qualify their support for page-height
, so they might (http://www.renderx.com/reference.html).
You could use the XSLTExtensions (https://github.com/pplcg/XSLTExtensions, https://www.w3.org/community/ppl/wiki/XSLTExtensions) from the Print and Page Layout Community Group (http://www.w3.org/community/ppl/).
Within the single XSLT transformation that generates the XSL-FO, you could:
You would then format the output XSL-FO.
It might be simplest to put all of your content in an fo:block
with known ID so that it's easy to get the height of the content by getting the height of the block.
It's been a while since I used the extensions, but that's the general idea.