Currently there's no possibility to set or use an EntityResolver (or
similar) but it's on the todo list. In the meantime you could try to set
the baseURL in Java code like this:

Configuration.put("baseDir", "https://myserver/somedir";);

But please be aware that this currently only works in the CVS version of
FOP (branch 'fop-0_20_2-maintain'). The current release only support
local directories, no URLs. This will be in the upcoming 0.20.5 release.

On 19.11.2002 13:51:55 Johan Åbrandt wrote:
> Hi,
> 
> I have the following external graphic declaration in a XML file:
> 
> <fo:external-graphic src="url('{$base-url}/images/logo.jpg')" 
> height="30pt" width="170pt"/>
> 
> I render it to a servlet outputstream using:
> 
> Driver driver;
> driver = new Driver( new InputSource( reader ), out ); 
> driver.setRenderer( Driver.RENDER_PDF );
> driver.run();
> 
> This works just fine when having the server configured for HTTP but when 
> using HTTPS, it fails with error:
> 
> Error while creating area : Error with image URL: unknown certificate 
> and no base directory is specified
> 
> I think this is because I am using a own generated certificate and not a 
> real certificate from f ex Verisign. I know that I can either create my 
> own SecurityManager (effectively disabling security), or use a real 
> certificate. I would however like to circumvent all such hazzles and 
> retrieve the image in some other means instead, intially I tried to use 
> a custom EntityResolver, but I doesnt seem like it is used for image url 
> resolution:
> 
> i.e.
> 
> driver = new Driver( new InputSource( reader ), out ); 
> driver.setRenderer( Driver.RENDER_PDF );
> 
> XMLReader xmlReader = XMLReaderFactory.createXMLReader();
> xmlReader.setEntityResolver( new CustomEntityResolver() );
> driver.setXMLReader( xmlReader );
> 
> driver.run();
> 
> Does anyone have any tips how to get the EntityResolver approach to 
> work, or know any other way to achieve something similar.


Jeremias Maerki

Reply via email to