Hi,
I recommend the CreateCheckBox.java example from the source code
download. That is very close to what Adobe is doing. (But all the
answers by mkl are great too)
I use only the "normal" appearance, that is the minimum needed. Having
them empty is probably worse than not having them at all.
Tilman
Am 10.12.2019 um 18:52 schrieb Jesse Zhou:
Hello,
I have a question about how pdf checkboxes work that I'm hoping someone
smarter than me can help explain. I have a PDF, in which I've added
checkboxes with an empty "down" appearance stream, but no other appearance
streams. The normal appearance stream is absent from these checkboxes.
I've programmatically "checked" the checkboxes using PDFBox, and even
though the values are changed in the PDF internally, the PDF viewers that
I've used (Preview on macOS and Adobe Acrobat, Google Chrome's built-in
viewer) don't show the box as "checked".
I'm guessing that it's because I haven't set the appearance stream. Is this
correct?
Curiously though, the PDF Viewers will "check" the box if I click on them
while viewing them. If it is because of the appearance streams, generally
speaking, do PDF Viewers have a smart way of handling if an appearance
stream is absent?
Looking for any guidance / direction. Here are some resources I've already
checked out.
-
https://stackoverflow.com/questions/43343232/how-to-add-a-border-to-a-checkbox-and-make-it-always-visible
-
https://stackoverflow.com/questions/43604973/creating-a-checkbox-and-printing-it-to-pdf-file-is-not-working-using-pdfbox-1-8/43606762
Thanks in advance!
-Jesse
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org