NodeJS file converter using LibreOffice or OpenOffice software under the hood.
- Convert PDF, Office and many other file types (supported file formats)
- Generate file thumbnails
- Callback and promise support
- Output to file or buffer
npm install --save node-convert
// or
yarn add node-convert
await office.convert('./test.doc', './test.pdf');
function callback() {
console.log('Done!');
}
office.convert('./test.doc', './test.pdf', callback);
const buffer = await convert('./test.doc');
Thumbnails can be generated by converting a file to an image format like JPEG or PNG.
await convert('./test.doc', './test.jpg');
await convert('./marketing.pdf', './marketing.jpg');
import convert from 'node-convert';
await convert('./test.doc', './test.pdf');
import { convert, listen } from 'node-convert';
await convert('./test.doc', './test.pdf');
const convert = require('node-convert');
function cb() {
console.log('Conversion complete');
}
convert('./test.doc', './test.pdf', cb);