How do you download a PDF from Viewer.js?
Hope am not too late in answering your question. Here are the steps:
- Open the particular pdf in the reader to full screen.
- Launch inspect.
- Look for a hidden download button with id
download
styled asdisplay: none
, Change that todisplay: inline
to make it visible. - Click the button to download your pdf.
By opening the network monitor in your browser's devtools, you can view all network requests the page makes; somewhere in there should be the PDF, though the URL / URI might not look like one.
On the specific link you provided, the page made a request to get.php
with a query string hash of the document - the response was a plain PDF file.
document.getElementById('download').click()
Answer by Matt C and Vincent Omondi