You can load the page to print into a (possibly hidden) iframe, and then call the window.print function on that frame. Using jquery, it will be something like this (not verified):
$('#printButton').click(function(evt) { evt.preventDefault(); $('body').append('<iframe src="document_to_be_printed.php?param=value" id="printIFrame" name="printIFrame"></iframe>'); $('#printIFrame').bind('load', function() { window.frames['printIFrame'].focus(); window.frames['printIFrame'].print(); } ); });
source share