How to obtain an embedded PDF file

If a website allows you to view a PDF file in the browser, but does not allow you to save the file locally, you can still have a local copy of the file using this simple hack.

Open Web Developer Tools in your web browser, switch to the Network tab, check the Disable Cache box and make sure that All types of content is enabled, then refresh the PDF document preview page. You will see all the requests to each resource used to build this page, supposedly including the PDF document.

Look under the largest resources (clicking the Size header to sort the list by size helps) and see if you have a resource with a stream of characters sent as a payload. This is usually returned by a request to a server script with a document ID sent as a request parameter. If you find something that looks like a possibly encoded document, copy the content to the clipboard and paste it into a text file. Save the file and decode it with base64.