wicked_pdf (or wkhtmltopdf) behaves strange in production mode. It took a bit time to track down the problem, but seemingly the reason that my PDF is broken are too much images or too large file sizes.
When i try to use a 300dpi pic (4 MB), it´s broken. When i decrease to 72 dpi, it works… sometimes. When i use just a thumbnail, it works always.
I made a test: One coversheet with a small test image works. Two coversheets also, … up to 30 sheets it works. When i attach cover sheet 31, my pdf is broken, always.
In development everything is fine, 300dpi images, 5 MB, 50 MB, no problem.
Does anybody know about this problem? And how to fix it? :-)
PS: when i do wkhtmltopdf via command line it shows no images at all, so it´s hard to test if wkhtmltopdf or wicked_pdf is the issue. I really don´t like generating PDFs!