Skip to content

Commit

Permalink
Update Test.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Taki21 authored Sep 13, 2016
1 parent c7b75d0 commit dcd282d
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions Test.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<script src = "jspdf.min.js"></script>
</head>
<body>

<p>Click the button to print the current page.</p>

<button onclick="myFunction()">Print this page</button>
<p>Whats Your Name?</p>
<input id="name">
<button type="button" onclick="myFunction()">Submit</button>

<script>
function myFunction() {
w = window.open('TextFile.txt');
w.print();
}
function myFunction() {
var name;
name = document.getElementById("name").value;
var pdf = new jsPDF();
pdf.text('Name: ' + name);
pdf.save('Test.pdf');
}

function printInfo() {
w = window.open('Test.pdf');
w.print();
}
</script>

<p> Download Info:</p>
<a href = "javascript:myFunction()">Download</a>
<br>
<p>Print Info:</p>
<button type="button" onclick="printInfo()">Print</button>

</body>
</html>

0 comments on commit dcd282d

Please sign in to comment.