Skip to content

lagden/doc2pdf

Repository files navigation

doc2pdf

NPM version Build Status Coverage Status


doc2pdf is a library that converts docx documents into pdf.
It uses the docxtemplater library and allows for the creation of document templates that can be generated with customized data. It depends on the LibreOffice executable being installed.

Install

$ npm i @tadashi/doc2pdf

Usage

import { doc2pdf } from '@tadashi/doc2pdf'

const inputFile = new URL('./helper/doc1.docx', import.meta.url)
const outputFile = new URL('./helper/doc1.pdf', import.meta.url)
const data = {
	firstName: 'Lucas',
	lastName: 'Tadashi',
	age: 12,
}

const file = await doc2pdf({ inputFile, outputFile, data })

Team

Lagden


Important

Buy me a coffee!
BTC: bc1q7famhuj5f25n6qvlm3sssnymk2qpxrfwpyq7g4

License

MIT © Thiago Lagden

About

doc2pdf is a library that converts docx documents into pdf

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors