Setup: Maven, Gradle and License Key
Harry
· 24 Sep 2026
· 1 views
Log in to track your progress and mark lessons complete.
Maven Dependency
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext7-core</artifactId>
<version>7.2.5</version>
<type>pom</type>
</dependency>Gradle Dependency
implementation group: 'com.itextpdf', name: 'itext7-core', version: '7.2.5', ext: 'pom'Hello PDF
import com.itextpdf.kernel.pdf.*;
import com.itextpdf.layout.*;
import com.itextpdf.layout.element.Paragraph;
PdfWriter writer = new PdfWriter("hello.pdf");
PdfDocument pdf = new PdfDocument(writer);
Document document = new Document(pdf);
document.add(new Paragraph("Hello, iText!"));
document.close();Always close() the Document — that finalizes and writes the file.