https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14251
Kyle M Hall <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146310|0 |1 is obsolete| | Attachment #146311|0 |1 is obsolete| | Attachment #146312|0 |1 is obsolete| | --- Comment #31 from Kyle M Hall <[email protected]> --- Created attachment 147731 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147731&action=edit Bug 14251: Allow use of CSS in discharge letter The discharge feature relies PDF::FromHTML which explicitly doesn't handle CSS [1]. This patch makes it use the `weasyprint` command-line tool to generate the PDF. This tool handles CSS correctly. To test: 1. Install weasyprint: $ apt install weasyprint 2. Add some style to your DISCHARGE letter. I used: <<today>> <h1>Discharge confirmation</h1> <p style="background-color: yellow;"><<branches.branchname>> certifies that the following borrower:<br> <<borrowers.firstname>> <<borrowers.surname>> (cardnumber: <<borrowers.cardnumber>>)<br> has returned all items.</p> 3. Have some non-latin chars on the patron name. I picked 'Henry Acevedo' and added 'Δοκιμή' as picked from bug 23589. Only to check no regressions. 4. Enable the 'UseDischarge' syspref 5. Go to Henry's detail page 6. Choose More > Discharge and Generate the discharge => SUCCESS: - Style is applied to the PDF - Greek characters are displayed correctly 7. Run the tests: $ kshell k$ prove -v t/db_dependent/Patron/Borrower_Discharge.t => SUCCESS: The rewritten tests pass! 8. Remove weasyprint: $ apt remove weasyprint 9. Repeat 7 => SUCCESS: Tests pass, relevant test is skipped because of missing weasyprint 10. Sign off :-D [1] https://metacpan.org/pod/PDF::FromHTML#CAVEATS Signed-off-by: David Nind <[email protected]> Signed-off-by: Kyle M Hall <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
