Solved

PDF display

Posted on 2004-08-26
3
192 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 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