我的问题是如何设置内容页面的位置?它似乎是在第一页开头自动生成的.另外,如何设置内容的CSS内容?
解决方法 wkHTMLtopdf有一个-xsl-style-sheet(file)参数,因此在扩展命令行-help(或-H)中详细说明.A table of content can be added to the document by adding a toc object tothe command line. For example: wkHTMLtopdf toc http://doc.trolltech.com/4.6/qstring.HTML qstring.pdfThe table of content is generated based on the H Tags in the inputdocuments. First a XML document is generated,then it is converted toHTML using XSLT.The generated XML document can be vIEwed by dumPing it to a file usingthe --dump-outline switch. For example: wkHTMLtopdf --dump-outline toc.xml http://doc.trolltech.com/4.6/qstring.HTML qstring.pdfThe XSLT document can be specifIEd using the --xsl-style-sheet switch.For example: wkHTMLtopdf toc --xsl-style-sheet my.xsl http://doc.trolltech.com/4.6/qstring.HTML qstring.pdfThe --dump-default-toc-xsl switch can be used to dump the defaultXSLT style sheet to stdout. This is a good start for writing yourown style sheet wkHTMLtopdf --dump-default-toc-xslThe XML document is in the namespace http://code.Google.com/p/wkHTMLtopdf/outlineit has a root node called "outline" which contains a number of"item" nodes. An item can contain any number of item. These are theoutline subsections to the section the item represents. A item nodehas the following attributes: - "Title" the name of the section - "page" the page number the section occurs on - "link" a URL that links to the section. - "backlink" the name of the anchor the the section will link back to.The remaining TOC options only affect the default style sheetso they will not work when specifying a custom style sheet.
因此,您可能会根据其默认值定义自己的XSLT,并将其传入.没有问题.
总结以上是内存溢出为你收集整理的pdf-generation – 使用wkhtmltopdf时如何设置内容表的位置全部内容,希望文章能够帮你解决pdf-generation – 使用wkhtmltopdf时如何设置内容表的位置所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)