Solved

SHOW PDF FILE AT WINDOWS FORM

Posted on 2011-02-13
16
657 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

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…
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 …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

635 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