如何通过代码更改 spool/direct 打印设置?
How to change the spool/direct print setting via code?
我需要更改打印属性中指定的设置:1. "Spool print documents..." 或 2. "Print directly to the printer."
在this answer J... indicates that this can be done using the PrintQueue Class。怎么样?
MSDN PrintQueue.isDirect (ReadOnly Property) says this: "This property can be set only
through the Windows common print dialog."
我假设这专门适用于 .net,并且在绝对意义上可能不正确。那么如何通过代码更改 spool/print 直接设置?
来自 J 的评论...
Various printer options can be set via the windows registry. Each
installed printer has a subkey in the following Registry path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\
Under this there is a attributes bitmap, in the value Attributes :
REG_DWORD 0002 (0x0002) Direct: Document to be sent directly to the
printer.
The spooler service might need to be restarted, for the changes to
take effect.
请注意,此注册表值包含多个属性。有关详细信息,请参阅 Windows Spooler Registry。
警告如果您使用注册表编辑器或其他方法错误地修改注册表,可能会出现严重问题。修改注册表需要您自担风险。
我需要更改打印属性中指定的设置:1. "Spool print documents..." 或 2. "Print directly to the printer."
在this answer J... indicates that this can be done using the PrintQueue Class。怎么样?
MSDN PrintQueue.isDirect (ReadOnly Property) says this: "This property can be set only through the Windows common print dialog."
我假设这专门适用于 .net,并且在绝对意义上可能不正确。那么如何通过代码更改 spool/print 直接设置?
来自 J 的评论...
Various printer options can be set via the windows registry. Each installed printer has a subkey in the following Registry path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\
Under this there is a attributes bitmap, in the value Attributes : REG_DWORD 0002 (0x0002) Direct: Document to be sent directly to the printer.
The spooler service might need to be restarted, for the changes to take effect.
请注意,此注册表值包含多个属性。有关详细信息,请参阅 Windows Spooler Registry。
警告如果您使用注册表编辑器或其他方法错误地修改注册表,可能会出现严重问题。修改注册表需要您自担风险。