View Single Post
Old 12-05-2020, 10:11 AM   #1
ghmerrill
Connoisseur
ghmerrill began at the beginning.
 
ghmerrill's Avatar
 
Posts: 72
Karma: 10
Join Date: Mar 2017
Location: Central NC
Device: Various
Color removal in conversion to PDF

I'm not sure that this ultimately matters to me, but it is (to me) unexpected behavior.

My Epub3 book contains several colored images. In addition, links are displayed in the traditional blue and underlined. This includes links for endnote numbers.

For (Amazon) print format purposes, I would like to generate a PDF that is color-free. That version of the Epub3 source uses grayscale versions of the images: no problem, of course. I have a CSS class (.isDisabled) referenced in each of my links which sets the color to black, the cursor to "disallowed", pointer-events to "none", and text-decoration to "none". In the Sigil viewer, this has the desired effect, and the links just don't appear.

The Kindle Previewer does not honor this class at all. The links appear in it as usual (active, blue, and underlined). Well, that's KDP. I don't know what expectations to have about its general handling of CSS. So I basically take what I get, and in this case it doesn't matter since I don't use this class for the Kindle version.

In Calibre, when I convert to PDF and do NOT check the "color" box under Look & feel -> Styling -> Filter style information, that .isDisabled CSS class is honored and none my links appear (Great!!). But of course, the other colors (e.g., backgrounds in display boxes, etc.) do appear.

Now ... wait for it ... you can probably guess what's coming ...

When I DO check the "color" box in the "Filter style information", the result is that all the specific color in backgrounds and such is removed so I get just black text (Great! As expected.). BUT THE LINKS APPEAR, are blue, and are active!!! Oddly, they are not underlined. So it appears the converter is partly honoring and partly not honoring that class. So it appears that when I try to suppress colors in the style information, this causes the converter to ignore the color (and other!!) settings in my .isDisabled class. This seems peculiar, though I can almost guess how it's being done.

As I say, I don't THINK this will make a material difference to me since I THINK (but haven't tested) that when I hand a PDF to KDP containing colored links and tell it to print in B&W, it will just do that and not grayscale the links. But I am curious about this conversion behavior with the style information setting.

Comments?

Also, is there anything I've overlooked in the conversion settings that will result in ALL of the text in the document appear in black (including the links) and without underlining?

Last edited by ghmerrill; 12-05-2020 at 10:22 AM.
ghmerrill is offline   Reply With Quote