Quantcast
Channel: MobileRead Forums - Conversion
Viewing all articles
Browse latest Browse all 3969

Obtaining transparent PDF backgrounds

$
0
0
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)
File Type: pdf b - calibre bg.pdf (144.7 KB)

Viewing all articles
Browse latest Browse all 3969

Trending Articles