Skip to content
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

Default :dpi to 72 (or similar) #467

Open
brendon opened this issue Nov 26, 2015 · 8 comments
Open

Default :dpi to 72 (or similar) #467

brendon opened this issue Nov 26, 2015 · 8 comments

Comments

@brendon
Copy link
Contributor

brendon commented Nov 26, 2015

I was having trouble with excessively long generation times:

wkhtmltopdf/wkhtmltopdf#1510

Turns out setting the :dpi to '72' fixed the problem.

I'm wondering if it's worth making this the default in wicked_pdf to prevent others having this problem in the future?

@unixmonkey
Copy link
Collaborator

Sounds good to me. Can you send a pull request?

@brendon
Copy link
Contributor Author

brendon commented Nov 26, 2015

Sure thing :) Here you go: #468

@brendon
Copy link
Contributor Author

brendon commented Dec 2, 2015

Seems like 72 has caused a problem for at least one person in: wkhtmltopdf/wkhtmltopdf#1510

Should the default be raised or should the actual problem be tracked down in that instance?

@unixmonkey
Copy link
Collaborator

Thanks for alerting me to that. I've removed the option for now, and published a new gem version while I think it over. If you have any ideas or suggestions, I'm all ears.

@brendon
Copy link
Contributor Author

brendon commented Dec 2, 2015

Thanks David, yes it's a weird one. I'll encourage that other person to do
some more digging into why his instance didn't work at 72dpi but worked at
100! It must be so hard working with a piece of software that behaves quite
differently depending on the environment it's installed in!

Brendon Muir

On Wed, Dec 2, 2015 at 6:05 PM, David Jones [email protected]
wrote:

Thanks for alerting me to that. I've removed the option for now, and
published a new gem version while I think it over. If you have any ideas or
suggestions, I'm all ears.


Reply to this email directly or view it on GitHub
#467 (comment).

@brendon
Copy link
Contributor Author

brendon commented Dec 2, 2015

Hi David, Thomas on the other thread has come back with some further information. Seems that setting the dpi to 75 works. And using 0.12.2.x also fixes the problem.

Perhaps we could settle for say 300dpi which would make the documents printable but would still hopefully not have long generate times with border-radius and the like? I'll test this out on my end and let you know :)

@unixmonkey
Copy link
Collaborator

As long as it works consistently, I'm ok with that.
It might also be worth a note in the README to set it to a lower value (and test) to improve performance.

@brendon
Copy link
Contributor Author

brendon commented Dec 15, 2015

I've done some tests on my end and 300 dpi vs 72 dpi doubles the generation time (in my case from 5 to 10 seconds). I'm not sure which you should choose as a default; I'll leave that up to you.

A line in the README would definitely be helpful too, and probably noting that there is a default in the parameters list in the README would also be good (I forgot to do this).

In my case, I'm going to stick with 72. Did you want me to do a new pull request once you've decided or is it a simple enough change on your end? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants