Print part of page - Nyt projekt

Title
Gå til indhold


Div gallery: Print

Div Text: Print

This is to show how you can ( on the client side ) print part of a page.
This could be used when you don't want a printout to contain also the template and other stuff that is shown on the screen.

It is not much code needed :


<script>
           printDivCSS = new String ('<link href="myprintstyle.css" rel="stylesheet" type="text/css">')
           function printDiv(divId) {
               window.frames["print_frame"].document.body.innerHTML=printDivCSS + document.getElementById(divId).innerHTML;
               window.frames["print_frame"].window.focus();
               window.frames["print_frame"].window.print();
           }
       </script>

       <br><br>
       <b>Div gallery:</b> <a href="javascript:printDiv('imPageRowContent_1')">Print</a><br>
       <br>
       <b>Div Text:</b> <a href="javascript:printDiv('imPageRowContent_3')">Print</a><br>
       <br>
       <iframe name="print_frame" width="0" height="0" frameborder="0" src="about:blank"></iframe>

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
who_is_logged(); echo $user['realname']; ?>
Tilbage til indhold