Solved

SHOW PDF FILE AT WINDOWS FORM

Posted on 2011-02-13
16
654 Views
Last Modified: 2012-05-11
Hi All,

I want to show pdf file at windows form.

How could I do it ?

Thank you.

0
Comment
Question by:emi_sastra
  • 8
  • 4
  • 4
16 Comments
 

Expert Comment

by:botweb
ID: 34882558
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
 
LVL 1

Author Comment

by:emi_sastra
ID: 34882583
Hi botweb,

Where acxWebBrowser is came from ?

Thank you.
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 34882619
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Expert Comment

by:botweb
ID: 34882673
Here you can get around using the Webbrowser in VB:
http://www.instructables.com/id/Make-a-web-browser-in-visual-basic/
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 34882738
I can't see how to show pdf file ?

Thank you.
0
 

Expert Comment

by:botweb
ID: 34882754
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
 
LVL 1

Author Comment

by:emi_sastra
ID: 34882786
How to code it ?

My code and your code failed to do so ?

Thank you.
0
 

Expert Comment

by:botweb
ID: 34882811
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
 
LVL 1

Author Comment

by:emi_sastra
ID: 34882863
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
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34883869
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 34887083
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 34887189
What do you think ?

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

Thank you.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34887221
If that single library suits you, what are you still looking for?
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 34887250
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
 
LVL 1

Author Comment

by:emi_sastra
ID: 34887260
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
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34887699
Glad to help :-)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question