rposborne/wkhtmltopdf-heroku

Random blank line appearing under certain conditions

Closed this issue · 1 comments

We use this gem to generate transcripts for private schools. We've generated hundreds over the years with no problems, but with one recent transcript we have a phantom blank line appearing inside the courses table.

This blank line only appears if a certain number of courses are present in the table. Removing a few random courses causes the blank line to go away. Additionally, removing one or two lines from the top-right of the transcript (where the address is located) will also cause the blank line to go away.

The blank line does not appear when the original HTML is opened in a browser. Additionally, if the wkhtmltopdf-binary gem is used to generate the PDF (instead of this wkhtmltopdf-heroku gem) the blank line never appears. This issue appears to be isolated to the Linux binary present in this gem.

To reproduce the problem, run this command against the input.html file:

wkhtmltopdf-heroku-2.12.6.0/bin/wkhtmltopdf --zoom 1.28 --orientation portrait --dpi 75 --page-size Letter --footer-center "[page] of [topage]" --footer-font-name Arial --footer-font-size 12 input.html output.pdf

The generated transcript will have noticeable blank line in the table, like this:

blank line

You can generate the PDF using the wkhtmltopdf-binary gem and will observe the blank line is gone:

wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf --zoom 1.28 --orientation portrait --dpi 75 --page-size Letter --footer-center "[page] of [topage]" --footer-font-name Arial --footer-font-size 12 input.html output.pdf

It looks like this:

no-blank-line

Any ideas as to what could be causing this behavior?

Hi - sorry for the super late response.

This is most likely a regression issue in wkhtmltopdf itself.

I believe wkhtmltopdf-binary uses 0.12.5 while this wkhtmltopdf-heroku gem has 0.12.6 - I'd recommend reporting this issue to https://github.com/wkhtmltopdf/wkhtmltopdf directly, or try this version https://rubygems.org/gems/wkhtmltopdf-heroku/versions/2.12.5.0 instead.