https://github.com/Kozea/WeasyPrint/issues/2205 The issue on GitHub is similar to this question, and they have had a commit to solve it. Hope you find it helpful.