Im working with playwright and i get the image from screenshot:
const image = await elementHandle.screenshot({
fullPage : true,
clip: {
width: 1200,
height: 1500,
}
});
It returns me the buffer of an image. So i need to convert the image buffer to pdf buffer.
Already used some plugins but it saves the pdf, and i need just the buffer of it (without saving it).
Like this plugin:
const pages = [
image
]
imgToPDF(pages, 'A4').pipe(fs.createWriteStream('temp.pdf'));
Any ideas?