Reputation: 244
Currently I have some xml documents which are converted via xsl into html. The html is converted via abcpdf into a pdf document. The content of the pages is dynamic. A page is represented by a div tag, however the amount of content going in could in fact be 3 pages long & I need some pages to have a header and a footer inserted and some not, so if a div tag has 3 pages worth of content, that means 3 headers and 3 footers inserting.
Also as the content is dynamic,page 10 may have no footer or header, however once the logic of the application has ran through a 2nd time page 10 could in fact be page 20.
I am looking for a solution which uses css to add the headers and footers conditionally. Its easy to use XSL to add them but as a div can contain up to 3 pages worth of content I need a way of adding the headers and footers (or possibly not) in all 3 pages contained within a div.
I have looked at css pagination, but not sure if this is the right solution.
Any ideas would be greatfully received
Upvotes: 1
Views: 419
Reputation: 260
Have you considered using XSL-FO (www.w3schools.com/xslfo/xslfo_intro.asp) with Apache FOP (xmlgraphics.apache.org/fop) to transform your XML content directly into a PDF? Unlike CSS XSL-FO is designed for print and as such pagination is part of the language. It is also quite easy to pick up if you already know XSLT & CSS, in fact the formatting syntax is taken from CSS 2. You could even use it on the HTML if it is valid XHTML, and there are tools such as CSSToXSLFO (www.re.be/css2xslfo/index.xhtml) that can help.
Upvotes: 1