Re: page-position=last vs. conditional blocks
Nwilan Glirt wrote: Now that I discovered that page-position=last is not implemented in FOP, I am looking for alternative ways to produce first, middle and last specific pages. Is there any way to do some conditional stuff on blocks such as testing if we are currently writing the last page? Askinig for page-position=last seems to be thequestion of the week. If creation time is uncritical, a two pass solution can provide this. The generated FO uses a repeatable--page-master-reference or a repeatable-page-master-alternatives for the main document body, in the first pass the maximum-repeats is unbounded (very large), in the second pass it is restricted to the relevant page count so that the next page master can kick in for the last page. In the XSLT, declare a parameter for the page count and something like this: xsl:param name=page-count/ xsl:template name=generate-page-master fo:page-sequence-master master-name=all !-- page master for first page -- fo:single-page-master-reference master-reference=first/ !-- page master for rest -- fo:repeatable--page-master-reference master-reference=rest maximum-repeats={$page-count}/ !-- page master for last, unused in first pass (no harm) -- fo:repeatable--page-master-reference master-reference=last/ /fo:page-sequence-master /xsl:template There has been sample Java code published on this list for automating the whole process: http://marc.theaimsgroup.com/?l=fop-userm=102002702026609w=2 J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
page-position=last vs. conditional blocks
Now that I discovered that page-position=last is not implemented in FOP, I am looking for alternative ways to produce first, middle and last specific pages. Is there any way to do some conditional stuff on blocks such as testing if we are currently writing the last page? _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
Re: page-position=last vs. conditional blocks
If you know what's exactly on your last page (ex. the last page is a form that the recipient of the document has to fill out) you could try to use two page-sequences, where the second page-sequence only defines a single page-master for the last page. But that won't work if content flows from the n-1th page to the last page. Anyway, during XSLT you don't get any information from FOP (even if it had it) to determine the last page. You can do that only if in the way outlined above. Perhaps, you have a situation like that. I hope this helps anyway. On Mon, 11 Nov 2002 16:17:19 +0100 Nwilan Glirt wrote: Now that I discovered that page-position=last is not implemented in FOP, I am looking for alternative ways to produce first, middle and last specific pages. Is there any way to do some conditional stuff on blocks such as testing if we are currently writing the last page? Jeremias Maerki
Re: page-position=last vs. conditional blocks
Nwilan Glirt wrote: Now that I discovered that page-position=last is not implemented in FOP, I am looking for alternative ways to produce first, middle and last specific pages. Is there any way to do some conditional stuff on blocks such as testing if we are currently writing the last page? No, even FOP itself is unable to know if it's the last page - that's the core problem. Actually it probably requires lookahead, the only way I can imagine is to try to layout *every* page as last and if flow is not exhausted, relayout it again as not last, anyway it's a topic for fop-dev. If you know explicitly what objects would be on the last page and you are sure it fits exactly 1 page you can move last page objects into a different fo:page-sequence object with appropriate master-reference to the last page master. -- Oleg Tkachenko eXperanto team Multiconn Technologies, Israel