| 1 |
## HTML_Printer.py
|
| 2 |
## Printing framework for wx in HTML
|
| 3 |
## EBorges
|
| 4 |
## 09.16.03
|
| 5 |
|
| 6 |
|
| 7 |
from wx.html import HtmlEasyPrinting
|
| 8 |
|
| 9 |
class Printer(HtmlEasyPrinting):
|
| 10 |
def __init__(self):
|
| 11 |
HtmlEasyPrinting.__init__(self)
|
| 12 |
|
| 13 |
def GetHtmlText(self,text):
|
| 14 |
"Simple conversion of text. Use a more powerful version"
|
| 15 |
print text
|
| 16 |
html_text = text.replace('\n\n','<P>')
|
| 17 |
html_text = text.replace('\n', '<BR>')
|
| 18 |
return html_text
|
| 19 |
|
| 20 |
def Print(self, text, doc_name):
|
| 21 |
self.SetHeader(doc_name)
|
| 22 |
#self.PrintText(self.GetHtmlText(text),doc_name)
|
| 23 |
self.PrintText(text,doc_name)
|
| 24 |
|
| 25 |
def PreviewText(self, text, doc_name):
|
| 26 |
self.SetHeader(doc_name)
|
| 27 |
#HtmlEasyPrinting.PreviewText(self, self.GetHtmlText(text))
|
| 28 |
HtmlEasyPrinting.PreviewText(self, text) |