I have a similar problem but from this article, it is not clear how do you find the values "Yes" and "No". The index for "Yes" could be 0 or 1 or 2 in a group of check-boxes and the item object does not have the values. In other words, how to find a connection/link/relation between "Yes" and index? Could you please clarify?
Thanks.
Hi Andrey,
As we said earlier, we can able to get the check box field item based on the export value. Please find the below code snippet to find which item is checked based on the export value. Please try this on your end and let us know if it satisfies your requirement.
FileStream docStream = new FileStream("../../Data/form_b_410_0.pdf", FileMode.Open, FileAccess.Read); PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream); //Get the loaded form. PdfLoadedForm loadedForm = loadedDocument.Form; string exportValue = "yes"; PdfLoadedField loadedField = null; PdfLoadedCheckBoxField loadedCheckBoxField = loadedField as PdfLoadedCheckBoxField; PdfLoadedCheckBoxItem checkBoxItem = null; loadedCheckBoxField.TryGetFieldItem(exportValue, out checkBoxItem); checkBoxItem.Checked = true; loadedDocument.Save("Output.pdf"); loadedDocument.Close(); |
Please let us know if you need any further assistance in this.
Regards,
Irfana J.
Worked!
Thank you so much!
Hi Andrey,
Thank you for your update. Please let us know if you need any further assistance in this.
Regards,
Gowthamraj K