Make AcroFields(iTextSharp) are non editable and set bold

自古美人都是妖i 提交于 2019-12-06 10:18:34

If you don't want to form to be editable, use form flattening as is done in the FillDataSheet example. Add this to your code:

fields.setGenerateAppearances(true);
stamper.setFormFlattening(true);

If you want to change the font of specific fields, use the setFieldProperty() method to change the "textfont" as is done in the TextFieldFonts example:

BaseFont bold =
        BaseFont.createFont(BaseFont.HELVETICA_BOLD, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED);
form.setFieldProperty("Desc_", "textfont", bold, null);

For more info, read the official documentation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!