aur1mas/Wkhtmltopdf

Problem with headers?

Closed this issue · 5 comments

Hi, i was using this php implementation, which worked almost right out of the box for me. But then i passed to the static 64bits version of wkhtmltopdf, and it juste keep on giving me supposedly server internal error. Checked lots of things, and im starting to think the headers, in download mode, are responsible.

Does anyone know if headers can crash on some servers? cause the command works really fine and get me back pdf datas.

thx

Well, I doubt if headers could make server to return Internal Error. Maybe you could paste to gist your code snippet & I will try reproduce this bug?

I had the same problem.. after much debugging I realised
header("Content-Length " . mb_strlen($result));
is missing a ":", should be header("Content-Length: " . mb_strlen($result)); !

thanks for solution MachineTi ;) updated the code.

cool, thanks for the code - found it much easier to use than the php integration one on wkhtmltopdf page

glad to hear :)