Back to Blog

    Developer Blog

    How to fix open file error on IE and Microsoft Edge browsers?

    Foxit PDF SDK for Web 6.2
    Foxit WebPDF Viewer - Discontinued

    When a file has errors opening exclusively on Microsoft Edge or IE, most times it is related to the initialization of the REST API. To fix that, you need to call the WebPDF.ViewerInstance.updateCurrentUserInfo() to make sure the API is running successfully and generating an Access Token. You can find the front-end WebPDF Viewer example code in
    viewer/
    webapp/scripts/control/pc/demo.js.

    The code for the initialization is described below:

    WebPDF.ready(docViewerId, optionsParams).then(function(data){
    … …
    return WebPDF.ViewerInstance.updateCurrentUserInfo();
    }).then(function(data) {
    WebPDF.ViewerInstance.on(WebPDF.EventList.DOCUMENT_LOADED, function(event,
    data){
    console.log("userId:"+WebPDF.AccountInstance.getUserId());
    console.log("userName:"+WebPDF.AccountInstance.getUserName());
    console.log("accesstoken:"+WebPDF.AccountInstance.getAccessToken()});
    }
    });
    

    Open your console to see the user details and the access token as the image below shows:

    pdf console preserve log jquery browser deprecated