Relative paths
Posted: Thu Aug 07, 2008 10:22 pm
I've been using Docbook 5.0 with XIncludes to create a very nested document so as to avoid repetitive work especially with screenshots etc.
When processing this the text comes out just fine. However the images are not coming out. I know why but I don't know how to fix it.
This is not the problem of loading the additional libraries to support PNG images in PDF.
The requirement is to locate the image file in the same directory as it is used. There are many images (100's) which potentially all have the same name but are distinguished by their position in the path hierarchy.
If I transform from the directory where the images live then all is OK but if I transform from above that or adjacent to it, then the images do not come out. In fact they are included as if there are in the current directory.
For example :-
Now, I know that a relative fileref processed with XInclude and with the parameter keep.relative.image.uris="0" is changed to account for any xml:base attributes. I also know that there is a preference to enable or disable the base URI fixup.
However, all permutations seem to fail in one way or another.
If 'Base URI fix-up' is ticked and keep.relative.image.uris is '1' the image location is the document root.
If 'Base URI fix-up' is ticked and keep.relative.image.uris is '0' the image location is the pathname twice, i.e. one appended after the other.
If 'Base URI fix-up' is unticked and keep.relative.image.uris is '0' the image location is the document root.
If 'Base URI fix-up' is unticked and keep.relative.image.uris is '1' the image location is the document root.
Is there something else I should be doing?
When processing this the text comes out just fine. However the images are not coming out. I know why but I don't know how to fix it.
This is not the problem of loading the additional libraries to support PNG images in PDF.
The requirement is to locate the image file in the same directory as it is used. There are many images (100's) which potentially all have the same name but are distinguished by their position in the path hierarchy.
If I transform from the directory where the images live then all is OK but if I transform from above that or adjacent to it, then the images do not come out. In fact they are included as if there are in the current directory.
For example :-
Code: Select all
<mediaobject>
<imageobject>
<imagedata fileref="rs-001.png"></imagedata>
</imageobject>
</mediaobject>
However, all permutations seem to fail in one way or another.
If 'Base URI fix-up' is ticked and keep.relative.image.uris is '1' the image location is the document root.
If 'Base URI fix-up' is ticked and keep.relative.image.uris is '0' the image location is the pathname twice, i.e. one appended after the other.
If 'Base URI fix-up' is unticked and keep.relative.image.uris is '0' the image location is the document root.
If 'Base URI fix-up' is unticked and keep.relative.image.uris is '1' the image location is the document root.
Is there something else I should be doing?