1. Home
  2. Foxit PDF SDK for Web
  3. How to fix open file error on IE and Microsoft Edge browsers?
  1. Home
  2. Foxit WebPDF Viewer - Discontinued
  3. How to fix open file error on IE and Microsoft Edge browsers?

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

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 succesfully 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:

Updated on March 19, 2019

Was this article helpful?

Related Articles