Ana içeriğe geç

How to Download View-Only (Download-Disabled) PDF Files from Google Drive

How to Download View-Only (Download-Disabled) PDF Files from Google Drive

Administrator
How to Download View-Only (Download-Disabled) PDF Files from Google Drive
When a PDF shared via Google Drive has download and print permissions restricted, you can compile the rendered canvas pages into a local PDF using the browser developer console.

  1. Open the view-only Google Drive PDF link in Google Chrome.
  2. Scroll slowly from the first page to the last so every page renders at full resolution in the DOM.
  3. Press F12 to open Developer Tools and select the Console tab.
  4. Paste the following JavaScript snippet into the console and press Enter:

Kod:
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]; if (!/^blob:/.test(img.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("document.pdf"); }; jspdf.src = 'https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js'; document.body.appendChild(jspdf);
Alıntı:Notice: The compiled file (
Kod:
document.pdf
) will download automatically once processed. Respect the document owner's confidentiality and copyright terms.
İşin Doğrusu Youtube Kanalı
Zamanlanmış görev