Skip to main content

7 posts tagged with "java"

View All Tags

Top Java Libraries for PDF Generation in 2025

· 12 min read
Michał Szymanowski
Michał Szymanowski
PDFBolt Co-Founder

Top Java Libraries for PDF Generation in 2025

Creating high-quality PDF documents is essential for Java applications. Whether generating invoices, reports, or dynamic business documents, choosing the right PDF library impacts your application's performance, maintainability, and licensing costs. The Java ecosystem offers diverse approaches – from direct programmatic construction to browser-based HTML to PDF conversion. This analysis explores the most popular Java PDF libraries available in 2025, providing comparisons, code examples, and guidance to help you select the optimal solution.

Apache PDFBox Java Tutorial: How to Generate PDFs

· 13 min read

Apache PDFBox Java Tutorial: Generate PDFs from HTML with Code Examples

When it comes to generating PDFs in Java, many developers reach for HTML to PDF libraries that rely on browser engines to render content. However, if you need full control over layout, fonts, positioning, and structure – especially for business-critical documents like invoices, reports, or certificates – Apache PDFBox offers a flexible, code-driven solution. Rather than converting entire web pages, PDFBox enables you to programmatically construct PDF documents from the ground up using Java. In this guide, you'll learn how to use PDFBox's low-level API to create precisely formatted PDFs. With this approach, you skip browser dependencies entirely and gain complete authority over how your PDFs are styled, structured, and generated.

How to Generate PDF from HTML in Java Using Flying Saucer

· 16 min read
Michał Szymanowski
Michał Szymanowski
PDFBolt Co-Founder

Convert HTML to PDF in Java using Flying Saucer and Thymeleaf – step-by-step guide

Looking for a reliable way to convert HTML to PDF in Java – without relying on headless browsers or heavyweight libraries? In this tutorial, you'll learn how to use Flying Saucer (xhtmlrenderer) together with Thymeleaf templates to generate clean, professional PDFs directly in your Java application. Flying Saucer is a lightweight, pure Java library that renders XHTML and CSS into PDF format – no external rendering engines required. It’s ideal for reports, invoices, and other dynamic documents where fast and reliable PDF generation is essential.

How to Convert HTML to PDF in Java Using Playwright and Thymeleaf

· 16 min read
Michał Szymanowski
Michał Szymanowski
PDFBolt Co-Founder

HTML to PDF with Playwright in Java

Need to convert HTML into polished PDFs in your Java project? This tutorial will show you how to use Playwright for Java together with Thymeleaf templates to generate clean, professional-looking PDFs. Whether you're creating invoices, reports, or other dynamic business documents, this solution allows you to render HTML to PDF with pixel-perfect precision using a headless browser. With easy-to-follow code examples and a straightforward setup, it's a practical and modern approach to HTML to PDF generation in Java.

OpenPDF in Java: How to Generate PDFs

· 17 min read
Michał Szymanowski
Michał Szymanowski
PDFBolt Co-Founder

Generate PDFs with OpenPDF in Java

Programmatic PDF generation is a vital skill for Java developers working on applications that require polished, automated documents such as invoices, reports, or contracts. OpenPDF, a lightweight and open-source PDF library derived from iText, offers a reliable and cost-free solution for creating such documents in Java. In this step-by-step guide, we'll build a professional PDF generator using OpenPDF, focusing on creating a business invoice as a practical example. This tutorial is crafted to be clear, actionable, and optimized for both learning and search engines, ensuring you can seamlessly integrate PDF generation into your projects.

Top HTML Template Engines

· 11 min read
Michał Szymanowski
Michał Szymanowski
PDFBolt Co-Founder

HTML to PDF - Template Engines

In the world of modern web development, creating dynamic, data-driven websites efficiently is a constant challenge. Template engines have emerged as a crucial tool in a developer's toolkit, streamlining the process of generating HTML content dynamically. This article explores what template engines are, how they work, their benefits, and the most popular options available today.

Creating Professional PDFs with iText and FreeMarker in Java

· 9 min read
Michał Szymanowski
Michał Szymanowski
PDFBolt Co-Founder

Creating Professional PDFs with iText and FreeMarker in Java

Generating dynamic PDFs with custom content and professional formatting is a common challenge for Java developers. While PDF is the go-to format for official documentation, creating these documents programmatically requires specialized tools and techniques. The combination of iText's PDF processing capabilities with FreeMarker's template engine offers a powerful solution to this challenge. This tutorial demonstrates how to implement a complete PDF generation system that transforms HTML templates into polished PDF documents with custom data.