You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm passing in a html page that will create multiple pages. WKHTML doesn't seem to have a problem when the pdf generated is one page. However, when it is goes beyond that, the app just hangs. Here is my code
generate: (html, destination, tempName) => {
return new Promise((resolve, reject) => {
const file = `${destination}/${tempName}`;
const readStream = fs.createReadStream(html);
wkhtmltopdf(readStream, (err, stream) => {
if (err) {
console.log(`Pdf generation: Failed, something went wrong
reading the template ${html}, further details here -> ${err}`);
reject(err);
} else {
// on finish ensures that fs is finished writing the file
stream.pipe(fs.createWriteStream(file)).on('finish',
() => resolve(file));
console.log('pdf generated at', file);
}
});
});
}
I'm passing in a html page that will create multiple pages. WKHTML doesn't seem to have a problem when the pdf generated is one page. However, when it is goes beyond that, the app just hangs. Here is my code
Here is a link to the code
https://github.com/UKHomeOffice/modern-slavery/blob/MS-812-PDF-design-v2/apps/pdf/util/pdf-generator.js
Here is the link to the html I am passing
https://github.com/UKHomeOffice/modern-slavery/blob/MS-812-PDF-design-v2/apps/pdf/views/pdf.html
I'd be grateful for your help, thanks in advance
The text was updated successfully, but these errors were encountered: