intbot / ng2-pdfjs-viewer

An angular component for PDFJS and ViewerJS (Supports all versions of angular)
Apache License 2.0
228 stars 112 forks source link

How to add aditional HTTP headers to ng2-pdfjs-viewer #121

Open vrevanna opened 3 years ago

vrevanna commented 3 years ago

In my case [pdfSrc] is backend api which returns pdf data. To authenticate api I need to pass Authorization header. How to pass aditional header to pass this through. Checked ng2-pdfjs-viewer documentation but i don't see anything.

codehippie1 commented 3 years ago

@vrevanna As of now, pdf is loaded in an iframe with an http get request. Let me look into this if custom headers can be added

codehippie1 commented 3 years ago

@vrevanna Check these out https://stackoverflow.com/questions/13432821/is-it-possible-to-add-request-headers-to-an-iframe-src-request https://stackoverflow.com/questions/17694807/how-to-set-custom-http-headers-when-changing-iframe-src/17695034#17695034