Yes i allready returns the generated pdf as you descriped. that works fine.
But what i'd like to do is to show an loading indicator to the user als long it takes to generate the pdf.
Do you understand? So i thought i create a button, that triggers a js method that handles the download.
So, my only problem is the js part..