Open ghost opened 2 years ago
I've tested it on a machine with Node Version v16.13.0, too and it doesn't work there as well.
Same here too, any solution ?
update for those that might come across this, just do ur edits and then head here http://localhost:3000/preview?export=true&data=1 then right click and click print or if you want the way author did it use puppeteer.
const generatePDF = async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(`https://wtfresume-sramezani.vercel.app/preview?export=true&data=${uuid}`, {
waitUntil: 'networkidle2',
});
await page.emulateMedia('screen');
await page.content()
const pdf = await page.pdf({
// path: `./pdf/${uuid}.pdf`,
printBackground: true,
format: 'A4',
width: '210mm',
height: '297mm',
});
await browser.close();
res.contentType("application/pdf");
res.send(pdf);
}
I tried this tool on my machine, but it did not work. After editing the resume the preview works fine, but as soon as I click the export to pdf button a 4 kb pdf file gets generated.
This file contains this (a 404 page?):
OS: Win 10 Node Version: v14.17.6