Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
as reported in #211899: table view problem (and solution) dompdf 0.5.1 is not able to handle the tbody tag. This also applies to the printpdf submodule.
The same solution can be applied to .../print/print_pdf/print_pdf.pages.inc in function _print_pdf_dompdf() just before the call to $dompdf->load_html($html):
// must get rid of tbody (dompdf goes into recursion)
$html = preg_replace('/<tbody>|<\/tbody>/', '', $html);
Comments
Comment #1
jcnventura CreditAttribution: jcnventura commentedThe latest dev contains this fix. In a few hours you should be able to test it.
Comment #2
jcnventura CreditAttribution: jcnventura commentedThe patch is not fully correct. The tbody tag can have attributes (http://www.w3schools.com/TAGS/tag_tbody.asp) and when that happens, the above pattern won't replace it.
The fix is very, very simple, and I will mark this fixed again when I do it...
João
Comment #3
jcnventura CreditAttribution: jcnventura commentedJust committed some code to better handle tbody's with attributes (adding the case-insensitive option).
João