C# & pdfcreactivex

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
Jonathan

C# & pdfcreactivex

Post by Jonathan »

I am using Visual Studio .NET...building a Windows Forms client in C#. I will be using PDF extensively and have had no luck with the Acrobat SDK. As such, I downloaded the eval version of your program to see if it works. I created a test client in C#...dropped the control on a Windows Form and let the IDE do the work. When I invoke the Open method an exception occurs stating "System.NullReferenceException occurred in axinterop.acpdfcreactivex.dll...Object reference not set to an instance of an object." When I debug the app, it seems that object is being created.

Here's the line of code that instantiates the object:

private AxACPDFCREACTIVEX.AxPDFCreactiveX PDFCtrl;
...
...
this.PDFCtrl = new AxACPDFCREACTIVEX.AxPDFCreactiveX();

This is the line of code that throws the exception:

this.PDFCtrl.Open("d:\\temp\\test.pdf","");

I would appreciate it if you could help me out. Thanks in advance!
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

Below is slightly modified version of your code that I can successfully use to preview a PDF document. You will notice that I have removed the "this.PDFCtrl = new AxACPDFCREACTIVEX.AxPDFCreactiveX();"

private AxACPDFCREACTIVEX.AxPDFCreactiveX axPDFCreactiveX1;
private void cmdOpenFile_Click(object sender, System.EventArgs e)
{
try
{
axPDFCreactiveX1.OpenEx ("c:\\test.pdf","");
axPDFCreactiveX1.Show();
}
catch(Exception ev)
{
MessageBox.Show(ev.Message);
}
}

Thanks
Post Reply