How to set a path for images?
Posted: Tue Dec 04, 2018 7:54 pm
I am having difficulties getting the img.src.path parameter in my DocBook WebHelp Classic Ant Scenario to work. I need to put all my image files into a single directory, and have all the images in all my books and sets get their images from that directory. Specifically, the image files are located here:
And the book and set source files are here:
My understanding is that I can set the img.src.path to add a prefix to the image name attributes in each <imagedata/> entity in the code. So, as I see it, this scenario:
Scenario 1
used with
should work the same way as this scenario:
Scenario 2
used with
However, the Scenario 1 yields this output in the HTML:
This is not correct. On the other hand, Scenario 2 yields this output in the HTML:
This is the correct output, as it puts the image where it belongs.
I am using the default Docbook WebHelp Classic transformation scenario; the only edits made were to the img.src.path parameter. In Scenario 1 I have also tried the following:
The latter two were tried because the default for the base and output directories are both ${cfd}/out/webhelp/, which is 3 levels down from the Images directory.
I don't know if changing keep.relative.image.uris from 0 to 1 is supposed to have an effect on this behavior, but in any case, it doesn't seem to. The output is the same with either setting.
Interestingly, for generating PDFs from the same source code, this works:
What am I doing wrong here? How can I get this to work? Thanks for your help on this.
Code: Select all
C:/Activity/Cogent/Docs/DocsOx/Source/Images/
Code: Select all
C:/Activity/Cogent/Docs/DocsOx/Source/[document_name]/
Scenario 1
Code: Select all
img.src.path = ${cfd}/../Images/
Code: Select all
<imagedata fileref="cdh-prop-butlicenses.gif" align="center"/>
Scenario 2
Code: Select all
img.src.path =
Code: Select all
<imagedata fileref="../Images/cdh-prop-butlicenses.gif" align="center"/>
Code: Select all
<img src="file:///C:/Activity/Cogent/Docs/DocsOx/Source/TestBook1/cdh-prop-butlicenses.gif" align="middle" />
Code: Select all
<img src="images/cdh-prop-butlicenses_530326563.gif" align="middle" />
I am using the default Docbook WebHelp Classic transformation scenario; the only edits made were to the img.src.path parameter. In Scenario 1 I have also tried the following:
Code: Select all
img.src.path = ../Images/
img.src.path = ../../../Images/
img.src.path = ${cfd}/../../../Images/
I don't know if changing keep.relative.image.uris from 0 to 1 is supposed to have an effect on this behavior, but in any case, it doesn't seem to. The output is the same with either setting.
Interestingly, for generating PDFs from the same source code, this works:
Code: Select all
img.src.path = ../Images/