0

I have a div of size 400*400px. I wrote a function to print it as follows

 function CallPrint(strid) {
        var prtContent = document.getElementById(strid);
        var WinPrint = window.open('', '', 'left=0,top=0,width=400px,height=400px,toolbar=0,scrollbars=0,status=0');
        WinPrint.document.write(prtContent.innerHTML);
        WinPrint.document.close();
        WinPrint.focus();
        WinPrint.print();
    }

This prints the content on whole a4 size paper. How can i fix the size of the hard copy printout.

Ayush
  • 485
  • 2
  • 6
  • 19

1 Answers1

0

I think what you want is a print stylesheet. http://www.webcredible.co.uk/user-friendly-resources/css/print-stylesheet.shtml

Bjoern Rennhak
  • 6,766
  • 1
  • 16
  • 21