AW: : Getting number of rendered pages

2001-07-30 Thread Erik Rehrmann

Hi Enrico,

thanks for your reply. Yes, your within FOP is worth a try, but I'm not happy with 
modifying the FOP source. 
I'd prefer to have a, say, RenderInfo object, to get useful information about the 
rendered document.

Thanks anyway,

Erik Rehrmann
IOn AG - [EMAIL PROTECTED]


-Ursprüngliche Nachricht-
Von: Enrico Schnepel [mailto:[EMAIL PROTECTED]] 
Gesendet: Montag, 30. Juli 2001 08:34
An: [EMAIL PROTECTED]
Betreff: Re: : Getting number of rendered pages


Hi Erik,

Yes, I have a Idea...

externaly from FOP:
You redirect stdout from FOP and use the last opening bracket [ and the 
following number as pagenumber.

within FOP:
You write your own class derived from PageSequence or 
PageNumberGenerator and write the last pagenumber (may be in the destructor) 
directly to your database or to a file.

Regards,
Enrico

Am Sonntag, 29. Juli 2001 20:45 schrieben Sie:
 Hi Enrico,

 this is a way to use the page number within the same transformation 
 process, but I need to have the page count in my application to write 
 it in a database table and to use it in a different transformation as 
 starting page.

 Any idea?

 Regards,
 
 Erik Rehrmann
 IOn AG - [EMAIL PROTECTED]


 -Ursprüngliche Nachricht-
 Von: Enrico Schnepel [mailto:[EMAIL PROTECTED]]
 Gesendet: Sonntag, 29. Juli 2001 20:37
 An: [EMAIL PROTECTED]
 Betreff: Re: Getting number of rendered pages


 Hi Erik

 I am writing a

 fo:block keep-with-previous=always id=LastPage 
 font-size=1pt/fo:block

 before /fo:flow and display the page number with

 Page fo:page-number/ of fo:page-number-citation ref-id=LastPage/

 within my region-before or region-after. This should result in

 Page 1 of 3

 I don't know wether this is the recomended way of getting the last 
 page number but it's working fine.

 Regards
 Enrico

 Am Sonntag, 29. Juli 2001 18:10 schrieben Sie:
  Hi all,
 
  does anybody know if it's possible to get the number of rendered 
  pages? I searched the docs, but couldn't find anything about it.
 
  I think it should be possible, because the PDFRenderer prints the 
  current page number to the message system.
 
  We have to print a book divided into several chapters and every 
  chapter has to be rendered separately, but must begin with the right 
  page number (information of every chapter is in a database table to 
  keep track of chapter sequence and page numbering).
 
  Any help is greatly appreciated.
 
  
  Erik Rehrmann
  IOn AG - [EMAIL PROTECTED]
 
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Getting number of rendered pages

2001-07-30 Thread Erik Rehrmann

Hi Jean-Claude,

the applications flow of work is:

1) Client requests print of chapter
2) A ProcessManager on the server picks up that request, looks up what process should 
handle that request and starts it with the necessary environment.
3) The process connects to the database, extracs all information needed for printing 
this chapter to XML and calls FOP for rendering the chapter to PDF.
4) After finishing this work the ProcessManager informs the client wether his request 
was handled successful and where he can find the PDF.

If I use java-extensions I have a problem of authentication. While the XML is 
generated into a public directory I cannot insert any database connect information. So 
wherefrom gets the java-extension the database connect information (server, port, 
service, database name, user, password)?

Regards,

Erik Rehrmann
IOn AG - [EMAIL PROTECTED]


-Ursprüngliche Nachricht-
Von: GALLO Jean-Claude [mailto:[EMAIL PROTECTED]] 
Gesendet: Montag, 30. Juli 2001 09:46
An: '[EMAIL PROTECTED]'
Betreff: RE: Getting number of rendered pages


Erik

try java-extensions. This help you to write external Java classes directly callable 
from your XSL transformation rules.


a simple exmaple :
xsl:stylesheet
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0
 xmlns:fo=http://www.w3.org/1999/XSL/Format;
 xmlns:e=http://www.w3.org/1999/XSL/Spec/ElementSyntax;
 xmlns:xjava=xalan:://mycompany.util.PrintInfo
 xmlns:java=http://www.apache.org/xslt/java;
exclude-result-prefixes=java



xsl:template match =TITLE
  xsl:variable name=locfo:page-number-citation
ref-id=@id//xsl:variable
  xsl:variable name=title select=text()/
  xsl:value-of select=ejava:putValue($loc, $title)/
   fo:block font-size=11pt
   ...

Just select the right place to put such rules in order to detect the start and the end 
of your chapters. I suppose you know JDBC to connect java code to your database.

Good luck.


 -Message d'origine-
 De: Erik Rehrmann [mailto:[EMAIL PROTECTED]]
 Date: 29 July 2001 18:10
 À: '[EMAIL PROTECTED]'
 Objet: Getting number of rendered pages
 
 
 Hi all,
 
 does anybody know if it's possible to get the number of
 rendered pages? I searched the docs, but couldn't find 
 anything about it.
 
 I think it should be possible, because the PDFRenderer prints
 the current page number to the message system.
 
 We have to print a book divided into several chapters and
 every chapter has to be rendered separately, but must begin 
 with the right page number (information of every chapter is 
 in a database table to keep track of chapter sequence and 
 page numbering). 
 
 Any help is greatly appreciated.
 
 
 Erik Rehrmann
 IOn AG - [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 


__
Jean Claude GALLO
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: AW: Getting number of rendered pages

2001-07-30 Thread Keiron Liddle


It could be possible to do this using a simple extension to fop.

- define you own namespace, with elements and props
- put the markup at the end of the document, where it can read the page
number
- provide some sort of connection with you other code


On Mon, 30 Jul 2001 10:28:39 Erik Rehrmann wrote:
 Hi Jean-Claude,
 
 the applications flow of work is:
 
 1) Client requests print of chapter
 2) A ProcessManager on the server picks up that request, looks up what
 process should handle that request and starts it with the necessary
 environment.
 3) The process connects to the database, extracs all information needed
 for printing this chapter to XML and calls FOP for rendering the chapter
 to PDF.
 4) After finishing this work the ProcessManager informs the client wether
 his request was handled successful and where he can find the PDF.
 
 If I use java-extensions I have a problem of authentication. While the
 XML is generated into a public directory I cannot insert any database
 connect information. So wherefrom gets the java-extension the database
 connect information (server, port, service, database name, user,
 password)?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: AW: Getting number of rendered pages

2001-07-30 Thread Erik Rehrmann

Hi Keiron,

- define you own namespace, with elements and props

ok

- put the markup at the end of the document, where it can read the page number

ok

- provide some sort of connection with you other code

maybe I'm currently too tired to understand, but what exactly to you mean by this?



-Ursprüngliche Nachricht-
Von: Keiron Liddle [mailto:[EMAIL PROTECTED]] 
Gesendet: Montag, 30. Juli 2001 10:41
An: [EMAIL PROTECTED]
Betreff: Re: AW: Getting number of rendered pages



It could be possible to do this using a simple extension to fop.

- define you own namespace, with elements and props
- put the markup at the end of the document, where it can read the page number
- provide some sort of connection with you other code


On Mon, 30 Jul 2001 10:28:39 Erik Rehrmann wrote:
 Hi Jean-Claude,
 
 the applications flow of work is:
 
 1) Client requests print of chapter
 2) A ProcessManager on the server picks up that request, looks up what 
 process should handle that request and starts it with the necessary 
 environment.
 3) The process connects to the database, extracs all information 
 needed for printing this chapter to XML and calls FOP for rendering 
 the chapter to PDF.
 4) After finishing this work the ProcessManager informs the client 
 wether his request was handled successful and where he can find the 
 PDF.
 
 If I use java-extensions I have a problem of authentication. While the 
 XML is generated into a public directory I cannot insert any database 
 connect information. So wherefrom gets the java-extension the database 
 connect information (server, port, service, database name, user, 
 password)?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Getting number of rendered pages

2001-07-30 Thread Erik Rehrmann

Hi Jeremias,

THAT's exactly what I was searching for! But unfortunatetly, the Driver.format() in 
the current cvs versions looks like

/**
 * format the formatting object tree into an area tree
 */
public synchronized void format()
throws FOPException {
FontInfo fontInfo = new FontInfo();
_renderer.setupFontInfo(fontInfo);

_areaTree = new AreaTree();
_areaTree.setFontInfo(fontInfo);

_treeBuilder.format(_areaTree);
}

The javadoc confirms this!

Do you mean an other class/method ?


Erik Rehrmann
IOn AG - [EMAIL PROTECTED]


-Ursprüngliche Nachricht-
Von: Jeremias Maerki [mailto:[EMAIL PROTECTED]] 
Gesendet: Montag, 30. Juli 2001 11:51
An: [EMAIL PROTECTED]
Betreff: Re: Getting number of rendered pages


 does anybody know if it's possible to get the number of rendered 
 pages? I searched the docs, but couldn't find anything about it.
 
 I think it should be possible, because the PDFRenderer prints the 
 current page number to the message system.
 
 We have to print a book divided into several chapters and every 
 chapter has to be rendered separately, but must begin with the right page number 
(information of every chapter is in a database table to keep track of chapter 
sequence and page numbering).
 
 Any help is greatly appreciated.

Driver.format() returns the number of generated pages as an integer.

Jeremias Märki

mailto:[EMAIL PROTECTED]

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029
Internet http://www.outline.ch


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: AW: Getting number of rendered pages

2001-07-30 Thread Jeremias Maerki

 THAT's exactly what I was searching for! But unfortunatetly, the Driver.format() in 
the current cvs versions looks like
 Do you mean an other class/method ?

No, the problem is this: I'm using an older version which still returned
the number of pages. Obviously, someone removed this functionality in
the meantime. My version from Feb 2001 does it this way:

return this.areaTree.getPages().size();

Can anybody tell my why this has been taken out? From what I can see in
the sources AreaTree still has the function getPages(). If nothing
speaks against it I'd like to see this enabled again.


Jeremias Märki

mailto:[EMAIL PROTECTED]

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029
Internet http://www.outline.ch


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: AW: Getting number of rendered pages

2001-07-30 Thread Keiron Liddle


On Mon, 30 Jul 2001 13:28:58 Jeremias Maerki wrote:
  THAT's exactly what I was searching for! But unfortunatetly, the
 Driver.format() in the current cvs versions looks like
  Do you mean an other class/method ?
 
 No, the problem is this: I'm using an older version which still returned
 the number of pages. Obviously, someone removed this functionality in
 the meantime. My version from Feb 2001 does it this way:
 
 return this.areaTree.getPages().size();
 
 Can anybody tell my why this has been taken out? From what I can see in
 the sources AreaTree still has the function getPages(). If nothing
 speaks against it I'd like to see this enabled again.

I can't find any evidence that the format method ever returned the page
number. Maybe you added that in.

Maybe this is where a user agent could come in.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: AW: Getting number of rendered pages

2001-07-30 Thread Jeremias Maerki

 On Mon, 30 Jul 2001 13:28:58 Jeremias Maerki wrote:
   THAT's exactly what I was searching for! But unfortunatetly, the
  Driver.format() in the current cvs versions looks like
   Do you mean an other class/method ?
  
  No, the problem is this: I'm using an older version which still returned
  the number of pages. Obviously, someone removed this functionality in
  the meantime. My version from Feb 2001 does it this way:
  
  return this.areaTree.getPages().size();
  
  Can anybody tell my why this has been taken out? From what I can see in
  the sources AreaTree still has the function getPages(). If nothing
  speaks against it I'd like to see this enabled again.
 
 I can't find any evidence that the format method ever returned the page
 number. Maybe you added that in.

Doh. Now that you say it. That maybe true. Too bad we don't have air
conditioning, my head seems to be boiling. :-)

So, why don't we add it in?

 Maybe this is where a user agent could come in.

Would you please explain? Thanks!

Jeremias Märki

mailto:[EMAIL PROTECTED]

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029
Internet http://www.outline.ch


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Getting number of rendered pages

2001-07-29 Thread Erik Rehrmann

Hi Enrico,

this is a way to use the page number within the same transformation process, but I 
need to have the page count in my application to write it in a database table and to 
use it in a different transformation as starting page.

Any idea?

Regards,

Erik Rehrmann
IOn AG - [EMAIL PROTECTED]


-Ursprüngliche Nachricht-
Von: Enrico Schnepel [mailto:[EMAIL PROTECTED]] 
Gesendet: Sonntag, 29. Juli 2001 20:37
An: [EMAIL PROTECTED]
Betreff: Re: Getting number of rendered pages


Hi Erik

I am writing a 

fo:block keep-with-previous=always id=LastPage 
font-size=1pt/fo:block

before /fo:flow and display the page number with 

Page fo:page-number/ of fo:page-number-citation ref-id=LastPage/

within my region-before or region-after. This should result in

Page 1 of 3

I don't know wether this is the recomended way of getting the last page 
number but it's working fine.

Regards
Enrico


Am Sonntag, 29. Juli 2001 18:10 schrieben Sie:
 Hi all,

 does anybody know if it's possible to get the number of rendered 
 pages? I searched the docs, but couldn't find anything about it.

 I think it should be possible, because the PDFRenderer prints the 
 current page number to the message system.

 We have to print a book divided into several chapters and every 
 chapter has to be rendered separately, but must begin with the right 
 page number (information of every chapter is in a database table to 
 keep track of chapter sequence and page numbering).

 Any help is greatly appreciated.

 
 Erik Rehrmann
 IOn AG - [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]