wkhtmltopdf и wkhtmltoimage - замечательные консольные либы написанные на Си, работают значительно быстрее чем другие аналоги
How do I use it?
Download a precompiled binary or build from source
Create your HTML document that you want to turn into a PDF (or image)
Run your HTML document through the tool.
For example, if I really like the treatment Google has done to their logo today and want to capture it forever as a PDF:
wkhtmltopdf http://google.com google.pdf
https://wkhtmltopdf.org/usage/wkhtmltopdf.txt