Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print from webpage using Javascript

Status
Not open for further replies.
Mar 14, 2002
711
US
I have this script which I found online in a help forum and it works very nice, except now I want to try to learn more about formatting it so I can set page margins, etc.

This is the script:

<script language="javascript">

function CallPrint(divPrint)
{
var prtContent = document.getElementById(divPrint);
var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML=strOldOne;
}
</script>

How can I go about setting page margins = 0.25 all around, etc, etc.

Thanks for any help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top