PDF Output: Fix CSS opacity property causing text to not be rendered. Now opacity is ignored, as it is unsupported by Qt WebKit. Fixes #1792048 [Text with opacity disappear after converting to PDF](https://bugs.launchpad.net/calibre/+bug/1792048)

This commit is contained in:
Kovid Goyal 2018-09-12 08:47:44 +05:30
parent 4f025790e5
commit 84cc6cab53
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -419,6 +419,10 @@ class PDFWriter(QObject):
amap = json.loads(evaljs('''
document.body.style.backgroundColor = "white";
// Qt WebKit cannot handle opacity with the Pdf backend
s = document.createElement('style');
s.textContent = '* {opacity: 1 !important}';
document.documentElement.appendChild(s);
paged_display.set_geometry(1, %d, %d, %d);
paged_display.layout();
paged_display.fit_images();