How to convert excel to PDF using nodeJS? Getting issues using libreoffice-convert

73 Views Asked by At

I want feature of users being able to download pdf files of records in my database. I am using NodeJS as my backend. I currently have excel download which works fine but for pdf after searching a lot I settled on converting the excel to pdf and then allowing users to download. This works fine with libreoffice-convert but there are two drawbacks I need to fix and cannot find any solution to.

  1. The speed of converting to pdf using libreoffice-convert is slow. If I am calling API, the API runs for approx 5-10 sec and then the converted file gets downloaded.
  2. If the number of columns is more in excel then the PDF file has most columns in page 1 and then on page 2 it will have 1-2 columns.

How can I fix these issues? I really want to stick with converting the excel to PDF because if I use pdfkit or something else that lets me create PDF files by code then I get stuck with design issues or something else altogether.

0

There are 0 best solutions below