Search code examples
pythonwinapiprintingwxpython

wxpython htmleasyprinting set page size past normal sheet size


I am writing a program in python 2.7 with wxpython 2.8 (windows 7) that will print out a banner on a sheet of paper roughly 7" by 40". I was trying to use wxpython's htmleasyprinting with a rendered image of what will be printed to the banner, but am unable to get past the default page sizes.

I am willing to use or learn any other library that might have this ability. (Must be royalty free)

Thank you for any help you can give. Here is the code you asked for. (temp is a simple html file that is long.)

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()

Solution

  • The problem was that my printer was not capable of printing on longer pieces of paper. A different printer works fine.