View Single Post
Old 07-03-2023, 09:09 AM   #1
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,612
Karma: 7891011
Join Date: Sep 2020
Device: none
Obtaining transparent PDF backgrounds

Hi all!

By running Prince PDF plugin, today I was able to get a transparent background on a PDF converted doc, after adding this line in CSS:

PHP Code:
body  {background:transparent !important;} 
This was a really cool find I wish I'd known about before.

However, in Calibre versions post-v3.48, I can't seem to find a workaround to get non-white background below text, upon converting from EPUB, MOBI etc., unless I edit the docs/ebooks internal CSS, to set a custom background color - inserting just that line I mentioned doesn't seem to work.

Is there perhaps some Extra CSS styling I can enter in the Look and Feel section of Calibre conversion, to get a fully transparent background?

So far, i've tried:

PHP Code:
* {background-colortransparent !important;}
* {
background-colorinherit !important;}
* {
background-colorinitial !important;}
* {
background-colorrevert !important;}
* {
background-colorrevert-layer !important;}
* {
background-color: unset !important;} 
Maybe there's some general HTML element in EPUB styling I'm not aware of, to which the wildcard doesn't apply...?

Reason I prefer transparent PDF in converted documents is that it's possible to add a custom background color using tools like PDF Xchange Editor, in order to reduce eye strain.

In the attachments you may see the difference between a Prince converted doc - with the "body bg transparent" CSS line addition, and the other one converted using Calibre native conversion, which has the advantage of running batch jobs...
Attached Files
File Type: pdf a - prince bg.pdf (102.5 KB, 69 views)
File Type: pdf b - calibre bg.pdf (144.7 KB, 71 views)

Last edited by Comfy.n; 07-03-2023 at 09:14 AM.
Comfy.n is offline   Reply With Quote