Link to home
Start Free TrialLog in
Avatar of emi_sastra
emi_sastra

asked on

SHOW PDF FILE AT WINDOWS FORM

Hi All,

I want to show pdf file at windows form.

How could I do it ?

Thank you.

Avatar of botweb
botweb
Flag of Germany image

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

Avatar of emi_sastra
emi_sastra

ASKER

Hi botweb,

Where acxWebBrowser is came from ?

Thank you.
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.
Here you can get around using the Webbrowser in VB:
http://www.instructables.com/id/Make-a-web-browser-in-visual-basic/
I can't see how to show pdf file ?

Thank you.
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
How to code it ?

My code and your code failed to do so ?

Thank you.
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.
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.
Avatar of Nasir Razzaq
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What do you think ?

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

Thank you.
If that single library suits you, what are you still looking for?
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.
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.
Glad to help :-)