Solved

PDF display

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

Independent Software Vendors: 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!

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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!
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

688 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