I'm using PDFMakeWrapper Server/side and nodemailer but when I generate a PDF is ok the problem is with the second one, it's generated but have like a cache or a copy of the last one pdf created, and go and go till I reset the server
here my code:
const printer = new Pdfmake({
Roboto: {
normal: __dirname + '/fonts/Roboto/Roboto-Regular.ttf',
bold: __dirname + '/fonts/Roboto/Roboto-Medium.ttf',
italics: __dirname + '/fonts/Roboto/Roboto-Italic.ttf',
bolditalics: __dirname + '/fonts/Roboto/Roboto-MediumItalic.ttf'
}
});
const doc = new DocumentDefinition();
async function FAL005(orden, Lote, materiales, lotes, cantidades){
const hoy = moment().format('DD/MM/yyyy');
doc.pageOrientation('landscape');
vigente');
doc.add(
new Txt('Si usted esta consultando una versión de este documento, Asegúrese que sea la vigente').alignment('right').fontSize(8).end
)
const pdf = printer.createPdfKitDocument(doc.getDefinition());
let buffers = [];
pdf.on('data', buffers.push.bind(buffers));
pdf.on('end', () => {
let pdfData = Buffer.concat(buffers);
});
HERE NODEMAILER
pdf.end();