Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Setting check box subfield values
  FAQ FAQ  Forum Search   Register Register  Login Login

Setting check box subfield values

 Post Reply Post Reply
Author
Message Reverse Sort Order
Revolution1200 View Drop Down
Beginner
Beginner
Avatar

Joined: 26 May 11
Location: Glasgow
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Revolution1200 Quote  Post ReplyReply Direct Link To This Post Topic: Setting check box subfield values
    Posted: 06 Jul 11 at 7:36PM
Cheers Andrew,
 
That is very similar to what I ended up doing!
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 01 Jul 11 at 2:50PM
Here is some code I use to display the possible sub field values required for setting check box and radio boxes.


                    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("|");
                                }
                            }

Back to Top
Revolution1200 View Drop Down
Beginner
Beginner
Avatar

Joined: 26 May 11
Location: Glasgow
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Revolution1200 Quote  Post ReplyReply Direct Link To This Post Posted: 06 Jun 11 at 4:51PM
Hi Rowan,
 
Thanks for your reply, was pulled of the project for a week or so and this is the first chance I have had to get back to it!!
 
Finally found out that the sub field names are in actual fact the values I need to send to turn then checkbox on - for instance under the question for Sex, there are 2 sub fields Male and Female, to check the Male check, I use PDFLibrary.SetFormFieldValue PDFLibrary.FindFormFieldByTitle("partc q5"), "male"
 
Slightly confusing but got there in the end!!
 
Cheers
 
Stuart
Back to Top
Rowan View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 10 Jan 09
Status: Offline
Points: 398
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rowan Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 11 at 12:20PM
Hi Stuart,

Can you try using "Yes" with SetFormFieldValue instead of "On"?

PDFLibrary.SetFormFieldValue(subFieldIndex, "Yes")

I did a quick test and Yes works for me but On does not.

Cheers,
- Rowan.
Back to Top
Revolution1200 View Drop Down
Beginner
Beginner
Avatar

Joined: 26 May 11
Location: Glasgow
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Revolution1200 Quote  Post ReplyReply Direct Link To This Post Posted: 26 May 11 at 10:25PM
Hi Folks,

I am currently reviewing QuickPDF for our company, we are looking to automatically fill in H&S forms.

For some reason I am unable to set the value of any of the check boxes on the form.

I have been using the following code to confirm the subfields within VB6

        For loopcounter = 1 To PDFLibrary.FormFieldCount
            currentFieldName = PDFLibrary.GetFormFieldTitle(loopcounter)
            If PDFLibrary.GetFormFieldType(loopcounter) = 4 Then
                If PDFLibrary.GetFormFieldKidCount(loopcounter) > 1 Then
                    Debug.Print PDFLibrary.GetFormFieldKidCount(loopcounter)
                    For subCounter = 2 To PDFLibrary.GetFormFieldKidCount(loopcounter) + 1
                        subFieldIndex = PDFLibrary.GetFormFieldSubTempIndex(loopcounter, subCounter)
                        subFieldName = PDFLibrary.GetFormFieldSubName(loopcounter, subCounter)
                        PDFLibrary.SetFormFieldValue(subFieldIndex, "On"
                    Next
              
                End If
            End If
        Next

I get a valid sub field index, and I can use this to verify that the subfield default value is "Off", I can also use the index to confirm that the subfield is of type 4 for a check box, however when I use the same value to try and set the field using

PDFLibrary.SetFormFieldValue(subFieldIndex, "On")

I get a return value of 0 which seems to mean the library cannot find the field specified?

Is anyone able to share some code where this works?

Kind Regards

Stuart
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store