打印机后台打印程序 api 份数 [英] Printer spooler api number of copies

查看:74
本文介绍了打印机后台打印程序 api 份数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的需要一些帮助,这是很多人在互联网上问的问题.我有不同的设置,尝试了不同的测试方式,这很令人沮丧.

I really could use some help, this is a question that alot of people are asking on the internet. I have different setups, tried different ways of testing, it's very frustrating.

首次设置:

  • 本地打印机

  • local printers

本地运行代码

从 pdf 或记事本打印:成功(份数为 2)

print from pdf or notepad: SUCCES (number of copies are 2)

从 word 打印:失败(份数为 1)

print from word: FAILED (numberof copies is 1)

第二个设置:

  • 共享的本地打印机

  • local printers that are shared

本地运行代码

从其他计算机打印到共享打印机

print from other computer to shared printers

份数总是1

那么每个人都缺少什么?当打印机仍然应该知道要打印什么时,某些字段丢失会发生什么?当您从另一台计算机打印时,也会发生什么字?有人能告诉我为什么窗户里的东西这么可怕吗?一切都应该通过后台处理程序,为什么数据错误?

Sowhat is everyone missing? What happens that some fields are missing while the printer still should know what to print? What does word that also happen when you print from another computer? Can someone tell me why somethings in windows are so terrible? Everythingshould pass the spooler, sowhy isthedata wrong?

亲切的问候!

推荐答案

打印机打印纸张和页面,因此副本会在某个阶段转换为页面.

A printer prints sheets and pages, so copies is converted to pages at some stage.

您获得的通知数据取决于正在打印的应用程序以及处理假脱机和渲染的系统和驱动程序组件.以我的经验,数据是不能依赖的,最好的数据是通过解析spool文件得到的.这可能包含也可能不包含副本数.

The notification data you get depends on both the application that is printing and the system and driver components handling the spooling and rendering. In my experience the data cannot be relied on, and the best data is obtained by parsing the spool file. This may or may not contain the number of copies.

Word 长期以来一直存在副本问题".有一个补丁可以解决这个问题,但另一种观点认为这是因为使用不寻常的打印方式.我将在这里引用一些链接内容:

Word has had the "copies problem" for a long time. There was a patch to supposedly fix this, but another opinion is that it's because it uses an unusual way of printing. I'll quote some of the link contents here:

对于臭名昭著的字数复制错误...... dmCopies 归档是 1SHD.在 SPL 文件的 DEVMODE 记录中找到正确的值(如果是 EMF 线轴).

With the infamous Word Copy Count bug… the dmCopies filed is 1 in the SHD. The correct value is found in the DEVMODE record in the SPL file (if it's an EMF spool).

我发现的唯一其他方法是监视 PrintedPages 字段JOB_INFO_2 结构,当作业已发送到打印机时,并查看它是否是 TotalPages 的倍数.

The only other way i found was to monitor the PrintedPages field of the JOB_INFO_2 structure, when the job has been sent to the printer, and see if it is a multiple of TotalPages.

[...]

发生的不是 Word 错误,而是 Windows 错误.Word 调用 startDoc总是将副本设置为 1.之后调用 DocumentProperties 和在 dmCopies 中进行更改并调用 ResetDC 进行更新.它是一种奇怪的打印方式,但没有错.问题是shd 文件和 printer_info 未使用此信息更新,只是保持在 StartDoc 调用中设置的 Devmode 信息.

What happens is not a Word bug, but a Windows bug. Word calls startDoc always with copies set to 1. After that calls DocumentProperties and makes the change in dmCopies and calls ResetDC to make the update. It is a strange way of printing but not wrong. The problem is that the shd file and printer_info is not updated with this information, just keeps the Devmode info set on the StartDoc call.

但是对生成新 DevMode 的 ResetDC 的调用保留在SPL 文件.如果您挂钩 DocumentProperties,您也​​可以获得该信息API 调用.

But the call to the ResetDC generating a new DevMode is kept on the SPL file. You can get that info too if you hook DocumentProperties API calls.

这篇关于打印机后台打印程序 api 份数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆