View Single Post
Old 01-25-2021, 05:14 PM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,661
Karma: 205039118
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Well it's not at all as simple as WebKit's view()->print(), but it's not impossible either.

One thing to keep in mind is that QWebEnginePage::print() first renders the page into a temporary PDF and then prints that. Which means that everything will be printed exactly as it's seen on your screen. That includes light text on a dark background if someone happens to have the "Make PageEdit simulate a dark appearance in Dark Mode" option checked in PageEdit's preferences.

So while I have a working proof of concept, I'm probably going to put a few guardrails on this thing so people can choose whether or not they really, really, really want to empty their black ink cartridge when printing under certain conditions!
DiapDealer is offline   Reply With Quote