How do I create super / subscript in iText?

The following example you’ll see how to create a superscript and subscript text in the pdf document using iText. We can use the Chunk‘s class method called setTextRise(). A positive value will create a superscript text while a negative value will create a subscript text.

How do I create an underlined or striked through chunk in iText?

You can use the Chunk‘s setUnderline(float thickness, float yPosition) method to add underline or strike through to a chunk. A negative value to the yPosition create an underline while a positive value will produce a strike through.

How do I define a font for text object in iText?

We can set font style for text object such as Chunk, Phrase, Paragraph, etc using the com.itextpdf.text.Font class. We can define the font face, size, style and its color using this class.