The body of the pdf file generated by puppeter is missing

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 for

puppeter 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:
clipboard.png
pdf:

clipboard.png

What is the reason for

? Have you ever met?

Apr.19,2021

change sleep to page.waitforselector to ensure that the data is already displayed on the view.


check the server log and guess that it may be a file permission problem

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3dddc-2c3bf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3dddc-2c3bf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?