at the core of this article this is achieved by using puppeteer in a Nodejs app
constcontent='< html content >'constbrowser=awaitpuppeteer.launch();constpage=awaitbrowser.newPage();awaitpage.setContent(content,{waitUntil:'networkidle2',});// alternatively: instead of setting the html content// you can visit a page// await page.goto('https://example.com', {// waitUntil: 'networkidle2',// });constpdf=awaitpage.pdf({format:'a4',printBackground:true,preferCSSPageSize:true,});awaitbrowser.close();
Im not sure i understood the question fully but let me know if this answers your question.
Please note that there are many alternatives to creating pdf documents and puppeteer is only one that this article focuses on
Thanks for your article, I agree and think that Puppeteer is the best way to create HTML to PDF. Unfortunately it is sometimes a little complicated to achieve on a large scale... In the end I used a micro-saas: doppio.sh
at the core of this article this is achieved by using puppeteer in a Nodejs app
Im not sure i understood the question fully but let me know if this answers your question.
Please note that there are many alternatives to creating pdf documents and puppeteer is only one that this article focuses on
Thanks for your article, I agree and think that Puppeteer is the best way to create HTML to PDF. Unfortunately it is sometimes a little complicated to achieve on a large scale... In the end I used a micro-saas: doppio.sh
Thanks for the input. I didn't know about this service. I'll check it out