Bug 26962

Summary: Koha notice/slips/receipts should print in true black (#000000)
Product: Koha Reporter: Lucas Gass <lucas>
Component: Label/patron card printingAssignee: Lucas Gass <lucas>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: alexanderchen530+kohabugzilla, andrewfh, caroline.cyr-la-rose, dcook, fridolin.somers, jonathan.druart
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Almost black color in CSS rules (like #000066) are now replaced by true black color #000000
Version(s) released in:
21.05.00,20.11.02
Attachments: Bug 26962: Make print.css pure black
Bug 26962: Make print.css pure black
Bug 26962: Make print.css pure black
Bug 26962: (follow-up) Catch other #000066 occurrences

Description Lucas Gass 2020-11-06 22:31:28 UTC
Many people have been complaining about poor print quality in Koha. A solution that I have found to work is changing the shade of black from either #333333 or #000066 to #000000 (pure black). 

We can do this for just print by updating /koha-tmpl/intranet-tmpl/prog/css/print.css
Comment 1 Alex C 2020-11-06 22:58:54 UTC
Just to add some info here for reference. The issue doesn't affect normal printing on letter sized paper on regular laser/ink printers, but on thermal POS printers it becomes like a fuzzy dotted print.

Our printers are Star TSP100 series.
Comment 2 Lucas Gass 2020-11-06 22:59:59 UTC
Created attachment 113281 [details] [review]
Bug 26962: Make print.css pure black

Test plan:
1. Generate some different notice/slips like ISSUESLIP, HOLD_SLIP, any slip you like
2. Inspect and see that body, p tags and see that the computed color is #333333 or #000066.
3. Apply patch
4. The computed style for color should not be #00000
5. This prints much better, especially on thermal/receipt printers
Comment 3 David Cook 2020-11-10 00:25:38 UTC
Created attachment 113336 [details] [review]
Bug 26962: Make print.css pure black

Test plan:
1. Generate some different notice/slips like ISSUESLIP, HOLD_SLIP, any slip you like
2. Inspect and see that body, p tags and see that the computed color is #333333 or #000066.
3. Apply patch
4. The computed style for color should not be #00000
5. This prints much better, especially on thermal/receipt printers

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 4 David Cook 2020-11-10 00:26:20 UTC
I could not find a way to follow the test plan in Chrome due to the Chrome print pop-up, but visually it looked good.
Comment 5 Alex C 2020-11-10 06:29:47 UTC
Just for documentation purposes I'm posting the original solution I found on StackOverflow and sent a ticket to ByWater:
https://stackoverflow.com/questions/27203571/receipt-printing-in-chrome-bad-quality

The original StackOverflow thread was in a different environment but he is using the same printer and the same receipt paper we have.

Thanks Lucas for making the solution work in Koha~ :)


Lucas/David - after this is all finished in Koha proper instead of using "@media print", I can test it on real receipt printers for you guys (actually I already tested while Lucas and I were playing around with it, it looks good with #000000).

Also a small thing that David's mentioning of Chrome pop-up reminded me to write this down too: we use Chrome's  --kioskprinting"  switch to bypass the "select a printer" pop-up and shoot out the receipts directly.

Thanks.
Comment 6 David Cook 2020-11-11 01:24:56 UTC
Great additional context, Alex!
Comment 7 Katrin Fischer 2021-01-10 21:35:12 UTC
Created attachment 114996 [details] [review]
Bug 26962: Make print.css pure black

Test plan:
1. Generate some different notice/slips like ISSUESLIP, HOLD_SLIP, any slip you like
2. Inspect and see that body, p tags and see that the computed color is #333333 or #000066.
3. Apply patch
4. The computed style for color should not be #00000
5. This prints much better, especially on thermal/receipt printers

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Jonathan Druart 2021-01-12 15:40:20 UTC
Why not the other occurrences?

% git grep -l -c 000066

At least those 3 seem relevant:
koha-tmpl/intranet-tmpl/prog/css/print.css
koha-tmpl/intranet-tmpl/prog/css/printreceiptinvoice.css
koha-tmpl/opac-tmpl/bootstrap/css/src/print.scss

No idea about:
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/macles.tt
Comment 9 Lucas Gass 2021-01-12 17:36:09 UTC
(In reply to Jonathan Druart from comment #8)
> Why not the other occurrences?
> 
> % git grep -l -c 000066
> 
> At least those 3 seem relevant:
> koha-tmpl/intranet-tmpl/prog/css/print.css
> koha-tmpl/intranet-tmpl/prog/css/printreceiptinvoice.css
> koha-tmpl/opac-tmpl/bootstrap/css/src/print.scss
> 
> No idea about:
> koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/macles.tt

Good point, I will submit a follow up.
Comment 10 Lucas Gass 2021-01-13 00:15:57 UTC
Created attachment 115104 [details] [review]
Bug 26962: (follow-up) Catch other #000066 occurrences

Addtional test steps:
-Check printing an invoice, inscept the page and make sure none of the colors are set to #000066
-For the OPAC you must rebuild the CSS ((https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)
-Look at some areas where you might print in the OPAC (try a list), inscept the page and make sure there is no colors set to #000066
-You can also use Jonathan's method of 'git grep -l -c 000066' to make sure no occurrences are left.
-I left macles.tt as is because I am not sure about that template
Comment 11 Jonathan Druart 2021-01-13 16:19:53 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 12 Fridolin Somers 2021-01-18 14:59:32 UTC
Small enhancement applies on 20.11, I choose to backport.

Pushed to 20.11.x for 20.11.02
Comment 13 Andrew Fuerste-Henry 2021-01-29 16:09:54 UTC
Enhancement, not backporting to 20.05. Please ask if needed!