Hi Everybody,
I am trying to put the printer to run the output from an html document.
Here is a small function to do that:
def callPrinterHtml(self,document):
self.printer = QPrinter()
self.printer.setPageSize(QPrinter.Letter)
dialog = QPrintDialog(self.printer, self)
if dialog.exec_():
document.print_(self.printer)
However the message pops up:
self.printer = QPrinter()
NameError: global name 'QPrinter' is not defined
The printer definition is clearly inside the function. So, what am I missing here?
All comments and suggestions are highly appreciated.