Missing extension for downloaded PDF when adding name to the file in Firefox
I am using the PDFMake stable version 0.1.54. In the Firefox, when I add the name of the file in download call pdfMake.createPdf(docDefinition).download("MyFile"), file is saved with the missing extension. So it saves as .File. Further we can open the file in any PDF viewer. But the downloaded file has no extension. But when we remove the file name in the download call, the file get downloaded with .pdf extension. This happens in firefox only, For chrome and edge, it is working fine.
var docDefinition = {
content: [
'First paragraph',
'Another paragraph, this time a little bit longer to make sure, this line will be divided into at least two lines'
]
};
pdfMake.createPdf(docDefinition).download("MyFile");
In Firefox, the file get downloaded with missing extension. But when we remove the file name, like this:
pdfMake.createPdf(docDefinition).download();
it works fine. What is the cause? Thanks in advance.
see documentation, first parametr is file name and is optional. If file name is not entered is used default value file.pdf.
File name is of course including extension - MyFile.pdf. Enter only MyFile is wrongly.