WebViewer Version:
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:
We are using Webviewer in order to download a PDF file returned from our WebApi (dotnet core). We cannot get many 206 responses that will eventually download the whole file.
Please describe your issue and provide steps to reproduce it:
We are loading the file using a blob with loadDocument like the following:
await this.viewerInstance.loadDocument(file.blob, {
extension: ‘pdf’
})
On backend we tried to return
-
return File(result.Stream, “application/pdf”, result.FileName, enableRangeProcessing: true);
-
or even a custom response
Response.StatusCode = StatusCodes.Status206PartialContent;
Response.Headers.Add(“Accept-Ranges”, “bytes”);
Response.Headers.Add(“Content-Length”, contentLength.ToString());
Response.Headers.Add(“Content-Range”, $“bytes {rangeStart}-{rangeEnd}/{result.FileSize}”);var inputStream = new MemoryStream();
await result.Stream.CopyToAsync(inputStream); // TEMPORARY SOLUTIONinputStream.Seek(rangeStart, SeekOrigin.Begin);
var buffer = new byte[contentLength];
inputStream.Read(buffer, 0, (int)contentLength);
In the case of simply returning a response with enableRangeProcessing, results with downloading the entire file.
And in the case of custom response, we only have 1 206 response and nothing else.
The file we are serving through web api is linearized.
We are on “@pdftron/webviewer”: “8.4.0”
Please provide a link to a minimal sample where the issue is reproducible: We are in POC stage for now…