Discussion:
View PDF Files in my windows form application
(too old to reply)
Staling Rivas
2005-05-30 22:33:48 UTC
Permalink
hello Group,

I'm a windows application and i need to view a pdf file inside my window.
I'm using an activex but this activex give me an error when load the second
pdf file...

If any body knows how do that please talk me.

Thanks.
Chris Mayers
2005-05-31 08:24:28 UTC
Permalink
What ActiveX control are you using, and what was the error that you got?

-I assume from what you said that the first PDF file opened successfully?
Maybe you need to close the first one or do some re-initialising before you
open the second??

Chris.
Post by Staling Rivas
hello Group,
I'm a windows application and i need to view a pdf file inside my window.
I'm using an activex but this activex give me an error when load the second
pdf file...
If any body knows how do that please talk me.
Thanks.
Peter D. Dunlap
2005-05-31 17:04:37 UTC
Permalink
On Tue, 31 May 2005 09:24:28 +0100, "Chris Mayers"
Post by Chris Mayers
What ActiveX control are you using, and what was the error that you got?
-I assume from what you said that the first PDF file opened successfully?
Maybe you need to close the first one or do some re-initialising before you
open the second??
Chris.
Or a new instance of the ActiveX object for each file?
Thomas Wenning
2005-06-14 14:14:31 UTC
Permalink
Post by Staling Rivas
hello Group,
I'm a windows application and i need to view a pdf file inside my window.
I'm using an activex but this activex give me an error when load the second
pdf file...
If any body knows how do that please talk me.
Thanks.
Hi,

try this:
Steps to create the C# version
1. Create a windows form application by using VS

2. Make the Acrobat control available in the toolbox of VS
Tools->Add/Remove Toolbox Items: turn on "Adobe Acrobat 7.0 Browser
Document" in COM Components tab. You will see it in the Toolbox's General
tab.

3. Drag this control to the form. you get:
private AxAcroPDFLib.AxAcroPDF axAcroPDF1;

4. Load a pdf file and make it show up.
axAcroPDF1.LoadFile("mypdf.pdf");
axAcroPDF1.Show();
5. Compile and run, you will see the document showing up inside of the
control.

Here is the code piece.
public class Form1 : System.Windows.Forms.Form
{
private AxAcroPDFLib.AxAcroPDF axAcroPDF1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

axAcroPDF1.LoadFile("mypdf.pdf");
axAcroPDF1.Show();
}

... ... ... here is the code generated by VS.

[Reply][Email][View Thread][Get Link]
ramkumar
2010-03-16 06:10:21 UTC
Permalink
Thanks a lot for your valuable answer, because i am new in c# and i was searching a code to read a pdf file in my application .So I got the best answer from you so thanks a lot once again..

From http://www.developmentnow.com/g/30_2005_5_0_0_532399/View-PDF-Files-in-my-windows-form-application.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com/g/

Loading...