I am using wkhtmltopdf (through the 'pdfkit' ruby gem) to generate pdf from html. There is a section in the page where the text content is lengthy, and it usually spans 2 (or more) pages. What happens sometimes is that a line of text is split across pages. Here's an image to help you understand what I mean:
Now I have done my fair bit of research on this: for example I have tried CSS fix on the sorrounding div (which was suggested in some other stackoverflow questions), like so:
page-break-inside:avoid !important;
and/or
page-break-before: always !important;
didn't work.
I have also tried:
display: block !important;
which didn't work either.
Does anyone know how to fix this problem?
FYI: I am using the latest version of wkhtmltopdf: wkhtmltopdf-0.11.0_rc1