אשמח אם מישהו כאן יכול לתרגם לי את הקוד דלהלן מJQuery ל j.s רגיל
// Download button (PNG)
$("#download-image").on('click', function() {
$(this).attr('href', $('#pdf-canvas').get(0).toDataURL());
// Specfify download option with name
$(this).attr('download', 'page.png');
});
// Download button (JPEG with quality 80%)
$("#download-image").on('click', function() {
$(this).attr('href', $('#pdf-canvas').get(0).toDataURL("image/jpeg", 0.8));
// Specfify download option with name
$(this).attr('download', 'page.jpg');
});