PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to Read/ Set Radio Button on AcroForm

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
sorcerer7



Joined: 06 Feb 2009
Posts: 6
Location: Plano Texas

PostPosted: Fri Feb 06, 2009 10:35 pm    Post subject: How to Read/ Set Radio Button on AcroForm Reply with quote

I have an AcroFrom that has several groups of radio buttons and I am currently unable to set the value using code. One of the groups of radio buttons is named "male or female".

I am using PDFSharp v1.2

Code:

            // Get the root object of all interactive form fields
            PdfAcroForm form = document.AcroForm;

            // Get all form fields of the whole document
            PdfAcroField.PdfAcroFieldCollection fields = form.Fields;

            // Get all form fields of the whole document
            string[] names = fields.Names;
            names = fields.DescendantNames;

            string fqName;
            PdfAcroField field;

            PdfRadioButtonField radField;

            fqName = "male or female";
            field = fields[fqName];
            radField = field as PdfRadioButtonField;



What would I need here to read the value or set the value of the PdfRadioButton radField?

What if anything should I be doing differently?

I am able to set text fields and checkboxes without any issue using:

Code:

            PdfTextField txtField;
            PdfCheckBoxField chkField;

            fqName = "nameoftextfieldtobeset(0)";
            field = fields[fqName];
            txtField = field as PdfTextField;
            txtField.Text = "text value being set";

            fqName = "nameofcheckboxtobeset(0)";
            field = fields[fqName];
            chkField = field as PdfCheckBoxField;
            chkField.Checked = true;



Thanks,
Chris
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com