0
Hello!
I’m trying to check a checbox of my PDF, but I’m not getting it right.
Instead of just checking one of the checkboxes, he’s always checking all 3
What I would like:
What I am getting:
PDF in Adobe Reader editor.
All 3 checkbox has the same name, this is giving the problem:
From what I’ve been doing, it seems that this export value has something to do with it.
My code:
private static void CreatePdf(string output)
{
using var pdfDoc = new PdfDocument(new PdfReader("CheckTest.pdf"), new PdfWriter(output));
var form = PdfAcroForm.GetAcroForm(pdfDoc, true);
var check = form.GetField("Check");
check.SetValue("01");
}
PDF link I used in the example: Link
Can someone help me mark the checkbox correctly?
Thank you!
maybe because everyone has the memo name/id? tried
form.GetField("Check#1");
? Verified what is being assigned tovar check
, is not a collection?– Leandro Angelo
It’s not a collection, it’s a collection
PdfButtonFormField
. I tried to take withform.GetField("Check#1")
Yes, hands don’t return anything.– Gustavo Sabel