Wkhtmltopdf Not Working on Amazon Linux 2023
Asked Answered
M

2

5

I installed wkhtmltox-0.12.6-1.amazonlinux2.x86_64.rpm on my EC2 instance(t3.xlarge). While using wkhtmltopdf in Node.js, I'm getting the following error:

Error generating PDF: Error: wkhtmltopdf: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
wkhtmltopdf exited with code 127
    at handleError (/var/www/html/Transectra/node_modules/wkhtmltopdf/index.js:161:16)
    at ChildProcess.<anonymous> (/var/www/html/Transectra/node_modules/wkhtmltopdf/index.js:133:7)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)

I tried to install libpng15 but can't able to install it, but I only want this wkhtmltopdf library

Maunsell answered 8/8, 2024 at 6:47 Comment(0)
D
7

I tried to install with def

dnf install -y https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox-0.12.6.1-3.almalinux9.$(uname -m).rpm

now check version

wkhtmltopdf --version
Dudgeon answered 8/8, 2024 at 6:55 Comment(0)
A
6

It may be version issue of wkhtmltopdf you have to check there website and reinstall supported version for Amazon Linux

Aurora answered 22/8, 2024 at 7:3 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.