-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering everything small on MacOS #754
Comments
Hello, I have found a discussion for this issue on wkhtmltopdf repository. The problem is on the binary not on this gem. |
Yeah, that's a tough one, and it's OS/configuration specific. You can try setting the There are also other suggestions in the linked thread. Hope it helps! |
The fix for non retina MacOS 10.13.5 with wkhtlmtopdf 0.12.4 is to add the flag WickedPdf supports this flag through the config To run the flag on development only: WickedPdf.config = {
#cross enviroment configs
}
if Rails.env.development?
WickedPdf.config[:lowquality] = true
end Thanks for your support @unixmonkey |
Whoa, thanks for letting me know about that. I'm sure the info will help others. |
I'm not sure if it will work for everyone, but the solution that seems to be easiest to implement on my projects is as follows: When making the controller method, I set the dpi to 300: respond_to do |format|
format.html
format.pdf {dpi: 300, pdf: 'filename', page_size: 'Letter', etc.}
end and then I add a stylesheet that gives the body a font-size: body {
font-size: 16px;
} and then I just add the stylesheet tag to the actual pdf and put everything in the body of the html: = wicked_pdf_stylesheet_link_tag 'filename'
<body>
<h1>Oh hey guise</h1>
</body> Maybe this will help some of you that find this when searching for other solutions. This is with the 12.4 binary, and I'm on Sierra 10.13.6 |
The opposite occurs in Heroku. The font gets way too big in version 0.12.4 of the binary gem. Fortunately, it can be solved with the same setting suggested by @jpaulomotta format.pdf do
render pdf: "orden_#{@order.id}_#{@order.customer.full_name}",
layout: 'pdf.html',
page_size: 'A7',
margin: {
top: 3,
right: 3,
bottom: 3,
left: 3
},
lowquality: true
end |
@jpaulomotta thank you so so much for opening this issue ahead of me <3 shout out to @unixmonkey and @ohboyd and @cesc1989 obviously for chippin' in ! I just spent the better part of 24hrs fighting this - and am angry with myself for not stopping by sooner [:| |
For anyone else finding this issue, I somehow just ran into this same issue. I assume it was due to a recent MacOS update, but was jarring to see really tiny text in our environment. Now, the simple fix is to update to wkpdftohtml-binary gem to 0.12.5 Thanks all who struggled through it way more than I did! |
Hello.
I'm having this issue on a MacOS High Sierra 10.13.5
Expected behaviour
I've followed the tutorial on the documentation, so I was expecting WickedPDF to render my page with no styles, just plain HTML in a way that's readable.
Current behaviour
This is what I'm getting. Super tiny fonts on my doument.
Zooming in shows the document with a super small font.
![screen shot 2018-07-19 at 3 55 42 pm](https://user-images.githubusercontent.com/1813007/42964061-60e35480-8b6c-11e8-8fc4-db62a3728c8a.png)
Using the param
![screen shot 2018-07-19 at 4 01 43 pm](https://user-images.githubusercontent.com/1813007/42964329-1ba06efc-8b6d-11e8-828a-dd9b6e13ad87.png)
debug
shows the HTML with the expected fonts.The error does not happen on Heroku as you can see in the picture below from the same application:
![screen shot 2018-07-19 at 4 02 31 pm](https://user-images.githubusercontent.com/1813007/42964384-3bbfc390-8b6d-11e8-9699-42bf0791794a.png)
My enviroment
Code
Layout
app/views/layouts/print_headless.pdf.erb
pdf_styles is a blank css file. Setting the font on the css was also unsuccessfull.
Controller
Am I missing any special installation step on MacOS?
The text was updated successfully, but these errors were encountered: