1 2 3 4 5 6 7
<!doctype html> <iframe srcdoc="Some content"></iframe> <script> window.onload = function() { document.querySelector("iframe").contentWindow.print(); }; </script>