Sounds as if the configuration isn't set soon enough. Please make sure
you instantiate the FopFactory at servlet startup and that you also set
the configuration on the FopFactory at this time. Then, each time the
servlet is called, just create a new Fop instance using that factory.
Without seeing your servlet code it's difficult to pinpoint. The above
is just wild guessing.

At any rate, it should not be necessary to run FOP twice just to get the
fonts embedded. That would be very bad.

On 06.08.2008 15:52:20 John T wrote:
> 
> 
> 
> Jeremias Maerki-2 wrote:
> > 
> > But then, what does
> > "it only works the second time" mean? Are there error messages the first
> > time? If yes, which? Have you tried with different browsers?  Please make
> > sure you've read the tips on this
> > page:http://xmlgraphics.apache.org/fop/0.95/servlets.html
> > 
> 
> Sorry for not being clear in my first post. What I mean to say is that the
> very first time it is called, the fonts I have embedded (CenturySchoolbook
> and Arial) do not show up in the generated PDF. Instead, the default font
> shows up. However, the second time I call the servlet, the correct font does
> show up. These error messages are being generated:
> 
> WARNING: Font 'CenturySchoolbook,normal,400' not found. Substituting with
> 'any,normal,400'.
> Aug 5, 2008 4:55:30 PM org.apache.fop.fonts.FontInfo notifyFontReplacement
> WARNING: Font 'CenturySchoolbook,normal,700' not found. Substituting with
> 'any,normal,700'.
> Aug 6, 2008 9:09:31 AM org.apache.fop.fonts.FontInfo notifyFontReplacement
> WARNING: Font 'Arial,normal,400' not found. Substituting with
> 'any,normal,400'.
> 
> I have tried with Firefox and IE - the behaviour is the same. The only
> solution I have found is to call the code (in the servlet) that generates
> the PDF twice; the first time using 
> org.apache.commons.io.output.NullOutputStream()  and the second time sending
> the output to the browser. While this solution works, I'd like to figure out
> why this behaviour is occuring.
> 
> Thanks,
> John
> 
> 
> 
> On 05.08.2008 19:52:15 John T wrote:
> > 
> > Hello. I am embedding fonts in my PDF and it seems to be working. However,
> > it
> > only works the second  time I call my servlet and subsequet times. Has
> > anyone seen this behaviour before or know the cause of such a behaviour?
> > The
> > servlet is runing on BEA Weblogic v8.1 on a Windows XP desktop. FOP
> > version
> > is 0.94
> > 
> > Thanks
> > John
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Embedding-Fonts-tp18836519p18851689.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 


Jeremias Maerki


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

Reply via email to