Image ascidoc->;Docbook不显示图像
我在处理ASCIDOC文档时遇到一些问题。它使用图像,但图像仅显示在HTML版本中,而不显示在PDF版本中Image ascidoc->;Docbook不显示图像,image,docbook,asciidoc,Image,Docbook,Asciidoc,我在处理ASCIDOC文档时遇到一些问题。它使用图像,但图像仅显示在HTML版本中,而不显示在PDF版本中 <book lang="en"> <bookinfo> <title>Test book</title> <author> <firstname>Robert</firstname> <surname>Larsen</surname>
<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>
我有一份简短的文件:
Test book
=========
Robert Larsen
:doctype: book
Test chapter
------------
image:test_image.jpg[Test image]
<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>
这在HTML中看起来很好。但是,当我首先转换为Docbook,然后转换为PDF(使用db2pdf)时,只会显示可选文本
<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>
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>
测试手册
罗伯特
拉森
RL
测试章节
测试图像
我也尝试过其他图像格式,所以不是这样。
我使用Ubuntu 12.10
<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>
有什么想法吗?我无法解释图像丢失的原因(可能是
inlinemediaobject的处理有问题)。在任何情况下,db2pdf都是旧工具链(基于DSSL样式表)的一部分,几乎不再维护
<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>
如果您将更现代的DocBook XSL样式表与FOP一起使用,它将起作用。请参阅以下Ubuntu文档:
<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>