Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate Image and PDF with custom fonts using wkhtmltoimage and wkhtmltopdf (Linux centos6 64-bit, hostgator )

I am stuck to generate image using wkhtmltoimage with my custom fonts.

  • OS Linux CentOs 64-bit
  • wkhtmltoimage and wkhtmltopdf version is 0.11.0_rc1-static-amd64

Example of Expected Result:

this is what i am expecting

and My OUTPUT is:

enter image description here

You can test this link:

After Googling, I found that by encoding the fonts with base64 you can get the exact result but after encoding i got success in loading the fonts but still facing problem with font-weight

Expected Result:

enter image description here

My Output:

enter image description here

You can check this link:

This all works fine on my windows server using wkhtmltoimage.exe version 0.12.1.2 but i am not being able to solve this issue on my hostgator shared hosting which has linux CentOs6 64-bit.

Your help would be appreciated.

like image 350
akash varlani Avatar asked Dec 12 '25 22:12

akash varlani


1 Answers

wkhtmltoimage requires several font libraries that hostgator obviously don't have. I don't think you can install them on a shared hosting account.

like image 166
Ilyas Serter Avatar answered Dec 15 '25 12:12

Ilyas Serter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!