From abd436ecf6ddb0be22e6aa91ac09082a8fe72b59 Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Mon, 25 May 2026 16:12:59 +0200 Subject: [PATCH] Bug 39208: Remove xhtml2pdf from printoverdues.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note: this requires a command line access to the test machine TEST PLAN: 1 - Anywhere on the computer running koha, run following command: mkdir tmp echo '

Тетрис — это классика!

' > tmp/tmp.html echo '* { color: red };' > tmp.css ./misc/cronjobs/printoverdues.sh tmp tmp.css 2 - Open the pdf in tmp/tmp.pdf, notice it is broken 3 - Apply patch 4 - Rerun ./misc/cronjobs/printoverdues.sh tmp tmp.css 5 - Open the pdf in tmp/tmp.pdf, notice it is now displaying properly, notice the css property still applies Signed-off-by: David Nind Signed-off-by: Paul Derscheid Signed-off-by: Lucas Gass --- misc/cronjobs/printoverdues.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/misc/cronjobs/printoverdues.sh b/misc/cronjobs/printoverdues.sh index 6819e0cede..fe0799bfcc 100755 --- a/misc/cronjobs/printoverdues.sh +++ b/misc/cronjobs/printoverdues.sh @@ -9,10 +9,7 @@ print_usage(){ echo " - printer_host Network Name or IP of the printer (port possibly included) "; echo " - printer_name printername "; echo "Note that css printerhost and printername are optional parameters "; - echo "Note that this script uses xhtml2pdf command "; - echo " xhtml2pdf command comes with pisa (a python library) - To install you need setuptools library for python - then type easy_install pisa "; + echo "Note that this script uses weasyprint command "; exit 1; } @@ -27,7 +24,7 @@ then fi if [[ -n $2 && -f $2 ]] then - optpisa="--css $2"; + cssopt="-s $2"; fi if [[ -n $3 ]] then @@ -37,9 +34,11 @@ if [[ -n $4 ]] then optprinter="$optprinter -d $4"; fi -for i in $1/*.html + +for i in $(ls $1/*.html 2>/dev/null) do - xhtml2pdf $optpisa $i; + outputfile=$(echo $i | sed 's/\.html/.pdf/') + weasyprint $cssopt $i $outputfile; done if [[ -n $optprinter ]]