什么是检查使用iTextSharp的pdf文件的复选框领域常见的方法是什么? [英] What is the common way to check the check box field in a pdf using iTextsharp?

查看:379
本文介绍了什么是检查使用iTextSharp的pdf文件的复选框领域常见的方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我填了使用iTextSharp的一个可填写的PDF数据。有在PDF表单中的复选框N多。我已经为使用是或否的复选框中的值。这工作得很好。但一些复选框不以这种方式工作;相反,我需要使用1或0,使其工作。因此,谁能帮我什么是检查/使用iTextSharp的取消复选框在PDF中的常见方式?提前

I am filling the data for a fillable pdf using iTextsharp. There are n number of checkboxes in the pdf form. I have set the value for the check boxes using "Yes" or "No". This works fine. But some of the check boxes does not work in this way; instead i need to use 1 or 0 to make it work. So can anyone help me what is the common way to check/uncheck the checkboxes in pdf using iTextSharp?

谢谢,

雪白

推荐答案

您可以用这种方式找到:

you can find in this way:

PdfReader reader = new PdfReader(fileNameIn);
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(fileNameOut));
AcroFields form = stamper.getAcroFields();

form.setField("Name","Test Name");
form.setField("odot","123456");
form.setField("Consortium","A Testing Co");
form.setField("PName","My Name");
form.setField("date","10/14/03");
form.setField("Box1","true"); //This is the checkbox control
stamper.close();



希望这有助于

hope this help

这篇关于什么是检查使用iTextSharp的pdf文件的复选框领域常见的方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆