Solved

PDF display

Posted on 2004-08-26
3
190 Views
Last Modified: 2010-04-15
hello I have to display a pdf file in my c# application (Windows.Form ).
I know we can use some acrobat control but no idea on it.
Can anybody give me a sample program on it.
Once again I just want to display a PDF file on windows forms and it will be used in a commercial product.

Thanks
0
Comment
Question by:uttam80
3 Comments
 

Accepted Solution

by:
_dataking_ earned 50 total points
ID: 11957105
In visual studio 2003 .net you can do the following assuming you have the adobe pdf reader installed

1) open the form or user control in which the pdf control should appear in the gui designer
2) in the toolbox pane right click and select add/remove items
3) select COM components from the customize toolbox menu2
4) select and insert the "Adobe Acrobat Control for ActiveX" by double clicking it and clicking ok
5) drag it into your form or control in the designer
6) assuming the pdf control has the name axPdf1 (the default name) use the following code to load and display a pdf document (change the filename appropriately), the code shown loads the file when the containing form is shown the first time using the load event.

private void Form1_Load(object sender, System.EventArgs e)
 {
            axPdf1.LoadFile(@"c:\test.pdf");
}

Hope this works for you too!

PS: you can also easily start the pdf application (if installed) externally by executing
System.Diagnostics.Process.Start(@"c:\test.pdf");
0
 

Author Comment

by:uttam80
ID: 11970766
Hello I did not had visual studio 2003 but still I found a way
thanks.
0
 
LVL 2

Expert Comment

by:phunchak
ID: 13919073
This works way easier....nice tip!

System.Diagnostics.Process.Start(@"c:\test.pdf");
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

16 Experts available now in Live!

Get 1:1 Help Now