我可以通过编程方式控制“旋转 180 度”复选框吗? 使用 VBA 的 HP 打印机驱动程序设置中的选项?

发布于 2024-07-09 01:08:03 字数 269 浏览 9 评论 0原文

我正在尝试使用双面打印单元打开和关闭 HP Laserjet 打印机 (4200/ 4350) 的“旋转 180 度”设置。

企业有“双面打印”的要求,为了最大程度地控制,我希望能够在打印时(通过打印宏)进行操作,无论是否为每种不同类型的文档启用双面打印业务合作。

我可以控制纸盘分配、打印顺序以及打开和关闭双面打印。 但是,无法弄清楚如何控制旋转选项(打开和关闭此选项)。

除了毯子之外还有其他可用的解决方案 - 在打印服务器上为所有文档/用户启用此选项吗?

I'm trying to switch on and off the Rotate 180 degree setting for an HP Laserjet printer (4200/ 4350) using a duplexer unit.

The Business has a requirement to "print on both sides", for maximum control I'd like to be able to manipulate at print time (through print macros) whether or not duplex printing is enabled for each of the different types of a document the business works with.

I can control the tray assignments, print order and switch duplexing on and off. However, cannot figure out how to control the rotation option (switch this on and off).

Any solutions available other than a blanket - enable this option on the print server for all documents/ users?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

热鲨 2024-07-16 01:08:03

也许可以通过以下方式控制 HP 双面打印选项:

打印机对象:Access 2003 VBA 语言参考 (http://msdn.microsoft.com/en-us/library/aa223133(office.11​​).aspx)

更具体地说:

双面属性 (http://msdn.microsoft.com/en-us/library/aa195860(office.11​​) .aspx)

Perhaps the HP duplex option can be controlled from:

Printer Object: Access 2003 VBA Language Reference (http://msdn.microsoft.com/en-us/library/aa223133(office.11).aspx)

More specifically:

Duplex Property (http://msdn.microsoft.com/en-us/library/aa195860(office.11).aspx)

べ映画 2024-07-16 01:08:03

COM 接口正是您所需要的。 用于更改托盘的 python 代码如下: VB 遵循相同的基本步骤。

import win32print
PRINTER_DEFAULTS = {"DesiredAccess":win32print.PRINTER_ALL_ACCESS}
pHandle = win32print.OpenPrinter('PRINTERNAME', PRINTER_DEFAULTS)
properties = win32print.GetPrinter(pHandle, 2) #get the properties
pDevModeObj = properties["pDevMode"] #get the devmode
pDevModeObj.DefaultSource = tray_three #change some sort of setting... this case is the tray
properties["pDevMode"]=pDevModeObj #write the devmode back to properties
win32print.SetPrinter(pHandle,2,properties,0) #save the properties to the printer

当然,您可能可以在word中通过vba更改打印机设置。 如果您使用 Excel 或任何其他办公产品,它将无法工作。

The COM interface is what you need. The python code for changing the tray is below: VB follows the same basic steps.

import win32print
PRINTER_DEFAULTS = {"DesiredAccess":win32print.PRINTER_ALL_ACCESS}
pHandle = win32print.OpenPrinter('PRINTERNAME', PRINTER_DEFAULTS)
properties = win32print.GetPrinter(pHandle, 2) #get the properties
pDevModeObj = properties["pDevMode"] #get the devmode
pDevModeObj.DefaultSource = tray_three #change some sort of setting... this case is the tray
properties["pDevMode"]=pDevModeObj #write the devmode back to properties
win32print.SetPrinter(pHandle,2,properties,0) #save the properties to the printer

Of course, you can probably just change printer settings through vba in word. If you are using excel or any other office product it will not work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文