I'm writing a simple asp.net that will the user to download an object list as a PDF-document. When clicking the button "get pdf" the client browser should ask the user where they wish to save the file. And that's it. Pretty straight forward.
I've found several guides explaining how to generate a PDF from a datatable, but all of these seem to require you to save the pdf to some sort of temp file, storing it locally in the process.
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream("c://sample.pdf", FileMode.Create));
Is this really necessary to save the file locally and then pass it on the user, who can then choose to save the file again? Am I miss something here? Is there any way to generate the PDF on the file and then pass it on to the client browser?
EDIT:
To specify, what I'm talking about here is probably to send a stream directly to the client browser, the file being generated on the fly completely. No local storage until the user gets the "do you want to download this file" prompt.