PDFJS.getDocument().then is not working, not file is loaded no callbacks are triggered, not errors in console.
See original GitHub issueTo reproduce:
PDFJS.getDocument("/pdf.pdf").then(function() { alert("yo") })
Console returns
Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}
Alert never happens, no xhr calls are fired.
Version info: 1.0.233, build d39af0a
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
pdf.js not loading pdf file - Stack Overflow
Most of these problems are caused by the fact that you are running your test by opening an html file, thus the browser...
Read more >JSDoc: Source: api.js
@property {boolean} [withCredentials] - Indicates whether or not; * cross-site Access-Control ... By default PDF.js attempts to load PDF files in chunks.
Read more >vue-pdf - npm
onProgress: Callback return loading progress. withCredentials: Wheter or not to send cookies in the fetch request. Examples. Example - current ...
Read more >Rendering PDF pages with PDF.js and Vue - rossta.net
I remember a time not too long ago when the possibility of rendering PDFs ... loading PDF.js to render an entire PDF document...
Read more >Programmatic file downloads in the browser - LogRocket Blog
When the client (web browser in this case) receives this HTTP response, it simply displays or renders the GIF image — which is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had this same issue when trying to use PDFJS inside a Chrome extension content script. Chrome extensions content scripts disallow the use of document.currentScript which PDFJS relies upon in order to load the pdf.worker.js script. Instead I manually edited pdf.js to reference a chrome extension URL via the Chrome extension API call:
PDFJS.workerSrc = chrome.extension.getURL(“libs/pdf.worker.js”);
Where libs/pdf.worker.js was the relative location inside my Chrome extension.
Not sure if that helps but I found this issue page from googling for my issue.
See my copy of pdf.js here https://github.com/fcfort/betterment-csv-chrome/blob/master/libs/pdf.js
same case not working
PDFJS.getDocument(‘\pdfjs\files’);
Promise {[[PromiseStatus]]: “pending”, [[PromiseValue]]: undefined}
can anyone resolve this ???