How do you download a PDF from Viewer.js?

Hope am not too late in answering your question. Here are the steps:

  1. Open the particular pdf in the reader to full screen.
  2. Launch inspect.
  3. Look for a hidden download button with id download styled as display: none, Change that to display: inline to make it visible.
  4. 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