使用itextSharp检查复选框pdf

时间:2020-06-09 07:41:53

标签: c# itext

我无法将我的复选框显示为选中状态。

var reader = new iTextSharp.text.pdf.PdfReader(originalFormLocation);

using (var stamper = new iTextSharp.text.pdf.PdfStamper(reader,ms)) {
    var formFields = stamper.AcroFields;

    var checkBoxFieldName =   "this.getField(\"resType\").value = \"On\";

    formfields.SetField(checkBoxFieldName, "On");
}

我尝试了上面的代码,但仍然没有任何反应。

我还尝试使用GetListSelection(引用:https://github.com/itext/itextsharp/blob/develop/src/core/iTextSharp/text/pdf/AcroFields.cs)来获取我选择的字段的字段值 它返回我检查的值。但我的pdf上显示的内容仍未选中。

希望有人可以提供帮助。

0 个答案:

没有答案