Determining when user moves to webcontrol (1 Viewer)

theDBguy

I’m here to help
Staff member
Local time
Today, 13:19
Joined
Oct 29, 2018
Messages
21,473
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.
Unfortunately, as I was saying earlier, I don't have enough time right now to pursue this line of thought, but it's just an idea I think may be possible. If I get a chance to try it later on, I'll let you know, but no promises though. My initial thought was what if instead of loading the PDF file into the web browser, you would create a HTML page that displays the PDF in it and load this HTML file in your browser control. You are then free to design and code the HTML file to maybe do other things and possibly interact with the user too. Just my 2 cents...
 

isladogs

MVP / VIP
Local time
Today, 21:19
Joined
Jan 14, 2017
Messages
18,219
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.

I haven't been following this thread and I'm therefore unclear why you need this. However for info it is possible to disable the page up/down buttons and mouse wheel scroll whilst using your form
 

CedarTree

Registered User.
Local time
Today, 16:19
Joined
Mar 2, 2018
Messages
404
Maybe the best idea so far is to split the PDF into separate pages (do this in batch beforehand) and have the user open each page explicitly via PageUp / PageDown buttons. This might be the best compromise unless someone donates some time in my direction to determine the page # the person is looking at on the fly! Thanks guys!
 

CJ_London

Super Moderator
Staff member
Local time
Today, 21:19
Joined
Feb 19, 2013
Messages
16,612
I kind of agree, you need to find a different way

for example you might be able to open the pdf to a specific page. then have your own scrollbar to move around the pages by refreshing the control. OK, the display doesn't scroll from one page to the next, but if the purpose is just for the viewer to see whole pages at a time, you have control of which page they are looking at....

I know you can open a pdf to a specific page using command line switches with adobe reader - not sure they would work in a web control but perhaps worth a try. See this link for the switches

https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

Edit: see you are thinking along the same lines
 

CedarTree

Registered User.
Local time
Today, 16:19
Joined
Mar 2, 2018
Messages
404
Right. What would be REALLY cool is if Adobe page URL parameters allowed you to open to a range of pages so you could just show 1 page at a time, but the user could still scroll up and down that singular page.
 

CedarTree

Registered User.
Local time
Today, 16:19
Joined
Mar 2, 2018
Messages
404
Right - the goal for my purposes however is to not just open to a specific page (&page=x), but to open ONLY that page.
 

isladogs

MVP / VIP
Local time
Today, 21:19
Joined
Jan 14, 2017
Messages
18,219
Right - the goal for my purposes however is to not just open to a specific page (&page=x), but to open ONLY that page.

Well perhaps you said that earlier in the thread but I hadn't seen that point before.
In that case combine the suggestions in my last two posts.
Disable page up/down and mouse wheel scrolling AND open to a specific page.
QED

BTW have you considered using the ActiveX Web browser control instead?
 

CedarTree

Registered User.
Local time
Today, 16:19
Joined
Mar 2, 2018
Messages
404
Opening to a specific page does not stop the user from scroll down to another page, and therefore not knowing which page they end up at.
 
Last edited:

CedarTree

Registered User.
Local time
Today, 16:19
Joined
Mar 2, 2018
Messages
404
That's the issue - you can't just turn off scrollbars easily in a PDF inside a Web Control.
 

isladogs

MVP / VIP
Local time
Today, 21:19
Joined
Jan 14, 2017
Messages
18,219
That's the issue - you can't just turn off scrollbars easily in a PDF inside a Web Control.

Your post #37 indicates it works.
And I'll ask again, have you considered using the ActiveX Web browser control?
 

CedarTree

Registered User.
Local time
Today, 16:19
Joined
Mar 2, 2018
Messages
404
Didn't have any more luck with ActiveX.
I can hide the scroll bar... but you can still scroll around to ANOTHER page.
If I somehow disable scrolling, then you can't scroll down within the SAME page.
It's a catch-22.
 

isladogs

MVP / VIP
Local time
Today, 21:19
Joined
Jan 14, 2017
Messages
18,219
OK I'll drop out again now.
You haven't said whether you have tried to disable PageUp & Pagedown controls or mouse wheel scrolling as I suggested

Good luck...whatever the point of this happens to be
 

CJ_London

Super Moderator
Staff member
Local time
Today, 21:19
Joined
Feb 19, 2013
Messages
16,612
I have a possible solution for you if all you are trying to capture is the page number.

I was unable to disable mousewheel in the web control and page up/down went out of sync after a few pages but by putting an invisible form over the web control I can prevent the user interacting with it so enables you to provide 'previous, next, enter a page number, home grown scrollbar' type functionality on your main form - the code resizes the pdf so a complete page viewed.

The attached is crude but demonstrates the principle.

Not sure how much of an explanation you require but form1 contains the web control and basic 'select a page' navigation

form2 is the invisible form, I've set a very low level of visibility so it can just be seen. It is a popup (needs to be) and I haven't provided any window placing code so you'll need to open it and drag it over the web control to get it to to its job.

You'll also need to populate the file name control.

I tried it on a pdf with some 3300 pages (mySQL manual) and it was pretty quick going from page 1 to page 3000 for example
 

Attachments

  • pdfweb.zip
    43 KB · Views: 99

isladogs

MVP / VIP
Local time
Today, 21:19
Joined
Jan 14, 2017
Messages
18,219
That's clever.
I use a similar idea of a semi transparent form to dim the background behind a popup form. The purpose there is to focus attention on the popup.
In case you are interested, its one of the options in my Attention Seeking database
 

CJ_London

Super Moderator
Staff member
Local time
Today, 21:19
Joined
Feb 19, 2013
Messages
16,612
My primary use for it (with some colour and transparency) is to highlight columns in a datasheet or continuous form
 

isladogs

MVP / VIP
Local time
Today, 21:19
Joined
Jan 14, 2017
Messages
18,219
I'd not thought of doing that.
However to my mind its easier to highlight columns without using an overlay.

For example in a continuous form


Or in a datasheet form
 

Attachments

  • datasheethighlight.jpg
    datasheethighlight.jpg
    102.9 KB · Views: 235

CJ_London

Super Moderator
Staff member
Local time
Today, 21:19
Joined
Feb 19, 2013
Messages
16,612
I use that method as well, but if there is conditional formatting involved, it looks a bit messy. Columns are being highlighted for reasons of user taking some action rather than emphasising a particular column.
 

isladogs

MVP / VIP
Local time
Today, 21:19
Joined
Jan 14, 2017
Messages
18,219
My purpose in highlighting columns is usually to indicate something has been done to the column(s). In the case of the continuous form, I'm highlighting the columns filtered based on combo selections. No CF involved

I rarely use datasheets so knocked up a quick example which did use CF to save time. However if I had used a datasheet subform, the same non CF code used in the continuous form would have worked for the DS subform also.

Anyway... not sure why you say CF can look messy. The end appearance can be identical whether CF used or not. ;)
 

Users who are viewing this thread

Top Bottom