I have a page that I`m navigating on playwright and then i have to click on a element to open a popup to get a preview of the pdf file
[popup] = await Promise.all([
page.waitForEvent('popup', { timeout: 20000 }),
frame.click('#imbImprimir'),
]);
I tried to get a buffer but I’m getting nothing using headless: true and
await popup.emulateMedia({ media: 'print' });
popup.emulateMedia({ media: 'print' });
const buffer = await popup.pdf({
format: 'A4',
printBackground: true,
});
Is there any other way to download this page as a pdf?
if i open the page on headless: false i can see the file and download it as a pdf clicking on the arrow file preview
Is it possible to download this file using playwright?