NULL Reference Exception when creating IacDocument

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
EmbTrak
Posts: 2
Joined: Mon Mar 05 2007

NULL Reference Exception when creating IacDocument

Post by EmbTrak »

I need to open a PDF document and paint it to my own Graphics object.

The first step in that appears to be creating a IacDocument.


IacDocument * aiDoc;

aiDoc = new IacDocument(NULL);

That 2nd line yields a Null Reference Exception. What's going on that I can't even get to square one?

Thanks.

Daniel Wilson
EmbTrak
Posts: 2
Joined: Mon Mar 05 2007

Still getting NULL Reference

Post by EmbTrak »

I'm back to PDFCreator after experimenting elsewhere ... trying again.

According to the VS Object Browser, a new IacDocument wants a System.Windows.Forms.ScrollableControl as an argument to the constructor. So I have put a Panel named panel1 on my form. System.Windows.Forms.Panel inherits from System.Windows.Forms.ScrollableControl, so this should be good:


IacDocument * aiDoc;
aiDoc = new IacDocument(panel1);

I still get the NULL Reference Exception.

What am I doing wrong?

thanks.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

The declaration of the the document object is as follows:

IacDocument document = new IacDocument( null )

However you need to initialize the library and activate it first by calling:

// initialize the library and set our license key
acPDFCreatorLib.Initialize();
acPDFCreatorLib.SetLicenseKey(licensee, activationCode);

Hope this helps.
Post Reply