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 gmcauley <gm...@llu.edu> on 2006/07/08 00:53:47 UTC
'Image not available' after migrating from 91b to 92b
I recently upgraded to 92b from 91b. Now fop seems to be having trouble finding
the image files I want to embed in a pdf. This worked fine in 91b.
For example, this line ...
<fo:external-graphic src="url('logo-b-nof.png')"/>
... results in this Tomcat output:
SEVERE: Image not available: url('logo-b-nof.png')
Jul 7, 2006 3:38:13 PM org.apache.fop.fo.flow.ExternalGraphic bind
... and my pdf shows up without the images.
I am also using embedded fonts which are working fine. The font files are in
the same directory as the images. This directory is the 'base' directory which
is set in my fop.conf file:
<base>/zzz/zzz/zzz/build/web/</base>
Since the fonts are found, I assume that the 'base' directory is being corrected
identified.
Has anyone run into this? Where should I begin to track this down?
Any help would be much appreciated.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: 'Image not available' after migrating from 91b to 92b
Posted by gmcauley <gm...@llu.edu>.
Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:
>
> Ah, the code clears this up. You set the user configuration on the
> FopFactory AFTER you create the FOUserAgent. The FopFactory doesn't keep
> track of the FOUserAgent and Fop instances it creates, so customize the
> FopFactory first and then do everything else.
>
Ok, that makes sense. Thank you for your help.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: 'Image not available' after migrating from 91b to 92b
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Ah, the code clears this up. You set the user configuration on the
FopFactory AFTER you create the FOUserAgent. The FopFactory doesn't keep
track of the FOUserAgent and Fop instances it creates, so customize the
FopFactory first and then do everything else.
On 11.07.2006 03:32:25 gmcauley wrote:
>
>
> Thank you Jeremias for your reply.
>
>
> >
> > I'd start debugging in
> > org.apache.fop.fo.flow.ExternalGraphics.bind().
> > Maybe some exception gets swallowed somewhere.
>
> The 'problem' seems to be: when doing configuration with a configuration file,
> the 'baseURL' field is not set in the 'FOPUserAgent' (ie, it is null).
>
> If I set the 'baseURL' on the user agent it works.
>
>
> Here is essentially the code I am using:
>
> FopFactory fopFactory = FopFactory.newInstance();
> ByteArrayOutputStream out = new ByteArrayOutputStream();
> FOUserAgent agent = fopFactory.newFOUserAgent();
> DefaultConfigurationBuilder cfgBuilder = new
> DefaultConfigurationBuilder();
> Configuration cfg = cfgBuilder.build("file://" + confPath +"cert.conf");
> fopFactory.setUserConfig(cfg);
> // String basePath = fopFactory.getBaseURLfromConfig(cfg, "base");
> // agent.setBaseURL(basePath);
> Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, agent, out);
>
>
> If I uncomment the next-to-last lines, everything works.
>
>
> 1) Is this the preferred way in to set the 'base' directory in 92b? It seems
> like a different approach from 91b.
>
> 2) I am not explicitly setting 'font-base' option in the configuration file,
> yet somehow fop seems to default to the 'base' directory. I am curious where
> this is done.
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: 'Image not available' after migrating from 91b to 92b
Posted by gmcauley <gm...@llu.edu>.
Thank you Jeremias for your reply.
>
> I'd start debugging in
> org.apache.fop.fo.flow.ExternalGraphics.bind().
> Maybe some exception gets swallowed somewhere.
The 'problem' seems to be: when doing configuration with a configuration file,
the 'baseURL' field is not set in the 'FOPUserAgent' (ie, it is null).
If I set the 'baseURL' on the user agent it works.
Here is essentially the code I am using:
FopFactory fopFactory = FopFactory.newInstance();
ByteArrayOutputStream out = new ByteArrayOutputStream();
FOUserAgent agent = fopFactory.newFOUserAgent();
DefaultConfigurationBuilder cfgBuilder = new
DefaultConfigurationBuilder();
Configuration cfg = cfgBuilder.build("file://" + confPath +"cert.conf");
fopFactory.setUserConfig(cfg);
// String basePath = fopFactory.getBaseURLfromConfig(cfg, "base");
// agent.setBaseURL(basePath);
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, agent, out);
If I uncomment the next-to-last lines, everything works.
1) Is this the preferred way in to set the 'base' directory in 92b? It seems
like a different approach from 91b.
2) I am not explicitly setting 'font-base' option in the configuration file,
yet somehow fop seems to default to the 'base' directory. I am curious where
this is done.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: 'Image not available' after migrating from 91b to 92b
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
No other indicators on the log before the "Image not available"? If not,
I'd start debugging in org.apache.fop.fo.flow.ExternalGraphics.bind().
Maybe some exception gets swallowed somewhere.
On 08.07.2006 00:53:47 gmcauley wrote:
> I recently upgraded to 92b from 91b. Now fop seems to be having trouble finding
> the image files I want to embed in a pdf. This worked fine in 91b.
>
> For example, this line ...
>
> <fo:external-graphic src="url('logo-b-nof.png')"/>
>
> ... results in this Tomcat output:
>
> SEVERE: Image not available: url('logo-b-nof.png')
> Jul 7, 2006 3:38:13 PM org.apache.fop.fo.flow.ExternalGraphic bind
>
> ... and my pdf shows up without the images.
>
>
> I am also using embedded fonts which are working fine. The font files are in
> the same directory as the images. This directory is the 'base' directory which
> is set in my fop.conf file:
>
> <base>/zzz/zzz/zzz/build/web/</base>
>
> Since the fonts are found, I assume that the 'base' directory is being corrected
> identified.
>
>
> Has anyone run into this? Where should I begin to track this down?
>
>
> Any help would be much appreciated.
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org