Hi!
I've looked through the docs and simply can't seem to find a configuration option/parameter, where I can state the filename of the pdf-file that is being generated. I simply want to dynamically change
I guess this might not be possible as the filename is hardcoded as far as I can see:
d.prototype.download=function(a){a=a||"file.pdf" and so on.
Thanks in advance,
Chris
it's not hardcoded, as you can see the download function takes a parameter with the file name
so you can call download('myFileName.pdf') as described in Getting Started :)
I hope this helps
Hi bpampuch!
I don't know how I could've missed that, thanks! closing this one.
is it possible to give a custom default name to the pdf while the user opens the document in a new tab with the
pdfMake.createPdf(docDefinition).open() method and then uses the save as option?
@erdemlal Yes. I hope it. now it is random Hexadecimal name.
@bpampuch is it impossible?
I thought I should do like .open('hoge.pdf');
but error...
TypeError: Cannot create property 'autoPrint' on string 'hoge.pdf'
.open({defaultFileName: 'hoge.pdf'});
it didn't error but not changed file name
Most helpful comment
is it possible to give a custom default name to the pdf while the user opens the document in a new tab with the
pdfMake.createPdf(docDefinition).open() method and then uses the save as option?