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,13 +82,26 @@ object Conversion {
Chunk.byteVector(ByteVector.view(html.getBytes(StandardCharsets.UTF_8)))
)
.covary[F]
WkHtmlPdf.toPDF(
cfg.wkhtmlpdf,
cfg.chunkSize,
StandardCharsets.UTF_8,
sanitizeHtml,
logger
)(bytes, handler)
cfg.htmlConverter match {
case HtmlConverter.Wkhtmltopdf =>
WkHtmlPdf.toPDF(
cfg.wkhtmlpdf,
cfg.chunkSize,
StandardCharsets.UTF_8,
sanitizeHtml,
logger
)(bytes, handler)
case HtmlConverter.Weasyprint =>
Weasyprint.toPDF(
cfg.weasyprint,
cfg.chunkSize,
StandardCharsets.UTF_8,
sanitizeHtml,
logger
)(bytes, handler)
}
}
case MimeType.ImageMatch(mt) =>