xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <dev.jerem...@greenmail.ch>
Subject Re: Configuration problem ????
Date Mon, 02 Jun 2003 12:32:45 GMT
What you want to do is a bit tricky. Try the following:

Instead of ...getResourceAsStream("myconfig.xml") try:

URL cfgUrl = ...getResource("myconfig.xml");
String baseURL = cfgURL.toExternalForm();
...then snip the "myconfig.xml" part from the URL and set it as
"fontBaseDir". Maybe that could solve the problem.

If that doesn't work you need to change FOP to do what you want. There's
some code in FOP (see SingleByteFont) that enables you to read the
embeddable font file using getResource. This is triggered by an "embed"
element in the metrics XML (See FontReader). But I'm pretty sure there's
so such mechanism for the metrics file so I think the whole thing is
pretty useless.

If you have to change FOP I suggest you start with the URLBuilder class
which could be a good starting point to resolve URLs. The redesigned FOP
will have better mechanisms to do that but that's future talk.

Good luck!

On 02.06.2003 12:14:39 Eric Chow wrote:
>       InputStream is =
> PDFGenerator.class.getResourceAsStream("myconfig.xml");
>       org.apache.fop.configuration.Configuration.put("fontBaseDir",
> "jar:file:my.jar!/");

Jeremias Maerki

To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org

View raw message