I’m attempting to utilize Puppeteer to generate a PDF for an Express application. Below is my current implementation:
const puppeteer = require('puppeteer');
const browserInstance = await puppeteer.launch({headless: true});
const newPage = await browserInstance.newPage();
await newPage.goto(fullUrl + '/#shareSection', {waitUntil: 'networkidle'});
newPage.emulateMedia('screen');
await newPage.pdf({path: './uploads/myPDF' + Date.now() + '.pdf', printBackground: true, width: '1000px'});
browserInstance.close();
This code produces a satisfactory PDF, but unfortunately, it does not include form elements such as radio buttons and checkboxes. Additionally, I need to focus on a specific div by its ID and eliminate any page breaks in the PDF. Is it possible to achieve these customizations using Puppeteer?