Chapter 4: Creating reports using pdfHTML

Roughly speaking, there are three major ways to create PDF documents using iText,

  1. You can create a PDF document from scratch using iText objects such as Paragraph, Table, Cell, List,... The advantage of this approach is that everything is programmable, hence configurable just the way you want it. The disadvantage is that you need to program everything; even small changes such as changing one color into another, require a developer to change the Java code of the application, to recompile the code, etc.


Chapter 3: Generating PDF based on Media Queries

In chapter 1, we converted the same hello.html page to different PDF document that looked (almost) identical, using different snippets of Java code. In this chapter, we'll convert one and the same HTML file to different PDF files with a different layout.


Chapter 2: Defining styles with CSS

In the previous chapter, we looked at different snippets of Java code. In this chapter, we'll use the same snippet for every example:

public void createPdf(String src, String dest) throws IOException {
    HtmlConverter.convertToPdf(new File(src), new File(dest));

Instead of looking at different snippets of Java code, we'll be looking at different snippets of HTML and CSS.


Chapter 1: Hello HTML to PDF

In this chapter, we'll convert some simple HTML snippets consisting of a "Test" header, a "Hello World" paragraph, and an image representing the iText logo, to PDF in many different ways.

Last week, iText Software and Inbatek were invited by the Electronic Transactions Development Agency (ETDA) in Bangkok (Thailand) for a full day of talks and sessions about PDF and e-invoicing. ETDA is a Public Organization in Thailand that functions as the main agency responsible for developing, promoting and supporting electronic transactions in order to create trust, opportunity and equity for all. We were honored to be included in this conference and were impressed with the quality of questions that stemmed from the pannel discussion. If you want to...
A simple example that shows how pdfHTML can be used in conjuction with screen size mediaqueries and floating elements to create different PDFs using responsive webdesign.
A simple example showcasing the creation of a Tagged PDF with pdfHTML, and the configuration to include the metadata, necessary to obtain an Accessible PDF.
Introduction iText 7's new add-on pdfHTML is a tool that aims to greatly simplify HTML to PDF conversion in Java or .NET. This is a straightforward and uniform use case, so many users will get satisfactory results with the one-line code sample below. For more complex usage, you may need to provide some configuration to pdfHTML. In this post, I will attempt to explain why you may need to use the config options, and how to use them. Basics The default way to use pdfHTML is either one of two basic one-line code samples: HtmlConverter.convertToPdf(new File("input.html"), new...