Solved

PDF display

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

696 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