awesome-unoconv
Node.js wrapper for converting Office files to PDF or HTML
Setup
Requirement
Unoconv is required, which requires LibreOffice (or OpenOffice).
Note that: The latest versions of LibreOffice have a completely different folder structure, so unoconv does not find its dependencies. Tested with LibreOffice
version 4.2.5.
$ brew install unoconv
Or pull Docker image unoconv.
Installation
$ npm install awesome-unoconv
Usage
Convert document to pdf directly.
const path = ;const unoconv = ; const sourceFilePath = path;const outputFilePath = path; unoconv ;
Convert document to pdf or html with options.
const path = ;const unoconv = ; const sourceFilePath = path;const outputFilePath = path; // or 'myDoc.html' unoconv // or format: 'html' ;
Convert document to Buffer.
const fs = ;const path = ;const unoconv = ; const sourceFilePath = path;const outputFilePath = path; // or 'myDoc.html' unoconv // or format: 'html' ;
Test
There is a test case inside test folder.