RE: Problem with .fo file

2003-12-11 Thread frederic . kieffer
Thanks for your quick answer.

As I was thinking Crimson was the cause of this issue, I changed the fo:root
tag of the .fo file,
and the parser was not confused by the document anymore.

Frédéric Kieffer


-Message d'origine-
De: J.Pietschmann [mailto:[EMAIL PROTECTED]
Date: mercredi 10 décembre 2003 23:27
À: [EMAIL PROTECTED]
Objet: Re: Problem with .fo file


[EMAIL PROTECTED] wrote:
 I'm able to convert it to PDF when using the command line, 
 but when I try to print it (using awt) thanks to embedded code, I have
this
 error :  
...
 [INFO,Default] Using org.apache.crimson.parser.XMLReaderImpl as SAX2
Parser
...
 [ERROR,Default] org.apache.fop.apps.FOPException: Error while attempting
to
 print document, root cause : Document root element is missing.

The FO document has a BOM at the start. Some old versions (or even all)
of the Crimson parser are confused by this. What JVM/run time environment
are you using? Check whether you can enforce using a recent Xerces release
as XML parser (there are plenty of instructions for everything on the net).

J.Pietschmann



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

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



Problem with .fo file

2003-12-10 Thread frederic . kieffer
Hello people,

I'm having trouble with a .fo file. 
I'm able to convert it to PDF when using the command line, 
but when I try to print it (using awt) thanks to embedded code, I have this
error :  

[INFO,Default] [PrintDocument][setupFopAndRender] loading and printing
XSL-FO document file:/C:/JBoss-2.4.4_Tomcat-3.2.3/properties/JO.fo
[INFO,Default] [INFO]
[INFO,Default] Using org.apache.crimson.parser.XMLReaderImpl as SAX2 Parser
[INFO,Default] [INFO]
[INFO,Default] Using org.apache.crimson.parser.XMLReaderImpl as SAX2 Parser
[INFO,Default] [INFO]
[INFO,Default] Using org.apache.crimson.parser.XMLReaderImpl as SAX2 Parser
[INFO,Default] [INFO]
[INFO,Default] building formatting object tree
[INFO,Default] [INFO]
[INFO,Default] setting up fonts
[ERROR,Default] org.apache.fop.apps.FOPException: Error while attempting to
print document, root cause : Document root element is missing.

Here is the sniplet of code I use :

...

 public void setupFopAndRender(String documentSource) throws FOPException,
IOException
{
PrinterJob aPrinterJob = PrinterJob.getPrinterJob();
PrintRenderer aPrintRenderer = new PrintRenderer(aPrinterJob);

URL anURL = ClassLoader.getSystemResource(documentSource);
System.out.println([PrintDocument][setupFopAndRender] loading and
printing XSL-FO document   + anURL.toString());
if (anURL == null)
throw new IOException(XSL-FO file could not be found.\n
Check for its presence in the classpath);
InputStream anInputStream = anURL.openStream();
Options options = new Options(userConfigFile);
Driver FOPDriver = new Driver(new InputSource(anInputStream), null);
Logger FOPLogger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
MessageHandler.setScreenLogger(FOPLogger);
FOPDriver.setLogger(FOPLogger);
FOPDriver.setRenderer(aPrintRenderer);
renderFop(FOPDriver);
anInputStream.close();
}




 private synchronized void renderFop(Driver FOPDriver) throws
IOException, FOPException
 {
FOPDriver.run();
 }




What am I missing ? What's wrong with my document ?
Thanks for any help
Fredéric Kieffer

Attached are the .fo file, and it's pdf



jo.pdf
Description: Binary data


JO.fo
Description: Binary data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RTF Support

2003-11-13 Thread frederic . kieffer
Hi people,
 
I just read that the support for RTF will be built soon. Is there any
release date scheduled ?
Thanks.
Frédéric

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



Background image

2003-05-12 Thread frederic . kieffer
Hi everybody.
I have a very simple question (which has been already answered I presume) :
How do i display a background image (my company's logo) in the center of the
page, without having it being repeateted through the document (I don't know
if I should use the background-repeat property of region-body, and
what's the value it should be set to).
Thanks for your feedback
Frédéric

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



RE: Background image

2003-05-12 Thread frederic . kieffer
Thanks for your support, but my document consists in a single page. 

-Message d'origine-
De: Matthew Lancashire [mailto:[EMAIL PROTECTED]
Date: lundi 12 mai 2003 15:19
À: [EMAIL PROTECTED]
Objet: RE: Background image


If it to be shown on the first page only you could define two page-masters
and
set up your page-sequence-master so it contains 2
conditional-page-master-references
The first one would have a condition of page-position=first
The second with page-position=rest

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 12 May 2003 14:08
To: [EMAIL PROTECTED]
Subject: Background image


Hi everybody.
I have a very simple question (which has been already answered I presume) :
How do i display a background image (my company's logo) in the center of the
page, without having it being repeateted through the document (I don't know
if I should use the background-repeat property of region-body, and
what's the value it should be set to).
Thanks for your feedback
Frédéric

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


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

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



Different page layout using pdf renderer or awt renderer

2003-02-17 Thread frederic . kieffer
Hi.
Rendering a document through the awtrenderer (sent directly to the printer)
doesn't give me the same result than rendering the samep document throught
the PDF renderer (PDF is generated in a servlet, then open in a browser
window). 
Both modules share the embedded fonts and xslt file.
Any hints?
Frédéric

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



RE: Different page layout using pdf renderer or awt renderer

2003-02-17 Thread frederic . kieffer
Thank you very much for your input.
Frédéric

-Message d'origine-
De: Jeremias Maerki [mailto:[EMAIL PROTECTED]
Date: lundi 17 février 2003 11:53
À: [EMAIL PROTECTED]
Objet: Re: Different page layout using pdf renderer or awt renderer


This happens because the two renderer use a different font source which
results in slightly different font metrics for the same fonts. This in
turn has consequences on the layout. There's currently nothing you can
do to get the same output other than by switching renderers. PDF and
PostScript, for example, should produce almost exactly the same output
because they can use the same font source. That's not possible with AWT.
It is even possible that different JDK version lead to different results
with the AWT renderer. Please be aware that the AWT renderer doesn't
directly support font embedding. Font embedding is done by the printer
driver of your operating system if it is enabled there.

On 17.02.2003 10:18:19 frederic.kieffer wrote:
 Rendering a document through the awtrenderer (sent directly to the
printer)
 doesn't give me the same result than rendering the samep document throught
 the PDF renderer (PDF is generated in a servlet, then open in a browser
 window). 
 Both modules share the embedded fonts and xslt file.
 Any hints?


Jeremias Maerki


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

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



Pages counting.

2003-02-14 Thread frederic . kieffer
Hi people!
I have this time a simple question. How can I know the numbers of pages that
FOP will render ? 
I need this because I have to write the information on the bottom of the
page(with something like :
 
Page fo:page-number/ , xsl:value-of select=$nbpages /
 
Thanks
Frédéric

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



RE: Pages counting.

2003-02-14 Thread frederic . kieffer
Thanks Markus.

-Message d'origine-
De: Müller, Markus [mailto:[EMAIL PROTECTED]
Date: vendredi 14 février 2003 16:12
À: [EMAIL PROTECTED]
Objet: AW: Pages counting.


Have a look at FOP.FAQ at http://xml.apache.org/fop/faq.html (FO) How do I
print the total number of pages, like in page 1 of 12.
Hope this is what you mean.

Markus



# -Ursprüngliche Nachricht-
# Von: [EMAIL PROTECTED] 
# [mailto:[EMAIL PROTECTED]
# Gesendet am: Freitag, 14. Februar 2003 16:07
# An: [EMAIL PROTECTED]
# Betreff: Pages counting.
# 
# Hi people!
# I have this time a simple question. How can I know the 
# numbers of pages that
# FOP will render ? 
# I need this because I have to write the information on the 
# bottom of the
# page(with something like :
#  
# Page fo:page-number/ , xsl:value-of select=$nbpages /
#  
# Thanks
# Frédéric
# 
# -
# To unsubscribe, e-mail: [EMAIL PROTECTED]
# For additional commands, e-mail: [EMAIL PROTECTED]
# 

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

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



Fop and Multithreading.

2003-02-12 Thread frederic . kieffer
Hi everybody!
Sorry to bother you again with my problem (running fop with EJBs), I'd like
to say that I still experience font corruption even if I use a singleton
class (or maybe i didn't design it correctly). 
So we felt back to a sequential approach to print our documents. We just
lost the speed we had when we tried to parallelize the documents' generation
(3s vs 20s).
So you can understand that when we have 3000 documents too print, this is
rather annoying.
If anybody had news about this subject, it'd be really welcome.
Thanks
Frédéric

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



RE: Fop and Multithreading.

2003-02-12 Thread frederic . kieffer
you'll find my attached my code.

-Message d'origine-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Date: mercredi 12 février 2003 17:58
À: [EMAIL PROTECTED]
Objet: Fop and Multithreading.


Hi everybody!
Sorry to bother you again with my problem (running fop with EJBs), I'd like
to say that I still experience font corruption even if I use a singleton
class (or maybe i didn't design it correctly). 
So we felt back to a sequential approach to print our documents. We just
lost the speed we had when we tried to parallelize the documents' generation
(3s vs 20s).
So you can understand that when we have 3000 documents too print, this is
rather annoying.
If anybody had news about this subject, it'd be really welcome.
Thanks
Frédéric

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



PrintRenderer.java
Description: Binary data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Antwort: Re: Antwort: Fop and multithreading.

2003-02-11 Thread frederic . kieffer
Like Reto, EJBs have been chosen to be strategic technology in my company.
Having tested Fop in Servlets I designed (generating pdf an opening it in
the client's browser) causes no problem ; 
in this case, the renderer I use is the PDF one.
But when I want to print directly (using the printer configured on the unix
box), I render the output through a class which extends AWTRenderer
which, and as Reto said, is not thread safe, because of the classe it uses.
So I was able to reproduce the issues outside EJBs.
I will try to write a testCase that reproduces the problems too.

Thanks.
Frédéric

-Message d'origine-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Date: lundi 10 février 2003 16:16
À: [EMAIL PROTECTED]
Objet: Antwort: Re: Antwort: Fop and multithreading.



Hi Jeremias,

I do agree very much with you about the concerns on EJB usage, though
unfortunately drop the EJB idea is not an option.
EJB is the chosen environment in this company (my client). Since XSL:FO has
also been chosen as strategic technology, we are bound to find a way for
the two to coexist.  Having a special service for the rendering may be an
option, but in the end this comes down to the same issues than doing it
inside the EJB using seperate ThreadPools, JMS and the like, this is a
long-discussed topic in EJB lists...

It seems obvious that you have not noticed the problems we see, because the
issue is most probably in AWTRenderer and its use of AWT classes
(java.awt.Font, java.awt.FontMetrics, java.awt.graphics).

Your suggestion is a good way forward: I will try write a TestCase that
reproduces the problems outside EJB and we see how we can go on from there.

Is the testcase you used in november available as a starter?

merci,
Reto


___

CSS Versicherung
Reto Blunschi EXTERNE
Rösslimattstrasse 40
CH-6002 Luzern
Telefon  ++41 (0)41 369 1236
Telefax  ++41 (0)41 369 1212
[EMAIL PROTECTED]
www.css.ch




Jeremias Maerki [EMAIL PROTECTED] on 10.02.2003 14:08:11

Bitte antworten an [EMAIL PROTECTED]

An:  [EMAIL PROTECTED]
Kopie:

Thema:   Re: Antwort: Fop and multithreading.

Frédéric and Reto,

having read the 24.1.2 Programming restrictions of the EJB 2.0
specification, I'd recommend you guys don't call FOP from an EJB. The
programming restrictions forbid among other things the following:
- Reading or writing of static variables (FOP still does this too often)
- Use of thread synchronization primitives (FOP does that mostly because
  of the static variables)
- Use of AWT functionality
- Use of java.io package to access files (which obviously happens as
  well)

So the singleton may also be a bad idea. I recommend you don't use FOP
within EJBs. Use a Servlet, a WebService or a custom-built server
service instead.

I've done some serious debugging of multithreading issues last November
by writing a test application that uses FOP in a multi-threaded fashion
(PDF only, no AWT). I haven't had the symptoms you describe so I can
only imagine it has to do with the enviroment (EJBs). Of course, it
could be that my test application was suboptimal, so maybe you two can
come up with a test application that triggers your symptoms outside an
EJB server. That would help track the error down. If you can't reproduce
the bug outside the EJB server I recommend you drop the EJB idea.

You can find the spec mentioned above here:
http://java.sun.com/products/ejb/docs.html#specs

Good luck!


On 10.02.2003 13:00:56 frederic.kieffer wrote:
 Thanks for your help.
 In addition, I'm in the same kind of situation as you are (multiprocessor
 Unix box, executing FOP in a Message Driven EJB on JBoss).
 I designed a singleton class which is used by this ejb each time a
message
 is being consumed.
 I'm going to try to synchronize its methods. Maybe this will help.


Jeremias Maerki


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









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

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



Fop and multithreading.

2003-02-10 Thread frederic . kieffer
Hi everybody.
I experience issues when using Fop (0.20.4 / 0.20.5rc) in a multithreaded
application.
I  designed a function which transforms a dom into pdf (using a xslt), then
prints it. This function is used in each thread.
I'm embedding fonts in this pdf.
The printed sheets of paper display incorrect font styles : sometimes font
size is change (8pt instead of 12pt), word are printed using italic, words
are overwritten on some others, etc..
If I use this function in a synchronous way, I don't have any problem.
Thanks for your help.
Frédéric kieffer
 

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



RE: Antwort: Fop and multithreading.

2003-02-10 Thread frederic . kieffer
Thanks for your help.
In addition, I'm in the same kind of situation as you are (multiprocessor
Unix box, executing FOP in a Message Driven EJB on JBoss).
I designed a singleton class which is used by this ejb each time a message
is being consumed.
I'm going to try to synchronize its methods. Maybe this will help.
Frédéric

-Message d'origine-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Date: lundi 10 février 2003 12:45
À: [EMAIL PROTECTED]
Objet: Antwort: Fop and multithreading.



Salut Frederic,

I am experiencing the same kind of problem as you do. In a multithreaded
env. (multiprocessor UNIX box, executing FOP in an EJB on weblogic) I see
that font sizes in different threads are messed up. In difference to your
problem I am producing TIFF output (using AWTRenderer). I have experimented
to use PDFRenderer, and I have not seen the problem using PDFRenderer,
though I did not embed fonts then.

I have posted to this list previously, but have not found a solution so
far.  I am still investigating the issue, last week I was doing other
things, but now I should have some time to further investigate. I am
suspecting that AWTRenderer, or the pja-liberary we are using on UNIX
becuase we have no X-Server on the box is responsible for it, though I have
no confirmation for this so far.

Since the symptoms we see look alike very much, we can probably join forces
here...
any help is very much welcome
Reto
___

CSS Versicherung
Reto Blunschi EXTERNE
Rösslimattstrasse 40
CH-6002 Luzern
Telefon  ++41 (0)41 369 1236
Telefax  ++41 (0)41 369 1212
[EMAIL PROTECTED]
www.css.ch




[EMAIL PROTECTED] on 10.02.2003 12:19:30

Bitte antworten an [EMAIL PROTECTED]

An:  [EMAIL PROTECTED]
Kopie:

Thema:   Fop and multithreading.

Hi everybody.
I experience issues when using Fop (0.20.4 / 0.20.5rc) in a multithreaded
application.
I  designed a function which transforms a dom into pdf (using a xslt), then
prints it. This function is used in each thread.
I'm embedding fonts in this pdf.
The printed sheets of paper display incorrect font styles : sometimes font
size is change (8pt instead of 12pt), word are printed using italic, words
are overwritten on some others, etc..
If I use this function in a synchronous way, I don't have any problem.
Thanks for your help.
Frédéric kieffer


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









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

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



RE: Antwort: Fop and multithreading.

2003-02-10 Thread frederic . kieffer
Thanks for your help

-Message d'origine-
De: Jeremias Maerki [mailto:[EMAIL PROTECTED]
Date: lundi 10 février 2003 14:08
À: [EMAIL PROTECTED]
Objet: Re: Antwort: Fop and multithreading.


Frédéric and Reto,

having read the 24.1.2 Programming restrictions of the EJB 2.0
specification, I'd recommend you guys don't call FOP from an EJB. The
programming restrictions forbid among other things the following:
- Reading or writing of static variables (FOP still does this too often)
- Use of thread synchronization primitives (FOP does that mostly because
  of the static variables)
- Use of AWT functionality
- Use of java.io package to access files (which obviously happens as
  well)

So the singleton may also be a bad idea. I recommend you don't use FOP
within EJBs. Use a Servlet, a WebService or a custom-built server
service instead.

I've done some serious debugging of multithreading issues last November
by writing a test application that uses FOP in a multi-threaded fashion
(PDF only, no AWT). I haven't had the symptoms you describe so I can
only imagine it has to do with the enviroment (EJBs). Of course, it
could be that my test application was suboptimal, so maybe you two can
come up with a test application that triggers your symptoms outside an
EJB server. That would help track the error down. If you can't reproduce
the bug outside the EJB server I recommend you drop the EJB idea.
  
You can find the spec mentioned above here:
http://java.sun.com/products/ejb/docs.html#specs

Good luck!


On 10.02.2003 13:00:56 frederic.kieffer wrote:
 Thanks for your help.
 In addition, I'm in the same kind of situation as you are (multiprocessor
 Unix box, executing FOP in a Message Driven EJB on JBoss).
 I designed a singleton class which is used by this ejb each time a message
 is being consumed.
 I'm going to try to synchronize its methods. Maybe this will help.


Jeremias Maerki


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

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



Fop font issues with MDB EJBs

2003-02-07 Thread frederic . kieffer
Hi there!
I'm experiencing font problems using Message Driven EJBs.
These beans are instanciated/created each time a message is pushed into the
JMS queue these beans are bound to.
Messages contains objects which I build DOMs from, before being used by a
class which does the transformation and printing.
As several messages can be queued withing a second, several EJBs may take
care of the process.
In that case, some fonts are not displayed on the printed paper.
I'm using  embedded fonts, and after a few good prints (the very few first)
, FOP seems to fall back to the default font.My logs show :
[15:49:45,703,Default] Parsing of document complete, stopping renderer
[15:49:46,083,Default] [ERROR] 
[15:49:46,083,Default] unknown font GerlingSwift,normal,normal so defaulted
font to any
[15:49:46,093,Default] [ERROR] 
[15:49:46,093,Default] unknown font GerlingSwift,normal,normal so defaulted
font to any
[15:49:46,153,Default] [ERROR] 
[15:49:46,163,Default] unknown font GerlingSwift,normal,normal so defaulted
font to any
[15:49:46,183,Default] [ERROR] 
[15:49:46,193,Default] unknown font GerlingSwift,normal,normal so defaulted
font to any
[15:49:46,213,Default] [ERROR] 
[15:49:46,223,Default] unknown font GerlingSwift,normal,normal so defaulted
font to any
[15:49:46,223,Default] [ERROR] 
[15:49:46,233,Default] unknown font GerlingSwift,normal,normal so defaulted
font to any
[15:49:46,243,Default] [INFO] 
[15:49:46,253,Default] Parsing of document complete, stopping renderer
[15:49:46,304,Default] [INFO] 
[15:49:46,304,Default] Parsing of document complete, stopping renderer
[15:49:46,374,Default] [ERROR] 
[15:49:46,384,Default] unknown font GerlingSwift,normal,normal so defaulted
font to any
[15:49:46,384,Default] [ERROR] 
[15:49:46,394,Default] unknown font GerlingSwift,normal,normal so defaulted
font to any
[15:49:46,414,Default] [INFO] 
[15:49:46,424,Default] Parsing of document complete, stopping renderer
[15:49:46,434,Default] [INFO] 
[15:49:46,444,Default] Parsing of document complete, stopping renderer
 
 
Maybe should I reuse the Driver to avoid this?
Thanks
Frédéric Kieffer

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