Removed temporary background-image fix

ref #36
This commit is contained in:
Nicolai Ort 2021-03-31 16:05:13 +02:00
parent b82a32ae3e
commit 5ba26c4cbf

View File

@ -192,6 +192,7 @@ export class PdfCreator {
*/ */
public async imgToBase64(html): Promise<string> { public async imgToBase64(html): Promise<string> {
const $ = cheerio.load(html) const $ = cheerio.load(html)
$('img').each(async (index, element) => { $('img').each(async (index, element) => {
let imgsrc = $(element).attr("src"); let imgsrc = $(element).attr("src");
if (imgsrc.startsWith("data:image")) { if (imgsrc.startsWith("data:image")) {
@ -217,7 +218,7 @@ export class PdfCreator {
image = `data:${img_type};base64,${image}` image = `data:${img_type};base64,${image}`
$(element).attr("src", image) $(element).attr("src", image)
}) });
return $.html(); return $.html();
} }