通过FOP将docbook处理为PDF时,获取了多余的第二个标题页 [英] Getting an unwanted second title page when processing docbook to PDF via fop

查看:104
本文介绍了通过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.before.verso"/>

当我应该使用时: <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天全站免登陆