area28
area28

Reputation: 1425

QuickPDF Instance Creation not working

I am unable to create an instance using PDFLibrary in C#.

The dll lives at c:/the project directory/lib/DebenuPDFLibraryDLL1016.dll

I generate the path and also tried hard coding it.

var dllPath = AppDomain.CurrentDomain.BaseDirectory + "Lib\\DebenuPDFLibraryDLL1016.dll";

This method assumes SysWOW or System32 dirs.

PDFLibrary QP = new PDFLibrary("DebenuPDFLibraryDLL1016.dll");

Also attempted with this:

PDFLibrary QP = new PDFLibrary(dllPath);

I've included the import file: DebenuPDFLibraryDLL1016.cs Inside the constructor, dll.dllHandle is always 0. The object is never instantiated. This is the part inside the DebenuPDFLibraryDLL1016.cs file that creates the dll instance.

    public PDFLibrary(string dllFileName)
    {
        dll = new DLL(dllFileName);
        if (dll.dllHandle != IntPtr.Zero)
        {
            instanceID = dll.DebenuPDFLibraryCreateLibrary();
            dll.RegisterForShutdown(instanceID);
        }
        else
        {
            dll = null;
        }
    }

Does anyone know why this would happen aside from having the wrong location of the dll? I have uninstalled / reinstalled the quick pdf data a few times.

Based on their documentation it should live in the SysWOW or System32 folders based on your application needs.

I think the issue is the dll and the server has the site set to the incorrect application type. I will try to change that next.

Upvotes: 1

Views: 325

Answers (1)

area28
area28

Reputation: 1425

Let me include my comment here as it seems I'm being told I didn't read the docs.

I've read the documentation and posted in their forum.

I fixed the issue. It is because the server didn't have the application setup to use the DLL I was trying to use. It's a 32 bit DLL and the server is 64 bit. I wasn't informed of this until a few minutes ago. Once I changed the reference for the DLL to the 64 bit version, it worked.

Upvotes: 2

Related Questions