Solved

SHOW PDF FILE AT WINDOWS FORM

Posted on 2011-02-13
16
656 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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