Mobileread
Calibre PDF Output: Adding Background Rgb colors customization options and Font Color
#1  Lodan 02-06-2019, 06:18 PM
Hi everyone!

New here.
I have a request for the following feature if possible with PDFs.
Adding Background Rgb colors customization options and
Font Color customization options to the PDF output in Calibre converter


Would be great to have the option to color the background of
the PDF page other than the default white, and if possible too the font color.
It would be of great help to make is easier on the eyes for on screen PDFs reading.

This feature is currently available in
Calibre> Epub viewer> Preferences> User Stylesheet tab.

I use the following background color code within the viewer to read
my epubs and would love to replicate them on my PDFs.

Many thanks for your help.


body {

color: rgb(0,0,0);


background-color:rgb(237,229,206);

text-align:justify;

line-spacing:1.8;

margin-top:10px;

margin-bottom:4px;

margin-right:20px;

margin-left:20px;

text-indent:2em;

}

h1, h2, h3, h4, h5, h6 {

color:black;

text-align:center;

font-style:italic;

font-weight:bold;}

image »
Reply 

#2  Lodan 02-06-2019, 09:21 PM
Hi again,

It is possible with Adobe Reader, and PDFElement as below:

Why not in Calibre?

https://www.youtube.com/watch?v=IO6KTVsZQkg


https://youtu.be/G2JiejYzORk?t=37
Reply 

#3  willus 02-07-2019, 08:34 AM
Quote Lodan
Would be great to have the option to color the background of the PDF page other than the default white, and if possible too the font color.
It would be of great help to make is easier on the eyes for on screen PDFs reading.
This probably belongs in the calibre forum somewhere, but just so you know, you can post-process your PDF with k2pdfopt to do this. See the -colorbg and -colorfg options (see command-line usage).

E.g. k2pdfopt -mode copy -colorbg ffff00 -colorfg 0000ff mydoc.pdf

... would make the background yellow and the text blue. The drawback is that you would be required to convert the PDF to bitmapped form (but the text would still be searchable and selectable). See example attached.

k2pdfopt -colorfg 0000ff -colorbg ffffd0 -mode copy pooh.pdf

Also see my other recent post mentioning this.
[pdf] pooh.pdf (1.47 MB, 44 views)
[pdf] pooh_k2opt.pdf (496.9 KB, 45 views)
Reply 

#4  Lodan 02-08-2019, 10:02 AM
Thanks willus for the idea and example.

I was looking for the feature in Calibre for the following application benefits:

when converting epubs to PDFs in Calibre simply
customizing the background color and fonts color.

Would be great also to be able to convert Epubs to PDFs
with custom background color and font color in Batch.

It would be also of great help for dyslexic people,
or people with reading disability wanting to convert their Epubs to PDF with Calibre.

Would save time and steps. The customization is already
available in Adobe Reader since 2013 at least as shown here:
https://www.youtube.com/watch?v=IO6KTVsZQkg

Here Kovid said (in 2016) it was difficult in Calibre:
https://www.mobileread.com/forums/sh...d.php?t=273117

Why since it is possible in Adobe Reader since 2013?

Thanks for any further help you can all provide.

Cheers
Reply 

#5  HarryT 02-09-2019, 06:34 AM
Calibre is open source. If you disagree with Kovid's view that it would be difficult, my suggestion would be to make the change yourself, and then submit the code changes to Calibre.
Reply 

#6  Doitsu 02-09-2019, 02:25 PM
Quote Lodan
Would be great also to be able to convert Epubs to PDFs with custom background color and font color in Batch.
You can also install Prince and generate .pdf files with the Calibre Prince PDF plugin or the prince command line tool.
Reply 

#7  Lodan 02-17-2019, 09:09 AM
Quote HarryT
Calibre is open source. If you disagree with Kovid's view that it would be difficult, my suggestion would be to make the change yourself, and then submit the code changes to Calibre.
Is it still difficult today in Calibre?

If yes, why/what needs to be done to make it feasible?

Thanks for specific suggestions.
Reply 

#8  Lodan 02-17-2019, 09:09 AM
Quote Doitsu
You can also install Prince and generate .pdf files with the Calibre Prince PDF plugin or the prince command line tool.
Thanks for your answer. I'll take a look at Prince.
Reply 

Today's Posts | Search this Thread | Login | Register