如何将打印机作业重定向到另一台打印机 [英] How to redirect printer jobs to another printer

查看:1113
本文介绍了如何将打印机作业重定向到另一台打印机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Iam努力尝试将待处理的打印机作业从打印队列重定向到另一台打印机。我已经找了很多选择,但我似乎找不到具体的方法。



我还设法检索所有待处理的工作但是似乎无法找到发送到另一台打印机的方法。



我在这里找到了一些暂停打印作业的东西,但我不想在同一台打印机上恢复它打印机,但另一个



使用WMI控制打印作业的简单方法 [ ^ ]



我尝试过:



 LocalPrintServer localPrintServer = new LocalPrintServer(); 
PrintQueue defaultPrintQueue = LocalPrintServer.GetDefaultPrintQueue();

//设置正确的打印机
pname = this.listBox1.SelectedItem.ToString();
//收集打印作业
GetPrintJobsCollection(defaultprinter); //这是工作

RedirectPrintJobs(pname); //不确定如何

//取消旧打印机上的旧作业
CancelPrintJob(defaultprinter); //这是工作

解决方案

可能你不能:队列中的打印数据特定于实际的打印机 - 如果你有两个不同的品牌(甚至是同一品牌和型号的不同型号或软件版本),数据对你重定向的打印机毫无意义。

这就是打印驱动程序的作用:使用制造商指令集获取输入并将其格式化为特定打印机,以生成打印后台处理程序(Windows的一部分和控制每个打印机的软件)的文件queue)发送到实际的硬件。



在它到达打印驱动程序之前,你真的需要重定向才能到达打印驱动程序。

Iam struggling trying to redirect pending printer jobs from a print queue to another printer. I have looked up for a lot of alternatives but I can not seem to find a specific way to do it.

I have also managed to retrieve all the pending jobs but can not seem to find a way to send to another printer.

I found something here to pause the print jobs but I don't want to resume it on the same printer but another one

A Simple Approach for Controlling Print Jobs using WMI[^]

What I have tried:

LocalPrintServer localPrintServer = new LocalPrintServer();
            PrintQueue defaultPrintQueue = LocalPrintServer.GetDefaultPrintQueue();

            //Set the correct printer
            pname = this.listBox1.SelectedItem.ToString();
            //Gather print jobs
            GetPrintJobsCollection(defaultprinter); //this is working

            RedirectPrintJobs(pname); //not sure how

            //Cancel old jobs on the old printer 
            CancelPrintJob(defaultprinter); //this is working

解决方案

Probably, you can't: the print data in the queue is specific to the actual printer - if you have two different makes (or even different models or software versions in the same make and model) the data will be meaningless to the printer you redirected it to.
That's what a print driver does: takes your input and formats it for a specific printer using a "manufacturer instruction set" to produce a file which the print spooler (part of Windows and the software that controls each queue) sends to the actual hardware.

You would really need to the redirection before anything gets to the print driver, long before it hits the print queue.


这篇关于如何将打印机作业重定向到另一台打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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