Product: pdftron/pdfnet-node
Product Version: 9.0.0-3
Lmabda ENV: Node JS 14 - 2.880.0 JS SDK - Amazon Linux 2 OS
Linux kernel – 4.14.165-102.205.amzn2.x86_64
Please give a brief summary of your issue: The HTML to PDF conversion works locally in demo mode. It is not working in lambda in demo mode or with a license.
Please describe your issue and provide steps to reproduce it:
The following code block takes data from a microsoft graph api email and converts email data to a PDF document. Locally on MAC OS 10.15.7 it works in demo mode. In my lambda environment it simply does not work. There are no errors thrown. The code is parsed but the const emailBodyDoc ends up with a 0 page count after conversion. I have tired this with the license and in demo mode in lambda and have gotten the same results.
try {
const html = `
${parsed.html}`;
const html2pdfSettings = await PDFNet.HTML2PDF.WebPageSettings.create();
const html2pdf = await PDFNet.HTML2PDF.create();
const emailBodyDoc = await PDFNet.PDFDoc.create();
html2pdfSettings.setAllowJavaScript(false);
html2pdfSettings.setAllowPlugins(false);
await html2pdf.insertFromHtmlString2(html, html2pdfSettings);
await html2pdf.convert(emailBodyDoc);
pageCount = await emailBodyDoc.getPageCount();
await resultDoc.insertPages(1, emailBodyDoc, 1, pageCount, PDFNet.PDFDoc.InsertFlag.e_none);
} catch (err) {
logger.error(JSON.stringify(
err,
null,
2,
));
}