finding a way to convert a nodebuffer docx to pdf

168 Views Asked by At

I am trying to convert my generated docx document to pdf using docx to pdf package https://www.npmjs.com/package/docx-pdf and I keep getting a Process exited with code 2 error. My docx document was generated using docxtemplater

const contentBuffer = doc.getZip().generate({ type: "nodebuffer" });

How do I convert my document: contentBuffer to pdf, this is what I am trying rn

 let output;
  
  const PDF = docxConverter(contentBuffer, output, function(err,result){
    if(err){
      console.log(err);
    }
    console.log('result'+result);
  });

Is there any other way to achieve this without using this package or method?

0

There are 0 best solutions below