473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Using VBA to determine Adobe Check Box state

twinnyfo
3,653 Expert Mod 2GB
Hello Friends,

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.
The "SECURE" PDFs prevent us from downloading the data to a CSV file. This would work perfectly for us, and would certainly be the preferred method for us, because we have to import several hundred of these forms at a time, and the CSV file would contain the file name and all data. However, the SECURE forms only export the file name to the CSV file and nothing else.

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.
Jan 7 '21
61 5598
SioSio
272 256MB
Rabbit,
I ran the code with the security settings in the PDF file set to "Not Allowed" except for "Content Copying for Accessibility", but I was able to get the value of the checkbox.

twinnyfo,
What are the security settings for that PDF file?
Jan 20 '21 #51
NeoPa
32,556 Expert Mod 16PB
Hi SioSio.

You should find all the information you need by reading through the thread to date. It has all been disclosed & discussed earlier, so repeating it at this point would be counter-productive.

For now it's probably enough to say that the solution you propose is not going to work for this question.
Jan 20 '21 #52
Rabbit
12,516 Expert Mod 8TB
In Siosio's defense, we didn't discuss the Adobe API much as I've never used it before. Twinny was unable to get the Adobe API to work with secure PDFs but if Siosio knows more about the API, that would be the best solution to accomplish this task.

Much of the discussion I was involved with was to take it as a given that the API would not allow access to secure PDFs as that would be quite the security oversight on Adobe's part.
Jan 20 '21 #53
twinnyfo
3,653 Expert Mod 2GB
All,

I have not had a chance to get back to this due to a conference, but if I remember correctly (way back when--it's difficult for us old geezers to remember things), I think I began this process with the API, as the code Sio provided looks too familiar to be coincidence.

I will try it again, but I do believe that this method does not access Secure PDFs.

Thanks for input from all!

More to follow....
Jan 20 '21 #54
SioSio
272 256MB
I haven't read the entire manual, but the Adobe API manual states that security settings only "ignore" printing-related methods (Print, PrintAll, PrintAllFit, PrintPages, PrintPagesFit, PrintWithDialog). I am. it has been.
I couldn't find any other mention of SecurePFD in the manual.
Jan 21 '21 #55
SioSio
272 256MB
NeoPa,

I don't want to stick to my code.
It uses code that can solve the problem.
But as I wrote in # 51, I have set the security of the sample PDF file to run the code.
Therefore, I would like to know what kind of security settings the unreadable PFD file has.
Jan 21 '21 #56
Rabbit
12,516 Expert Mod 8TB
This page from Adobe would indicate that there are security settings that affect more than printing: https://helpx.adobe.com/acrobat/how-...otect-pdf.html
Jan 21 '21 #57
SioSio
272 256MB
For reference, here are the security properties of the PDF file when the code runs successfully:
Since my environment is Japanese, I will paste an image with the same settings.

Jan 21 '21 #58
SioSio
272 256MB
I found information when the code cannot access the PDF file.
If this was written in Adobe LiveCycle Designer, the code probably can't manipulate the fields.
Jan 21 '21 #59
NeoPa
32,556 Expert Mod 16PB
Hi SioSio.

I won't say your approach is wrong. I would merely say that if you believe it might be a viable approach, in spite of the earlier part of the discussion, then I'd expect you to explain first why you are going against what has already been said.

People get things wrong all the time. However, so many members post without regard to what has already been posted that if you're that rare member that knows more than those who've already discussed the matter then it makes sense to explain that up front. Otherwise people will naturally assume you are simply not caught up with the thread.

Don't get me wrong. I've seen some of your posts and I know you're cleverer than the average - and you post helpful replies often - but it helps to know that you are up to date with the thread already as so many jump in without reading what's there so the thread gets complicated to read when people have to go over the same issues that have already been dealt with. I hope that makes sense.

It certainly sounds like you have some experience in the matter but I'll leave you to sort out between you if you can find a way to use that approach that was given up on before due to its not working with secure documents.
Jan 21 '21 #60
twinnyfo
3,653 Expert Mod 2GB
I will try working SioSio's recommendation next week. There are several issues with my current PC that are not allowing this to work--which has nothing to do with the discussion so far; it is a purely internal IT Managed issue.

I do think there is a bit of confusion concerning terms and what is meant by a "SECURED" PDF. My issue has nothing to do with the Document's settings (which can sometimes be set by the user), but has to do with the Form's settings (which cannot be modified by the user). I don't know what software our "company" uses to create our PDF Forms, but when you open them, it says "SECURED" in the title bar. If I create a PDF Form out of a Word Document, this will not appear. Our forms can accept signature credentials from smart cards, and since our forms record personnel and privacy information, they are always secure, for protection's sake.

We will see how this falls out next week................
Jan 21 '21 #61
SioSio
272 256MB
Rabbit, twinnyfo,
Thank you for following me.
If the PDF FORM is created with a tool other than Acrobat, that's why the API doesn't work, I think so. For now, I think the Rabbit method is good.

Everyone participating in this discussion,
However, I think it is necessary to post it if the problem can be solved in a more orthodox way. I thought to needed it, so I posted the code.
When I posted first the code, I needed to show that even a secure PDF file can be processed by the ACROBAT API.
If everyone feels the discussion is confusing for my posted, I apologize.
Jan 22 '21 #62

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Kamuela Franco | last post by:
I would like to use a Python script to periodically check to see if a program is still running and if it isn't I want to start it up. Could someone point me on the right path? Thanks in advance....
2
by: Askari | last post by:
Hi, How do for do a "select()" on a CheckButton in a menu (make with add_checkbutton(....) )? I can modify title, state, etc but not the "check state". :-( Askari
7
by: Najib Abi Fadel | last post by:
Is postgres going to support in a future release the use of SUBSELECT in a CHECK expression ?? Thx
2
by: Ron Vecchi | last post by:
I have an aplication that will consitently be comutication with a webserver remotly via Internet. What is the best way and most lightweight way to constently check the conection so my app will...
1
by: mdb | last post by:
I want to determine whether the SHIFT key is depressed, but NOT during a key up/down/pressed event. How can I do that?
1
by: wardy | last post by:
I've got a .NET web application that currently uses session to maintain state. I am just looking down the road and thinking of scaleability and if I need to go to a web farm, then using "inproc"...
4
by: Jeff | last post by:
We have multiple ASP.Net web apps in development. As a standard we are looking to go with SQL Server to hold state information. Can we have the multiple apps all point to a single State DB? Or...
9
by: PawelR | last post by:
Hello group, I'm begginer in ASP.net and my question is very simple. In my webform I have CheckBox (myCB) and DropDownList (myDDL). I want set myDDL.Enabled =myCB.Checked and show change without...
3
by: Mark | last post by:
I'm aware of how to preserve state using session, application variables, view state, query strings, etc. I'm told that you can use POST to do a similar state preservation. How does this work...
1
by: milop | last post by:
Hello. Not wanting to have to cast every object that needs to be stored in session state, I am thinking of using Profiles introduced with ASP.Net 2.0. All of my objects are serializable so...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.