-
1. Re: Click a PDF Button from Visual Basic
lrosenthJun 28, 2010 7:00 AM (in response to GVBman)
You can't "push a button" from javaScript.
-
2. Re: Click a PDF Button from Visual Basic
GVBman Jun 28, 2010 7:11 AM (in response to lrosenth)Is there another means of clicking or activating this button?
-
3. Re: Click a PDF Button from Visual Basic
GVBman Jun 28, 2010 5:21 PM (in response to GVBman)Actually, you CAN use javascript to simulate a button click, but I'm going to try using the Windows API.
-
4. Re: Click a PDF Button from Visual Basic
BetterColour Jul 4, 2010 6:43 PM (in response to GVBman)Hi,
If you can't get a button to be clicked through JavaScript as IroSenth says, then maybe you can approach it differently.
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)?
-
5. Re: Click a PDF Button from Visual Basic
GVBman Jul 9, 2010 11:09 AM (in response to BetterColour)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?
-
6. Re: Click a PDF Button from Visual Basic
BetterColour Jul 9, 2010 11:39 AM (in response to GVBman)1 person found this helpfulHi,
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.
Reference:
http://www.xtremevbtalk.com/showthread.php?t=194129
and
http://allapi.mentalis.org/apilist/FindWindowEx.shtml
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):
http://www.vbforums.com/showthread.php?t=345259
and
http://www.vb-helper.com/howto_move_click_mouse.html
Hopes this helps
Antoine
ps: if it does help click to give me my first ten points good answer!
-
7. Re: Click a PDF Button from Visual Basic
GVBman Jul 10, 2010 6:16 AM (in response to BetterColour)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.
Cheers.
-
8. Re: Click a PDF Button from Visual Basic
lrosenthJul 11, 2010 8:11 AM (in response to GVBman)
It sounds like this is probably and xfa-based form which means that you really have no option but simulating the ui
Leonard
-
9. Re: Click a PDF Button from Visual Basic
lrosenthJul 11, 2010 8:13 AM (in response to GVBman)
Buttons for xfa forms do not use native OS controls which is why you can't find it
Leonard
-
10. Re: Click a PDF Button from Visual Basic
GVBman Jul 11, 2010 11:39 AM (in response to lrosenth)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.
-
11. Re: Click a PDF Button from Visual Basic
BetterColour Jul 11, 2010 1:46 PM (in response to GVBman)You could try to sniff its handle if it has one using spy++ or process monitor.