Re: Headers and pagination
On Wednesday 01 August 2001 01:00, [EMAIL PROTECTED] wrote: I must be really confused. I thought that the header was defined once and only once in the page-sequence as static-content and the page-sequence-master children allowed for the use of different page layouts for different pages, but not content of the page. Anyway, if you could lead me to an example I would be very happy. You can only have one fo:flow per page-sequence, but you can have as many fo:static-content's as you like, and use as many page-masters as you need for one given page-sequence. Every page in a page-sequence could have different page-masters and different headers, footers and sidebars. There should be some examples in FOP already, under docs/examples. Regards, Arved Sandstrom -- Fairly Senior Software Type e-plicity (http://www.e-plicity.com) Halifax, Nova Scotia Wireless * B2B * J2EE * XML - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Headers and pagination
Dear Tim, et.al., I'm doing the same as you for our newsletter - wanting to change the heading when a new chapter is started. I achieve this by starting a new fo:page-sequence ... for each chapter containing a fo:static-content flow-name=xsl-region-before containing the title. I've attached by XSL file. It's in the template for chapter (in body). Any comments gratefully received. ?xml version=1.0 encoding=iso-8859-1? !-- XML - PDF for UKUUG newsletter 0.0.0 Initial implementation (mick, 23 Jan 2001) 0.1.0 Restructure based on RenderX tutorial (mick, 16 Feb 2001) 0.1.1 Internal links added (mick, 21 Feb 2001) -- xsl:stylesheet version=1.0 xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:xsl=http://www.w3.org/1999/XSL/Transform; !-- top-level newsletter - title chapter+ -- xsl:template match=/newsletter fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set !-- layout for the first page (toc) -- fo:simple-page-master margin-bottom=0.5in margin-left=0.75in margin-right=0.75in margin-top=0.5in master-name=toc page-height=11.7in page-width=8.3in fo:region-after extent=0.75in/ fo:region-before extent=1.5in/ fo:region-body margin-bottom=0.75in margin-top=1.45in/ /fo:simple-page-master !-- layout for the remaining pages (chapters) -- fo:simple-page-master margin-bottom=0.5in margin-left=0.75in margin-right=0.75in margin-top=0.5in master-name=chapters page-height=11.7in page-width=8.3in fo:region-after extent=0.75in/ fo:region-before extent=1.5in/ fo:region-body column-count=2 column-gap=0.25in margin-bottom=0.75in margin-top=0.5in/ /fo:simple-page-master fo:page-sequence-master master-name=newsletter fo:single-page-master-reference master-name=toc/ fo:repeatable-page-master-reference master-name=chapters/ /fo:page-sequence-master /fo:layout-master-set xsl:call-template name=toc/ xsl:apply-templates select=chapter/ /fo:root /xsl:template !-- article (in body) - (@book | @letter | @news | @software) author? section+ -- xsl:template match=article xsl:variable name=article xsl:number count=chapter/ xsl:number count=article/ /xsl:variable fo:block id={$article}/ xsl:choose xsl:when test=@type='book' or @type='software' xsl:apply-templates select=book|software/ /xsl:when !-- @type='letter' has no header -- xsl:when test=@type='news' fo:block font-size=16pt font-weight=bold line-height=18pt text-align=start xsl:apply-templates select=title/ /fo:block /xsl:when /xsl:choose xsl:if test=author and @type!='letter' fo:block font-size=14pt font-weight=bold line-height=16pt space-before=16pt text-align=start (xsl:if test=@type='book' or @type='software'Reviewed by /xsl:if xsl:apply-templates select=author/) /fo:block /xsl:if xsl:apply-templates select=section/ xsl:apply-templates select=id(author/@id)/biography/ xsl:if test=position()!=last() fo:block space-after=12pt space-before=12pt fo:leader leader-length=3.25in leader-pattern=rule/ /fo:block /xsl:if /xsl:template !-- article (in toc) - @book/title | @letter/author | @software/title | title -- xsl:template match=article mode=toc xsl:variable name=article xsl:number count=chapter/ xsl:number count=article/ /xsl:variable fo:table fo:table-column column-width=6.5in/ fo:table-column column-width=10pt/ fo:table-body fo:table-row fo:table-cell fo:block font-size=10pt font-weight=normal id=toc{$article} line-height=12pt start-indent=18pt text-align=justify fo:basic-link internal-destination={$article} xsl:choose xsl:when test=@type='book' or @type='software' xsl:apply-templates select=book/title|software/title/ /xsl:when xsl:when test=@type='letter' From xsl:apply-templates mode=toc select=author/
Re: Headers and pagination
At 05:59 PM 7/31/01 +1000, [EMAIL PROTECTED] wrote: I know I can get different headers for each page sequence, but I don't know how to make the page number flow on from the previous page sequence. Using initial-page-number would work, but I don't know how many pages are in the first sequence, and I also don't know how many pages are in the subsequent page sequence. Hi, Tim FOP now implements fully 2 properties on fo:page-sequence that are exactly what you need - 'force-page-count' and 'initial-page-number'. You will be the first known 3rd party tester. :-) The _default_ behaviour of page-numbering is to already do what you want to do (the default behaviour of 'initial-page-number'). The aforementioned properties happen to give you extra flexibility. Also check out the 'format' property... Regards, Arved Sandstrom Fairly Senior Software Type e-plicity (http://www.e-plicity.com) Wireless * B2B * J2EE * XML --- Halifax, Nova Scotia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Headers and pagination
Title: RE: Headers and pagination Hi, I've just been playing with this stuff, and it all seems to work fine. If you don't specify initial-page-number the pages will happily keep counting; you can even change the format between page sequences without affecting the count. One thing I did notice: if you use initial-page-number then something tries to force the new page sequence onto an odd page; this does not happen when allowing the page numbers to flow on between sequences. You can prevent this behaviour using force-page-count=no-force (I'm assuming it defaults to auto when using initial-page-count). FOP now implements fully 2 properties on fo:page-sequence that are exactly what you need - 'force-page-count' and 'initial- page-number'. You will be the first known 3rd party tester. :-) Also check out the 'format' property... I've included a test sample below which works fine with last night's CVS. Just change the commented page-sequence bits to experiment with the different numbering/formatting possibilities. Regards, Twylite -- XML included below, hope your mailer knows what not to do. ?xml version=1.0 encoding=UTF-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format fo:layout-master-set fo:simple-page-master master-name=cover page-height=29.7cm page-width=21cm margin-top=2.5cm margin-bottom=2.5cm margin-left=2.5cm margin-right=2cm fo:region-after extent=1cm / fo:region-body margin-top=3cm / /fo:simple-page-master fo:simple-page-master master-name=meta page-height=29.7cm page-width=21cm margin-top=2.5cm margin-bottom=2.5cm margin-left=2.5cm margin-right=2cm fo:region-after extent=1cm / fo:region-body margin-top=1.1cm margin-bottom=1.1cm / /fo:simple-page-master fo:simple-page-master master-name=bodypage page-height=29.7cm page-width=21cm margin-top=2.5cm margin-bottom=2.5cm margin-left=2.5cm margin-right=2cm fo:region-after extent=1cm / fo:region-body margin-top=2.1cm margin-bottom=1.1cm / /fo:simple-page-master /fo:layout-master-set !-- fo:page-sequence master-name=cover -- fo:page-sequence master-name=cover force-page-count=no-force fo:static-content flow-name=xsl-region-after fo:block font-family=Helvetica font-size=10pt text-align=start Page: fo:page-number / /fo:block /fo:static-content fo:flow flow-name=xsl-region-body fo:block font-family=Helvetica font-size=18pt text-align=center My Reference Manual /fo:block /fo:flow /fo:page-sequence !-- fo:page-sequence master-name=meta format=i -- !-- fo:page-sequence master-name=meta format=i initial-page-number=1 -- fo:page-sequence master-name=meta format=i initial-page-number=1 force-page-count=no-force fo:static-content flow-name=xsl-region-after fo:block font-family=Helvetica font-size=10pt text-align=start Page: fo:page-number / /fo:block /fo:static-content fo:flow flow-name=xsl-region-body fo:block font-family=Times Roman font-size=12pt text-align=justify First page of metadata. /fo:block /fo:flow /fo:page-sequence !-- fo:page-sequence master-name=bodypage -- fo:page-sequence master-name=bodypage initial-page-number=1 fo:static-content flow-name=xsl-region-after fo:block font-family=Helvetica font-size=10pt text-align=start Page: fo:page-number / /fo:block /fo:static-content fo:flow flow-name=xsl-region-body fo:block font-family=Times Roman font-size=12pt text-align=justify First page of body. /fo:block /fo:flow /fo:page-sequence /fo:root
RE: Headers and pagination
I must be really confused. I thought that the header was defined once and only once in the page-sequence as static-content and the page-sequence-master children allowed for the use of different page layouts for different pages, but not content of the page. Anyway, if you could lead me to an example I would be very happy. Cheers Tim -Original Message- From: Arved Sandstrom [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 1 August 2001 10:15 To: [EMAIL PROTECTED] Subject: RE: Headers and pagination At 09:44 AM 8/1/01 +1000, [EMAIL PROTECTED] wrote: Are you expecting me to test FOP 0.19 or the latest CVS version? If it's the former then it doesn't do what I tested it for, which is page numbering continuing on from previous page-sequence while specifying initial-page-count=auto for all page-sequences. I tested is by modifying Trevor's example (see attached). [ SNIP ] Latest CVS. For my application I'm attempting to convert XML using XSLT to PDF, and in this case the size of the data in the flow of every page-sequence is undefined. Continuing the page count from page-sequence to page-sequence appears to be okay as far as the XSL:FO spec, but I want to change the header during a page sequence. Let me see if I can make it clearer: Page 1 Page 2 Page 3 Page n - - - - | Hdr 1 | | Hdr 2 | | Hdr 2 | | Hdr 2 | | - | | - | | - | | - | | Flow1 | | Flow1 | | Flow2 | | Flow3 | | | | | | | | | - - - - Remember all the flows are undefined so Flow 1 could be 1..n pages etc.. If you want to change the header during a page-sequence then you need to use page-sequence-master, and some combo of single-page-master-reference, repeatable-page-master-reference and repeatable-page-master-alternatives. I don't immediately see any stumbling block to what you want to do. Regards, Arved Fairly Senior Software Type e-plicity (http://www.e-plicity.com) Wireless * B2B * J2EE * XML --- Halifax, Nova Scotia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] The information in this e-mail together with any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of review, disclosure, modification, distribution and/or publication of this e-mail message is prohibited. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer and/or your computer system network. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]