Question

I am having some trouble with an AsciiDoc document. It uses an image, but the image is only shown in the HTML version, but not in the PDF version.

I have this short document:

Test book
=========
Robert Larsen
:doctype: book

Test chapter
------------
image:test_image.jpg[Test image]

This looks fine in HTML. But when I convert first to Docbook and then to PDF (using db2pdf), then only the alternative text is shown.

The Docbook version is:

<book lang="en">
<bookinfo>
    <title>Test book</title>
    <author>
        <firstname>Robert</firstname>
        <surname>Larsen</surname>
    </author>
    <authorinitials>RL</authorinitials>
</bookinfo>
<chapter id="_test_chapter">
<title>Test chapter</title>
<simpara><inlinemediaobject>
  <imageobject>
  <imagedata fileref="test_image.jpg"/>
  </imageobject>
  <textobject><phrase>Test image</phrase></textobject>
</inlinemediaobject></simpara>
</chapter>
</book>

I have tried other image formats as well, so that is not it. I use Ubuntu 12.10

Any ideas?

Was it helpful?

Solution

I can't explain why the image is missing (perphaps there is something wrong with the processing of inlinemediaobject). In any case, db2pdf is part of an old toolchain (based on DSSSL stylesheets) that is hardly maintained anymore.

It will work if you use the more modern DocBook-XSL stylesheets together with FOP. See this Ubuntu documentation: https://help.ubuntu.com/community/DocBook#DocBook_to_PDF.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top