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

Print Barcode Download PDF Shows Error #45

Open
Michlaguardia99 opened this issue Sep 21, 2023 · 5 comments
Open

Print Barcode Download PDF Shows Error #45

Michlaguardia99 opened this issue Sep 21, 2023 · 5 comments

Comments

@Michlaguardia99
Copy link

The exit status code '1' says something went wrong: stderr:

@Michlaguardia99 Michlaguardia99 changed the title Print Barcode shows error Print Barcode Download PDF Shows Error Sep 21, 2023
@FahimAnzamDip
Copy link
Owner

Refer to laravel snappy docs.

@Michlaguardia99
Copy link
Author

Also on the sales - actions - pos invoice

the print is not working, im debugging it but still cant find what's happening

@FahimAnzamDip
Copy link
Owner

All the printing is using laravel snappy please check their setup process if you are using windows.

@zalzdarkent
Copy link

Check the vendor/h4cc folder, there is a wkhtmltopdf folder. Download wkhtmltopdf on the internet, then extract it and the wkhtmltopdf folder will appear. Replace the wkhtmltopdf folder in vendor/h4cc with the wkhtmltopdf folder you just extracted. Then look for snappy.php in the config folder and direct the path to wkhtmltopdf.exe which is in vendor/h4cc/wkhtmltopdf/bin.

@uvindu94
Copy link

The error message you're encountering indicates that the system is unable to find the specified path for the wkhtmltopdf executable. This typically happens when the path provided to wkhtmltopdf.exe is incorrect or the executable is missing from the specified location.

Steps to Resolve the Issue:

  1. Verify the Path:
    Ensure that wkhtmltopdf.exe is located in the specified directory: C:\wkhtmltopdf\bin\wkhtmltopdf.exe.
    If it’s not in this directory, you’ll need to update the path to the correct location.

  2. Install wkhtmltopdf (If Not Installed):
    If wkhtmltopdf is not installed, download and install it:
    You can download it from the official website: wkhtmltopdf.org.
    After installation, ensure that the executable (wkhtmltopdf.exe) is located in C:\wkhtmltopdf\bin.

  3. Add wkhtmltopdf to the System Path (Optional):
    Adding wkhtmltopdf to your system's PATH environment variable allows you to run wkhtmltopdf from any location without specifying the full path.
    To add it to your PATH:
    Right-click on This PC or My Computer on the desktop or in File Explorer.
    Select Properties.
    Click on Advanced system settings.
    Click on Environment Variables.
    In the System variables section, scroll down and select the Path variable, then click Edit.
    Click New and add the path C:\wkhtmltopdf\bin.
    Click OK to close all dialogs.

  4. Test the Installation:
    Open a Command Prompt and type wkhtmltopdf to see if the command is recognized.
    If the command works, try running your application again.

  5. Check the Command in Your Application:
    Ensure that your application is correctly calling the wkhtmltopdf command with the right parameters. If you’re using a package or library to generate PDFs, check its configuration settings for the path to wkhtmltopdf.
    Example Configuration in Laravel:
    If you're using Laravel with a package like barryvdh/laravel-snappy to generate PDFs, the configuration might look like this in config/snappy.php:

'pdf' => [
    'enabled' => true,
    'binary'  => 'C:\wkhtmltopdf\bin\wkhtmltopdf.exe',
    'timeout' => false,
    'options' => [],
    'env'     => [],
],

Ensure that the binary path is correct.

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

4 participants