doc2pdf

1.0.2 • Public • Published

doc2pdf

Convert DOC to PDF.

Install

$ apt-get install unoconv -y
$ npm i doc2pdf -S

Usage

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); // <Buffer>
});
 
// create pdf from file
doc2pdf('./file.docx').then((pdf) => {
  console.log(pdf); // <Buffer>
});

License

MIT.

/doc2pdf/

    Package Sidebar

    Install

    npm i doc2pdf

    Weekly Downloads

    226

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    15.8 kB

    Total Files

    7

    Last publish

    Collaborators

    • bifot