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(); }
@@sondosaldhoon4856 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(); }
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 على جوجل درايف محميه. وللاسف انا لا املك جهاز كمبيوتر حاليا واقوم بتصفح من خلال الفون. هل هناك طريقه اقوم بتحميل من خلال الفون
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(); }
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(); }
@@marymhmod5955 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(); }
@@salahaldas1164 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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
بارك الله لك في علمك و في أهلك و وفقك لما يحبه و يرضاه 😍😍
اين الكود لوسمحت ؟؟
الله يجزاك الخير يآرب ❤️❤️👍🏻
شكرا يا محترم
الف شكر يا الغالي نجحت الطريقة مع قوقل كروم
بارك الله فيك احسنت
بارك الله فيك
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("check.pdf");
};
jspdf.src = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
بارك الله فيك، لكن لم تشرح اذا كان الملف المرفق فيديو فكيف يتم تنزيله اذا كان الملف فيديو
وين عملية النسخ قبل اللصق؟؟؟؟
طيب بالنسبة للفيديوهات المحمية؟؟
ابداااع اقسم بالله شكرا الك ❤
الله يسعدك فالايفون كيف احتاجه بأسرع وقت
استاذ فادي متى حتكمل managerial accounting شابتر ١٠ و ١١ و ١٢؟!
شكرا جزيلا ..جزاكم الله خيرا
بتقدر تبعتلي الكود مو زابط معي اطلعه
@@sondosaldhoon4856
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
شكرا لك، ولكن لم استطع الحصول على الكود للأسف
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
ولا انا
Excellent
لكنه لا يعمل لى على power point الا على pdf
ألف شكر.. طريقة فعالة
الطريقه شغاله ❤️
مفيش طريقه لمقاطع الفيديو المحميه
هل في طريقة لتنزيل الفيديوهات المحميه
نعم ممكن
وطريقة تحميل الفيديو لو سمحت
في طريقة للفيديوهات؟
شكرا جزيلا لك
ممكن طلب مساعده
لدي لينك ملفات pdf على جوجل درايف محميه. وللاسف انا لا املك جهاز كمبيوتر حاليا واقوم بتصفح من خلال الفون. هل هناك طريقه اقوم بتحميل من خلال الفون
شكرا جزيلا علي ردك واهتمامك
سأحول البحث عن احد الاصدقاء لديه لاب توب ليساعدني في الأمر لان ذلك الموقع لا يقوم بالتحميل
شو هو اللي بعمله لصق كود خاص ؟
قمت بتحميل الملف ولكن تم بجودة سيئة للغاية فهل فيه طريقة لتحسين جودته
لماذا حذفت الكود ؟؟
الكود اللي لصقناه من وين اجيبه
طب بالنسبه للفيديو ؟
طيب هل في طريقة لتحميل المقاطع المحمية ؟
+1
نعم
كيف؟؟
+١
ruclips.net/user/shortssvZTuEjpsB8?si=m6S1RHaq2PH0cAq2
دكتور تكفى تنزل شابتر ١٠ و١١ و١٢ عندي اختبار بعد يومين ارجوك
فى حاله لم يوجد علامه للتحميل
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
ممكن الكود
طريقة فعالة بس الكود عشان نجيبه جلطة
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
ممكن الكود
@@marymhmod5955
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
لما اجي اضغط كنترول انتر مايحمل معاي
ممكن الكود
@@salahaldas1164
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
هل يمكنني منع المشاهد من نشر دروسي عبر مواقع التواصل الاجتماعي
مافي كود من وين احصل عليه
وين الكود ؟؟؟؟؟؟؟
جودة الصور مو واضحة ☹
فى حالة الكود لا يعمل ما الحل
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
الكود لم يعد موجيد
يطلب منا تسجيل الدخول
الكود راح الرابط م يفتح
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
وين الكود؟
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
اين الكود
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
how can it work for protected video ??
جيب لنا رابط مباشر لو سمحت
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
@@masterpieces3584 ا4
وين الكود أخي؟
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
Uncaught SyntaxError: Invalid or unexpected token
ممكن الكود
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
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 = 'cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);