• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 662
  • Last Modified:

SHOW PDF FILE AT WINDOWS FORM

Hi All,

I want to show pdf file at windows form.

How could I do it ?

Thank you.

0
emi_sastra
Asked:
emi_sastra
  • 8
  • 4
  • 4
1 Solution
 
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
 
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 8
  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now