Printing problem
Peter Abraham
abraham_peter at fastmail.fm
Thu Jun 8 03:31:49 PDT 2006
Hi,
I tried the following very simple code based on the example of
http://wiki.wxpython.org/index.cgi/Printing. (Debian Sarge, wxPython
2.6.3.2)
from wx.html import HtmlEasyPrinting
reload(sys)
sys.setdefaultencoding("utf-8")
class Print_man(HtmlEasyPrinting):
def __init__(self):
HtmlEasyPrinting.__init__(self)
def Print(self, file_name):
if not self.PrintFile(file_name):
print "???"
def Preview(self, file_name):
self.PreviewFile(file_name)
class Main_frame(wx.App):
def OnInit(self):
...
self.Printing = Print_man()
...
def Print_file(self, event):
self.Printing.Print("teszt.html")
Despite the following warning message during the starting of the script
it prints a simple .html file.
"(python:10204): GnomePrintCupsPlugin-WARNING **: iconv does notsupport
ppd character encoding: ISOLatin1, trying CSISOLatin1"
My questions: Is there any solution to print a "not simple" html file
(e.g with tables, images)? Can I use html 4.0? Can I use unicode
characters? Beside the HtmlEasyPrinting class is there any printing
solution 'inside wxPython' that works under Linux and Windows XP, too?
(Previously a .pdf file was created with Reportlab modul and the created
file was printed by another program. If it is possibe I'd like to change
this solution.) My aim: print an invoice or a report by one button
press. (Without preview or any dialog box.)
thanx,
Peter
--
Peter Abraham
abraham_peter at fastmail.fm
--
http://www.fastmail.fm - Access your email from home and the web
More information about the wxpython-users
mailing list