Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WkHtmlToPDF displays a tiny pdf if text is too long

Tags:

wkhtmltopdf

I am not sure how to overcome this problem even though I have set the page size to be A4, I would assume that my page size would remain intact and my content would be wrapped correctly?

note I am using the wrapper WkHtmlToXSharp to create my pdf

enter image description here

Issue: If you enter strings that are not split, i.e. one long string - what I have showed in the image above will occur. How do I fix this? Is there some options for WkhtmlToPDF to wrap the text?

like image 664
Haroon Avatar asked Nov 04 '22 01:11

Haroon


1 Answers

If you want a CSS solution, you could try setting a width for the element that overflows and then testing with word-wrap: break-word;, overflow:hidden; and white-space: nowrap to control the issue, some of these or a combination might work for you. As for a wkhtmltopdf solution that would be universal... If you find any, I want one too!

like image 105
Joel Peltonen Avatar answered Nov 29 '22 16:11

Joel Peltonen