Most of the npms didnt works for me but this one do the job:
npm i convert-multiple-files
convert.ts:
import { convertWordFiles } from 'convert-multiple-files'; const docToPdf = async (filePath: string, outputDir: string): Promise<string> => await convertWordFiles(filePath, 'pdf', outputDir); export { docToPdf };
const outputFile = await docToPdf('file.docx', './outFolder');
Top comments (1)
The only one that worked for me, thank youuuu :)