JVM Languages

Tools

How do I set an image as the content of a cell in iText?

This example demonstrate how to add an image into a cell in iText. One way to set image into cell’s content is by creating an instance of com.itextpdf.text.pdf.PdfPCell and pass an image object (com.itextpdf.text.Image) in the constructor parameter. The constructor also accept a boolean value whether the image will be fitted into the cell or not.