Solved

SHOW PDF FILE AT WINDOWS FORM

Posted on 2011-02-13
16
651 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
 

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now