How to download view only PDF files (protected PDF files)

Jack16306
4 Min Read

Google Drive is the most popular online data storage service in Vietnam today, and surely each of us has used this service or downloaded a certain data file on Google Drive like documents, movies, software, games, etc. And there may be times when you will not be able to download PDF files or DOC files from Google Drive because the download feature is disabled. In the event that the file download feature is locked on Google Drive, usually users will think of taking a screenshot and saving it as a file.

However, that method is quite laborious, so in this article I will share with everyone how to download view only PDF files from Google Drive, as well as some document files such as DOCs and images.

How to download view only PDF files (protected PDF files) with JScode

Step 1: Access the PDF file (document) that you want to download but it is blocked, and then drag the file gently to the final page for the file to load.

Step 2: To open the browser console window, press Ctrl + Shift + I (for Windows) or Command + Option + I (for Mac).

Step 3: At the console tab, copy and paste the code below and press enter. (Or download code here)

let jspdf = document.createElement("script");
jspdf.onload = function () {
let pdf = new jsPDF();
let elements = document.getElementsByTagName("img");
for (let i in elements) {
let img = elements[i];
console.log("add img ", img);
if (!/^blob:/.test(img.src)) {
console.log("invalid src");
continue;
}
let can = document.createElement('canvas');
let con = can.getContext("2d");
can.width = img.width;
can.height = img.height;
con.drawImage(img, 0, 0, img.width, img.height);
let imgData = can.toDataURL("image/jpeg", 1.0);
pdf.addImage(imgData, 'JPEG', 0, 0);
pdf.addPage();
}
pdf.save("download.pdf");
};
jspdf.src = 'https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);

Step 4: You proceed to save the file, and you’re done.

Download view only PDF files (protected PDF files) with browser extension

Step 1: Open your browser and install the “GoFullPage – Full Page Screen Capture” application by clicking “Add to Chrome”

A message appears, select “Add extension”.

Step 2: When you see the page below, the extension has been installed.

To pin an extension, click the extension icon in the top right corner, then click the pin next to the extension name.

Step 3: You access the document you want to download, then click on the pinned extension icon.

Step 4: The extension will capture the entire document, you just have to wait. After capturing it, it will display the document page. You click the download button to download the document.

To remove the extra dark border from the PDF, use an online tool like Crop PDF to trim the borders, apply changes and download the cropped PDF file.

FINALLY

In this article, I showed you how to download view only PDF files on Google Drive (protected PDF files). I hope this post is useful.

See also  How to download Google Drive Videos without Permission
Share this Article
Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *