Hello everyone, I am currently working on a project for a friend and have encountered some issues. I am attempting to fill out a form with a library called iTextsharp: http://itextpdf.com/ The form that I am attempting to fill out is http://www.copyright.gov/forms/formco2d.pdf and I have been able to fill out the text input fields, however I have not been able to figure out how to check the checkboxes. The code I am using is as follows:
string formFile = @"C:\Users\Owner\Documents\formco2d.pdf"; string newFile = @"C:\Users\Owner\Documents\formco2dfilledout.pdf"; PdfReader reader = new PdfReader(formFile); PdfStamper stamper = new PdfStamper(reader, new FileStream(newFile, FileMode.Create)); AcroFields fields = stamper.AcroFields; // set form fields fields.SetField("serial_1a", "True"); fields.SetField("f1b", "Title Of Work"); fields.SetField("f1cv", "Volume"); fields.SetField("f1cn", "Number"); fields.SetField("f1ci", "Issue"); stamper.Close(); button1.Text = "Done";
That code fills out the fields just fine, but has no effect on the actual checkboxes. I have tried sending True, 1, Active, etc to them but nothing makes them active.
Does anyone have any ideas on what I might be able to do about this?