Upon request, my ASP.NET server should convert an HTML file to PDF using a chrome headless instance and return the resulting PDF.
CMD command:
chrome --headless --disable-gpu --print-to-pdf-no-header --print-to-pdf="[pdf-file-path]" --no-margins "[html-file-path]"
The PDF file is not trivial to deal with. The server needs to cleanup the PDF file from the previous request, needs to detect when the new PDF is created, and then read the file into the memory. All this is just too slow.
Is there a better solution to this? Could I get the file directly into memory somehow? Or manage the PDF file better?