To prepare the conversion from HTML to PDF, we need ourselves
To convert HTML to PDF from a file
location =/html_to_pdf_from_file {
html2pdf on; # включаем pdf-фильтр
}
To convert HTML to PDF from text
location =/html_to_pdf_from_text {
html2pdf on; # включаем pdf-фильтр
return 200 "<p style="background-color: #c11">Здравствуй, мир!</p>"; # возвращаем HTML
}
To convert HTML to PDF from a proxy
location =/html_to_pdf_from_proxy {
html2pdf on; # включаем pdf-фильтр
proxy_pass somewhing_that_returns_html; # перенаправляем на туда, гду возвращается HTML
}
as a result, when accessing these locations, instead of HTML, a PDF generated based on it will be returned (using
This, of course, is not the best generator, I tried a couple more before it, but found errors in them
Source: habr.com