Product: PDFTron Webviewer (Web SDK)
Product Version: 7.3.0
I am experiencing “Download failed” warnings in pdftron and I don’t know how I can re initialize the download process. To describe the what is happening:
- I feed a 300mb file into the viewer via URL.
- I look into dev tools network tab and see the viewer requesting chunks of the file (my back end supports byte ranges).
- In the middle of downloading the file, the pdf viewer stops and outputs a warning that says “Download failed”.
I am seeing pdftron viewer do more download requests after the prompt of “Download failed”, but after successfully requesting these chunks, the viewer still doesn’t display anything and is stuck to what was displayed before the warning prompt.
Here is a snippet of code where the system attempts to view the pdf, as you can see, I simply pass a url to the loadDocument function.
WebViewer({
...
fullAPI: true
}, this.viewerElement).then(async (instance) => {
file_upload.addEventListener('change', async () => {
if (file_upload.value)
this.attachmentId = file_upload.value;
this.url = '';
if (!this.attachmentId)
return;
this.url = projectionPage.urlFor(`Download/AttachmentPartial/${this.attachmentId}?verbose=false`);
}
instance.loadDocument(this.url, { filename: this.filename });
});
});
}
I would appreciate If anyone can point me into the right direction.