WebViewer Version: 11.2.0
Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? No
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? Yes
Is your issue related to annotations? No
Please give a brief summary of your issue:
(Think of this as an email subject)
WebViewer v11.2.0 not opening offline document in mobile apps
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
In Mobile apps if the mobile is offline we allow user to load document in offline mode for that we are using PartRetriver which is not working and throwing error while reading document data.
Code for PartRetriver:
/** Generates a part retriever using PDFTron API */
this.generateLocalPartRetriever(this.item).then(
async (partRetriever: any) => {
console.log('partRetriever', partRetriever);
/** Load the XOD file */
const { documentViewer } = Core;
await documentViewer.loadDocument(partRetriever, {
docId: this.item.distributionContentId,
extension: 'xod',
filename: this.item.fileNameWithoutExtension + '.xod',
});
},
this.fail.bind(this),
);
private generateLocalPartRetriever(item: IContent) {
console.log('path', this.offline.generateFileName(this.item));
console.log('directory', Directory.Data);
return new Promise(async (resolve, reject) => {
Filesystem.readFile({
path: this.offline.generateFileName(this.item),
directory: Directory.Data
}).then(async (file) => {
console.log('file', file);
const blob: any = this.offline.b64toBlob(file.data,
'application/octet-stream',
this.offline.generateFileName(this.item));
let partRetriever;
try {
const { PartRetrievers } = this.viewerInstance.Core;
partRetriever = await PartRetrievers
.getPartRetriever(PartRetrievers.Types.LocalPartRetriever, blob);
resolve(partRetriever);
} catch (err) {
console.log('Error generating part retriever', err);
reject();
return;
}
});
});
}
Need help to solve this issue as its giving below error in logs.
Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating '(y.slice||y.webkitSlice||y.mozSlice||y.uRa).call')
Please provide a link to a minimal sample where the issue is reproducible: