I have some problems with Cocoon 2.0.3 or 2.0.4, Fop 0.20.3 or 0.20.4, inline SVG (because using cocoon:// protocol does not work in general) and fonts.
Using Cocoon 2.0.3 with Fop 0.20.3 my PDFs look really nice according to fonts. But I can not include SVGs using fo:instream-foreign-object: java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/DefaultSVGContext.
This class does not exist in batik-all-1.5b2.jar used in Cocoon, but the reason can't be the Batik jar, because it works in Cocoon 2.0.4 with the same jar.
On the other hand the fonts only work in 2.0.3. They are configured in Cocoon's sitemap:
<map:serializer name="pdf" mime-type="application/pdf" src="org.apache.cocoon.serialization.FOPSerializer">
<user-config src="webapps/ROOT/doc/fop/config.xml"/>
</map:serializer>
and the user-config looks like
<configuration> <fonts> <font metrics-file="webapps/ROOT/doc/fop/fonts/Verdana.xml" kerning="yes" embed-file="webapps/ROOT/doc/fop/fonts/Verdana.ttf"> <font-triplet name="Verdana" style="normal" weight="normal"/> </font> <font metrics-file="webapps/ROOT/doc/fop/fonts/Verdanab.xml" kerning="yes" embed-file="webapps/ROOT/doc/fop/fonts/Verdanab.ttf"> <font-triplet name="Verdana" style="normal" weight="bold"/> </font> <font metrics-file="webapps/ROOT/doc/fop/fonts/Verdanai.xml" kerning="yes" embed-file="webapps/ROOT/doc/fop/fonts/Verdanai.ttf"> <font-triplet name="Verdana" style="italic" weight="normal"/> </font> <font metrics-file="webapps/ROOT/doc/fop/fonts/Verdanaz.xml" kerning="yes" embed-file="webapps/ROOT/doc/fop/fonts/Verdanaz.ttf"> <font-triplet name="Verdana" style="italic" weight="bold"/> </font> </fonts> </configuration>
They work *despite* bug 6533 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6533) and Vadim's fix, which was - according to CVS commit messages - applied after Cocoon 2.0.3 release (http://cvs.apache.org/viewcvs.cgi/cocoon-2-historical/src/java/org/apache/cocoon/serialization/Attic/FOPSerializer.java?only_with_tag=cocoon_2_0_3_branch).
The same does not work in Cocoon 2.0.4. I get an NullPointerException, because _something_ is null. The config file is loaded correctly, but something goes wrong with the font files:
2003-03-11 16:04:00,896 INFO [org.jboss.web.localhost.Engine] ERROR (2003-03-11) 16:04.00:896 [manager.] (/conweb/stream.secure.pdf) Thread-8/MessageHandler: Failed to read font metrics file nullwebapps/ROOT/doc/fop/fonts/Verdana.xml : /home/jheinicke/development/IUPB/iupb/nullwebapps/ROOT/doc/fop/fonts/Verdana.xml
(see the both 'null' above)
beginning of stacktrace:
javax.xml.transform.TransformerException: java.lang.NullPointerException
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3135)
at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.NullPointerException
at org.apache.fop.render.pdf.fonts.LazyFont.getAscender(Unknown Source)
at org.apache.fop.layout.FontState.getAscender(Unknown Source)
So what should I do? Should I abstain from using fonts or from using dynamically generated images? I want both :-) Or is it in current CVS version possible to use the cocoon:// protocol, which would be the most prefered solution.
Has anyone solved a similar problem?
Regards,
Joerg
--
System Development VIRBUS AG Fon +49(0)341-979-7419 Fax +49(0)341-979-7409 [EMAIL PROTECTED] www.virbus.de
CeBIT 2003 vom 12. bis zum 19. März in Hannover
VIRBUS stellt gemeinsam mit der IBM-Tochter IT-Services and Solutions GmbH aus. Lassen Sie sich überraschen von den neuen, umfassenden Möglichkeiten im Internet-gestützten Zahlungsverkehr. Besuchen Sie uns: Halle 3, Stand D55.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]