【问题标题】:win32api.ShellExecute only opens up the document but doesnt print itwin32api.ShellExecute 只打开文档但不打印
【发布时间】:2022-10-20 10:07:38
【问题描述】:
def print_in_default_printer(filename,printerdef):
    win32print.SetDefaultPrinter(printerdef)
    win32api.ShellExecute(
        0,
        "printto",
        filename,
        '"%s"' % win32print.GetDefaultPrinter(),
        ".",
        0
    )

这是我正在使用的代码,由于某些原因,它只打开了我想要打印的 .doc 文件并停在那里。 尝试测试所有内容,但仍然无法正常工作。谢谢你们的帮助!

【问题讨论】:

    标签: python printing ms-word pywin32 shellexecute


    【解决方案1】:

    ¿ Probaste reemplazando printto print?

    En mi caso, he realizado impresiones de PDF, TXT con print y el resultado un éxito。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      相关资源
      最近更新 更多