Fix html conversion for text files

It must honor the configuration when doing html->pdf.
This commit is contained in:
eikek
2023-01-09 18:17:23 +01:00
parent 1d39b5c74e
commit 85094cc1f6

View File

@ -82,6 +82,8 @@ object Conversion {
Chunk.byteVector(ByteVector.view(html.getBytes(StandardCharsets.UTF_8)))
)
.covary[F]
cfg.htmlConverter match {
case HtmlConverter.Wkhtmltopdf =>
WkHtmlPdf.toPDF(
cfg.wkhtmlpdf,
cfg.chunkSize,
@ -89,6 +91,17 @@ object Conversion {
sanitizeHtml,
logger
)(bytes, handler)
case HtmlConverter.Weasyprint =>
Weasyprint.toPDF(
cfg.weasyprint,
cfg.chunkSize,
StandardCharsets.UTF_8,
sanitizeHtml,
logger
)(bytes, handler)
}
}
case MimeType.ImageMatch(mt) =>