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

Add option use_xvfb to emulate an X server #909

Merged
merged 1 commit into from Jun 12, 2020

Conversation

mschnitzer
Copy link
Contributor

Hi,

so I really struggled to get wkhtmltopdf (which is obviously used by wicked_pdf) working without having an X server running on my virtual server. Unfortunately, the best solution I found, was to wrap all wkhtmltopdf around the xvfb-run command which is - from my understanding - emulating an X server for systems where a real X server is not available. Doing so, made my PDF's generating normally again.

I'm not really sure whether there's any better solution. I didn't find anything working so far besides the approach I'm following.

As there are many topics/issues about generating PDF's without an X server being available, I decided to propose my code changes to wicked_pdf. Let's discuss whether this is a good approach or if you see anything else, which seems to be more suitable.


Commit Message:

On some systems an X server is not available, and thus a PDF generation
is not possible. This can be avoided when installing xvfb-run which
emulates an X server.

Enabling the use_xvfb option will wrap any wkhtmltopdf commands
around the command xvfb-run, in order to be able to create PDF's, even
without having an X server running.

On some systems an X server is not available, and thus a PDF generation
is not possible. This can be avoided when installing `xvfb-run` which
emulates an X server.

Enabling the `use_xvfb` option will wrap any `wkhtmltopdf` commands
around the command `xvfb-run`, in order to be able to create PDF's, even
without having an X server running.
@mathieujobin
Copy link
Contributor

LGTM, rubocop failures looks unrelated

@unixmonkey unixmonkey merged commit aefa10f into mileszs:master Jun 12, 2020
@unixmonkey
Copy link
Collaborator

This is now in the published gem version 2.1.0.

Thank you for your help!

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

Successfully merging this pull request may close these issues.

None yet

3 participants