I love it. But instead of "document.pdf" as the file name on download, what if you changed it to "[pdf title].pdf"? Several downloads in a row gets confusing
Were you letting users download it via PDF.js before which is why it was document.pdf? It makes sense to download it via PDF.js since the file is actually already loaded once the user renders it.
Oh, that might actually be it. The 'download file' button in the pdf.js menu is a different button from the button at the bottom/right hand side of the page (with different code behind it - the pdf.js 'download' button comes stock with pdf.js). I haven't really tested its behaviour much, but it's quite possible that it's calling things document.pdf.
Perhaps I should just remove the pdf.js 'download' button, seeing as there's one elsewhere in the UI anyway.