如何使用iText 7在PDF文件中添加复选框? [英] How to add a check box in a PDF file using iText 7?
本文介绍了如何使用iText 7在PDF文件中添加复选框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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:
推荐答案
适应Bruno对iText 7的回答:
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);
p.add(chunk);
document.add(p);
这篇关于如何使用iText 7在PDF文件中添加复选框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文