Print Page | Close Window

Cannot get QuickPDF library to work

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=2481
Printed Date: 05 May 25 at 8:37AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Cannot get QuickPDF library to work
Posted By: RandyJ
Subject: Cannot get QuickPDF library to work
Date Posted: 03 Jan 13 at 6:56PM
I am an employee for a company looking to license a PDF library for use in our product and I have been assigned the task of evaluating different libraries to determine which we want to use.

QuickPDF seems to be the best suit for our needs thanks to it having support for Device Context handles, which would allow us to add native printing to PDF with very little modification to our existing code. However, I have run into some issues with getting the actual library itself to run.

My development environment is Visual C++ 6 and I have tried both the Lib and DLL versions of the library to no avail.

With the Lib version, I successfully added the library and .h file to the project and wrote some test code around it, but the application crashes on this line

DEBENUPDFLIBRARYLIB0912_DllMain(GetModuleHandle(NULL), DLL_PROCESS_ATTACH, NULL);

I attempted to use the DLL version, but cannot even get the application to compile, using either the standard of MFC .h and .cpp files.

With the standard version, I get an error about precompiled headers, and after I added

#include "stdafx.h"

I began to get an error with this line

DebenuPDFLibraryDLL0912 QP("DebenuPDFLibraryDLL0912.dll");

where the CString cannot be cast to what the constructor expects.

With the MFC version, it will not even compile due to CStringW not being a known identifier.

Any input would be appreciated as to how to get this working.





Replies:
Posted By: Wheeley
Date Posted: 03 Jan 13 at 8:28PM
I would say look here for examples.

http://www.quickpdflibrary.com/help/getting-started.php

Hope it helps
Wheeley


Posted By: AndrewC
Date Posted: 05 Jan 13 at 10:35AM
Visual C++ v6 is getting very old and I suspect it doesn't fully support Unicode.  QPL and the CPP files are expecting the EXE to be compiled as a Unicode app which uses Unicode strings internally instead of 8 bit strings.

I am wondering if the following code works ?  Note the 'L' at the front of the string.

  DebenuPDFLibraryDLL0912 QP(L"DebenuPDFLibraryDLL0912.dll");

Another option is to try using the .h file from the 'DLL\Import\C' directory and then use the 'A' functions such as

  DPLUnlockKeyA
  DPLLoadFromFileA
  DPLRenderPageToFileA 

as these functions take 8bit strings (char *)

Andrew.


Posted By: RandyJ
Date Posted: 07 Jan 13 at 2:26PM
That fixes the error with the constructor, however the other functions are "undeclared identifiers". It is difficult to determine the correct way of getting this to work because the documentation is inconsistant.

From the quick start guide:

int InstanceID;
InstanceID = DPLCreateLibrary();
if (DPLUnlockKey(InstanceID, "your license key") == 1) {
DPLDrawText(InstanceID, 100, 500, "Hello world");
DPLSaveToFile(InstanceID, "C:\Docs\HelloFromDLL.pdf");
}
DPLReleaseLibrary(InstanceID);

from the example:

    // Declare and load Quick PDF Library DLL
    DebenuPDFLibraryDLL0912 QP("DebenuPDFLibraryDLL0912.dll");

    // Library key
    CStringW strLicenseKey = L"INSERT_LICENSE_KEY_HERE";

    // PDF output filename
    CStringW strFileName = L"hello-world.pdf";

    // Display message containing the library version
    CStringW strMessage = L"Quick PDF Library Hello World sample";
    strMessage += L"\n";
    strMessage += L"Library version: " + QP.LibraryVersion();

    // Unlock the library
    int iResult = QP.UnlockKey(strLicenseKey);
    if (iResult == 1)
    {


Posted By: RandyJ
Date Posted: 07 Jan 13 at 4:57PM
Believe I got it working. I used the non MFC c++ .h and .cpp (with a small modification) and the L to cast the string to unicode. 


Posted By: DezhiF
Date Posted: 23 May 13 at 3:06PM
I have this exact problem with Lib version, my application
crashes on this line:

DEBENUPDFLIBRARYLIB0912_DllMain(GetModuleHandle(NULL), DLL_PROCESS_ATTACH, NULL);

This is the error we get:
Unhandled exception at 0x770407e4 in cadracad.exe: 0xC0000025: Windows cannot continue from this exception.


We are attempting to call this from our C code which is not built with Unicode support. We are using Visual Studio 2008 compilers. Is it possible to do what we are attempting?

Thanks!
Dezhi Fan



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