1

I am trying to render a PDF using PDFJS Library. https://mozilla.github.io/pdf.js/examples/

We are receiving Content-type as "application/octet-stream; charset=UTF-8" like below from an API that we are calling within javascript from our HTML. But PDF JS is not able to use app/octet stream directly. Is there any way to natively get base64 from the octet stream in Javascript,so it can be used by PDFJS.

PDF JS can directly use base64 string : https://jsfiddle.net/pdfjs/cq0asLqz/

%PDF-1.4
%����
1 0 obj
<<
/Pages 2 0 R
/Type /Catalog
>>
endobj
Vipul
  • 11
  • 1
  • 2

0 Answers0