Closed leonbold87 closed 8 years ago
hello,
This is a known issue in wkhtmltopdf@0.12.2 see: https://github.com/wkhtmltopdf/wkhtmltopdf/pull/2463
there is nothing much I can do here...You can build your own binary from the branch above and use it to replace the included binary in this gem. This will be fixed in the next verison. (wkhtmltopdf 0.12.3) - I'm not sure when that will be released though. https://github.com/wkhtmltopdf/wkhtmltopdf/milestones/0.12.3
Thanks, P
Oh actually... you can try my old gem, which has a 0.12.1 release. use this in your gemfile:
gem 'wkhtmltopdf-binary', github: 'pallymore/wkhtmltopdf-binary', tag: '0.12.1'
and let me know if it works!
Can be closed now?
Hello, wkhtmltopdf-binary-edge v 0.12.2.1
First of all, thank you for creating this; the original wkhtmltopdf started having major problems with our newer OS and image encryption!
I have created a brochure generation process utilizing wkhtmltopdf; we were producing excellent pdfs appropriately sized at 300 DPI, 12.75" by 10.25" with a resolution of 3825px by 3075px.
However, upon upgrading to binary-edge, the DPI parameter no longer triggers. We consistently get 100 DPI instead, despite using the same code. Notably, all of the other options (margin, page_height, page_width, etc.) all work with no issue.
pdf = WickedPdf.new.pdf_from_string(render_to_string('api/v1/to_pdf/cover.html.haml', layout: 'cover_bio.pdf.html' ), orientation: "Landscape", page_height: "12.75in", page_width: "10.25in", dpi: "300", lowquality: false, encoding: "UTF-8", margin: { top: 0, bottom: 0, left: 0, right: 0, } ) name = "cover#{user_id}.pdf" save_path = Rails.root.join('public',name) File.open(save_path, 'wb') do |file| file << pdf end
If you have any suggestions or support, I would be very grateful! Our printer requires the PDF to be in 300 DPI, no less!