RE: [xsl] Page numbering

Subject: RE: [xsl] Page numbering
From: "Angela Williams" <Angela.Williams@xxxxxxxxxxxxxxxxxx>
Date: Fri, 25 May 2007 14:54:18 -0500
Andy,
I am currently working on the same type of project.

I use a two-step process.  The repository manager completes my
pre-processing transform, where I replace variables with actual data and
perform some formatting steps that would be difficult to manage within a
single transform.  As part of this pre-process, I copy everything else
in the document as-is. The repository manager takes the result of the
pre-process and transforms the new, merged document with my master
document stylesheet.

You could use the pre-process step to merge the cover sheet with the
requested document, and then use fo page numbering to insert the number
of pages.

<xsl:template match="current-page">
  <fo:inline>
     <fo:page-number />
  </fo:inline>
</xsl:template>

<xsl:template match="total-pages">
  <fo:inline>
    <fo:page-number-citation ref-id="the-end" />
  </fo:inline>
</xsl:template>

<snippet>
    <fo:flow flow-name="body">
       <xsl:apply-templates />

      <fo:block id="the-end" />
    </fo:flow>
  </fo:page-sequence>
</snippet>

And the usage is: Page <current-page /> of <total-pages />.


Hope this helps!
Angela Williams
Software Developer
The 401k Company, A Charles Schwab Company
98 San Jacinto Blvd. ~ Suite 1100 ~ Austin, TX 78701
Office: 512.344.1547 ~ Fax: 512.397.6656
Angela.Williams@xxxxxxxxxxxxxxxxxx

-----Original Message-----
From: Andy Carr1 [mailto:CARRA@xxxxxxxxxx]
Sent: Friday, May 25, 2007 4:31 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Page numbering

Hi, I need some help

I use xsl-fo to transform document xml (stored in a repository) into
PDF.

However prior to printing the document I need to create a cover sheet(s)
which could run to several pages.

My intention is to use xsl-fo to create this cover sheet, which must
contain the number of pages (document + cover-sheet(s) ).

Does anyone know how I could calculate the number of pages in the
repository stored document "on the fly" as the cover sheet needs to
contain this information.

The process flow is something like

1. Search Repository
2. Find Document
3. Right click -> print request
4. Create cover-sheet PDF (containing number of pages) 5. Send
cover-sheet and document to printer as PDF.

My brain is hurting trying to figure this out, so any help would be
appreciated.

Regards
Andy

Andy Carr
Senior IT Specialist
Tel: Internal - 298037 External - 01252 558037 Mail Point  M1C IBM
Application Services Meudon House, Meudon Avenue, Farnborough, GU14 7NB
(Notes) Andy Carr1/UK/IBM@IBMGB
(Internet)CARRA@xxxxxxxxxx






Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number

741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU

Current Thread