﻿function PrintImage(print_area)
{
  //var x = document.getElementById(print_area);
  //Creating new page
  var pp = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
  //Adding HTML opening tag with <HEAD> … </HEAD> portion 
  pp.document.writeln('<HTML><HEAD><title>Print Preview</title>')
  pp.document.writeln('<base target="_self"></HEAD>')
  //Adding Body Tag
  pp.document.writeln('<body>');
  //Adding form Tag
  pp.document.writeln('<form method="post"><div id="print_area2" align="center">');
  pp.document.writeln(document.getElementById('print_area').innerHTML);
  //Ending Tag of </form>, </body> and </HTML>
  pp.document.writeln('</div></form></body></HTML>'); 
  
  pp.document.close();
  pp.focus();
  pp.print();
  pp.close();
}