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.
$ npm i @tadashi/doc2pdf
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 })Important
Buy me a coffee!
BTC: bc1q7famhuj5f25n6qvlm3sssnymk2qpxrfwpyq7g4
MIT © Thiago Lagden