Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript export to pdf

// Simple PRINT PDF
 let mywindow = window.open('', 'PRINT', 'height=650,width=900,top=100,left=150');

  mywindow.document.write(`<html><head><title>Print PDF</title>`);
  mywindow.document.write('</head><body>');
  mywindow.document.write('the PDF content goes here'); // pass your content here (e.g. document.getElementById(myDiv).innerHTML)
  mywindow.document.write('</body></html>');

  mywindow.document.close(); // necessary for IE >= 10
  mywindow.focus(); // necessary for IE >= 10*/

  mywindow.print();
  mywindow.close();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #export #pdf
ADD COMMENT
Topic
Name
6+3 =