在发送到打印机之前,如何以编程方式对普通Windows打印队列“假脱机文件"的假脱机文件头进行编辑? [英] How to programmatically achieve editing of the spool file header of the normal windows print queue 'spool file' before it is sent to the printer?

查看:128
本文介绍了在发送到打印机之前,如何以编程方式对普通Windows打印队列“假脱机文件"的假脱机文件头进行编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在执行此文件期间将其发送到打印机之前,如何截取和更改Windows 7打印后台处理文件(.SPL),以便在标头中添加一些其他信息,例如"@PJL SET NAME ="PainPoint"".打印作业?

How to intercept and change the windows 7 print spool file (.SPL) to add some additional information in the header like '@PJL SET NAME="PainPoint" ' before this file is sent to the printer during the execution of the print job?

.SPL文件的顶部部分提取为:

The .SPL file partial extract from top is :

%-12345X@PJL SET STRINGCODESET=UTF8
@PJL COMMENT DATE=02/08/2017
@PJL ENTER LANGUAGE=PCLXL
) HP-PCL XL;2;1;FXXPL2-1.0.0,WINNT-6.1,XPL2DRV-6.9.1.1
?X???........

推荐答案

编辑假脱机文件显然很简单.诀窍是如何访问假脱机文件.

Editing the spool file is obviously trivial. The trick is how to get access to the spool file.

我可以想到一些临时方法:

I can think of a few ways offhand:

  1. 在后台处理后暂停打印作业,对其进行编辑,然后将其释放.在此处查看我的答案.这并非易事,您可能需要根据可用的时间/精力来使用第三方软件.
  2. 创建打印驱动程序或后台打印程序组件(例如端口)或语言监控器编辑文件.(感谢Carey Gregory建议使用语言监视器).这是一个很大的话题,您必须阅读很多文档才能弄清楚该如何做,但是WDK中有一个示例(Pjlmon).请注意,适用于Windows 8/Server 2012的更新的V4驱动程序模型RedMon (免费)来调用您的应用以编辑假脱机文件.然后,RedMon会将其发送到所需的打印机.
  1. Pause the print job after spooling, edit it, then release it. See my answer here. This is not trivial and you may need to resort to third-party software depending on time/effort available.
  2. Create a print driver or spooler component such as a port or language monitor to edit the file. (Thanks to Carey Gregory for the suggestion to use a language monitor). This is a big topic and you'll have to read a lot of documentation to figure out how to do it, but there is a sample (Pjlmon) in the WDK. Note that the newer V4 driver model for Windows 8/Server 2012 doesn't support these components.
  3. If you don't need to do this transparently you could set up RedMon (free) to call your app to edit the spool file. RedMon will then send it to the desired printer.

VeryPDF具有一些

VeryPDF has some similar commercial products with more capabilities.

这篇关于在发送到打印机之前,如何以编程方式对普通Windows打印队列“假脱机文件"的假脱机文件头进行编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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