Does the WebViewer Client support br/gzip compression when using streaming (byte ranges) pdfs? The demo app shows that its using an Accept-Encoding header of identity which basically tells the server not to compress. Any ideas how to get compression working when working with linearized pdfs?
This is exactly the issue I have because I am calling loadDocument with a URL that will do a redirect to a pre-signed URL.
Itâs a pity that this doesnât work:
documentViewer.loadDocument(self.options.documentPath, {
extension: âpdfâ,
customHeaders: {
âAccept-Encodingâ:âgzip, deflate, br, zstdâ
}
}).then().catch(
err => self._handleDocumentLoadException(err, instance));
Gives this error:
webviewer-core.min.js:1569 Refused to set unsafe header âAccept-Encodingâ
From the load document method I use a Spring Boot REST url with a redirect to a pre-signed url. I noticed that this endpoint is called twice by Apryse webviewer before loading the pdf. The first time it is called with Accept-Encoding âidentityâ and the second time with the Accept-Encoding âgzip, deflate, br, zstdâ. The first time I do not redirect. The second time I redirect to a GET pre-signed url. This works!
