1

I have a HTML table with a variable amount of columns and I wish to convert it to PDF using wkhtmltopdf so that it always scales to fit the width of a landscape A4 PDF. The effect being that the table scales smaller as more columns are added. It might become illegibly small at some point, but that is fine.

Smart scaling seems to work up to a point; few columns scale larger to fill the page. Added more columns seems to scale it smaller. Eventually though, with enough columns added, the page fails to scale any further and the columns are clipped by the edge of the page.

Is what I'm trying to attempt impossible with the tools at hand?

Hugh
  • 1,431
  • 2
  • 16
  • 30
  • I think possibly what I am seeing is a bug. https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1813 – Hugh Jul 25 '15 at 22:08

1 Answers1

0

I ended up rolling back to wkhtmlpdf 0.9.9.3. It introduces some new (well old) bugs such as pages breaking in the middle of table rows. I've also lost some features like being able to set the view port size. Fortunately these issues are less important that the smart scaling not working.

Hugh
  • 1,431
  • 2
  • 16
  • 30
  • workaround for breaking in the middle of table rows see here http://stackoverflow.com/questions/13516534/how-to-avoid-page-break-inside-table-row-for-wkhtmltopdf – z-- Aug 03 '15 at 18:12
  • Thanks @hannes. I found that worked in `0.12.2.1` but had no effect on the older `0.9.9.3`. – Hugh Aug 04 '15 at 08:13