Wkhtmltopdf: page breaks and multiple column layouts not working

I am using wkhtmltopdf (11.0_rc1) using the wicked_pdf gem. I notice that layouts of several columns do not reproduce well when page breaks.

I also noticed that the behavior varies between CentOS (on Heroku) and Windows. On Windows, a page break is performed in some cases.

Have you encountered such problems before? Any help is appreciated.

 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type='text/css'> .page { page-break-after:always !important; clear:both; display:block; } #content { width: 800px; } </style> </head> <body> <div id="content"> <div class="page"> <div style="float:left;width:200px;"> DESCRIPTION 1 </div> <div style="float:left;"> PIE CHART IMAGE 1 </div> </div> <div class="page"> <div style="float:left;width:200px;"> DESCRIPTION 2 </div> <div style="float:left;"> PIE CHART IMAGE 2 </div> </div> <div class="page"> <div style="float:left;width:200px;"> DESCRIPTION 3 </div> <div style="float:left;"> PIE CHART IMAGE 3 </div> </div> </div> </body> </html> 
+4
source share
2 answers

Check out the answer and article here:

https://github.com/mileszs/wicked_pdf/issues/96

Most likely, the version of wkhtmltopdf that you installed has not been fixed by QT.

+1
source

you can see how to install a fixed version of QT

it worked for me. and save your html as simple as possible.

0
source

Source: https://habr.com/ru/post/1391604/


All Articles