Please give a brief summary of your issue:
PDFNet.Convert.toPdfWithBuffer segfaults in AWS lambda function but runs fine locally.
Please describe your issue and provide steps to reproduce it:
Utilizing pdftron PDFNet.Convert.toPdfWithBuffer to merge PDF email attachments from MSFT outlook into one PDF. This works fine on MAC OS/Unix however every time I attempt to run this is a lambda function on AWS. A segfault occurs on the toPdfWithBuffer function and I have not been able to figure out why. No error is thrown.
This is my function call: await PDFNet.Convert.toPdfWithBuffer(tempDoc, a[‘content’], ext);
a[content] is the buffer of an email attachment object from microsoft graph client.
and the parameters are as follows:
tempDoc ===> { name: ‘PDFDoc’, id: ‘55ee36fb6d70’ } - created with const tempDoc = await PDFNet.PDFDoc.create();
a[content] ===> <Buffer 25 50 44 46 2d 31 2e 37 0d 25 e2 e3 cf d3 0d 0a 32 34 37 20 30 20 6f 62 6a 0d 3c 3c 2f 4c 69 6e 65 61 72 69 7a 65 64 20 31 2f 4c 20 31 36 35 30 36 38 … 1650638 more bytes>
ext ===> pdf
Has anyone ran into issues utilizing buffers in node on AWS Lambda.
Thank you for your help, I added the runWithCleanup, we also switched from utilizing the buffer to writing temp files and it appears to be working now.
Previously the issue was not file specific. Since it started working after the aforementioned changes I did not attempt to run the ConvertTest sample.