You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Andreas Grund <an...@kgu-consulting.de> on 2006/01/10 09:38:03 UTC
problem with FOP 0.91.beta and gif images
Hi,
i create a stylesheet containing the following source:
<fo:table-cell column-number="1">
<fo:block><fo:external-graphic src="bild1.gif" content-width="75mm"/></fo:block>
</fo:table-cell>
Everytime i try to publish my xml-file using my stylesheet i got the error message: image not available: bild1.gif. But the image file is stored in the same folder as the stylesheet. Why does Fop not found the image? I use fop 0.91.beta with all jars found in the downloadfile: fop-0.91beta-bin-jdk1.4.zip. Do I need some further jars to enable gif support in FOP?
Best regards - med venlig hilsen - mit freundlichen Grüssen
Andreas Grund
__
Andreas Grund Dipl. Wi-Inf. (BA)
KGU-Consulting GmbH
Software-Developer
Lise-Meitner-Str. 2
phone:
+49 461 31852-18
D 24941 Flensburg
telefax:
+49 461 31852-20
web: http://www.kgu-consulting.de <http://www.kgu-consulting.de/>
Re: problem with FOP 0.91.beta and gif images
Posted by Kaarle Kaila <ka...@kaila.fi>.
hi,
In my current case the images would belong to the XML file and not the
stylesheet so current is OK with me!
For some other case I could need some icons etc from a common directory.
regards
Kaarle Kaila
----- Original Message -----
From: "Jeremias Maerki" <de...@jeremias-maerki.ch>
To: <fo...@xmlgraphics.apache.org>
Sent: Tuesday, January 10, 2006 11:01 AM
Subject: Re: problem with FOP 0.91.beta and gif images
> The command-line of FOP uses the directory of the source XML file (not
> the stylesheet) as base directory/URL. If your stylesheet is not in the
> same directory as the XML file FOP won't find it if you don't specify an
> explicit base directory in the config file. So, the work-around for you
> at the moment is to explicitely set the base URL in the config file
> (Element: "base").
>
> If I'm thinking about it, it is probably a bad idea to use the XML file
> as base URL source when a stylesheet is used. Normally, you'd place the
> resources for a stylesheet relative to the stylesheet, not the source
> XML file. fop-devs, what do you think? It would be easy to fix. On the
> other side, 0.20.5 seems to do the same (see
> Options.setCommandLineOptions).
>
> On 10.01.2006 09:38:03 Andreas Grund wrote:
> > Hi,
> >
> > i create a stylesheet containing the following source:
> >
> > <fo:table-cell column-number="1">
> > <fo:block><fo:external-graphic src="bild1.gif"
content-width="75mm"/></fo:block>
> > </fo:table-cell>
> >
> > Everytime i try to publish my xml-file using my stylesheet i got the
> > error message: image not available: bild1.gif. But the image file is
> > stored in the same folder as the stylesheet. Why does Fop not found the
> > image? I use fop 0.91.beta with all jars found in the downloadfile:
> > fop-0.91beta-bin-jdk1.4.zip. Do I need some further jars to enable gif
> > support in FOP?
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: problem with FOP 0.91.beta and gif images
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Jeremias Maerki wrote:
> If I'm thinking about it, it is probably a bad idea to use the XML file
> as base URL source when a stylesheet is used.
The XML source may refer to other ressources as well, which would
probably use the XML source URL as base.
That's not going to be easy to resolve, because after the transformation
there's no way to know whether a reference came from the XML source or
from the style sheet.
I'd keep the XML source URL as a base, and tell people to set a base URL
in the config if image URLs are to be resolved against the style sheet's
URL. For more advanced use cases, we probably need a search path, or
the user has to supply a custom URI resolver.
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: problem with FOP 0.91.beta and gif images
Posted by Glen Mazza <gm...@apache.org>.
Jeremias Maerki wrote:
> If I'm thinking about it, it is probably a bad idea to use the XML file
> as base URL source when a stylesheet is used. Normally, you'd place the
> resources for a stylesheet relative to the stylesheet, not the source
> XML file. fop-devs, what do you think? It would be easy to fix. On the
> other side, 0.20.5 seems to do the same (see
> Options.setCommandLineOptions).
>
Hmmm...that's a good point, it depends on the scenario. If the graphics
are common for all generations using that stylesheet (say, a graphical
masthead of a newsletter), your suggestion makes the most amount of sense.
But imagine a stylesheet used to print a one page biography for an
arbitrary person, and that the stylesheet displays a "photo.gif" picture
of the person in a certain area. I could imagine each person for which
we would want to use the stylesheet having his own directory with a
"bio.xml" and "photo.gif". Then, the stylesheet would use the specific
"photo.gif" in the directory where the specified bio.xml file is.
Perhaps an option allowing for either scenario would be best.
Glen
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: problem with FOP 0.91.beta and gif images
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
The command-line of FOP uses the directory of the source XML file (not
the stylesheet) as base directory/URL. If your stylesheet is not in the
same directory as the XML file FOP won't find it if you don't specify an
explicit base directory in the config file. So, the work-around for you
at the moment is to explicitely set the base URL in the config file
(Element: "base").
If I'm thinking about it, it is probably a bad idea to use the XML file
as base URL source when a stylesheet is used. Normally, you'd place the
resources for a stylesheet relative to the stylesheet, not the source
XML file. fop-devs, what do you think? It would be easy to fix. On the
other side, 0.20.5 seems to do the same (see
Options.setCommandLineOptions).
On 10.01.2006 09:38:03 Andreas Grund wrote:
> Hi,
>
> i create a stylesheet containing the following source:
>
> <fo:table-cell column-number="1">
> <fo:block><fo:external-graphic src="bild1.gif" content-width="75mm"/></fo:block>
> </fo:table-cell>
>
> Everytime i try to publish my xml-file using my stylesheet i got the
> error message: image not available: bild1.gif. But the image file is
> stored in the same folder as the stylesheet. Why does Fop not found the
> image? I use fop 0.91.beta with all jars found in the downloadfile:
> fop-0.91beta-bin-jdk1.4.zip. Do I need some further jars to enable gif
> support in FOP?
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: problem with FOP 0.91.beta and gif images
Posted by Kaarle Kaila <ka...@kaila.fi>.
hej,
I have used something like this
<fo:external-graphic src="url(pave_files/P1R7.jpg)"/>
And it works OK!
med vänlig hälsning
Kaarle Kaila
----- Original Message -----
From: Andreas Grund
To: fop-users@xmlgraphics.apache.org
Sent: Tuesday, January 10, 2006 10:38 AM
Subject: problem with FOP 0.91.beta and gif images
Hi,
i create a stylesheet containing the following source:
<fo:table-cell column-number="1">
<fo:block><fo:external-graphic src="bild1.gif" content-width="75mm"/></fo:block>
</fo:table-cell>
Everytime i try to publish my xml-file using my stylesheet i got the error message: image not available: bild1.gif. But the image file is stored in the same folder as the stylesheet. Why does Fop not found the image? I use fop 0.91.beta with all jars found in the downloadfile: fop-0.91beta-bin-jdk1.4.zip. Do I need some further jars to enable gif support in FOP?
Best regards - med venlig hilsen - mit freundlichen Grüssen
Andreas Grund
__
Andreas Grund Dipl. Wi-Inf. (BA)
KGU-Consulting GmbH
Software-Developer
Lise-Meitner-Str. 2
phone:
+49 461 31852-18
D 24941 Flensburg
telefax:
+49 461 31852-20
web: http://www.kgu-consulting.de