An HTML to PDF library for the JVM. Based on Flying Saucer and Apache PDF-BOX 2. With SVG image support.
Clone or download
Failed to load latest commit information.
docs Update README and integration guide to RC15. [ci skip] Aug 6, 2018
obsolete-archive Cleanup repository - Move everything obsolete to the obsolete-archive… Jun 25, 2016
openhtmltopdf-core #273 #180 Fixes absolutes and transforms escaping overflow hidden. Sep 8, 2018
openhtmltopdf-examples #180 #208 Tests around transforms for the fast renderer. Sep 16, 2018
openhtmltopdf-java2d [maven-release-plugin] prepare for next development iteration Aug 6, 2018
openhtmltopdf-jsoup-dom-converter Upgrades to jsoup 1.9.1 to no longer be warned about CVE-2015-6748 Aug 17, 2018
openhtmltopdf-latex-support [maven-release-plugin] prepare for next development iteration Aug 6, 2018
openhtmltopdf-log4j [maven-release-plugin] prepare for next development iteration Aug 6, 2018
openhtmltopdf-mathml-support [maven-release-plugin] prepare for next development iteration Aug 6, 2018
openhtmltopdf-objects [maven-release-plugin] prepare for next development iteration Aug 6, 2018
openhtmltopdf-pdfbox #180 #126 More work on shadow pages for fast renderer. Aug 19, 2018
openhtmltopdf-rtl-support [maven-release-plugin] prepare for next development iteration Aug 6, 2018
openhtmltopdf-slf4j [maven-release-plugin] prepare for next development iteration Aug 6, 2018
openhtmltopdf-svg-support [maven-release-plugin] prepare for next development iteration Aug 6, 2018
tests regression snapshot was missing source images, now using Ant to make … Apr 17, 2009
.cvsignore . Apr 13, 2009
.gitignore For #1 - Set up Apache PDF-BOX 2 output device module. Nov 4, 2015
.hgignore Add .hgignore for those using hg-git Aug 7, 2010
.travis.yml Add Java 9 to the test matrix. Crossing fingers! Mar 30, 2018
LICENSE For #8 - Update LICENSE. Jun 25, 2016
LICENSE-LGPL-2.1.txt - change (back) license to 2.1 or later Jul 15, 2015
LICENSE-LGPL-3.txt - license update LGPL version 2.1 to 3 Jul 15, 2015
LICENSE-W3C-TEST Added license for W3C tests, as requested on tests website. Jul 10, 2007 Update README and integration guide to RC15. [ci skip] Aug 6, 2018
pom.xml [maven-release-plugin] prepare for next development iteration Aug 6, 2018

Build Status




Open HTML to PDF is a pure-Java library for rendering arbitrary well-formed XML/XHTML (and even HTML5) using CSS 2.1 for layout and formatting, outputting to PDF or images.

Use this library to generated nice looking PDF documents. But be aware that you can not throw modern HTML5+ at this engine and expect a great result. You must special craft the HTML document for this library and use it's extended CSS feature like #31 or #32 to get good results. Avoid floats near page breaks and use table layouts.



Open HTML to PDF is distributed under the LGPL. Open HTML to PDF itself is licensed under the GNU Lesser General Public License, version 2.1 or later, available at You can use Open HTML to PDF in any way and for any purpose you want as long as you respect the terms of the license. A copy of the LGPL license is included as license-lgpl-2.1.txt or license-lgpl-3.txt in our distributions and in our source tree.

Open HTML to PDF uses a couple of FOSS packages to get the job done. A list of these, along with the license they each have, is listed in the LICENSE file in our distribution.


Open HTML to PDF is based on Flying-saucer. Credit goes to the contributors of that project. Code will also be used from neoFlyingSaucer


  • OPEN HTML TO PDF is tested with OpenJDK 7, Oracle JDK 8 and Oracle JDK 9.
  • No, you can not use it on Android.
  • You should be able to use it on Google App Engine (Java 8 or greater environment). Let us know your experience.
  • Flowing columns are not implemented. Implemented in RC12.
  • No, it's not a web browser.


Test cases, failing or working are welcome, please place them in /openhtmltopdf-examples/src/main/resources/testcases/ and run them from /openhtmltopdf-examples/src/main/java/com/openhtmltopdf/testcases/


head - 0.0.1-RC16-SNAPSHOT


  • NOTE: Started moving project documentation to wiki.
  • #228 Support for letter-spacing CSS property. By @danfickle
  • #143 Merging of remaining items thanks to @backslash47
    • Support for box-sizing:border-box. With additional work (for min/max width/height) by @danfickle
    • Text justification for embedded unicode fonts
    • #250 Optional PDF/A conformance. Thanks @syjer
  • #252 Incorrect placement of form controls. Thanks @tiredelk
  • #249 Cache font metrics across runs to avoid having to load fallback fonts on each run. By @danfickle
  • #254 Allow use of SVG image in image tag. Thanks @syjer


  • IMPORTANT: This release was brought forward so that we link against PDFBOX-2.0.11 as previous versions had a security vulnerability when parsing arbitary PDF files. While I believe this should not impact this project directly, having an insecure library on your classpath may be dangerous if you use it for other tasks. #241 #239 Thanks @rototor, @cseblog
  • NOTE: This release incorportate a new faster renderer (especially for large documents) that is in alpha state. Specifically, it can be used with everything except inline-blocks. You can start testing it now with builder.useFastMode() #180 Thanks @rajaningle @javimartinez @dilworks @rototor
  • Image with CSS max-width and max-height incorrectly scaled #242 Thanks @koan00
  • Bold and italic emulation #240 Thanks @syjer @backslash47
  • Work on correctly outputting multiple HTML files to one PDF #222 Thanks @rototor
  • ONGOING: Attempt at fixing font file handle leak #215 Thanks @rototor
  • Don't throw NPE when no base URI is provided #206
  • Fix link annotation placement in margin or generated boxes Thanks @jesselong, @Kuhlware, @markhowardnz


Note: Shaped links only work in Acrobat Reader. All other PDF reader seem to ignore them.