Comment by bob1029
If your HTML is simply an intermediary to get you to a PDF, you could consider just skipping straight to building the PDF directly:
This would be far more efficient than spinning up an entire browser and printing PDFs to disk.
If your HTML is simply an intermediary to get you to a PDF, you could consider just skipping straight to building the PDF directly:
This would be far more efficient than spinning up an entire browser and printing PDFs to disk.
Building PDF directly (unless you're creating documents, especially fillables) is non-intuitive. Most PDFs are people trying to capture live data in a cached manner. If not, using a preliminary format like Markdown/HTML/LaTeX/DocX/etc to generate your PDF is almost always more intuitive.