Here's one that might have a very simple answer of "No," or it could be relatively simple solution and I just don't know what to look for, or it could be complex. So, here is the question:
Is it possible to use VBA to determine the state of a check box in an Adobe Acrobat Form?
Further details: We use our Database to extract data from standardized PDFs forms. I use virtual keys to simulate tabbing through the form and copying and pasting data from the form and saving it to the database. This is not my favorite way of doing this, but it works, although with occasional breakages which I am able to manage mostly through error handling.
The following restrictions apply, making any other options impossible (that I know of):
- The PDFs are "SECURE" PDFs
- We do not "own" the forms, so we can't modify the forms to suit our needs.
SECURE PDFs also prevent us from opening the PDF as an object within the DB. I've checked with the Adobe Acrobat SDK and played around with this over the years and every time we open a SECURE PDF, the object methods fail, as the form itself prevents us from having access to the data.
Using our method of virtual keys, we can gather just about everything we need from these forms and import it into our DB. The only thing we are missing is a few check boxes on the forms.
Using the virtual keys, it is possible to manipulate these check boxes. For example, I can simulate checking and un-checking these check boxes all day long. However, since I am unable to check the current state of the check box, I can never glean the value of the check box as it is sent to us.
I am able to add data to the clipboard for all the other data fields on the form and I am able to clear the clipboard. As an example of what I have tried so far, is that I have cleared the clipboard, navigated to the check box and tried to "add" data to the clipboard. Then, I check to see if there is anything in the clipboard, and there is not. So, obviously, there is no "data" behind the current location of the field on the form.
But, is it possible to somehow "test" or determine the current state of a check box on a PDF if that check box currently has the focus on the form?
As mentioned above, the answer might be a simple, "No!"
I could also be missing something simple that I haven't tried because I don't know about it.
It could be something rather more involved, but if it works, that might suit my needs.
I did not attach any forms as they are proprietary and contain personal data. And, this question would apply to any Adobe Acrobat PDF Form (AFAIK).
I'm glad to answer any other questions regarding this.