xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luis Bernardo <lmpmberna...@gmail.com>
Subject Re: FOP Trunk - URI Resolution
Date Mon, 25 Mar 2013 23:41:59 GMT

Try something like this:

String confFile = "/path/to/fop.xconf";
FopFactoryBuilder builder = new FopConfParser(new 
File(confFile)).getFopFactoryBuilder();

On 3/24/13 1:03 AM, Björn Häuser wrote:
> Hi,
>
> thank you all for patience and work for Apache FOP.
>
> I recently switched to the trunk version to get support for table-markers! This is so
nice! Thank you all!
>
> With the switch came some problems regarding image path resolution, it stopped working
(for me) with hopefully the same configuration as I used on 1.1.
>
> This is my directory structure:
> src/main/java/foo/bar/document.java -> thats the one which initializes fop
> src/main/resources/templates/foo.xsl -> base .xsl file
> src/main/resources/templates/images/image.png -> the image
>
> What I want is that in the *.XSL files all images are referenced by images/image.png,
the extra "images/" is fine for me.
>
> What I tried is:
> FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new URI("classpath:src/main/resources/templates/"));
> fopFactory = fopFactoryBuilder.build();
>
> But this gives me this exception:
> Caused by: java.lang.IllegalArgumentException: URI is not absolute
>      at java.net.URI.toURL(URI.java:1095)
>      at org.apache.fop.apps.io.ResourceResolverFactory$NormalResourceResolver.getResource(ResourceResolverFactory.java:188)
>
> I truncated the rest of the Stacktrace.
>
> What do I need to configure for that working in that way?
>
> Thanks in advance
> Björn
>
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message