Answers for "export page to pdf using js"

0

html to pdf javascript

var doc = new jsPDF();          
var elementHandler = {
  '#ignorePDF': function (element, renderer) {
    return true;
  }
};
var source = window.document.getElementsByTagName("body")[0];
doc.fromHTML(
    source,
    15,
    15,
    {
      'width': 180,'elementHandlers': elementHandler
    });

doc.output("dataurlnewwindow");
Posted by: Guest on December-15-2020
0

pdf to image javascript

$("#download-image").on('click', function() {
	// For IE 10 & 11
	if(typeof window.navigator.msSaveBlob === 'function')
		window.navigator.msSaveBlob(new Blob( [__CANVAS.msToBlob()], {type: 'image/png'} ), 'page.png');
	else
		$(this).attr('href', __CANVAS.toDataURL()).attr('download', 'page.png');
});
Posted by: Guest on November-25-2020

Browse Popular Code Answers by Language