Hello Jerimias,
Thanks for you help.
But if I want to do as following, I think it can't use that solution.
In pdf-util.jar contains the following file structures:
META-INF/
my/
/test/
/GenPDF.class
/myconfig.xml
/rs_song.xml
/rs_song.ttf
And I will get the InputStream for myconfig.xml with the following
statement:
InputStream is = GenPDF.class.getResourceAsStream("myconfig.xml");
And, now, I don't know how I can define the "myconfig.xml" to use the
"rs_song.xml" and "rs_song.ttf" ??
Please help me.
Best regards,
Eric
----- Original Message -----
From: "Jeremias Maerki" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]