How to generate pdf from docbook 5.0

前端 未结 7 1708
再見小時候
再見小時候 2021-01-31 00:19

I\'ve written a docbook 5.0 document with the header:




        
7条回答
  •  花落未央
    2021-01-31 00:34

    I see three options (available in Debian/Ubuntu) to generate pdf from docbook:

    • jade, which provides the docbook2pdf command the asker used. jade is ancient and works with SGML, which predates XML and does not support Unicode; it also lacks support for docbook 5.

    • the docbook-xsl stylesheets which go through XSL-FO. docbook-xsl is for docbook 4.5, docbook-xsl-ns is for docbook5. Use fop to go from XSL-FO to PDF. Pipeline: docbook5 —(xsl)—> xml.fo —(fop)—> pdf . Commands involved: xsltproc, fop.

    • dblatex, which is primarily targeting docbook4.5 but has been updated for some of docbook5.

    xmlto can drive the last two, although it currently defaults to docbook-xsl and not docbook-xsl-ns.


    A quick Docbook5 user guide

    Prerequisites

    sudo aptitude install docbook5 docbook-xsl-ns xsltproc fop xmlto libxml2-utils xmlstarlet
    

    Validation

    xmlstarlet val --err --xsd /usr/share/xml/docbook/schema/xsd/5.0/docbook.xsd book.xml
    

    PDF output

    xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/fo/docbook.xsl book.xml > book.fo
    fop -fo book.fo -pdf book.pdf
    

提交回复
热议问题