Home:ALL Converter>C# download pdf from ajax driven url

C# download pdf from ajax driven url

Ask Time:2015-02-11T06:55:27         Author:drobison

Json Formatter

In a C# application I would like to open a url and download a pdf.

When this url is hit from the browser the page quickly loads and begins what I believe are ajax calls. After several seconds the browser download prompt appears with the pdf file.

I have attempted to open this url via WebClient. The stream I return is not the pdf file and is is the actual html of the page.

How can I detect the the pdf file has loaded and download it?

Author:drobison,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/28443481/c-sharp-download-pdf-from-ajax-driven-url
yy