This script rips (protected/view-only) PDFs from Google Drive by copying all the page images provided by Google Drive, and then put it on a PDF. It is a ripper (not a downloader) because it does not download the PDF file directly, and it involves some sort of conversion (PDF > images > PDF).
This script is based on https://gist.github.com/dpaluy/74258794f7930401cc27262e0ea794dd and https://gist.github.com/cirippo/86edfbddc3125eb64ee4b2d8faa52caa, with updates made since I was quite bored, and didn't want to adjust parts of the code to my own when I'm using it.
- Uses latest jsPDF version and modern JavaScript techniques
- Supports Trusted Types API (for Google Chrome/Chromium users)
- Supports various pages sizes with no additional configuration
- Uses original file name when downloading the finished document
- Designed to be ran multiple times
- Open the document in Google Docs.
- Zoom in by using the bottom toolbar so the images will be at the largest size possible
- Load all the images on the document by scrolling to the very bottom.
- Open the Console tab on Developer Tools.
- Execute the JavaScript by pasting the code and send it by pressing ENTER.
- Wait until the PDF is downloaded.