1
When I view document in mobile device its giving error
Question asked by Sanyami Vaidya - 8/8/2017 at 10:29 PM
Answered
When I view any document on a mobile device it's giving me console error like "Uncaught TypeError: Cannot read property '$e' of null" in MobileReader.js. It's only giving in chrome browser.
 

1 Reply

Reply to Thread
0
Cem Alacayir Replied
Employee Post Marked As Answer
It's caused when you call documentViewer.setZoomLevel function in documentViewerLoad event when viewing the page in mobile mode (via Chrome Device Toolbar). As a workaround call setZoomLevel function only when not in mobile mode:
<script type="text/javascript">
    function documentViewerLoad(sender, e) {
        var documentViewer = sender; //sender parameter will be the DocumentViewer instance

        if (documentViewer.selectedType != "html5Mobile")
            documentViewer.setZoomLevel(1); // Set zoom to 100%
    }
</script>
 

Reply to Thread