Apples, not oranges
")) - .convert("/path/to/file.pdf"); + .object(HtmlToPdfObject.forUrl("https://github.com/phc007/htmltopdf-java", htmlToPdfSettings)) + .convert("/path/to/file.pdf"); ``` -#### Saving a webpage from URL as a PDF file +#### Saving HTML as a PDF file ```java +HashMapApples, not oranges
", htmlToPdfSettings)) .convert("/path/to/file.pdf"); ``` #### Saving multiple objects as a PDF file ```java +HashMapThis is the second object...
")) + .object(HtmlToPdfObject.forUrl("https://github.com/phc007/htmltopdf-java", htmlToPdfSettings)) + .object(HtmlToPdfObject.forHtml("This is the second object...
", htmlToPdfSettings)) // ... .convert("/path/to/file.pdf"); ``` @@ -71,7 +79,7 @@ as an HTTP response or adding it as an email attachment ```java HtmlToPdf htmlToPdf = HtmlToPdf.create() // ... - .object(HtmlToPdfObject.forUrl("https://github.com/wooio/htmltopdf-java")); + .object(HtmlToPdfObject.forUrl("https://github.com/phc007/htmltopdf-java")); try (InputStream in = htmlToPdf.convert()) { // "in" has PDF bytes loaded @@ -108,6 +116,11 @@ It might be worth checking that the following packages are installed: - freetype - fontconfig +``` +apt-get -qq -y --no-install-recommends install\ + ca-certificates fontconfig libc6 libfreetype6 libjpeg62-turbo libpng16-16 libssl1.1 libstdc++6 libx11-6 libxcb1 libxext6 libxrender1 xfonts-75dpi xfonts-base zlib1g +``` + ## Developer Notes Useful commands when trying to upgrade library files in `src/main/resources/wkhtmltox`: diff --git a/build.gradle b/build.gradle index 145cf21..88add39 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group 'io.woo' -version '1.0.9.6' +version '1.0.9.7' apply plugin: 'java' apply plugin: 'maven' diff --git a/pom.xml b/pom.xml index 40857cb..7ae6c93 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@