Getting Started

The most popular iText example is the "Hello World" example, explaining the five steps to create a PDF from scratch using iText:

// step 1
Document document = new Document();
// step 2
PdfWriter.getInstance(document, new FileOutputStream(filename));
// step 3
document.open();
// step 4
document.add(new Paragraph("Hello World!"));
// step 5
document.close();

Obviously, iText is capable of doing much more than creating a PDF that shows the words "Hello World", but let's take a look at some basic questions to get started.