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 08:30:05 GMT
Here's what I googled out of the net:
http://javaalmanac.com/egs/java.net/JarUrl.html

So you can do:
URL mycfg = new URL("jar:file:/C:/Temp/my.jar!/myconfig.xml");
InputStream in = mycfg.openStream();
try {
    new Options(in);
} finally {
    in.close()
}

In your config file:
<font metrics-file="jar:file:/C:/Temp/my.jar!/rs_song.xml"
  embed-file="jar:file:/C:/Temp/my.jar!/rs_song.ttf" kerning="yes">

Untested but it should work if you have a recent FOP version (0.20.5rc
or later).

You can probably also set the "fontBaseDir" value so you don't have to
change the myconfig.xml file:
org.apache.fop.configuration.Configuration.put("fontBaseDir", "jar:file:/C:/Temp/my.jar!/");

or:
<configuration
  <entry>
    <key>fontBaseDir</key>
    <value>jar:file:/C:/Temp/my.jar!/</value>
  </entry>


I hope this helps.

On 02.06.2003 04:46:28 Eric Chow wrote:
> If I want to use my configuration in embedded program, I can add the
> following statement in my program for generating PDF.
> 
> Options op = new Options(new File("myconfig.xml"));
> 
> 
> It works if the "myconfig.xml" is in the physical folder.
> and the following is the content of myconfig.xml.
> 
> <configuration>
>    <fonts>
>       <font metrics-file="rs_song.xml" embed-file="rs_song.ttf"
> kerning="yes">
>          <font-triplet name="Song" style="normal" weight="normal"/>
>          <font-triplet name="Song" style="normal" weight="bold"/>
>          <font-triplet name="Song" style="italic" weight="normal"/>
>          <font-triplet name="Song" style="italic" weight="bold"/>
>       </font>
>    </fonts>
> </configuration>
> 
> Questions and need help:
> 
> 1. If the "rs_song.xml" and the "rs_song.ttf" are in a JAR file, how can I
> do ???


Jeremias Maerki


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


Mime
View raw message