JS Code
let jspdf = document.createElement("script");
jspdf.onload = function () {
let pdf = new jsPDF('p', 'mm', [1000, 625]);
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);
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);
- Realated Searches
- How to download view only protected PDF from Google Drive
- how to download view only ppt from google drive
- how to download view only videos from google drive
- download protected google docs
- download view only pdf google drive online
- unlocking a protected, shared google drive document
- how to download protected pdf file from website
- how to download non downloadable pdf
- download pdf from google drive link
- download view only pdf from google drive online
- how to download view only pdf from google drive
- download view only pdf from google drive link
- how to download view only ppt from google drive
- how to download view only videos from google drive
- how to download view only folders from google drive
- download pdf from google drive link online
- unlocking a protected, shared google drive document
W3drive is a platform over the internet that allows its visitors to learn about everything happening around them.

Post a Comment