在打印web页面时如何让它不显示下面的网址和上面的页码?

解决方案 »

  1.   

    (1)ie的文件-〉页面设置-〉讲里面的页眉和页脚里面的东西都去掉,打印就不出来了。 
    (2)<HTML> 
    <HEAD> 
    <TITLE> New Document </TITLE> 
    <META NAME="Generator" CONTENT="EditPlus"> 
    <META NAME="Author" CONTENT="YC"> 
    <script language="VBScript"> 
    dim hkey_root,hkey_path,hkey_key 
    hkey_root="HKEY_CURRENT_USER" 
    hkey_path="\Software\Microsoft\Internet Explorer\PageSetup" 
    ’//设置网页打印的页眉页脚为空 
    function pagesetup_null() 
      on error resume next 
      Set RegWsh = CreateObject("WScript.Shell") 
      hkey_key="\header"   
      RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" 
      hkey_key="\footer" 
      RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" 
    end function 
    ’//设置网页打印的页眉页脚为默认值 
    function pagesetup_default() 
      on error resume next 
      Set RegWsh = CreateObject("WScript.Shell") 
      hkey_key="\header"   
      RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&w&b页码,&p/&P" 
      hkey_key="\footer" 
      RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&u&b&d" 
    end function 
    </script> 
    </HEAD> <BODY> 
    <br/> 
    <br/> 
    <br/> 
    <br/> 
    <br/> 
    <br/><p align=center> 
    <input type="button" value="清空页码" onclick=pagesetup_null()> <input type="button" value="恢复页吗" onclick=pagesetup_default
      

  2.   

    是不是可以使用panel.再设定打panel中的内容
      

  3.   

    lnwuyaowei(风可以追我),你好,你的方法我试过了,页面提示有错误
      

  4.   

    http://www.wave12.com/web/SigCon.asp?bCate=50&sCateName=%B9%A6%C4%DC%BD%E9%C9%DC&ID=173&CateName=wsReport4.5
      

  5.   

    <!-- startprint -->
    您要打印的部分;
    <!-- endprint -->
    <div><input tupe=botton name="Print"  value="打印" onclick="prit()"</div>教本如下:
    <script language="javascript">
    function prit()
    {
      bdhtml=window.document.body.innerHtml;
      strstart="<!-- startprint -->";
      strend="<!-- end -->";
      prnstr=bdhtml.substr(bdhtml,indexof(strstart)+17)
    prnstr=bdhtml.substring(0,prnstr.indexof(strend))
    window.document.body.innerHtml=prnstr;
    window.print();}
    </script>
      

  6.   

    css里面可以比较简单的设置========
    欢迎使用www.bz2008.com 可以辅助生成大部分的程序代码,注册即可使用
    支持所有开发语言和平台
      

  7.   

    <OBJECT id="WebBrowser" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" VIEWASTEXT></OBJECT><INPUT onclick="document.getElementById('WebBrowser').ExecWB(8,1)" type="button" value="页面设置">
    <INPUT onclick="document.getElementById('WebBrowser').ExecWB(7,1)" type="button" value="打印预览">