【问题标题】:wxpython htmleasyprinting set page size past normal sheet sizewxpython htmleasyprinting 设置页面大小超过正常工作表大小
【发布时间】:2014-02-01 21:37:10
【问题描述】:

我正在使用 wxpython 2.8 (windows 7) 在 python 2.7 中编写一个程序,它将在一张大约 7" x 40" 的纸上打印出横幅。我试图将 wxpython 的 htmleasyprinting 与将打印到横幅的渲染图像一起使用,但无法超过默认页面大小。

我愿意使用或学习任何其他可能具有此功能的库。 (必须免版税)

感谢您提供的任何帮助。这是您要求的代码。 (temp 是一个很长的简单 html 文件。)

import wx

from wx.html import HtmlEasyPrinting

app = wx.App()

f = open('temp.htm','rb')
temp = f.read()
f.close()

ptr = HtmlEasyPrinting()

pd = ptr.GetPrintData()
pd.PaperSize = wx.Size(178,538)
ptr.PrintText(temp)

app.MainLoop()

【问题讨论】:

  • 欢迎来到 Stack Overflow!如果您提供到目前为止编写的代码,通常更容易帮助解决此类问题,即使它并不能完全满足您的要求。
  • 谢谢!我已经发布了我使用的代码但没有成功。

标签: python winapi printing wxpython


【解决方案1】:

问题是我的打印机无法在较长的纸张上打印。其他打印机工作正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多