There is a button on a PDF form that I would like to click programmatically. I can get the name of the button's field by:
jso = pdDoc.GetJSObject
When this button is clicked, it creates additional fields that need to be filled out. I've tried setting it's value to "1", "True", "Yes", etc. with no success.
Thanks in advance for your help.
Perhaps you can create those additional fields through a function that is called when the user has entered text into a field (or any user action)?
If I knew how to create the fields in the manner that this button does so, I wouldn't be on this forum. The button expands the pdf and allows for a whole new applicant 2, applicant3, etc. creating entire new sections on the form each time the button is pushed. Using the existing functionality of this button would obviously be easier and quite frankly, I don't know how to create the new fields and format them so that the government agency that it is submitted to will accept it. The government agency reads these fields by looking at xml. In the old days we input this form by hand, but it's my job to do this programmitcally and expand the form for multiple applicants, etc.
Since this button shows up as a field and I'm able to update other fields in this form, isn't there some way of updating the button's field value or is there a way to call the function behind the button from visual basic?
In VB / XP you can call Windows to simulate a click on the screen, however you need to pass the location of the click.
Unless the PDF always open up the same way (say, 100% size), I don't see how you could provide consistantly the coordinates for the click.
If it does open up the same way, then maybe you could go about finding the location via something like this:
Get thewindow position using something like
FindWindowEx and GetWindowPos and GetClientRect.
Then assuming that the button position is always the same (I think it has to) then you could pinpoint the location on whatever customer's screen by going with percentages. If the button is 25% to the left of the window, and 25% down, you can do the arithmetic to find where to click.
Reference (a good starting point):
Hopes this helps
ps: if it does help click to give me my first ten points good answer!
Thanks Antoine. I was going to go that route if I had no other options. I think you can actually find the windows handle of the button useing findwindowex and not have to worry about it's position, but I haven't tried it.
I'm having a difficult time finding the buttons in the windows API also. I am able to see the AcrobatMDIChildWnd which I believe the buttons reside in, but I can't figure out how to access that specific window.
I downloaded a vb.net project that was able to access 2 check boxes on the top of the form, but they must be in a top level window.