Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 415887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:25:32+00:00 2026-05-12T18:25:32+00:00

I have a webbrowser object on a winform that I would like to use

  • 0

I have a webbrowser object on a winform that I would like to use to display a pdf.
The pdf resides on a ftp server. I have been able to show the pdf by downloading it
to the disk and pointing the webbrowser object to it (navigate), but I want to stream
it for security reasons. Has anyone been able to stream a pdf to a webbrowser that is located on a .Net winform?

    Dim URI As String = host & targetFilename
    Dim ftp As System.Net.FtpWebRequest = CType(FtpWebRequest.Create(URI), FtpWebRequest)

    ftp.Credentials = New System.Net.NetworkCredential(userName, passWord)
    ftp.KeepAlive = False
    ftp.UseBinary = True
    ftp.Method = System.Net.WebRequestMethods.Ftp.DownloadFile

    Using webResp As System.Net.FtpWebResponse = DirectCast(ftp.GetResponse(), System.Net.FtpWebResponse)
        Using respStream As Stream = webResp.GetResponseStream
            If GetFileExtension(targetFilename) = "PDF" Then
                WebBrowser1.DocumentStream = respStream
                Application.DoEvents()
            End If

            respStream.Close()
        End Using
    End Using
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:25:32+00:00Added an answer on May 12, 2026 at 6:25 pm

    Since you’re already using the WebBrowser control; why not have it point to a local html file that includes an embed tag:

    <embed src="ftp://ftpserver/yourpdf.pdf" />
    

    I haven’t tested it, but the pdf should be served within the context of the control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a windows application that contains an ActiveX WebBrowser control. As part of
I have an .Net Froms application that displays web pages through a WebBrowser control.
Here's the issue: I have a hook in IE that reacts on WebBrowser.OnNavigateComplete2 event
Hey, I have been trying to switch my code from using an ie object
I have a Windows Forms application in C#/Visual Studio 2008 with an IE WebBrowser
Have you ever seen any of there error messages? -- SQL Server 2000 Could
I have the following code that, weirdly, works for a couple of seconds and
I have a HTML page that contains a flash file and some a JavaScript
I need to have a working web browser in a fullscreen Direct3D application. For
Have just started using Google Chrome , and noticed in parts of our site,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.