fdf


FDF - how to check a checkbox?


I'm using FDF to populate a PDF template. On my PDF template, I have a checkbox and radio field called c1 and r1 respectively. What's the syntax I should use in my FDF file to check or select the c1 and r1 field?
I tried things like
<</T(c1)/V(1)>>
<</T(c1)/V(checked)>>
<</T(c1)/V(on)>>
<</T(c1)/V(true)>>
But none of them work.
I found the answer. To check, use
<</T(c1)/V(Yes)>>
To turn off, use
<</T(c1)/V(Off)>>
I found the answer on this page:
http://www.4dcodeexchange.net/fdfformbuilder.htm
Excerpt
Checkboxes come in 2 flavors grouped
and individual. Individual checkboxes
will usually have a value of "Yes" or
"Off". Grouped checkboxes are
different in that each checkbox will
have its own value. If you have
problems with your FDF, look here
first.
Just to make a precision.
It seems that to check an individual checkbox you need to use the export value you set when creating your box in Acrobat.
This value is, indeed, by default to "Yes"
The value passed to check the box is often "Yes" and "Off" - However, this is only the default value and it can be changed from "Yes" to almost any value at all (this is controlled by the export value of the document, as pointed out by others).
If you are looking to procedurally get the on/checked state value (which you will need to reliably set this checkbox as checked), it is contained in the appearances "AP" dictionary of the field. That dictionary should contain another dictionary "N", and each key is one of two values for the checkbox. The first key will be the unchecked value (usually "Off") and the second key will be the checked value (usually "Yes"). How you do this entirely depends on the API.
If you use pdftk from the command line, you can see what the expected values are using the command dump_data_fields: Eg.
pdftk document.pdf dump_data_fields
Will show something like this:
---
FieldType: Button
FieldName: basform
FieldFlags: 0
FieldValue: No
FieldJustification: Left
FieldStateOption: Off
FieldStateOption: basic_forms <---- Checked value expected by FDF
Here we can see that the checked state is actually expecting "basic_forms" and not "Yes". I believe the other state is always "Off", but that may depend on the language your program is using (the default "Yes" value certainly does).
For me works:
<</T(c1)/V(0)>>
for checked values and
<</T(c1)/V(Off)>>
values by default.
Yes From JAVA ALSO we can pass value "Yes" to check the checkbox in pdf or fdf thanks....
Rachit Shah

Related Links

FDF - how to check a checkbox?

Categories

HOME
cobalt
delphi-7
wakanda
android-studio-2.2
nunit
youtube-data-api-v3
pascal
camera
oracle-apex-5
devise
rendering
dojo
cq5
telegram-bot
babeljs
jtextpane
retrofit2
joomla3.0
google-form
scrolltop
altera
azure-powershell
entitymanager
glyphicons
firefox-addon
git-extensions
pyramid
nim
windows-xp
parcelable
ms-access-2003
cppreference
constexpr
gitlab-api
mockjax
testbed
pop3
indy10
processwire
protege4
swagger-php
password-protection
health-monitoring
mongoose-schema
unordered-map
laravel-elixir
jide
double-click
pair-programming
arules
otp
gpg-signature
vibrate
android-instrumentation
stripe-connect
webjars
mta
stream-processing
sklearn-pandas
nupic
relativelayout
dynamics-nav-2016
boomerang
qt5.2
finalbuilder
viola-jones
uncompress
omnifaces
user-permissions
xmltype
broadband
beatsmusic
android-cookiemanager
iiop
paw
trdion2011
insight.database
radiant
decoupling
asdf
nebula
css-reset
wp7test
android-loadermanager
vfs
os.system
objectquery
fusefabric
koken
isa-swizzling
wiimote
listactivity
jqueryform
pos-for-.net
complex-event-processing
fail-fast-fail-early
perl5.12
image-capture
appliance
wspbuilder

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App