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