issue with using LoadFromStream method

  • I am trying to use the LoadFromStream method to view a PDF from a website url.
    I get the stream object using the following code and then call the LoadFromstream method. I don't get any errors but i don't see the PDF either. The PDF does exist and i can view it in IE.

    Any suggestions?

    Uri myUri = new Uri("http://localhost/a.pdf");
    WebRequest myWebRequest = WebRequest.Create(myUri);
    WebResponse myWebResponse = myWebRequest.GetResponse();
    Stream s = myWebResponse.GetResponseStream();
    pdfViewer1.LoadFromStream(myWebResponse.GetResponseStream());

  • are you suggesting that i first save it to a TEMP file on the client machine and then use the LoadFromFile method? That may not work since we may not have access to storing data on client machines and that could pose a security risk. Can u pls explain how the LoadFromStream works? What do i need to pass to LoadFromStream.
    Any other suggestions. Is there a possibility to include a LoadFromUrl method in the near future?