PDFResult download - set the filename

Hello,
Before raising a feature request i wanted to check if it was possible to set a default filename for a PDFResult download? The API docs don’t show a output_filename or similar parameter.
Thanks

Hi Niko,

This is currently not possible. Therefore, I will add this post to the feature request category.

As a workaround you could change the setting of your browser to ‘ask where to save each file before downloading’ (chrome://settings/downloads, there is a similar checkbox in Firefox). This will allow you to change the filename.

Regards,

Raoul

Hello Raoul, I have my browser set to do this but think it would be good feature to be able to set by code. Thanks

Hi Ian,

I would likt to mention that a workaround can be to implement a VIKTOR DownloadButton to download the PDF. This would allow you to set a custom filename.
Only drawback is that the pdf needs to be recreated in memory, so i long does it take the pdf to be created?

I’ll keep that in mind, the pdf doesn’t take long to generate in this case but that could change so not reloading would be preferable.