问题描述
是否可以在.Net(或WMI)中确定打印到文件时打印驱动程序是否将打印为PCL或PostScript或XPS格式?
Is there a way to determine in .Net (or WMI) if a print driver will print to PCL or PostScript or XPS format when printing to a file?
推荐答案
如果目标操作系统是Windows,那么另一种方法是对驱动程序和打印队列进行一些逻辑处理。您可以使用WMI / .NET API来获取驱动程序DLL名称。如果它是unidrv.dll,则驱动程序是PCL驱动程序,如果是pscript.dll,则驱动程序是PS驱动程序。当然,这是针对基于MS Unidrv / PScript驱动程序框架的驱动程序,但您会发现大部分已安装的基于该驱动程序的驱动程序都基于该框架。
If your target OS is Windows, one more way is to do some logic on the driver and the print queue. You can use WMI/.NET APIs to get the driver DLL name. If it is unidrv.dll then the driver is a PCL driver and if it is pscript.dll then it is a PS driver. Of course, this is for drivers based on the MS Unidrv/PScript driver framework but you will find that a large majority of your installed based drivers are based on this framework.
这篇关于是否可以在.Net(或WMI)中确定在打印到文件时打印驱动程序是否将打印为PCL或PostScript格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!