simple.html 829 B

123456789101112131415161718192021222324252627
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. <title>html2pdf Simple Example</title>
  7. </head>
  8. <body>
  9. </body>
  10. </html>
  11. <script src='../../dist/jspdf.debug.js'></script>
  12. <script src='../../libs/html2pdf.js'></script>
  13. <script>
  14. var pdf = new jsPDF('p', 'pt', 'letter');
  15. var canvas = pdf.canvas;
  16. canvas.height = 72 * 11;
  17. canvas.width= 72 * 8.5;;
  18. // can also be document.body
  19. var html = '<html><body>Hello <strong> World</strong></body></html>';
  20. html2pdf(html, pdf, function(pdf) {
  21. pdf.output('dataurlnewwindow');
  22. });
  23. </script>