I am generating pdf with following code, and send it to browser, when i click pdfviewer download button, filename shows like "c89d9d51-9bfa-4955-84d1-ac6e330e5875.pdf", how can i change it?

createPdf(function(req,res){
var pdfDoc = printer.createPdfKitDocument(docDefinition);
//pdfDoc.pipe(fs.createWriteStream('./output.pdf'));
var chunks = [];
var result;pdfDoc.on('data', function(chunk) {
chunks.push(chunk);
});
pdfDoc.on('end', function() {
result = Buffer.concat(chunks);
callback(result);});
pdfDoc.end();
});
From docs (http://pdfmake.org/#/gettingstarted) to specify a custom name of PDF file you want to download, you may to achieve this:
// download the PDF (temporarily Chrome-only)
pdfMake.createPdf(docDefinition).download('optionalName.pdf');
Aswered.
How about open()?
and open()?
Most helpful comment
From docs (http://pdfmake.org/#/gettingstarted) to specify a custom name of PDF file you want to download, you may to achieve this: