SHOW PDF FILE AT WINDOWS FORM

Hi All,

I want to show pdf file at windows form.

How could I do it ?

Thank you.

LVL 1
emi_sastraAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
botwebCommented:
The easy way:

Try WebBrowser control.

Let us say you put an unbound object frame to a form. Then in the form module the following code will populate the control.

 
Me.acxWebBrowser.Object.Navigate <path to pdf file>

Open in new window

0
 
emi_sastraAuthor Commented:
Hi botweb,

Where acxWebBrowser is came from ?

Thank you.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
emi_sastraAuthor Commented:
There is no object property for WebBrowser.

  Me.WebBrowser1.ObjectForScripting.Navigate(sender.tag)

Runtime error : Object variable or With block variable not set.

Thank you.
0
 
botwebCommented:
Here you can get around using the Webbrowser in VB:
http://www.instructables.com/id/Make-a-web-browser-in-visual-basic/
0
 
emi_sastraAuthor Commented:
I can't see how to show pdf file ?

Thank you.
0
 
botwebCommented:
Oh, you simple let the Browser view a PDF file. Like the Browser is doing when you adress to a PDF file.
So just adress the Browser component to a PDF file like file://C:\File.pdf
0
 
emi_sastraAuthor Commented:
How to code it ?

My code and your code failed to do so ?

Thank you.
0
 
botwebCommented:
Simply follow here http://www.instructables.com/id/Make-a-web-browser-in-visual-basic/ to get to know the Webbrowser component and how to use it.
0
 
emi_sastraAuthor Commented:
Please see below code.

     AddHandler btn.MouseClick, AddressOf Show_Pdf_File_With_Web_Browser

 Private Sub Show_Pdf_File_With_Web_Browser(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Try
            'Dim WebBrowser1 As New WebBrowser
            WebBrowser1.Navigate(sender.tag)
        Catch ex As Exception
        End Try

    End Sub

It works for the first sender but not others sender.

Thank you.
0
 
CodeCruiserCommented:
0
 
emi_sastraAuthor Commented:
What do you think ?

I should add about 7 dll, compare to a singe Acrobat Library without installing acrobat reader ?

Thank you.
0
 
CodeCruiserCommented:
If that single library suits you, what are you still looking for?
0
 
emi_sastraAuthor Commented:
Just curious about it, since someone here introduce it and I am a learning guy.

I was wrong, should install adobe reader in order to use it.

Thank you.
0
 
emi_sastraAuthor Commented:
I think I will close this question.

Your link http://www.codeproject.com/KB/applications/PDFViewerControl.aspx could help me learn it.

Thank you very much for your help.
0
 
CodeCruiserCommented:
Glad to help :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.