[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How to create document with different headers but
You set up your formatting with contingencies for different page geometries in a sequence of page geometries: (1) - create a page geometry for the first page with a <region-before> name something like "before-on-first", name the geometry something like "first" (2) - create a page geometry for all the other pages with a <region-before> name something like "before-rest", name the geometry something like "rest" (3) - create a page sequence master, that delivers the first geometry for the first page and the other geometry for the remainder of your pages: <page-sequence-master name="all-pages"> <single-page-master-reference master-reference="first"/> <repeatable-page-master-reference master-reference="rest"/> </page-sequence-master> (4) - point to the page-sequence-master from your page sequence: <page-sequence master-reference="all-pages"> (5) - define the static content you need on each of the two geometries: <static-content region-name="before-on-first"> <block>Do this!</block> </static-content> <static-content region-name="before-rest <block>that</block> </static-content> I hope this helps. ....................... Ken -- Different header on first page (xsl:fo)? Simon Dotschuweit - Wed, 7 Apr 2004 08:48:27 -0400 (EDT) G. Ken Holman - Wed, 7 Apr 2004 11:21:47 -0400 (EDT) <= <- Previous Index Next -> Different header on first pag, Simon Dotschuweit Thread Use of moded templates?, Mark Lundquist RE: Retaining XML output, Michael Kay Date Use of moded templates?, Mark Lundquist Month -----Original Message----- From: Karen Varga [mailto:vargakaren@xxxxxxxxx] Sent: Monday, February 07, 2005 7:37 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: How to create document with different headers but same body (xslfo/xslt) Hi Omprakash.V I'm not sure I follow how your example helps me. I see you define one simple-page-master and one page-sequence for the firstpage, however what about the rest of the document. This is as far as I got when I suddenly realized that it won't work because I'm having to redefine the fo:flow for the two page-sequences, which means my for loop counter will start at the beginning again, instead of continuing from page 1... (I've taken out my margin settings etc to make the code more eligible) <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <!-- Global document pages and sequencing --> <fo:layout-master-set> <!-- Define first page layout --> <fo:simple-page-master master-name="first"> <fo:region-before region-name="first_before" extent="10cm" /> <fo:region-body region-name="first_body" margin-top="10cm" extent="17.7cm" /> </fo:simple-page-master> <!-- Define 'rest of document' page layout --> <fo:simple-page-master master-name="rest"> <fo:region-before region-name="rest_before" extent="5cm" /> <fo:region-body region-name="rest_body" margin-top="5cm" extent="22.7cm" /> </fo:simple-page-master> <!-- Specify the page sequence --> <fo:page-sequence-master master-name="master-sequence"> <fo:single-page-master-reference master-reference="first" /> <fo:repeatable-page-master-reference master-reference="rest" /> </fo:page-sequence-master> </fo:layout-master-set> <!-- Define layout of FIRST page sequence --> <fo:page-sequence master-reference="first"> <fo:static-content flow-name="first_before"> <fo:block>HEADER DETAIL FOR FIRST PAGE</fo:block> </fo:static-content> <fo:flow flow-name="first_body"> <fo:block>FIRST BODY</fo:block> <xsl:for-each select="hazardousGoodsItem"> <fo:block><xsl:value-of select="description" /></fo:block> </xsl:for-each> </fo:flow> </fo:page-sequence> <!-- Define layout and contents of REST page sequence --> <fo:page-sequence master-reference="rest"> <fo:static-content flow-name="rest_before"> <fo:block>THIS IS THE REST HEADER SECTION</fo:block> </fo:static-content> <fo:flow flow-name="rest_body"> <fo:block>REST BODY</fo:block> <xsl:for-each select="hazardousGoodsItem"> <fo:block><xsl:value-of select="description" /></fo:block> </xsl:for-each> </fo:flow> </fo:page-sequence> </fo:root> --- omprakash.v@xxxxxxxxxxxxx wrote: > > > Hi, > Have you tried using the fo:static-content > element, This is where you > specify the header and footer you would like to use. > You can use this in > conjunction with the page-sequence element and > specify one sequence for > only the first page header and content and another > sequence for your > remaining content. > > Hope this helps. > > Cheers, > Omprakash.V > > > <fo:layout-master-set> > > <fo:simple-page-master page-width="auto" > page-height="auto" master-name > ="all-pages" page-master-name="one" > ><fo:region-body column-gap="12pt" column-count="1" > margin-left="1in" > margin-bottom="1in" margin-right="1in" > margin-top="1in"/><fo:region-before > display-align="before" extent="1in" region-name > ="page-header"/><fo:region-after > display-align="after" extent="1in" > region-name="page-footer"/><fo:region-start > extent="1in"/><fo:region-end > extent="1in"/></fo:simple-page-master></fo:layout-master-set> > > <fo:page-sequence master-reference="firstpage"> > > <fo:title>New Page 1</fo:title> > > <fo:static-content flow-name="page-header"><fo:block > font-size="8pt" > text-align="center" space-before="0.5in" > space-before.conditionality > ="retain">Very big > header</fo:block></fo:static-content> > > <fo:static-content flow-name="page-footer"> > <fo:block font-size="8pt" text-align="center" > space-after="0.5in" > space-after.conditionality="retain">- > <fo:page-number/> -</fo:block> > </fo:static-content> > > <fo:flow flow-name="xsl-region-body"><fo:block > role="html:body"> > First page content here > </fo:flow> > > > > > > > > > > > Karen Varga > > > <vargakaren@y To: > xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > ahoo.com> cc: > (bcc: omprakash.v/Polaris) > > Subject: > How to create document with different headers > but same > 02/07/2005 body > (xslfo/xslt) > > 06:26 PM > > > Please > > > respond to > > > xsl-list > > > > > > > > > > > > > I am going round and round in circles trying to > create > a pdf document (using xslt and xslfo) that has a > different header on the first page to the rest of > the > document, but the SAME body. > > Basically my body content is solely a list of items > displayed using a xsl:for-each loop. This list is > an > unknown length and needs to flow over to the next > page > and the next etc. > > The first page of the document has a large header > and > footer to display. But for the rest of the pages I > only need to display a small header section. The > body > for all the pages is however the same. > > Does anybody know how to do this? I have tried all > sorts with multiple page-sequences and a > page-sequence-master but cannot get it to use the > same > body. I cannot have the for loop start again on the > second page, it must continue from the first page. > Also, the size of the items displayed is not limited > to a single line and therefore it is unknown as to > how > many items will fit on a page. > > I've also tried using an xsl:if statement but don't > know how to get the page number. I was thinking if > I > could get the page number then I could just use an > if > statement to determine which header code to display. > > Please help! > > > > > > __________________________________ > Do you Yahoo!? > Take Yahoo! Mail with you! Get it on your mobile > phone. > http://mobile.yahoo.com/maildemo > > > > > > > This e-Mail may contain proprietary and confidential > information and is sent for the intended > recipient(s) only. > If by an addressing or transmission error this mail > has been misdirected to you, you are requested to > delete this mail immediately. > You are also hereby notified that any use, any form > of reproduction, dissemination, copying, disclosure, > modification, > distribution and/or publication of this e-mail > message, contents or its attachment other than by > its intended recipient/s is strictly prohibited. > > Visit Us at http://www.polaris.co.in > > __________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|