OSError: wkhtmltopdf exited with non-zero code 127. error while loading shared libraries: libpng15.s

Copper Contributor

I've been trying to build an app function for an auto-generating pdf task using pdfkit module. Though somehow Azure couldn't find the wkhtmltopdf (I've listed it in requirement.txt to install it as well) for pdfkit. Thus I manually downloaded it from wkhtmltopdf -> lambda zip and deployed the package to the Azure function app as well. And manually configure the path for pdfkit like: 

config = pdfkit.configuration(wkhtmltopdf='TableandChart/wkhtmltox-0.12.6-4.amazonlinux2_lambda/bin/wkhtmltopdf')

 

It seemed to work but then the other error popped up (though I've also included the libs like libpng15.so.15 in TableandChart/wkhtmltox-0.12.6-4.amazonlinux2_lambda/lib/ when deploying)

 

Result: Failure Exception: OSError: wkhtmltopdf exited with non-zero code 127. error: TableandChart/wkhtmltox-0.12.6-4.amazonlinux2_lambda/bin/wkhtmltopdf: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory

 

Hung_ChienHsiang_1-1645694898132.png

 

Hung_ChienHsiang_0-1645694886316.png

 

has anyone faced a similar situation, or does anyone know how to correctly adopt pdfkit in Azure

 

Thank you in advance,

Hsiang

0 Replies