This task can be performed using Doppio.sh
PDF and Screenshot for Modern Softwares
Best product for this task

Doppio.sh
dev-tools
Fully managed API to generate and privately store documents and screenshots using top rendering technology. (HTML to PDF API / HTML to Screenshot API)

What to expect from an ideal product
- Doppio.sh offers an easy-to-use API for converting HTML directly to PDF.
- It leverages top-notch rendering technology to ensure high-quality PDFs.
- The API is fully managed, so you don't need to handle infrastructure or maintenance.
- Doppio.sh provides secure storage for the generated PDFs, keeping your data safe.
- It also supports creating screenshots from HTML, adding versatility to your document generation.