How to cancel or destroy a getPage request with disableAutoFetch set
See original GitHub issueDear pdf.js contributors,
With disableAutoFetch set
, is there a way to cancel fetching on getPage()
? The same way one destroy()
getDocument promise
It looks like it is possible but I found only internal functions.
Best, A.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
JSDoc: Source: api.js
* Abort all network requests and destroy the worker. * @returns {Promise<void>} A promise that is resolved when destruction is; * completed.
Read more >How to use full PDF.js viewer with toolbar in webpack and ...
I am requiring PDFjs with require('pdfjs-dist/webpack') so it doesn't send the "a fake worker has been set up" warning. I can't really find...
Read more >JSDoc: Source: display/api.js
workerSrc); /** * Disable range request loading of PDF files. ... disableAutoFetch); /** * Enables special hooks for debugging PDF.js.
Read more >types/pdfjs-dist/index.d.ts - UNPKG
When range requests are enabled PDF.js will automatically keep ... 226, * NOTE: It is also necessary to disable streaming, see above,.
Read more >PDF.js - Source code - Greasy Fork
It is a library for other scripts to include with the meta directive // @require https://greasyfork.org/scripts/388114-pdf-js/code/PDFjs.js?version=721820 ...
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
Closing as answered by the comments above.
It allows completely custom data delivery, that you thus can implement in what ever way you want/need in your case (it’s being used in the PDF Viewer that’s built-in to the Firefox browser).
While it does allow a great deal of flexibility, it’s consequently a fair bit more complex than just providing a URL when calling
getDocument
😃There’s the API unit-tests and also the default viewer usages here, here, here and finally here and here.