I am trying to add page numbers to my document in xsl fo. I can get the page numbers to work but I need them to show at the bottom of each page. I know you can define an area as region-after but don't know how. Heres my xsl file so far.
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="ISO-8859-1" ?>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:xlink="http://www.w3.org/1999/xlink">
- <xsl:output method="xml" indent="yes"/>
- <xsl:template match="/">
- <fo:root>
- <fo:layout-master-set>
- <fo:simple-page-master master-name="A4"
- page-height="29.7cm" page-width="21.0cm" margin="1cm">
- <fo:region-body/>
- </fo:simple-page-master>
- </fo:layout-master-set>
- <fo:page-sequence master-reference="A4">
- <fo:flow flow-name="xsl-region-body">
- <fo:block-container absolute-position="absolute"
- top="-2cm" left="-3cm" width="670" height="947px"
- background-image="file:background.gif">
- <fo:block/>
- </fo:block-container>
- <fo:block font-family="Helvetica" font-size="18pt" text-align="end" space-before="5px">
- Date: <xsl:value-of select="quote/project/date"/>
- </fo:block>
- <fo:block font-family="Helvetica" font-size="18pt" text-align="end" space-before="5px">
- Project Manager: <xsl:value-of select="quote/project/proj_manager"/>
- </fo:block>
- <fo:block font-family="Helvetica" font-size="18pt" text-align="end" space-before="1cm">
- <xsl:value-of select="quote/project/comp_name"/>
- </fo:block>
- <fo:block font-family="Helvetica" font-size="18pt" text-align="end" space-after="20cm">
- <xsl:value-of select="quote/project/project_name"/>
- </fo:block>
- <fo:block font-family="Helvetica" font-size="10pt" text-align="center" space-before="3cm">
- 18 Derryloran Industrial Estate
- </fo:block>
- <fo:block font-family="Helvetica" font-size="10pt" text-align="center">
- Sandholes Road
- </fo:block>
- <fo:block font-family="Helvetica" font-size="10pt" text-align="center">
- Cookstown
- </fo:block>
- <fo:block font-family="Helvetica" font-size="10pt" text-align="center">
- Co. Tyrone
- </fo:block>
- <fo:block font-family="Helvetica" font-size="10pt" text-align="center">
- Tel: (028) 8676 1141 Fax: (028) 8676 9732 Email: info@tes-ni.com
- </fo:block>
- <!-- Nextpage: Quote -->
- <fo:block break-before="page" space-before="2in" space-after="2in">
- <fo:block text-align="center" space-before="2cm" font-weight="bold" font-size="18pt">
- PANELS
- </fo:block>
- <fo:table space-before="1cm">
- <fo:table-body>
- <xsl:for-each select="quote/panels/panel">
- <fo:table-row>
- <fo:table-cell padding="6pt">
- <fo:block text-align="start"><xsl:value-of select="panel_name"/></fo:block>
- </fo:table-cell>
- <fo:table-cell padding="6pt">
- <fo:block text-align="end" space-after="2cm">£<xsl:value-of select="totalcost"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- </xsl:for-each>
- <fo:table-row>
- <fo:table-cell>
- <fo:block text-align="start" font-weight="bold" border-top="0.5pt solid red">Sub Total</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block font-weight="bold" text-align="end" border-top="0.5pt solid red">£<xsl:value-of select="sum(quote/panels/panel/totalcost)"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- </fo:table-body>
- </fo:table>
- <fo:block text-align="center" space-before="2cm" font-weight="bold" font-size="18pt">
- ADDITIONAL ITEMS
- </fo:block>
- <fo:table space-before="1cm">
- <fo:table-body>
- <xsl:for-each select="quote/project/extras/item">
- <fo:table-row>
- <fo:table-cell padding="6pt">
- <fo:block text-align="start"><xsl:value-of select="ex_item"/></fo:block>
- </fo:table-cell>
- <fo:table-cell padding="6pt">
- <fo:block text-align="end">£<xsl:value-of select="ex_cost"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- <fo:table-row>
- <fo:table-cell padding="6pt" number-columns-spanned="2">
- <fo:block font-style="italic" text-align="start"><xsl:value-of select="ex_description"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- </xsl:for-each>
- <fo:table-row>
- <fo:table-cell>
- <fo:block text-align="start" font-weight="bold" border-top="0.5pt solid red">Sub Total</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block font-weight="bold" text-align="end" border-top="0.5pt solid red">£<xsl:value-of select="sum(quote/project/extras/item/ex_cost)"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- </fo:table-body>
- </fo:table>
- <fo:table space-before="1cm">
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell>
- <fo:block text-align="start" font-weight="bold" border-top="0.5pt solid red" font-size="18pt">Total Cost</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block font-weight="bold" text-align="end" border-top="0.5pt solid red" font-size="18pt">£<xsl:value-of select="sum(quote/project/extras/item/ex_cost)+sum(quote/panels/panel/totalcost)"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- </fo:table-body>
- </fo:table>
- </fo:block>
- <fo:block text-align="center">Page <fo:page-number/></fo:block>
- <!-- Nextpage: Quotation Terms -->
- <fo:block break-before="page" space-before="2in" space-after="2in">
- <fo:block text-align="start" space-before="2cm" font-size="18pt" font-weight="bold">
- PAYMENT TERMS
- </fo:block>
- <fo:block font-family="Helvetica" font-size="12pt" text-align="start" space-before="1cm">
- <xsl:value-of select="quote/project/extras/payment"/>
- </fo:block>
- <fo:block text-align="start" space-before="2cm" font-size="18pt" font-weight="bold">
- DELIVERY TERMS
- </fo:block>
- <fo:block font-family="Helvetica" font-size="12pt" text-align="start" space-before="1cm">
- <xsl:value-of select="quote/project/extras/delivery"/>
- </fo:block>
- <fo:block text-align="start" space-before="2cm" font-size="18pt" font-weight="bold">
- VALIDITY
- </fo:block>
- <fo:block font-family="Helvetica" font-size="12pt" text-align="start" space-before="1cm">
- <xsl:value-of select="quote/project/extras/valid_for"/>
- </fo:block>
- </fo:block>
- <fo:block text-align="center">Page <fo:page-number/></fo:block>
- <!-- Nextpage: Our Company -->
- <fo:block break-before="page" space-before="2in" space-after="2in">
- <fo:block text-align="center" space-before="6cm" font-size="18pt" font-weight="bold">
- OUR COMPANY
- </fo:block>
- <fo:block text-align="justify" space-before="1cm" font-size="12pt">
- TES are a multi-faceted company, working to the highest standard of engineering excellence. Innovative and dynamic, TES are established in a number of industries offering professional and quality services to include;
- </fo:block>
- <fo:list-block space-before="1cm">
- <fo:list-item >
- <fo:list-item-label end-indent="label-end()" >
- <fo:block space-before="1cm">
- 1)
- </fo:block>
- </fo:list-item-label>
- <fo:list-item-body start-indent="body-start()" >
- <fo:block text-align="justify" space-before="1cm" font-size="12pt">
- Mechanical and Electrical Services to the Water Treatment Industry
- </fo:block>
- </fo:list-item-body>
- </fo:list-item>
- <fo:list-item >
- <fo:list-item-label end-indent="label-end()" >
- <fo:block space-before="1cm">
- 2)
- </fo:block>
- </fo:list-item-label>
- <fo:list-item-body start-indent="body-start()" >
- <fo:block text-align="justify" space-before="1cm" font-size="12pt">
- Design, manufacture and installation of electrical control panels
- </fo:block>
- </fo:list-item-body>
- </fo:list-item>
- <fo:list-item >
- <fo:list-item-label end-indent="label-end()" >
- <fo:block space-before="1cm">
- 3)
- </fo:block>
- </fo:list-item-label>
- <fo:list-item-body start-indent="body-start()" >
- <fo:block text-align="justify" space-before="1cm" font-size="12pt">
- Integrated SCADA and PLC Software
- </fo:block>
- </fo:list-item-body>
- </fo:list-item>
- <fo:list-item >
- <fo:list-item-label end-indent="label-end()" >
- <fo:block space-before="1cm">
- 4)
- </fo:block>
- </fo:list-item-label>
- <fo:list-item-body start-indent="body-start()" >
- <fo:block text-align="justify" space-before="1cm" font-size="12pt">
- Full range of bespoke Building Services Solutions
- </fo:block>
- </fo:list-item-body>
- </fo:list-item>
- </fo:list-block>
- <fo:block text-align="justify" space-before="1cm" font-size="12pt">
- Committed to exceeding client expectations, TES, with our team of experienced designers and engineers remain focused on offering pioneering solutions and expert design services.
- </fo:block>
- <fo:block text-align="justify" space-before="1cm" font-size="12pt">
- Our Project Management team are renown for the skilled execution of professional engineering and management services ensuring that each project is delivered to the highest standard in a timely and efficient manner.
- </fo:block>
- <fo:block text-align="justify" space-before="1cm" font-size="12pt">
- With a proven track record in the delivery of high value public and private sector projects, TES never fail to deliver. Fully committed to deploying stringent Health and Safety Policies, Quality standards and Environmental procedures, TES are without question a socially responsible business.
- </fo:block>
- <fo:block text-align="justify" space-before="1cm" font-size="12pt">
- A fast-moving and forward thinking organisation, TES offer fully integrated engineering services in an expert and highly professional manner. Our reputation exceeds us as offering a client-focused service through quality workmanship. This is why our company mantra remains;
- </fo:block>
- <fo:block text-align="center" space-before="2cm" font-size="16pt" font-weight="bold">
- Quality Driven....Customer Focused
- </fo:block>
- <fo:block text-align="center">Page <fo:page-number/></fo:block>
- <xsl:for-each select="quote/panels/panel">
- <!-- Nextpage: SVG Drawings -->
- <fo:block break-before="page">
- <fo:instream-foreign-object>
- <svg xmlns="http://www.w3.org/2000/svg" width="29.7cm" height="29.7cm" xml:space="preserve">
- <g transform="rotate(-90)">
- <image xlink:href="{svgdrawing/text()}" x="-27cm" y="1cm" width="70cm" height="40cm"/>
- </g>
- </svg>
- </fo:instream-foreign-object>
- </fo:block>
- </xsl:for-each>
- </fo:block>
- </fo:flow>
- </fo:page-sequence>
- </fo:root>
- </xsl:template>
- </xsl:stylesheet>