Skip to content

Instantly share code, notes, and snippets.

View bluntelk's full-sized avatar

Jason Playne bluntelk

View GitHub Profile

Keybase proof

I hereby claim:

  • I am bluntelk on github.
  • I am boxie (https://keybase.io/boxie) on keybase.
  • I have a public key ASCkzla_gVSaWSI60BaYghy4I0aYTjx2XBCu2pTdxAJYTwo

To claim this, I am signing this object:

@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).