

Our microservice invokes the wkhtmltopdf command line tool which reads the HTML document and transforms it into a PDF document.A client sends an HTTP request to our microservice, and specifies the url of the HTML document and the file name of the created PDF file.This blog post describes how we can create a microservice that transforms HTML documents into PDF Documents by using Java 8, Spring Boot, and Wkhtmltopdf.īefore we will implement our microservice, we will take a quick look at the PDF creation process. Then I heard about a command line tool called wkhtmltopdf and never looked back. However, I had to tolerate their shortcomings because I didn't have a choice. There are libraries that can create PDF documents from HTML markup, but I have never been completely happy with them.

The problem is that creating PDF documents is not exactly a walk in the park. Typically the users of our application want to see these reports on the user interface and have the possibility to export them as Excel and/or PDF documents. When we are writing a web application, we often face a requirement which states that our application must provide reporting to its users.
