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

Installation: wkhtmltoimage-amd64 not found #486

Closed
RyanPaiva56 opened this issue Sep 2, 2023 · 1 comment
Closed

Installation: wkhtmltoimage-amd64 not found #486

RyanPaiva56 opened this issue Sep 2, 2023 · 1 comment

Comments

@RyanPaiva56
Copy link

RyanPaiva56 commented Sep 2, 2023

Hi, I tried a ton of things and still not able to get it to work:

I installed via composer:

https://github.com/h4cc/wkhtmltopdf-amd64

Here's my controller code:

$snappy = new Pdf('vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64');
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="file.pdf"');
echo $snappy->getOutput('localhost/schedule');

I get this error:

[2023-09-02 21:54:47] local.ERROR: The exit status code '127' says something went wrong:
stderr: "sh: 1: vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64: not found

Any ideas?

@RyanPaiva56
Copy link
Author

I swear to god I worked on this for like 20 minutes, and as soon as I posted the issue, I thought of needing to use base_path. For anyone else who googles this here ya go:

$snappy = new Pdf(base_path() . '/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64');

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

1 participant