4

I am using wkhtmltopdf/wicked_pdf to generate a PDF view in Rails on Heroku. I am running Mac OS X locally.

Here are my versions:
- Ruby 2.1.3 (Both)
- Rails 4.0.3 (Both)
- wkhtmltopdf-binary-edge, 0.12.2.1 (Local)
- wkhtmltopdf-amd64, 0.12.2.1 (Production)
- wicked_pdf, 0.11.0 (Both)

The issue I am having is that some of the CSS code is rendering correctly on both my local environment and production while other css code appears to be ignored. Specifically the code used to repeat table headers and prevent rows from being split over two pages. See below:

.table-break { page-break-inside:auto !important; }
.row-break { page-break-inside:avoid !important; page-break-after:auto !important; }
.head-break { display:table-header-group !important; }

Here are two images depicting this discrepancy:
Local:
https://docs.google.com/a/digiquatics.com/file/d/0B321e2H8Q00CZWlmcFRyaXRRSEk/edit
Production:
https://drive.google.com/file/d/0B321e2H8Q00CNDI1VFl3NTdzZlU/view

Thank you in advance!

  • have you solved this problem? I am having the same issue – 0r4cl3 Apr 02 '17 at 18:20
  • +1 having the same issue, pdf even generate differently from 2 different heroku apps ... i was thinking it was due to having different wkhtmltopdf binary versions so downgraded wicked_pdf and wkhtmltopdf-heroku to .12.3.0 then that it was due to different dyno type (standard vs proffessional) being mounted on different infrastructure and wanted to play with :disable_smart_shrinking settings (wkhtmltopdf seems to use a graphical interface or at least graphical server settings) but i couldn't reproduce the case so far ... – nicolas Jun 02 '17 at 08:20

0 Answers0