Print Page | Close Window

XFA Field Check Box

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=3520
Printed Date: 26 Nov 24 at 4:07AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: XFA Field Check Box
Posted By: mdgodfrey
Subject: XFA Field Check Box
Date Posted: 02 Nov 17 at 9:30PM
I can populate fields in a XFA document as long as it it a text field.
I don't see anyway to check a field that is a Check Box however.

Does anyone know how to do that?

Thanks



Replies:
Posted By: Ingo
Date Posted: 02 Nov 17 at 10:42PM
Hi,

perhaps this guide from the online reference will be a help?
http://www.debenu.com/kb/programmatically-extract-form-field-data-pdf-files/



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



Posted By: mdgodfrey
Date Posted: 03 Nov 17 at 5:25PM
I appreciate the reference. I have been able to extract data from a form and mostly can place data into a form. This guide does give me a few more options I hadn't considered so thanks.

The exception for me at the moment is a CheckBox. I can see how to alter the format of the check but so far can only place a check by manually doing that in the form.
In reading the data from a CheckBox when it is unchecked the field value is 'Off'. So one might think that placing 'On' into the checkbox would activate the check mark. This does not work for me however.

I am attempting to place that data with this code:
PDF.SetXFAFormFieldValue('Form1099-S/c1_3', 'On');  //Does not produce the check mark

Doing something similar works just fine it the field is a text box but not when its a check box.

Thanks again


Posted By: Ingo
Date Posted: 03 Nov 17 at 6:15PM
Hi,

fpr normal forms (not XFA) it works like this:
// ...
                   QP.SetNeedAppearances(1);
                   QP.SetFormFieldValueByTitle( FieldName, FieldValue );
                   nresult := QP.FindFormFieldByTitle(FieldName);
                   QP.UpdateAppearanceStream(nresult);
// ...
And you're right a value "On" oder "Off" will change the checkbox and regarding XFA it should work similar ...? BTW: Is your fieldname correct with the slash in it?



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



Posted By: mdgodfrey
Date Posted: 03 Nov 17 at 9:55PM
This works fine with text fields but I can't get either method to work with a check box.


Posted By: Ingo
Date Posted: 05 Nov 17 at 8:07PM
for me it works fine ;-)
Perhaps it would help if you're able to post more than only one single line of code...



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




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