htmlcssnode.jswkhtmltopdfwkhtmltopdf-binary

Table row is getting cut while using wkhtmltopdf node module converting to pdf


Facing issue while converting HTML to PDF long one almost 3-4 pages of tables data is available. Its getting cut and distorted.

I tried most of solution which is mention related to wkhtmltopdf stackoverflow thread.enter image description here

table, tr, td, th, tbody, thead, tfoot {
    page-break-inside: avoid !important;
}

this doesnt help me

Any help in this ?


Solution

  • Upgrading wkhtmltopdf to version 0.12.5 with qt patched resolved my issue.

    Script to install wkhtmltopdf 0.12.5 with qt patched on ubuntu

    If you face any issues related to zooming and extra whitespace try add these options in the wkhtmltopdf npm package

    --zoom  value between 0.0 to 1.0
    
    --disable-smart-shrinking 
    

    Issues related to this from GitHub : Regression on upgrade from 0.12.3 to 0.12.5