从 Internet Explorer 打印并得到 20 页的附记

发布于 2025-01-07 03:41:27 字数 1239 浏览 0 评论 0原文

我有一个非常简单的网页,通常可以在许多不同的计算机上从 IE 正确打印。页面本身只是一个 html 表格和一个标题。我尝试打印 Google 的主页并且打印正确,因此此问题特定于我的页面。

页面在打印预览中看起来正确。然而,当它从打印机中出来时,有大约 20 页的内容,看起来像是后记和十六进制。

第一页包含我页面的查询字符串的一部分(有一堆参数)。接下来是一串开始的行:

@PJL COMMENT XRXbegin
@PJL COMMENT OID_ATT_JOB_OWNER "**user's name not included**'
@PGL COMMENT OID_ATT_JOB_NAME "** my url **
..etc

then
%!PS-Adobe-3.0
%%Title: **my url again**
%%Creator: PScript5.dll Version 5.2.2
..etc

then
%%BeginResource: file Pscript_WinNT_ErrorHandler 5.0 0

then
lot's of what I'm assuming is postscript then about 20 pages of hexadecimal

this is the html

<body onLoad="window.print();" style="font-size:150%">
    <div style="width:750px">
        <div>
            <span class="fieldName">Email:</span>
            <span class="fieldValue">an email address </span>
        </div>                                
        <div>
            <span class="fieldName">Date:</span>
            <span class="fieldValue">2/18/2012 8:16 PM</span>
        </div>
    </div>
    <div class="nopass"><!-- clears floats --></div>
</body>

I have a very simple webpage that normally prints correctly from IE on many different computers. The page itself is just an html table and a heading. I tried printing Google's homepage and it printed correctly, so this this issue is specific to my page.

The page looks correct in the print preview. However, when it comes out of the printer there are about 20 pages of what appears to be postscript and hexadecimal.

The first page has part of my page's query string (there are a bunch of parameters). This is followed by a bunch of lines that start:

@PJL COMMENT XRXbegin
@PJL COMMENT OID_ATT_JOB_OWNER "**user's name not included**'
@PGL COMMENT OID_ATT_JOB_NAME "** my url **
..etc

then
%!PS-Adobe-3.0
%%Title: **my url again**
%%Creator: PScript5.dll Version 5.2.2
..etc

then
%%BeginResource: file Pscript_WinNT_ErrorHandler 5.0 0

then
lot's of what I'm assuming is postscript then about 20 pages of hexadecimal

this is the html

<body onLoad="window.print();" style="font-size:150%">
    <div style="width:750px">
        <div>
            <span class="fieldName">Email:</span>
            <span class="fieldValue">an email address </span>
        </div>                                
        <div>
            <span class="fieldName">Date:</span>
            <span class="fieldValue">2/18/2012 8:16 PM</span>
        </div>
    </div>
    <div class="nopass"><!-- clears floats --></div>
</body>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝眸 2025-01-14 03:41:27

我15年前就遇到过这个问题。我认为发生的情况是您使用了错误的打印机驱动程序来发送到打印机。当 IE 生成以页面描述语言打印页面的代码时,它会添加一个序言(在本例中是以“%!PS-Adobe-3.0”开头的行之前的所有内容)

当您将此文件发送到打印机时,它无法识别序言,因此假设接下来的所有内容都只是原始文本。您可以看出它正在这样做,因为它是以平淡的固定宽度字体打印的。

两个修复:

  1. 为要打印的打印机选择正确的打印机驱动程序。如果尚未安装,您可能需要安装它。

  2. 打印。

或者:

  1. 选中“打印到文件”。保存到文件。
  2. 打开原始后记输出并编辑掉序言。
  3. 打开一个 dos 窗口
  4. 将要打印的打印机设置为类似 :lpt1
  5. 我不记得 dos 中的确切语法了,但可能是: copy file.pdf :lpt1
  6. 你的打印机必须支持 postscript,并且必须在不支持 postscript 的情况下这样做需要一个序言。

15 年前,我在网络连接打印机上完成了此操作,当时我从客户那里收到了很多原始 Postscript 文件,我需要在高速数字印刷机上打印它们。显然,首选解决方案是最佳解决方案,但我认为另一个解决方案可以帮助您了解正在发生的情况。

更新:“XRX开始
序言中的“似乎表明您使用的驱动程序来自 Xerox。

由于 URL 对于您尝试打​​印的页面来说是唯一的,因此实际名称可能会使打印机感到困惑。URL 中可能有一个百分号,或者可能是无论 HP 的 PCL 语言使用什么。

I ran into this issue 15 years ago. What I think is happening is that you are using the wrong printer driver for the printer you are sending to. When IE generates the code to print the page in a page description language, it's adding a preamble (which in this case is everything before the line that starts as "%!PS-Adobe-3.0")

When you send this file to the printer, it does not recognise the preamble, and therefore assumed everything that follows is just raw text. You can tell it's doing this because it is printed in a bland fixed width font.

Two fixes:

  1. Select the proper printer driver for the printer you want to print to. You may need to install it if it is not already.

  2. Print.

or:

  1. Check "print to file". Save to file.
  2. Open up the raw postscript output and edit out the preamble.
  3. open a dos window
  4. set the printer you want to print to to something like :lpt1
  5. I don't remember the exact syntax in dos any more but it's probably: copy file.pdf :lpt1
  6. you printer must support postscript, and must do so without needing a preamble.

I did this on a network attached printer 15 years ago when we I got a lot of raw postscript files from a customer and I needed to print them on a high speed digital press. Obviously, the preferred solution is the top solution, but I though this other one would help you understand what is going on.

Update: "XRXbegin
" in the preamble seems to indicate the driver you are using is from Xerox.

Since the URL is unique to the page you are trying to print, the actual name might be confusing the printer. The URL might have a percent bang in it or maybe whatever is used for HP's PCL language.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文