xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Chow" <ec...@macaucabletv.com>
Subject Re: Configuration problem ????
Date Mon, 02 Jun 2003 10:30:34 GMT
Hi, Jeremias ,

In fact, I want to put all the config file and TTF files in a JAR file that
will be put into the /WEB-INF/lib if a WAR file or EAR file?


How can FOP get the configurations files and  TTF files ??

Best regards,
Eric



----- Original Message -----
From: "Jeremias Maerki" <dev.jeremias@greenmail.ch>
To: <fop-user@xml.apache.org>
Sent: Monday, June 02, 2003 4:30 PM
Subject: Re: Configuration problem ????


> 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
>


---------------------------------------------------------------------
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