views:

14

answers:

0

hello,

i have an asp.net site and from one of the web pages i need to generate a pdf document that contains the output of a set of web pages that the user selects. i call it "batch pdf". basically, the user is asked to choose which web pages she needs to put into the pdf and then clicks a button which creates a pdf with all the selected web pages in it.

so, to do that, i have a web page that is requested when the user clicks the button. i send the list of selected pages (their ids) to it via query string and on the server, for each web page id in the query string, it generates a http request to the localhost and gets the page's pdf from this request (i have Request.Filter that does conversion from html to pdf). then it combines all pdf streams into a single pdf and dumps it into the response stream. everything works.

but i would like to do it using ajax. currently when the user clicks the button, a new browser window opens and the user has to wait for the server to finish before she can see the page. i would like to instead send an ajax request and when pdf generation has completed, i would like to show the pdf. well, one way to do this is to write the pdf into a file on the server when ajax sends a request and then redirect to this file, but is there a way to avoid messing with files? for example, can i put the entire pdf into the session? any other ideas?

thanks! konstantin