Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bifot/doc2pdf
Convert DOC to PDF.
https://github.com/bifot/doc2pdf
Last synced: about 2 months ago
JSON representation
Convert DOC to PDF.
- Host: GitHub
- URL: https://github.com/bifot/doc2pdf
- Owner: bifot
- License: mit
- Created: 2018-11-18T12:55:21.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-18T15:12:55.000Z (about 6 years ago)
- Last Synced: 2024-10-07T17:01:15.579Z (3 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# doc2pdf
Convert DOC to PDF.
## Install
```sh
$ apt-get install unoconv -y
$ npm i doc2pdf -S
```## Usage
```js
const path = require('path');
const fs = require('fs');
const doc2pdf = require('doc2pdf');// read buffer from .docx file
// sync operation is for demonstration only
// use async operation in production mode
const buffer = fs.readFileSync('./file.docx');// create pdf from buffer
doc2pdf(buffer).then((pdf) => {
console.log(pdf); //
});// create pdf from file
doc2pdf('./file.docx').then((pdf) => {
console.log(pdf); //
});
```## License
MIT.