Python Forum
[PyQt] print an image using PyQt
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] print an image using PyQt
#1
i tried to use QtPrintSupport
it works fine with html content but image doesn't shows up
from PyQt5 import QtPrintSupport

self.editor = QTextEdit(self)
self.editor.setHtml(html_page_var)
dialog = QtPrintSupport.QPrintPreviewDialog()
dialog.paintRequested.connect(self.editor.print_)
dialog.exec_()
Reply
#2
i need help
Reply
#3
Well if you supply a MRE (Minimal Reproducible Example) of you issue perhaps you can get a quicker answer. I for one have not played around with QtPrintSupport as of yet but without an MRE of you issue I am not even going to take a stab at it as there is not enough to work with. Note if you do not have an MRE that means you are not doing this in a MUC (Minimal Usable Code) which is a mistake in-and-of-itself because when trying to get something to function you need to isolate its functionality and play with it until you get it working before you bring it into the main program you are developing
Reply
#4
well it was a silly mistake the code is working just fine
i was typing the wrong image path, silly i know
Reply
#5
No not really -- sometimes the most frustrating bugs are simply a typo
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] Newbe question about Print() to PyQt TimW 9 14,365 Dec-19-2017, 11:36 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020