You can use window.print (), which prints the current HTML document. Use media queries to customize your stylesheet. You can create your document on the fly and print at any time.
@media print { #header, #footer, #nav { display: none !important; } }
Some code from one of my projects only prints contents from a table:
$scope.print = function () { console.log('modal print'); var table = document.querySelector('.CSSTableGenerator').innerHTML; var myWindow = window.open('', '', 'width=800, height=600'); myWindow.document.write(table); myWindow.print(); };
Mike
source share