mikecousins/react-pdf-js

how to setting headers??

Closed this issue · 2 comments

i want to setting headers.
but error occurs...

sample 1)
<PDFJS
file="https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf"
httpHeaders={{'Cache Control': 'max-age=0, no-cache, no-store, must-revalidate', 'Access-Control-Allow-Origin': '*'}}
/>

error:
image

sample 2)
<PDFJS
file="https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf"
httpHeaders={{'Cache Control': 'max-age=0, no-cache, no-store, must-revalidate', 'Access-Control-Allow-Origin': '*'}}
/>

error:
image

how to setting headers??? please help me...

This is not currently possible. To do this today you'd have to use the raw pdf.js library.

This used to be an option? - #58