carboneio / carbone

Fast and simple report generator, from JSON to pdf, xslx, docx, odt...
https://carbone.io
Other
1.31k stars 194 forks source link

[Bug Report]: Convert Docx to PDF becomes unresponsive #193

Open ViniciusContini opened 1 year ago

ViniciusContini commented 1 year ago

Environment Carbone Version: 3.5.5 Node Version: 18.16.0 Browsers: N/A Desktop OS: Elementary OS 7 (based on Ubuntu 22.04 LTS) Other: LibreOffice: 7.5.5

Expected Behaviour I expect the carbone library's convert function to operate consistently in both simple javascript project and serverless environments, ensuring successful DOCX to PDF conversions.

Actual Behaviour Currently, when I run the conversion within the serverless project, the process becomes unresponsive, preventing the successful completion of the conversion. This behavior is not observed in the simple javascript project.

Steps to reproduce Steps to reproduce the bug:

  1. Set up a serverless project.
  2. Integrate the carbone library and invoke the convert function on a DOCX file.
  3. Observe that the conversion process becomes unresponsive or hangs.

Code example

const fileBuffer = readFileSync(docxPath);

const options = {
    convertTo: "pdf",
    extension: "docx",
  };

carbone.convert(fileBuffer, options, async function (err, result) {
     if (err) {
          console.log(err);
     }
     await writeFile("./report.pdf", result);
          process.exit();
});
maniac-on-moon commented 9 months ago

Please try to install apt install libnss3 and give a hint if it works. (so did for me, for LO 7.6.4.1).