Node.js Tutorial to Convert Word DOCX to PDF Document Using word2pdf Library Full Project For Beginners

 

 

npm i word2pdf

 

 

yarn add word2pdf

 

 

 

Example

 

 

index.js

 

 

const word2pdf = require('word2pdf');
const fs = require('fs');

const convert = async () => {
	const data = await word2pdf('test.docx')
	fs.writeFileSync('test.pdf', data);
}

Leave a Reply