xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "robyp7 ." <rob...@gmail.com>
Subject how can override the start fo:page-number in xsl:fo with my number
Date Mon, 07 Sep 2015 12:28:53 GMT
Hi,

i use an old fop lib version 0.20.5
I have an xsl:fo with

<fo:block text-align="end">

       *Page number :*<fo:page-number />
</fo:block>
this is in the footer

I need to create a PDF with a initial number > 1 and for ex. 10 or 11 or
some other else..

So the first page begin with 10, the secondo eith 11 and so..

I need to pass this number as parameter from jsp web page to my bean/java
classes that call the fop rendering

I implement a CustomRender (it extend the class org
<eclipse-javadoc:%E2%98%82=JFXIntegration/C:%5C/Users%5C/portoni%5C/.m2%5C/repository%5C/fop%5C/fop%5C/0.20.5%5C/fop-0.20.5.jar%3Corg>
.apache
<eclipse-javadoc:%E2%98%82=JFXIntegration/C:%5C/Users%5C/portoni%5C/.m2%5C/repository%5C/fop%5C/fop%5C/0.20.5%5C/fop-0.20.5.jar%3Corg.apache>
.fop
<eclipse-javadoc:%E2%98%82=JFXIntegration/C:%5C/Users%5C/portoni%5C/.m2%5C/repository%5C/fop%5C/fop%5C/0.20.5%5C/fop-0.20.5.jar%3Corg.apache.fop>
.render
<eclipse-javadoc:%E2%98%82=JFXIntegration/C:%5C/Users%5C/portoni%5C/.m2%5C/repository%5C/fop%5C/fop%5C/0.20.5%5C/fop-0.20.5.jar%3Corg.apache.fop.render>
.Renderer)
and i override tese two method:

*public* *void* render(Page page, OutputStream outputStream){

*throws* IOException, FOPException {


   page.setNumber(pageCount);

System.out.println("##@@## Rendering page " + page.getNumber());

pageCount++;

renderer.render(page, outputStream);

}


*public* *void* renderPage(Page page){
page.setNumber(pageCount);

System.out.println("@@##@@ Rendering page " + page.getNumber());

pageCount++;

renderer.renderPage(page);

}


but page.setNumber(pageCount); doesn't seem to work!

How can I do this work?
Thanks in advice!


Roberto

Mime
View raw message