3.1.0 Events documentLoaded and ready not triggered

78 views
Skip to first unread message

Jérémy Guyenot

unread,
Jan 15, 2018, 1:06:26 PM1/15/18
to PDFTron WebViewer
Hi,

since the 3.1.0 version we encountered a not triggered events onto "ready" and "documentLoaded".
we migrate from 2.2.2. We disabled the config.js file to see if it is the cause but not.

Could you solve the problem?



var options = {
            l: "xxxxxxxxxxx",
            path: globalVars.ServerUrl + '/mgMultiViewer/external/PDFTron/WebViewer/lib',
            type: "html5",
            documentType: "pdf",
            enableAnnotations: true,
            serverUrl: globalVars.ServerUrl + '/mgMultiViewer/external/PDFTron/myAnnotationHandler.php',
            annotationAdmin: !Number(fileReadOnly),
            enableReadOnlyMode: Number(fileReadOnly),
            streaming: false,
            pdfnet: false,
            custom: JSON.stringify(tblCustom),
            config: globalVars.ServerUrl + '/mgMultiViewer/js/mgViewerPDFconfig.js'
        };

         $(viewerElement).bind('ready', _onViewerReady);
         $(viewerElement).bind('documentLoaded', _onDocumentLoaded);
         if (typeof (properties['onViewerReady']) == "undefined") {
             options.initialDoc = url;
         }

        pdfWebViewer = new PDFTron.WebViewer(options, viewerElement);

Matt Parizeau

unread,
Jan 16, 2018, 3:37:40 PM1/16/18
to PDFTron WebViewer
Hi,

Are you able to reproduce the issue in an uncustomized WebViewer 3.1? For example I tried adding breakpoints to the WebViewer Controls sample in the ready and documentLoaded handlers and they were hit as expected. You can check it out at https://www.pdftron.com/webviewer/demo/samples/webviewer-controls/webviewer-controls.html?doctype=xod and add breakpoints in the webviewer-controls.html file.

If you could provide us with a sample project that can reproduce the issue then we can investigate further.

Thanks,

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Jérémy Guyenot

unread,
Jan 17, 2018, 12:53:59 PM1/17/18
to PDFTron WebViewer
Hi,

without any custom file the problem is the same. None event are triggered.

Jérémy Guyenot

unread,
Jan 17, 2018, 12:53:59 PM1/17/18
to PDFTron WebViewer

Hi,

in the screenshot, you can see that the events are binded to the div element but not trigered by jquery.


Le mardi 16 janvier 2018 21:37:40 UTC+1, Matt Parizeau a écrit :

Jérémy Guyenot

unread,
Jan 17, 2018, 12:53:59 PM1/17/18
to PDFTron WebViewer
Hi,

we just find the problem.

For your Viewer you need to use jquery 3.2.1 but actually our app use 1.7.2. We adde the code behind to work.
(function ($) {
//the code
})(jQuery);

Le mardi 16 janvier 2018 21:37:40 UTC+1, Matt Parizeau a écrit :
Reply all
Reply to author
Forward
0 new messages