python - PyQt5 with Qt 5.8: QWebEnginePage.print with QPrintPreviewDialog results in emtpy preview -
i have program used use qwebkit
show , print custom generated html reports in dialog , now, want convert whole thing qwebengine
. works fine far, printing doesn't!
up used qwebview.print()
hand whole html data on qprintpreviewdialog
wasn't problem @ all. now, understand, thought i'd have use qwebengineview.qwebenginepage.print(printer object, callback)
achieve same.
sadly, tried far hasn't worked. preview pane of qprintpreviewdialog stays empty , result given callback after printing done false - although printer object still valid whole time, in callback.
i tried out different things, worked somehow , therefor think, qwebenginepage.print() function buggy somehow or there bug in pyqt, in fact, don't , perhaps me doing wrong.
successful workarounds (which don't ;-) ):
don't use
qprintpreviewdialog
, generate output viaqwebengineview.qwebenginepage.printtopdf(filename)
: worked!generate temporary
qtextedit
object , print viaqprintpreviewdialog
: worked, badly formatted html in case...
can tell me, if i'm assuming wrong here or if there descent example on how print html via qprintpreviewdialog
using qwebengineview
?
regards, holger
qtwebengine doesn't support printing print preview, see qtbug-57982. printing qprinter directly works though.
Comments
Post a Comment