Determining when user moves to webcontrol (1 Viewer)

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:15
Joined
May 7, 2009
Messages
19,233
web control is not a Static Image. it has it's own methods.
in addition an Acrobat object has its own methods also.
there are two layers you need to get through.

the hardest part is on acrobat side, it does not expose any Events other than directly commanding it to do anything.

check AcroExch.AVDoc, on this object you can get the Current Page Number of the pdf.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:15
Joined
Feb 19, 2013
Messages
16,607
interesting find - I'll take a closer look when I have some time.

re your scroll position, you need to find all the scrollinfo data - it's outside of my experience so don't know if the scrollinfo type is the same for explorer as it is for windows

found this (even older) link - no responses but implies it is the same since it is using the same function names
http://forums.codeguru.com/showthread.php?204725-Scrolling-IE-web-browser-control

also this link which uses a webbrowser control
https://www.experts-exchange.com/questions/20874063/WebBrowser-Auto-Scrolling.html
 

CedarTree

Registered User.
Local time
Today, 09:15
Joined
Mar 2, 2018
Messages
404
Thanks - I tried working with the second link and still, no luck. It's error free, but doesn't seem to be getting the PDF scroll position which, as you say, must be more complex (???)
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:15
Joined
Feb 19, 2013
Messages
16,607
sorry, can't devote any real time to this right now - did you try my suggestion about using a subform - might save a lot of effort
 

CedarTree

Registered User.
Local time
Today, 09:15
Joined
Mar 2, 2018
Messages
404
Um... not sure how to disable the webcontrol scrollbar with a PDF embedded? I've tried a few ideas that I googled (body scroll = 'no'), etc. with no luck.
 
Last edited:

CedarTree

Registered User.
Local time
Today, 09:15
Joined
Mar 2, 2018
Messages
404
P.S. If I use .navigate "pdf#scrollbar=0", it turns of the visible scrollbar, but I can still scroll using my mousewheel when I hover over the PDF. So I think they are still active and the form scrollbar is still not really being used.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:15
Joined
Feb 19, 2013
Messages
16,607
disable the web control? If you have placed it in a subform the scrolls will still work for the subform

What exactly are you trying to achieve? there may be a better way....
 

CedarTree

Registered User.
Local time
Today, 09:15
Joined
Mar 2, 2018
Messages
404
So basically I'm trying to do at least ONE of the following:
1) Ideally, read the page # the person is looking at in the PDF... this seems very difficult unless I can get scroll position and estimate page # (I know the # of pages, and I hope I can get max Scroll position)
2) If I can't do 1, at least I'd like to know that the person scrolled up or down. That way, I can go to a specific page (using &page=x in the URL) and then I know which page they're on but I can tell if they moved away from that page if they scrolled.

PS If I disable webcontrol, the PDF won't load at all it seems.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:15
Joined
Feb 19, 2013
Messages
16,607
but why? what's the benefit? are you trying to track user activity? something else?
 

CedarTree

Registered User.
Local time
Today, 09:15
Joined
Mar 2, 2018
Messages
404
Users need to record if a page should be removed from the PDF (we do this on the backend). Rather than having them type each page # to remove, I'd like them to be able to scroll through, and just click a "Remove" button with the page already known. The user can see the page # ideally so they know it's good.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:15
Joined
Oct 29, 2018
Messages
21,454
Users need to record if a page should be removed from the PDF (we do this on the backend). Rather than having them type each page # to remove, I'd like them to be able to scroll through, and just click a "Remove" button with the page already known. The user can see the page # ideally so they know it's good.
Hi. I have been following this thread in the background because I think it might be possible but just not with the current approach except I just don't have time at the moment to give it a try. In any case, based on what you just said, would it be possible to split the PDF into single pages and instead of scrolling, give the user two buttons: Previous Page and Next Page. When the user clicks a button, you then load the single page in the browser control. If they click on the Remove button, then you'll know which page they wanted to delete. Just a thought...
 

CedarTree

Registered User.
Local time
Today, 09:15
Joined
Mar 2, 2018
Messages
404
Yes thanks... I thought of that briefly at some point (not sure why I didn't pursue it). I guess it would add processing time since you'd have to split the PDFs, etc. So I think that WOULD work... but not my ideal solution. But good idea!!!
 

CedarTree

Registered User.
Local time
Today, 09:15
Joined
Mar 2, 2018
Messages
404
I mean maybe a compromise is to disable scrolling / pageup / pagedown on the control itself. And have a Page Up/Down button and each time send a URL command. But I can't get the control disabling to work.
 

CedarTree

Registered User.
Local time
Today, 09:15
Joined
Mar 2, 2018
Messages
404
As a reminder (to myself), using scrollbar=0 in the URL hides the scrollbars, but I can still pageup/down and mouse wheel myself around.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:15
Joined
Oct 29, 2018
Messages
21,454
As a reminder (to myself), using scrollbar=0 in the URL hides the scrollbars, but I can still pageup/down and mouse wheel myself around.
Hi. If I was going to pursue this, I was thinking of approaching it from JavaScript and HTML or Acrobat API. Just a thought...
 

CedarTree

Registered User.
Local time
Today, 09:15
Joined
Mar 2, 2018
Messages
404
Thanks. I'd need some guidance if JS (and/or maybe HTML) is the way to go (I understand some basics). I'd rather avoid Acrobat API b/c not all my users have Acrobat Pro.
 

CedarTree

Registered User.
Local time
Today, 09:15
Joined
Mar 2, 2018
Messages
404
Also, while I like the potential compromise of disabling scrolling and just using page=x URLs via an explicit Page Up / Down button, the user might still want to scroll up or down WITHIN a page?
 

Users who are viewing this thread

Top Bottom