WebViewer opening component on new tab on Edge

23 views
Skip to first unread message

Mirko Lugano

unread,
Dec 11, 2018, 1:20:04 PM12/11/18
to PDFTron WebViewer
Hi, I am successfully using PDFTron WebViewer (before version 3.2.0, now migrated to 4.0.3).
I load PDFs directly (no XODs) into the webViewer HTML5 component that I have integrated in my web app. PDFs are stored on Windows Azure.
Everything works perfectly in Chrome.
On Edge it does not work (nor had it worked with version 3.2.0). On loading the PDF, the URL of the current tab switches to "ui-legacy/MobileReaderControl.html#d=<pdf_url>".
I think loading the "MobileReaderControl" is not correct anyway, since I am working with my laptop and not a mobile device. Anyway, is it related to Edge being picky about IFrame attributes? What could / should I do about it?

On the demo page "https://www.pdftron.com/webviewer/demo/" it works, but if I open the Edge devtools on this page, a page reload is triggered.
Thanx
Mirko

Justin Jung

unread,
Dec 14, 2018, 2:42:42 PM12/14/18
to PDFTron WebViewer
Hi Mirko,

It looks like you are using the legacy UI.
Legacy UI is composed of two different viewer apps for desktop and mobile, and it tries to autoload mobile viewer for appropriate devices based on navigator.userAgent.
However, we did notice that Edge on desktop sometimes returns true to cover touch screen desktops.

Based on your requirement, you have the following options:
1. Overwrite PDFTron.WebViewer.prototype.isMobileDevice to return false, which will never load mobile viewer even in mobile devices.
2. Overwrite PDFTron.WebViewer.prototype.isMobileDevice to handle Edge properly.
3. Use the new default UI which uses single viewer app for both desktop and mobile.

You can see the current implementation of isMobileDevice function in WebViewer/lib/webviewer.js

Justin Jung
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages