Print Page | Close Window

How to set "checked" for checkboxes

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3313
Printed Date: 02 May 24 at 2:05AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: How to set "checked" for checkboxes
Posted By: Josef Gschwendtner
Subject: How to set "checked" for checkboxes
Date Posted: 20 Apr 16 at 2:50PM
Hi,

I have read that one sets the checkstate of a checkbox with the values "Yes" and "Off".
Now we have a PDF-Form where we have to set "checked" by value "Ja" (German for "Yes").

How do we find out what string is needed to check the checkbox for a certain PDF-Form?

Regards,
Josef



Replies:
Posted By: Ingo
Date Posted: 20 Apr 16 at 7:44PM
Hi Josef,

why you don't want read the relevant sample on page 34/35 of the developer guide?



-------------
Cheers,
Ingo



Posted By: Josef Gschwendtner
Date Posted: 11 May 16 at 4:07PM
Hi,

it seems, this is no information one gets from the developer guide.

We have password protected documents with checkboxes the “Yes-No”, “On-Off” values are replaced by values “100-Off” or others.

My question is:
How can we find out which value is for a certain checkbox appropriate to check/uncheck it by code.

Regards,
Josef



Posted By: pinozzy
Date Posted: 11 May 16 at 4:32PM
hello,

Have you tried this approach?

for (int i = 1; i <= QP.FormFieldCount(); i++)
                    {
                        string title = QP.GetFormFieldTitle(i);
                        string hint = QP.GetFormFieldDescription(i);
                        string s = QP.GetFormFieldValue(i);
                        int type = QP.GetFormFieldType(i);
                   
                            if (type == 3 || type == 4) // Radio or CheckBox
                            {
                                int sc = QP.GetFormFieldSubCount(i);
                                for (int j = 1; j <= sc; j++)
                                {
                                    string sfn = QP.GetFormFieldSubName(i, j);
                                    textBox1.AppendText(sfn);
                                    if (j != sc)
                                        textBox1.AppendText("|");
                                }
                            }

From this post:
http://www.quickpdf.org/forum/setting-check-box-subfield-values_topic1842.html



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk