Hi we are opening the new page and trying to perform
Ctrl+P keyboard action on the new page, code is attached below
(async () => {
const browser = await chromium.launch({ headless: false });
const context = await browser.newContext();
const page = await context.newPage();
await page.goto('https://example.com');
// Simulate Ctrl+P to open the print dialog
await page.keyboard.down('Control');
await page.keyboard.press('P');
await page.keyboard.up('Control');
await page.waitForTimeout(5000);
await browser.close();
})();
we are not able to achieve this, can we accomplish this in Playwright and any example code available,
please help us solve this issue; and can save this printed pdf in local file
I am trying to
handle the printer pop-up box
New contributor
Shiva Prasad R is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.