use puppeter to generate a pdf file that prints out without a body.
Local tests can print out the text, that is, if you go to the server, there will be no content
The code forpuppeter is as follows:
const browser = await puppeteer.launch();
const page = await browser.newPage();
// console.log("page",page);
page.goto("http://localhost:9000/Supervision/supTemp.html?id=" + id,{waitUntil: "networkidle2"})
await sleep(1200);
console.log("sleep",Date.now());
await page.pdf({ path: "./uploads/" + id + ".pdf", format: "A4" });
console.log("end",Date.now());
await browser.close();
The content of HTML page is generated dynamically according to the parameters of Chuanru. The HTML screenshot is as follows:
pdf:
What is the reason for
? Have you ever met?