Rank: Member
Groups: Registered
Joined: 8/11/2016(UTC) Posts: 14  Thanks: 1 times
|
A search on the forum for "radio" didn't turn up anything.
I have 4 radio buttons named RadioGroupZ. The related choices are 0, 1, 2, 4. I'd like to tick one of these. Can you show how that is done through InterForm?
_doc = Patagames.Pdf.Net.PdfDocument.Load("...", new PdfForms()); var interactiveForms = _doc.FormFill.InterForm; foreach (var field in interactive.Forms) { //condition finds radiobutton //how to tick one radio within group? }
Thanks.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Code:
_doc = Patagames.Pdf.Net.PdfDocument.Load("...", new PdfForms());
var interactiveForms = _doc.FormFill.InterForm;
foreach (var field in interactive.Forms)
{
//condition finds radiobutton
//how to tick one radio within group?
if (field.FieldType == FormFieldTypes.FPDF_FORMFIELD_RADIOBUTTON)
field.CheckControl(3, true); //3 - for example - it is an index of radiobutton control in radibutton's group
}
|
|
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/11/2016(UTC) Posts: 14  Thanks: 1 times
|
Thanks. I have another scenario in which the grouped values are letters. I find the specific radio within the group by matching its option value. I want to tick it but nothing happens. Here is my code: Code:
foreach (var item in field.Controls)
{
if(item.ExportValue == someOptionValue)
{
field.Value = "On";
}
}
Where field is one of the grouped radios. Line 5 does execute. Do you know what I'm doing wrong? I'm running into the same issue with checkboxes. Edited by user Thursday, November 17, 2016 2:53:23 PM(UTC)
| Reason: Not specified
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
I'm guessing after modifying the page's dictionary the internal acro forms structures are not populated with new values. Due to this reason the some things may not work properly. You need to reload the page somehow. Please try to call page.Dispose(). This is initiates a page reload.
|
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close