2

我在处理 AsciiDoc 文档时遇到了一些问题。它使用图像,但图像仅在 HTML 版本中显示,而不在 PDF 版本中显示。

我有这个简短的文件:

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

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

这在 HTML 中看起来不错。但是,当我先转换为 Docbook,然后再转换为 PDF(使用 db2pdf)时,则只显示替代文本。

Docbook 版本是:

<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>

我也尝试过其他图像格式,所以不是这样。我使用 Ubuntu 12.10

有任何想法吗?

4

1 回答 1

1

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.

于 2013-01-30T15:27:37.270 回答