OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook] When compiling PDF, relative paths no longer work (Ubuntu serverguide)


Bob, thanks very much for your reply.
And sorry for originally posting to the wrong list.

On 2016.03.23 13:12 Bob Stayton wrote:

> [Moving this over to the docbook-apps mailing list where stylesheet 
> issues are discussed]

> Hi Doug,
> Not quite sure what's going wrong with your setup, but the path to those 
> icons (referred to as admonition graphics) is described in this doc 
> available online:
> 
> http://www.sagehill.net/docbookxsl/PrintIcons.html#PrintAdmonGraphics
>
> Let us know if that doesn't help.  In that case, further information 
> about your tool setup and how you are applying it would be helpful.

O.K. what we have only partly resembles what is described in the link.
The serverguide project workflow predates my involvement, and
the original contributors have long since gone.

The serverguide project is setup with a subdirectory, libs,
and a further subdirectory admon.

In libs there is only one relevant file: ubuntu-pdf.xsl:

ubuntu-pdf.xsl:
<xsl:param name="admon.graphics" select="1"></xsl:param>
<xsl:param name="admon.textlabel" select="0"></xsl:param>
<xsl:param name="admon.graphics.path" select="'libs/admon/'"/>
<xsl:param name="admon.graphics.extension" select="'.png'"/>

So, I assume the desired path is relative to where the make command
is running, as it runs from the project root directory.
Possible related Makefile extractions:

Makefile:UBUNTUPDFXSL=libs/ubuntu-pdf.xsl

serverguide-pdf:

        if [ $(LN) != "C" ]; then \
                ./scripts/translate.sh -d serverguide -l $(LN); \
        fi
        if find serverguide/$(LN) -name "serverguide.xml"; then \
                xsltproc --xinclude -o $(BASE)serverguide/$(LN)/serverguide.fo $(UBUNTUPDFXSL) serverguide/$(LN)/serverguide.xml; \
                fop -fo $(BASE)serverguide/$(LN)/serverguide.fo -pdf $(BASE)serverguide/$(LN)/serverguide.pdf; \
        fi

admon contains:

doug@s15:~/sguide-trunk/z/libs$ ls -l admon
total 20
-rw-rw-r-- 1 doug doug 2344 Feb 20  2015 caution.png
-rw-rw-r-- 1 doug doug 2448 Feb 20  2015 important.png
-rw-rw-r-- 1 doug doug 2347 Feb 20  2015 note.png
-rw-rw-r-- 1 doug doug 2367 Feb 20  2015 tip.png
-rw-rw-r-- 1 doug doug 2618 Feb 20  2015 warning.png

If I change the file locations to absolute, then the PDF compile works:

ubuntu-pdf.xsl:
<xsl:param name="admon.graphics" select="1"></xsl:param>
<xsl:param name="admon.textlabel" select="0"></xsl:param>
<xsl:param name="admon.graphics.path" select="'/home/doug/sguide-trunk/z/libs/admon/'"/>
<xsl:param name="admon.graphics.extension" select="'.png'"/>

But, you see it is impractical to make anyone's particular local path
part of the master serverguide project documents.

Example error message:
[INFO] FOUserAgent - Rendered page #378.
[ERROR] FOUserAgent - Image not found. URI: libs/admon/note.png. (See position 13370:482)
[ERROR] FOUserAgent - Image not found. URI: libs/admon/note.png. (See position 13379:478)
[ERROR] FOUserAgent - Image not found. URI: libs/admon/note.png. (See position 13470:478)
[INFO] FOUserAgent - Rendered page #379.

References:
https://bugs.launchpad.net/serverguide/+bug/1559783

... Doug




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]