![]() |
#1 |
Connoisseur
![]() 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. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,164
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
When you filter out color, what conversion does is remove all color specifications. it has no way to know you like some color specifications and not others. If you want to do that, use extra css to remove some colors and not others.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() Posts: 72
Karma: 10
Join Date: Mar 2017
Location: Central NC
Device: Various
|
But it's not filtering out all colors in this case. The links are appearing colored even though (a) all other color is filtered out and (b) there is a CSS class in scope that specifically changes link color to black. It also turns off text decoration and cursor events. Again, it appears that when the "color" filter is turned on in the output style information, the text-decoration setting in this class is being processed, but the others aren't:
.isDisabled { color: black; cursor: not-allowed; opacity: 1.0; text-decoration: none; pointer-events: none; } When the color filter is NOT set, then the entire class is being processed (but of course OTHER colors aren't suppressed). Last edited by ghmerrill; 12-05-2020 at 10:43 AM. |
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() Posts: 72
Karma: 10
Join Date: Mar 2017
Location: Central NC
Device: Various
|
My guess is something along the lines that when the Calibre color filter is on, then when the converter encounters something like .isDisabled, it just ignores the color setting in it and goes with the default (blue for links). But this doesn't explain why it's ignoring the cursor and pointer-events settings.
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,164
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Becuae link color is part of what is known as the user agent styles, which conversion cannot affect. they are decided by whatever renders the boook.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Connoisseur
![]() Posts: 72
Karma: 10
Join Date: Mar 2017
Location: Central NC
Device: Various
|
Okay, that makes sense. And I take you're point about adjusting your own color on the Epub side. And in my case there's only one class that needs to be altered to accomplish that. I was mostly just curious about how the processor was looking at things. Thanks.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PDF pass removal | anil4523 | 1 | 08-23-2018 10:33 AM | |
Is it possible to run font style removal without conversion? | jecilop | Conversion | 7 | 12-19-2015 10:33 PM |
Looking for PDF DRM removal help | Ozlo | 12 | 10-30-2015 07:46 AM | |
DRM removal and conversion | Gene45 | Plugins | 6 | 05-30-2015 12:14 AM |
DRM removal from PDF and subdirectories | Student1 | Workshop | 5 | 03-14-2009 12:04 AM |