Print Page | Close Window

Problem with UnlockKey on the Web server

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3563
Printed Date: 25 Apr 24 at 1:51PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Problem with UnlockKey on the Web server
Posted By: pmillsaps
Subject: Problem with UnlockKey on the Web server
Date Posted: 15 May 18 at 3:51PM
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.";
            }



Replies:
Posted By: pmillsaps
Date Posted: 15 May 18 at 4:00PM
Of course I solved it right after I submitted the question.  I had to 'Enable 32-Bit Applications' on the AppPool, and that seemed to fix it right up.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk