Thank you all for your suggestions!
@codeanpeace pointed to an interesting thread about a similar case and general handling of downloads.
I’ll try @evadne suggested solution in that thread and see if I have better results than rendering to a link with target=“_blank”.
Thanks @BartOtten, I’m using the version of send_download
where the file is not stored : send_download(conn, {:binary, contents}, filename: "Filename.pdf")