[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] RE: [docbook] When compiling PDF, relative paths no longer work (Ubuntu serverguide)
Hello Doug, I'm a lurker on this list and I have a suggestion for you. I'll snip a few things below. I think your issue is a behaviour change between fop versions, not anything with the docbook-xsl stylesheets. >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. As always! The criminals so often get away! I know, too, because I have been one of those criminals in the past. I found your Makefile (I think): http://bazaar.launchpad.net/~ubuntu-core-doc/serverguide/trunk/view/head:/Makefile >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'"/> All fine. >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 All fine. All fine. >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. Of course. Oh, by the way, I tried out your Makefile on an OpenSUSE 13.2 system and can report success, just as well as on an Ubuntu 14.04 system. What's the difference? Just fop. >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. And, you can see that these error messages (which look very much like something from java logging lands) are generated from FOP. The docbook-xsl stylesheets are creating the serverguide.fo output with the correct paths to the files you want, but fop can't find the files. https://xmlgraphics.apache.org/fop/2.0/changes_2.0.html FOP-2306: use the URI of the source FO document rather than the config file as a default base URI Ubuntu 14.04 ships with FOP Version 1.1 Ubuntu 16.04 ships with FOP Version 2.1 I don't know if there is a command-line switch to set the default base URI, but I'd imagine there is one. (I don't have easy access to an Ubuntu-16.04 nor a fop-2.1 at the moment....) A few additional points: * The above Makefile fragment could use a slightly safer shell idiom. Instead of 'xsltproc --xinclude $OPTIONS ; fop -fo $OPTIONS you should probably do: 'xsltproc --xinclude $OPTIONS && fop -fo $OPTIONS * The Makefile refers to, but never uses the following variable: NWDBXSL=/usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl * The libs/ubuntu-pdf.xsl refers to a filesystem path location for the fo/docbook.xsl file. This path was not found on my OpenSUSE system, for example, but was found on the Ubuntu system I used. You can take advantage of the catalog to refer to the docbook-xsl stylesheets by their well-known (system?) identifier. Thus, here's a suggested diff: -<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl"/> +<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/> Good luck with the fop issue, -Martin -- Martin A. Brown http://linux-ip.net/
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]