Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

How to run C# sample

Question

When I try to build the C# sample I get a compile error: "the type or namespace PDFLibrary could not be found.

When I try to add a reference to QuickPDFDLL0723.dll in the project I get and error saying not accessible or not a valid assembly or com componenet.

How do I get the C# sample to compile?

VS 2008

Answer

Can you let us know what sample you are trying to compile ?

Adding the library as a reference does not work as the DLL is not a .NET DLL.

What is needed is:

  1. Make sure the QuickPDFDLL0723.cs is a file in your current project. In your solution, window, right click and choose "Add" then "Existing Item" and select the file. This file can be found in <Quick PDF Install Dir>\DLL\Import\CSharp directory.

  2. Make sure the using QuickPDFDLL0723; is at the top of you code.

  3. He is an example of the my form1.cs file which will give you some more ideas of how the code can be structured. This code assumes the the DLL is located in the current PATH somewhere. eg current directory or in C:\WINDOWS\SYSTEM32 (32bit) or C:\WINDOWS\SysWOW64 (64bit)

NOTE: Also make sure your Target Platform is set to x86. Go to Project, Properties and then choose the Build tab. Check that the Target Platform is set to 'x86' and it NOT set to 'Any CPU'.

 using QuickPDFDLL0723;

 namespace QuickPDFTest
 {
      public partial class Form1 : Form
      {
           PDFLibrary QP = new PDFLibrary("QuickPDFDLL0723.dll");
           public Form1()
           {
                InitializeComponent();

                if (QP.UnlockKey("insert your key here") == 0)
                    MessageBox.Show("QP.UnlockKey failed");
           }
      }
 }

© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum