如何打印文档而不在php或javascript页面底部显示地址 无标题文件 var message=“打印”; 函数printpage(){ window.print(); } 文件。填写(“”);

如何打印文档而不在php或javascript页面底部显示地址 无标题文件 var message=“打印”; 函数printpage(){ window.print(); } 文件。填写(“”);,javascript,Javascript,我想生成账单,但使用此代码,但它会在将要打印的页面底部显示地址,我不想在底部显示地址。 请帮助使用php或javascript编写代码。这是一个浏览器设置,不能使用php/javascript更改。检查浏览器的打印机设置,以在打印时禁用页眉/页脚文本 对于创建报告,我建议您看看。考虑到google docs创建pdf然后打印,我建议您也这样做。您要求的是以某种方式禁用打印时添加的页眉和页脚 这实际上是一个打印选项,可以在打印设置中禁用 CSS中有一个变通方法可以使用。 注意:仅适用于现代浏览器

我想生成账单,但使用此代码,但它会在将要打印的页面底部显示地址,我不想在底部显示地址。
请帮助使用php或javascript编写代码。

这是一个浏览器设置,不能使用php/javascript更改。检查浏览器的打印机设置,以在打印时禁用页眉/页脚文本


对于创建报告,我建议您看看。

考虑到google docs创建pdf然后打印,我建议您也这样做。

您要求的是以某种方式禁用打印时添加的页眉和页脚

这实际上是一个打印选项,可以在打印设置中禁用

CSS中有一个变通方法可以使用。 注意:仅适用于现代浏览器

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
              <script language="Javascript1.2">

                var message = "Print";
                function printpage() {
                window.print();

                }

                document.write("<center><input type=submit class=print id=non-printable value=print  onClick=\"printpage()\"/></center>");

            </script>
</body>
</html>

@页面
{
大小:auto;/*auto是初始值*/
边距:0mm;/*这会影响打印机设置中的边距*/
}
身体
{
背景色:#FFFFFF;
边框:实心1px黑色;
边距:0px;/*这会在发送到打印机之前影响内容的边距*/
}

OT:但我一直认为谷歌文档是一种可怕的打印方法。必须从网页生成pdf,然后下载并打开pdf阅读器来打印网页上的内容Geokay谢谢。你知道php中生成bill或reports的其他方法吗?我在回答中建议使用一个库来创建报告。祝你好运太好了,谢谢。您知道生成php报告的其他方法吗?@kennyDs指出,您可以看看
<head>
 <style type="text/css" media="print">
  @page 
  {
    size: auto;   /* auto is the initial value */
    margin: 0mm;  /* this affects the margin in the printer settings */
  }

  body 
  {
    background-color:#FFFFFF; 
    border: solid 1px black ;
    margin: 0px;  /* this affects the margin on the content before sending to printer*/
  }
  </style>
  </head>