19

I was on a site with a PDF without a download option. I read online that you should "inspect element" to find the true source. After scrolling through the elements > properties I found a "Base URI" (I don't fully understand this)

From here the PDF loaded but there still wasn't a print /save button. If I use Chrome's Print > Save as PDF it only saves a few of the pages. From what I can tell by playing around with it is that it only loads certain pages and only for a while. After that the pages go back to being blank again until you scroll to them. I tried scrolling through the whole document and then print > save PDF but it only showed the bottom pages and the top ones went blank again. Anyone know how to get the whole document in PDF?

2
  • 1
    Do you own the rights to download it?
    – Xavierjazz
    Jun 17, 2017 at 20:13
  • 1
    Yes I do. My goal is mainly offline viewing. I like WiFi off when I read to stop notifications etc.
    – Pulse
    Jun 17, 2017 at 20:31

3 Answers 3

11

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.
3
  • 19
    Alternative method: open the inspector and simply trigger the download button from the console: document.getElementById('download').click()
    – Matt C
    Mar 12, 2019 at 16:27
  • @MattC that should be an answer by itself :) Dec 4, 2019 at 12:53
  • @MattC How exactly do I enter that command?
    – GJC
    Mar 25, 2021 at 20:59
6

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.

4
  • 1
    Thank you for your response. Can you please elaborate on the steps from the link I provided to get the plain PDF? I'm not sure exactly how to get there.
    – Pulse
    Jun 17, 2017 at 20:29
  • 2
    In the Chrome devtools (F12), there is a tab called "Network" at the top. In it, all network requests are shown; reload the page to get everything from a normal page load. There will be a long list of network requests, and the raw PDF in this case has a URI starting with get.php and shows up under category XHR
    – ethanwu10
    Jun 17, 2017 at 23:12
  • 3
    In some readers, the F12 command will be disabled, so you will have to go to Google Controls > More tools > Developer tools to access it. Then go to the Network tab and reload the page. All files will appear in the list. You can sort by size, and usually the largest one is the PDF. As ethanwu10 mentioned, the type will probably be listed as XHR. If you preview that file, and then right-click on the preview and selected "Open in new tab" the PDF file will often open up or be downloaded immediately.
    – Doug
    Jan 23, 2018 at 14:15
  • 1
    @Doug I see no such get.php. Any picture of what it really looks like?
    – GJC
    Mar 25, 2021 at 20:59
6
document.getElementById('download').click()

Answer by Matt C and Vincent Omondi

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .