html-pdf is just generating the first page, i'm trying to generate a dynamic pdf from a request and it just generates the first page and the header of the second page;
some example:
`,
options
)
.toFile(fileoutput, function(err, res) {
if (err) return console.log(err);
});
var stat = null;
setTimeout(() => {
stat = fs.statSync(fileoutput);
res.writeHead(200, {
"Content-Type": "application/pdf",
"Content-Length": stat.size
});
fs.createReadStream(fileoutput).pipe(res);
}, 5000);
fs.unlink(fileoutput);
});
module.exports = app => app.use("/pdf", router);
===========================================================================
if the request data is greater then one page it will print only the first page and the header of a second page if the header is configured, if isn't the second page will be a blank page ....
html-pdf is just generating the first page, i'm trying to generate a dynamic pdf from a request and it just generates the first page and the header of the second page; some example:
=========================================================================== const express = require("express"); const fs = require("fs"); const router = express.Router(); const path = require("path"); const pdf = require("html-pdf"); const caminho_t_alvara = path.join(
router.post("/generate", async (req, res) => { var options = { format: "A4" }; const { data, code, name} = req.body; var fileoutput = path.join(__dirname,
../Outputs/${code}${name}.pdf
);pdf .create( `<!DOCTYPE html>
${data}