0.2.1 • Published 2 years ago

dwk-pdf v0.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

DWKPdf

Generate PDF files from Docx or HTML. (bundle of: ejs, mammoth, wkhtmltopdf)

For work install wkhtmltopdf (in fedora dnf install wkhtmltopdf)

Example:

// Import
const { DWKPdf } = require('dwk-pdf'); // CommonJS
import { DWKPdf } from "dwk-pdf"; // ESM
// Create a new DWKPdf instance
const pdf = new DWKPdf(`<p><%= name %></p>`); // from html
const pdf = DWKPdf.fromDocx(docxBuffer, {}, {}); // from docx
const pdfStream = await pdf.render({
    name: "My name",
});

await pdfStream.pipe(fs.createWriteStream("test.pdf"));
0.2.1

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago