- You can easly print any part of webpage means any specific div using javascript,
- Please follow simple below steps for that:
e.g.:
HTML
<div id="any_id_name">
<p>Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book.</p>
</div>
JavaScript
<script type="text/javascript">
var prtContent = document.getElementById("any_id_name");
var WinPrint = window.open('', '', 'width=500,height=500,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
</script>
Note: Please change width and height as per your requirenment of popup size.
Enjoy!
No comments:
Post a Comment