Pdfmake has an option to 'pipe' the generated doc directly to the client.
So, if you pass the response object to the code that generates the pdf, it will be something like:
var printer = new PdfPrinter(fonts);
//Assuming pdf is your generated PDF:
doc = printer.createPdfKitDocument(pdf);
res.setHeader('Content-type', 'application/pdf');
res.setHeader('Content-disposition', 'inline; filename="nice.pdf"');
doc.pipe(res);
doc.end();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…