<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<p>Click the button to print the current page.</p>
<button onclick="myFunction()">Print this page</button>
<script>
function myFunction() {
var printContent = $("#content").html();
var printWindow = window.open();
printWindow.document.write(printContent);
printWindow.document.close();
printWindow.print();
}
</script>
<h1 id="content">This is demo print content</h1>
</body>
</html>
Created
June 25, 2019 11:29
-
-
Save hossainemruz/4a6163c33f85972ed0d82e3935abc016 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A4 size paper dimension: http://www.graphic-design-employment.com/a4-paper-dimensions.html