PDF creation with wkhtmltopdf: White background color

1,169 views
Skip to first unread message

Thomas Jarosch

unread,
May 9, 2017, 8:00:48 AM5/9/17
to TaskJuggler Users
Hi,

thanks to this mailinglist I learned about the
idea of automatic PDF creation with wkhtmltopdf.

There was one little issue: The background color of the PDF
defaults to black. This was less optimal for printing.

Here's a small shell script tweak to the HTML stylesheet
to have a white background color:

---------------------
# switch background color to white in the HTML output
css_file="css/tjreport.css"
if [ ! -f "$css_file" ]; then
echo "File $css_file not found. Aborting"
exit 1
fi
echo "body {" >> "$css_file"
echo "background-color: #FFFFFF;" >> "$css_file"
echo "}" >> "$css_file"

wkhtmltopdf -s A3 -O landscape Overview.html output.pdf
---------------------

Just run these commands after executing tj3.
Hope this helps someone else.

Cheers,
Thomas

Reply all
Reply to author
Forward
0 new messages