<p>Can anyone provide and example of downloading a PDF file using Watin?  I tried the SaveAsDialogHandler but I couldn't figure it out.  Perhaps a MemoryStream could be used?</p>

<p>Thanks,</p>

<p>--jb</p>

This code will do the trick. The UsedialogOnce class can be found in the WatiN.UnitTests code and will be part of the WatiN 1.3 release (which will probably be released tonigh 14 october).
FileDownloadHandler fileDownloadHandler = new FileDownloadHandler(file.FullName);
using (new UseDialogOnce(ie.DialogWatcher, fileDownloadHandler))
{
    ie.Button("exportPdfButtonId").ClickNoWait();
```
```
fileDownloadHandler.WaitUntilFileDownloadDialogIsHandled(30);
fileDownloadHandler.WaitUntilDownloadCompleted(200);
```
```
}
HTH,
Jeroen van Menen
Lead developer WatiN