通过 fop 将 docbook 处理为 PDF 时获得不需要的第二个标题页 [英] Getting an unwanted second title page when processing docbook to PDF via fop

查看:11
本文介绍了通过 fop 将 docbook 处理为 PDF 时获得不需要的第二个标题页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用dockbook xml 构建标准书籍格式,然后通过fop 将其格式化为PDF.

I'm constructing a standard book format in dockbook xml then formatting it to PDF via fop.

然而,当我构建最终的 PDF 时,我得到了第二个损坏的标题页,其中再次包含标题和内嵌图像.在这个页面上,标题在整个页面上都是合理的(所以奇怪地传播)并且图像偏离了中心.

When I construct the final PDF however i'm getting a second broken title page that has the title and the inline image again. On this page the title is justified across the whole page (so spread oddly) and the image is off-centre.

书名后面还有一个冒号,书名中没有.

The title also has an additional colon after it that is not present in the book title.

如果我使用 XSL 参数删除标题页,标题页将被删除,但损坏的标题页仍保留在 PDF 中.

If I remove the title page using XSL parameters, the title page is removed, but the broken title page still remains in the PDF.

我可以看到在 .fo 文件中生成第二页的额外行,但无法弄清楚它是如何通过 xsltproc 到达那里的.我的第一个假设是它会自动创建标题页,然后在阅读其他章节之前再次重新解释标题.

I can see the extra line that is generating the second page in the .fo file, but can't work out how it's getting there via xsltproc. My first assumption is that it is automatically creating the title page then reinterpreting the title again before it goes through the other chapters.

如果我通过 oXygen 导出,我不会遇到这个标题页问题,这让它更令人困惑.

I don't get this title page problem if I export via oXygen, which makes it more baffling.

这是图书代码:

<!DOCTYPE book [
<!ENTITY chap1 SYSTEM "01_n.xml">
<!ENTITY chap2 SYSTEM "02_n.xml">
<!ENTITY chap3 SYSTEM "03_n.xml">
<!ENTITY chap4 SYSTEM "04_n.xml">
<!ENTITY chap5 SYSTEM "05_n.xml">
<!ENTITY chap6 SYSTEM "06_n.xml">
<!ENTITY chap7 SYSTEM "07_n.xml">
<!ENTITY chap8 SYSTEM "08_n.xml">
<!ENTITY chap9 SYSTEM "09_n.xml">
<!ENTITY chap10 SYSTEM "10_n.xml">
<!ENTITY chap11 SYSTEM "11_n.xml">
<!ENTITY chap12 SYSTEM "12_n.xml">
<!ENTITY chap13 SYSTEM "13_n.xml">
<!ENTITY chap14 SYSTEM "14_n.xml">
<!ENTITY chap15 SYSTEM "15_n.xml">
<!ENTITY chap16 SYSTEM "16_n.xml">
<!ENTITY chap17 SYSTEM "17_n.xml">
<!ENTITY chap18 SYSTEM "18_n.xml">
]>

<book xmlns="http://docbook.org/ns/docbook" version="5.0">
    <info>
        <title>Manual</title>
         <subtitle>
            <inlinemediaobject>
                <imageobject>
                    <imagedata fileref="logo.png" format="image_format" scalefit="1" width="100%" contentdepth="100%" />
                </imageobject>
            </inlinemediaobject>
        </subtitle>
    </info>

    &chap1;
    &chap2;
    &chap3;
    &chap4;
    &chap5;
    &chap6;
    &chap7;
    &chap8;
    &chap9;
    &chap10;
    &chap11;
    &chap12;
    &chap13;
    &chap14;
    &chap15;
    &chap16;
    &chap17;
    &chap18;
</book>

以及生成文件的 pdf 部分:

And the pdf part of the makefile:

pdf:   
    xsltproc  \
    --output  myfile.fo  \
    --stringparam  paper.type  A4  \
    /docbook/format.xsl \
    book.xml

    fop  -fo  myfile.fo  -pdf  myfile.pdf

    open myfile.pdf

我使用的formal.xsl 没有什么特别之处,如果我使用标准的docbook xsl 文件,我会得到相同的结果.

There is nothing particularly special about the formal.xsl I am using, and I get the same result if I use the standard docbook xsl file.

感谢您的帮助!通过搜索现有问题,我已经获得了很多关于 docbook 格式的有用提示.

Thanks for any help! I've already gained a lot useful tips for docbook formatting by searching though existing questions.

推荐答案

mzjn 提供了线索:

我使用的是:

我应该何时使用:<xsl:template name="book.titlepage.verso"/>

后一个代码删除了第二个不稳定的页面,而前者只删除了分页符.

The latter code removes the second wonky page, whereas the former only removes the page break.

这篇关于通过 fop 将 docbook 处理为 PDF 时获得不需要的第二个标题页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆