hi friends.
i have a QWebView that renders my html fine. when i print it on a pdf printer or save it as pdf in pyqt it looks fine. but when i print it on real printer or print it as xps document i got unexpected results. fonts (arial) do not render correctly and some texts are overlapped and printed on a wrong offset.
this is my code :
printer.setFontEmbeddingEnabled(True)
printer.
setOrientation(QtGui.
QPrinter.
Landscape)printer.
setPageMargins(2,
2,
2,
2, QtGui.
QPrinter.
Millimeter)printer.setFullPage(True)
dialog.setModal(True)
dialog.setWindowTitle("Print")
if dialog.
exec_() == QtGui.
QDialog.
Accepted: self.web_view.print_(dialog.printer())
printer = QtGui.QPrinter( QtGui.QPrinter.HighResolution )
printer.setFontEmbeddingEnabled(True)
printer.setOrientation(QtGui.QPrinter.Landscape)
printer.setPageMargins(2, 2, 2, 2, QtGui.QPrinter.Millimeter)
printer.setFullPage(True)
printer.setPaperSize(QtGui.QPrinter.A4)
dialog = QtGui.QPrintDialog(printer)
dialog.setModal(True)
dialog.setWindowTitle("Print")
if dialog.exec_() == QtGui.QDialog.Accepted:
self.web_view.print_(dialog.printer())
To copy to clipboard, switch view to plain text mode
i am using PyQt 4.11.4 on windows 7 x64
how can i fix this? is there any alternative way?
Bookmarks