I am trying to implement the QuickPDF on our web server to allow users to 'Decrypt' password'd files on demand. If I run the code on my local machine, it unlocks the PDF library, and works correctly. When I run the code after deployment to the Webserver running on Server2012R2, it fails on the UnlockKey portion of the code.
We own version 11.12, and that version was failing. So I tried downloading the newest version to see if it would work with version 15.11, but had the same exact results, ie, local version works fine, but it fails when deployed to the webserver.
I modified the code a bit to match their article on the MVC version of the code, so here is the relevant code segments:
string DLLprefix = "DebenuPDFLibraryDLL"; string DLL64prefix = "DebenuPDFLibrary64DLL"; string dllName; // Check to see if IntPtr size is 4. If 4 then it's 32-bit, if 8 then it is 64-bit. if (IntPtr.Size == 4) { dllName = DLLprefix + DPLVer.ToString("D4") + ".DLL"; // 32 bits } else { dllName = DLL64prefix + DPLVer.ToString("D4") + ".DLL"; // 64 bits } // Load the library from the Lib folder DPL = new PDFLibrary(Server.MapPath("~/bin/" + dllName)); // Check to see if library loaded successfully, LibraryVersion can be called before UnlockKey function is used
if (DPL.LibraryVersion() != "") { // LibraryVersion has returned a result so lets display it on our web page string LibVer = DPL.LibraryVersion(); Output.LibraryVersion = LibVer; } else { // If this is returned then the library was not successfully initialized. Output.LibraryVersion = "version not found"; } if (DPL.UnlockKey(QuickPDF_LicenseKey) != 0) { } else { // If this is returned one of the following // things has happened: // 1. The library was not successfully initialized. // 2. The license key is not valid (either it is an // expired trial license key or it is a license key // for an older version of the library. logger.Info("Debenu Quick PDF Library could not be unlocked."); Output.DllUnlocked = "Debenu Quick PDF Library could not be unlocked."; }
|