Skip to content

Instantly share code, notes, and snippets.

View lwen3's full-sized avatar

Lee Wen lwen3

  • WEN Informática
  • São Paulo, Bazil
  • 07:28 (UTC -03:00)
View GitHub Profile
@bluntelk
bluntelk / wkhtmltopdf.tablesplit.js
Created May 14, 2013 02:01
based on https://gist.github.com/niflostancu/3683510 by Florin Stancu This is a reworked table split hack. I had problems with the original with the tables not being populated evenly (I would sometimes have empty tables with headers only, or a table with only a few rows) This version has support for tfoot tags. Your table should be laid out with…
/**
* WkHtmlToPdf table splitting hack.
*
* Script to automatically split multiple-pages-spanning HTML tables for PDF
* generation using webkit.
*
* To use, you must adjust pdfPage object's contents to reflect your PDF's
* page format.
* The tables you want to be automatically splitted when the page ends must
* have a class name of "splitForPrint" (can be changed).