[PyQt] Printing from QWebView (contents visible) gives a set of blank pages

ivanko.rus ivanko.rus at gmail.com
Tue Aug 23 03:10:17 BST 2011


Thank you for answering. The strange thing is that my versions are the same
as yours. But well, I made an ultra-dirty hack by passing the QWebView's
HTML to a QTextEdit and then printing it from there, so for now it will
serve (the pages I am loading into my QWebView are actually pretty simple).
But thanks anyway!

2011/8/21 Hans-Peter Jansen <hpj at urpla.net>

> On Sunday 21 August 2011, 19:52:41 ivanko.rus wrote:
> > Good afternoon! Recently I was trying to print a Web page from
> > QWebView and ran into a pretty weird problem. It is the following: I
> > can print my QWebView perfectly when setting the QPrinter's output
> > format to PDF or PostScript. But when I try to print to a normal
> > printer, however, it gives me the correct number of pages, only that
> > the pages are all blank. I tried to do this with a virtual PDF
> > printer in Windows, a normal printer (it had ink, btw =), tried to
> > choose the "print to file" option on Windows, and the results were
> > all the same. The other thing that puzzles me even more is that if I
> > replace the QWebView with a QTextEdit, everything works perfectly
> > with all kinds of printers. So I hope that someone can give me a
> > little help, I would appreciate it very much. Thank you!
>
> You missed to tell us something about your versions.
>
> Works here with:
> python: 2.6.2
> sip: 4.12.4
> qt4: 4.7.1
> pyqt4: 4.8.5
> os: Linux
>
> Note, that printing is implemented quite differently in Windows and
> Linux, and QWebView is somewhat complex in itself.. It might be a
> printer _driver_ problem, which aren't that uncommon with Windows (but
> who cares: it's the industrial standard by definition).
>
> Pete
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110822/b13ff3aa/attachment.html>


More information about the PyQt mailing list