I been working on this project for now more than 2 weeks and have come to a dead end, so I hope someone can give me few more ideas.

Here is what I am trying to do in brief:

1. Navigate to a secure 3rd party page,
2. Log-in into the secure site
3. Once log in, fill out another form that yields a viewable PDF
4. Save the PDF file to disk.

All looks pretty straight forward and simple and I have completed step 1-3 in few minutes, except there are couple restrictions on the website that are making step 4 really difficult.

- the PDF is generated with a AJAX call and it can only be viewed one time

In another words, the AJAX call provides a temp PDF URL and serves it to the browser, and that temp URL is useless there after.

Here is what I have tried:

1. using Forms.WebBrowser
-can't redirect save the PDF
- even if getting the ActiveX instance and calling ExecWB, the end user still has to complete the saving process, see code below

SHDocVw.WebBrowser web = (SHDocVw.WebBrowser)wb.ActiveXInstance;
web.ExecWB(SHDocVw.OLECMDID.OLECMDID_SAVEAS, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, ref input, ref output);

2. using Firefox embedded browser object with Gecko engine

- again the steps 1-3 were easy, however saving the PDF yields in a blank document

3. using WebKit (Chrome engine) wrapper
- saving the PDF was not option, but grabbing it from the Browser Cache was and it works well sometime. For whatever reason the PDF does not always get cached.

4. Using WebRequest class
- not able to get step 3 because webpage requires client scripting

5. Using Adobe Reader dlls
- I was unable to redirect the browser output to the axReader.


I am curious if anyone has gotten any WebBrowser class, and redirect it 3rd output to IO.