OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] How to get total number of pages in the footer?


Bob Stayton wrote:

> Has anyone else solved this problem?

Yes, but I used two passes for formatting. During the first pass 
document was formatted, then I used itext 
(http://www.lowagie.com/iText/) to read the total number of pages from 
PDF. This number was used to generate new FO file for the second pass.

As itext is written in Java, you can call it directly from Saxon. Just 
place itext.jar into Java classpath and then use itext directly from 
XSLT stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
		xmlns:itext="com.lowagie.text.pdf.PdfReader"
		exclude-result-prefixes="itext"
                 version="1.0">

<xsl:variable name="totalNumberOfPages" 
select="itext:getNumberOfPages(itext:new('document.pdf'))"/>

...

				Jirka



-- 
------------------------------------------------------------------
   Jirka Kosek     e-mail: jirka@kosek.cz     http://www.kosek.cz
------------------------------------------------------------------
   Profesionální školení a poradenství v oblasti technologií XML.
      Podívejte se na náš nově spuštěný web http://DocBook.cz
        Podrobný přehled školení http://xmlguru.cz/skoleni/
------------------------------------------------------------------
                    Nejbližší termíny školení:
      ** XSLT 13.-16.3.2006 ** XML schémata 24.-26.4.2006 **
        ** DocBook 15.-17.5.2006 ** XSL-FO 12.-13.6.2006 **
------------------------------------------------------------------

S/MIME Cryptographic Signature



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]