You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Web browser and its version:
* Operating system and its version:
* PDF.js version:
* Is a browser extension:
When opening an issue, you always need to provide the above information (since otherwise it's not guaranteed that an answer applies to the PDF.js version you're using).
However, something along the following lines ought to work:
document.addEventListener("webviewerloaded",function(){// Prevent the default "tracemonkey.pdf" file from loading.PDFViewerApplicationOptions.set("defaultUrl","");PDFViewerApplication.initializedPromise.then(function(){// The viewer has now been initialized.// Open your PDF file, with custom headers.PDFViewerApplication.open("A string containing the path to your PDF file",{httpHeaders: // Add your HTTP headers here.});})});
Attach (recommended) or Link to PDF file here:
Configuration:
Steps to reproduce the problem:
on file viewer.js
pdf.js/web/viewer.js
Line 214 in 4fe9260
listen event and motify appOptions
on file app.js
pdf.js/web/app.js
Line 741 in 4fe9260
but app_options.js has not option for httpHeaders ,
pdf.js/src/display/api.js
Line 192 in 4fe9260
What is the expected behavior? (add screenshot)
suport custom httpHeader for viewer.js
i can only hook xhr, fetch for hack this moment.
What went wrong? (add screenshot)
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
The text was updated successfully, but these errors were encountered: