P.S. P.S. - 1 year ago 81
Java Question

How add checkobox in Pdf file in itexpdf 7

How can I add a checkobox into a Pdf file like it is done in this question, but using iText 7?

I want the result to look like this:

expected result

Answer Source

Adapting Bruno's answer to iText 7:

Paragraph p = new Paragraph("This is a tick box character: ");
PdfFont zapfdingbats = PdfFontFactory.createFont(FontConstants.ZAPFDINGBATS);
Text chunk = new Text("4").setFont(zapfdingbats).setFontSize(14);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download