对 wkhtmltopdf 的调用功能进行包装,方便简化使用

jhonnymertz df3287d6d0 Refactoring command line creation and path definition il y a 10 ans
src df3287d6d0 Refactoring command line creation and path definition il y a 10 ans
.gitignore 4e2e512b5a Fix compile on current java il y a 10 ans
LICENSE 5c32296c22 Initial commit il y a 11 ans
README.md 929e4a8c04 Updating README il y a 10 ans
pom.xml df3287d6d0 Refactoring command line creation and path definition il y a 10 ans

README.md

Java WkHtmlToPdf Wrapper

A Java based wrapper for the wkhtmltopdf command line tool. As the name implies, it uses WebKit to convert HTML documents to PDFs.

Requirements

wkhtmltopdf must be installed and working on your system.

Usage

Pdf pdf = new Pdf();
pdf.addHtmlInput("<html><head><meta charset=\"utf-8\"></head><h1>Müller</h1></html>");

The wkhtmltopdf shell command accepts different types of options such as global, page, headers and footers, and toc. Please see wkhtmltopdf -H for a full explanation. All options are passed as array, for example:

Options can be defined through an abstract param object:

Pdf pdf = new Pdf();
pdf.addParam(new Param("--enable-javascript"), new Param("--html-header", "file:///header.html"));

Wrapper options

TODO

Error handling

TODO

License

This project is available under MIT Licence.