PDF build relative path does not work with 16.04

Bug #1559783 reported by Doug Smythies
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Server Guide
Fix Released
Critical
Doug Smythies

Bug Description

There are a great many errors and warnings when compiling the PDF version of the serverguide when using a 16.04 computer (a server in this case).

The main error seems to be that it doesn't seem to be able to find note and tip and warning png files, and therefore they do not end up in the PDF document.

Example:
[ERROR] FOUserAgent - Image not found. URI: libs/admon/note.png. (See position 8734:488)

Many of the rest were also there before.

Related branches

Revision history for this message
Doug Smythies (dsmythies) wrote :

The image not found problem is very similar to bug 1559070.
If I do the following edits:

doug@s15:~/sguide-trunk/z$ bzr diff
=== modified file 'libs/fo-cust.xsl'
--- libs/fo-cust.xsl 2011-05-03 07:11:18 +0000
+++ libs/fo-cust.xsl 2016-03-21 21:42:00 +0000
@@ -25,7 +25,7 @@
   <!-- Admon Graphics -->
     <xsl:param name="admon.graphics" select="1"/>
     <xsl:param name="admon.textlabel" select="0"/>
- <xsl:param name="admon.graphics.path" select="'libs/admon/'"/>
+ <xsl:param name="admon.graphics.path" select="'/home/doug/sguide-trunk/z/libs/admon/'"/>
     <xsl:param name="admon.graphics.extension" select="'.png'"/>

     <!-- Callout Graphics -->

=== modified file 'libs/ubuntu-pdf.xsl'
--- libs/ubuntu-pdf.xsl 2012-10-22 16:36:22 +0000
+++ libs/ubuntu-pdf.xsl 2016-03-21 21:44:32 +0000
@@ -183,7 +183,7 @@
 <!-- If true (non-zero), admonitions are presented with a generated text label such as Note or Warning in the appropriate language. If zero, such labels are turned off, but any title children of the admonition element are still output. The default value is 1. -->
 <xsl:param name="admon.textlabel" select="0"></xsl:param>

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

 <xsl:template match="*" mode="admon.graphic.width">

then, at least in this respect, the PDF serverguide compiles O.K. and the various icons are present in the document.

Note 1: It is not practical to use absolute addressing in this case.
Note 2: This isn't a problem with yelp, because it is not installed on my server. It is likely the same problem but in yelp-tools and/or yelp-xsl.

Revision history for this message
Doug Smythies (dsmythies) wrote :
summary: - PDF build problems when compiling with 16.04
+ PDF build relative path does not work with 16.04
description: updated
Revision history for this message
Shaun McCance (shaunm-gnome) wrote :

The serverguide's PDF build is based on the docbook-xsl stylesheets, not the yelp-xsl stylesheets. So it's almost certainly not related to yelp-tools or yelp-xsl, unless I'm missing something.

Revision history for this message
Doug Smythies (dsmythies) wrote :

@Shaun: O.K. thanks for your valuable input. I uninstalled yelp-xsl and yelp-tools and the pdf serverguide still compiles.

I'll leave this set as "Ubuntu Server guide" until I can figure out the correct package, but I'll update the description.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Isn't it simply the docbook-xsl package?

Revision history for this message
Doug Smythies (dsmythies) wrote :

Hi Gunnar, actually no, I no longer think so.

I now believe the problem is in fop and not anything docbook at all.
Why?
I compared an old serverguide.fo file from 2014.10.10, and its relative "note.png" reference
is the same as a serverguide.fo file compiled now.

Anyway, after getting no help at all from the docbook IRC channel, I joined the docbook-apps e-mail list and am trying to get help there, but now I just figured out the above.

Revision history for this message
Doug Smythies (dsmythies) wrote :

For version 2.0 of fop there is a change log entry:

FOP-2306: use the URI of the source FO document rather than the config file as a default base URI

Indeed, changing the relative paths to be based on the location of the serverguide.fo file, makes it so that, at least this issue, is solved.

So:
. fop did a non-backwards compatible change.
. this bug report should actually be against the serverguide.
. once the fix is pushed into the master serverguide branch, a 16.04 or more recent computer MUST be used to compile the PDF.

References:
https://xmlgraphics.apache.org/fop/2.0/changes_2.0.html
https://lists.oasis-open.org/archives/docbook-apps/201603/msg00007.html

Changed in serverguide:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Doug Smythies (dsmythies)
Changed in serverguide:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.