maven-doxia-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Jerman <>
Subject Using Relative URLs for images.
Date Thu, 17 Dec 2009 18:38:06 GMT
Hi folks,

At present Doxia (specifically the PDF plugin) only supports images with
URLs taken from the classpath or as absolute URLs. This doesn¹t affect
normal site generation since that just passes through the URL without
resolution and so everything works OK.

However, the PDF plugin tries to resolve the path names to images and with a
normal maven site/resources/images layout that that won¹t work. The reason
is that the Œbase¹ for resolving relative  file paths URLs is wrong by

If I use the following pom config:


And change the location that Œitext.basedir¹ is set to (in 3-4 places...).

        System.setProperty( "itext.basedir",
bookFile.getParentFile().getParentFile().getAbsolutePath() );

So that it looks two levels up rather than one level up... Everything seems
to work OK.

What the changes do are:

Generate the PDF to the site directory rather than it¹s own directory.
Create the site before generating PDFs .. note this puts the images in a
Œknown place¹ relative to the PDF output.
Set up the base for resolution to be consistent for both html and pdf

So... having said that, I¹m wondering what do to do next..

This change isn¹t entirely backwards compatible (but maybe someone can
figure out a way to make it so). I will create a patch for the change but am
not sure if it is worth doing if it isn¹t backwards compatible.. The
alternative is to keep a private version...

I know that a colleague of mine raised a Jira ( on this subject.

Any thoughts? 


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message