Testing Debenu Quick PDF Library

Klaas den Dekker
Posts: 23
Joined: Sat Oct 22, 2005 8:22 pm

Testing Debenu Quick PDF Library

Post by Klaas den Dekker »

Hi,
I'm testing the Debenu Quick PDF Library with Fivewin + xHarbour but I'm having problems starting up.
I use:
cLicense := "jx4aq86h5ou5mk9i86644936y"
xId := DllCall( hDLL,nil,"DPLCreateLibrary" )
xVal := DllCall( hDLL,nil,"DPLUnlockKey",xId,StrPtr(cLicense) )
DllCall( hDLL,nil,"DPLReleaseLibrary",xId )

XId return a value (f.i. 83652944) but xVal allways return 0, what means that the library is not correct unlocked.
The problem according to the helpdesk of Debenu is that the string cLicense is not correcty parsed to the function.
I also tried:
xVal := DllCall( hDLL,nil,"DPLUnlockKey",xId,cLicense )

Can anyone help me?
Does anyone use the Debenu Quick PDF Library?

best regards,
Klaas den Dekker
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Testing Debenu Quick PDF Library

Post by Antonio Linares »

Klaas,

What FWH version are you using ?

Are you using Harbour or xHarbour ? Borland ?

thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
Klaas den Dekker
Posts: 23
Joined: Sat Oct 22, 2005 8:22 pm

Re: Testing Debenu Quick PDF Library

Post by Klaas den Dekker »

xHarbour 1.2.1 rev. 9421
Borland 5.82
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Testing Debenu Quick PDF Library

Post by Antonio Linares »

Klaas,

What FWH version are you using ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Klaas den Dekker
Posts: 23
Joined: Sat Oct 22, 2005 8:22 pm

Re: Testing Debenu Quick PDF Library

Post by Klaas den Dekker »

FWHX 12.07
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Testing Debenu Quick PDF Library

Post by Antonio Linares »

Klaas,

How are you initially setting the value of hDLL ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Klaas den Dekker
Posts: 23
Joined: Sat Oct 22, 2005 8:22 pm

Re: Testing Debenu Quick PDF Library

Post by Klaas den Dekker »

Yes, I am:

STATIC hDLL

IF DebLoadDLL()
cLicense := "jx4aq86h5ou5mk9i86644936y"
xId := DllCall( hDLL,nil,"DPLCreateLibrary" )
xRet := DllCall( hDLL,nil,"DPLUnlockKey",StrPtr(cLicense) )
DllCall( hDLL,nil,"DPLReleaseLibrary",xId )
ENDIF
....


** Load Debenu lib
FUNCTION DebLoadDLL()
LOCAL lResult := .T.
hDLL := LOADLIBRARY( GsExeDir()+"\"+DLLfile )
IF ABS( hDLL ) <= 32
lResult := .F.
ENDIF
RETURN lResult
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Testing Debenu Quick PDF Library

Post by Antonio Linares »

Klaas,

Could you please email me the DLL in a ZIP file renamed as ZOP ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
carlos vargas
Posts: 1421
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Testing Debenu Quick PDF Library

Post by carlos vargas »

no he podido registrar la clave de la licencia, aun la DEMO :-) antonio, nUnlock siempre vale 0, probado con xharbour, modo consola.

http://castillolawyers.no-ip.info/owncl ... ec7252fb8d

Code: Select all

#define DC_CALL_CDECL          0x0010 
#define DC_CALL_STD            0x0020

/*--------------------------------------------------------------*/

STATIC hDLL

/*--------------------------------------------------------------*/

PROCEDURE Main()
   LOCAL nInstanceID
   LOCAL nUnlock
   
   PRIVATE cDllFile := "d:\compiler\t\DebenuPDFLibraryDLL1113.Dll"
   PRIVATE cLicense1 := "jk7o53he84n6bo9np5cj9yb8y"
   PRIVATE cLicense2 := "jx4aq86h5ou5mk9i86644936y"
   
   cls
   ?
   ?"File exist:",File( cDllFile )
   ?"License Key", cLicense1
   ?
   
   IF DebLoadDLL()
      nInstanceID := DllCall( hDLL, DC_CALL_STD, "DPLCreateLibrary" )
      ?"InstanceID.:", nInstanceID
      IF !HB_IsNIL( nInstanceID )
         nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKey", nInstanceID, cLicense1 )
         ?"Unlock:", nUnlock 
         IF nUnlock==1
            ?"File created:"
            DllCall( hDLL, DC_CALL_STD, "DPLDrawText", nInstanceID, 100, 500, "Hello Word!" )
            DllCall( hDLL, DC_CALL_STD, "DPLSaveToFile", nInstanceID, "d:\test.pdf" ) 
         ELSE
            ?"Error unlock:", GetLastError()
         ENDIF
         DllCall( hDLL, DC_CALL_STD, "DPLReleaseLibrary", nInstanceID )
      ELSE
         ?"Error instance:", GetLastError()
      ENDIF
   ENDIF
   
   DebUnLoadDLL()
   
RETURN

/*--------------------------------------------------------------*/

FUNCTION DebLoadDLL()
   LOCAL lResult := .T.
   
   hDLL := LoadLibrary( cDllFile )

   IF Abs( hDLL ) <= 32
      lResult := .F. 
   ENDIF
   
   ?"Dll loaded.:", lResult
   ?"hDLL.......:", hDll
   
RETURN lResult

/*--------------------------------------------------------------*/

FUNCTION DebUnLoadDLL()
    
   IF Abs( hDLL ) <= 32
      FreeLibrary( hDLL )
   ENDIF
   
RETURN

/*--------------------------------------------------------------*/

/*
  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);
  
*/

/*
IF DebLoadDLL()
cLicense := "jx4aq86h5ou5mk9i86644936y"
xId := DllCall( hDLL,nil,"DPLCreateLibrary" )
xRet := DllCall( hDLL,nil,"DPLUnlockKey",StrPtr(cLicense) )
DllCall( hDLL,nil,"DPLReleaseLibrary",xId )
ENDIF
*/
 
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
Posts: 1421
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Testing Debenu Quick PDF Library

Post by carlos vargas »

codigo tanto para xharbour como para harbour, ahora no me muestra ningun texto, ademas que la funcion DPLUnlockKey no funciona aun, pero si DPLUnlockKeyA

Code: Select all

#define DC_CALL_CDECL          0x0010 
#define DC_CALL_STD            0x0020

/*--------------------------------------------------------------*/

STATIC hDLL

/*--------------------------------------------------------------*/

PROCEDURE Main()
   LOCAL nInstanceID
   LOCAL nUnlock
   
   PRIVATE cDllFile := "d:\compiler\t\DebenuPDFLibraryDLL1113.Dll"
   PRIVATE cLicense1 := "jk7o53he84n6bo9np5cj9yb8y"
   PRIVATE cLicense2 := "jx4aq86h5ou5mk9i86644936y"
   
   cls
   ?
   ?"File exist:",File( cDllFile )
   ?"License Key", cLicense1
   ?
   
   IF DebLoadDLL()
      nInstanceID := DllCall( hDLL, DC_CALL_STD, "DPLCreateLibrary" )
      ?"InstanceID.:", nInstanceID
      IF !HB_IsNIL( nInstanceID )
         nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKeyA", nInstanceID, cLicense1 ) //No funciona DPLUnlockKey
         ?"Unlock:", nUnlock 
         IF nUnlock==1
            ?"File created:"
            DllCall( hDLL, DC_CALL_STD, "DPLDrawText", nInstanceID, 10, 10, AnsiToWide("Hello Word!") ) //Esto no funciona
            DllCall( hDLL, DC_CALL_STD, "DPLSaveToFile", nInstanceID, AnsiToWide("d:\test.pdf") ) 
         ELSE
            ?"Error unlock:", GetLastError()
         ENDIF
         DllCall( hDLL, DC_CALL_STD, "DPLReleaseLibrary", nInstanceID )
      ELSE
         ?"Error instance:", GetLastError()
      ENDIF
   ENDIF
   
   DebUnLoadDLL()
   
RETURN

/*--------------------------------------------------------------*/

FUNCTION DebLoadDLL()
   LOCAL lResult := .T.
   
   hDLL := LoadLibrary( cDllFile )

   #ifdef __XHARBOUR__
   IF Abs( hDLL ) <= 32
   #else
   IF empty(hDll)
   #endif   
      lResult := .F. 
   ENDIF
   
   ?"Dll loaded.:", lResult
   ?"hDLL.......:", hDll
   
RETURN lResult

/*--------------------------------------------------------------*/

FUNCTION DebUnLoadDLL()
   
   #ifdef __XHARBOUR__
   IF Abs( hDLL ) <= 32
   #else
   IF !empty(hDll)
   #endif   
      FreeLibrary( hDLL )
   ENDIF
   
RETURN

/*--------------------------------------------------------------*/
#ifdef __HARBOUR__
#ifndef __XHARBOUR__
function FreeLibrary(hDll)
return DllUnload(hDll)  
function LoadLibrary(cDll)
return DllLoad(cDll)
function GetLastError()
return WAPI_GETLASTERROR()     
#endif
#endif

/*
  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);
  
*/

/*
IF DebLoadDLL()
cLicense := "jx4aq86h5ou5mk9i86644936y"
xId := DllCall( hDLL,nil,"DPLCreateLibrary" )
xRet := DllCall( hDLL,nil,"DPLUnlockKey",StrPtr(cLicense) )
DllCall( hDLL,nil,"DPLReleaseLibrary",xId )
ENDIF
*/
 
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
Posts: 1421
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Testing Debenu Quick PDF Library

Post by carlos vargas »

ya acepta la licencia, crea el archivo, pero no imprime nada.

Code: Select all

#define DC_CALL_CDECL          0x0010 
#define DC_CALL_STD            0x0020

/*--------------------------------------------------------------*/

STATIC hDLL

/*--------------------------------------------------------------*/

PROCEDURE Main()
   LOCAL nInstanceID
   LOCAL nUnlock
   
   PRIVATE cDllFile := "d:\compiler\t\DebenuPDFLibraryDLL1113.Dll"
   PRIVATE cLicense1 := "jk7o53he84n6bo9np5cj9yb8y"
   PRIVATE cLicense2 := "jx4aq86h5ou5mk9i86644936y"
   
   cls
   ?
   ?"File exist:",File( cDllFile )
   ?"License Key", cLicense1
   ?
   
   IF DebLoadDLL()
      nInstanceID := DllCall( hDLL, DC_CALL_STD, "DPLCreateLibrary" )
      ?"InstanceID.: ", nInstanceID
      IF !HB_IsNIL( nInstanceID )
         nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKey", nInstanceID, AnsiToWide(cLicense1) )
         ?"Unlock: ", nUnlock 
         IF nUnlock==1
            ?"File created: "
            DllCall( hDLL, DC_CALL_STD, "DPLDrawText", nInstanceID, 100, 100, AnsiToWide("Hello Word!") ) //Esto no funciona
            DllCall( hDLL, DC_CALL_STD, "DPLSaveToFile", nInstanceID, AnsiToWide("d:\test1.pdf") ) 
         ELSE
            ?"Error unlock: ", GetLastError()
         ENDIF
         DllCall( hDLL, DC_CALL_STD, "DPLReleaseLibrary", nInstanceID )
      ELSE
         ?"Error instance: ", GetLastError()
      ENDIF
   ENDIF
   
   DebUnLoadDLL()
   
RETURN

/*--------------------------------------------------------------*/

FUNCTION DebLoadDLL()
   LOCAL lResult := .T.
   
   hDLL := LoadLibrary( cDllFile )

   #ifdef __XHARBOUR__
   IF Abs( hDLL ) <= 32
   #else
   IF empty(hDll)
   #endif   
      lResult := .F. 
   ENDIF
   
   ?"Dll loaded.:", lResult
   ?"hDLL.......:", hDll
   
RETURN lResult

/*--------------------------------------------------------------*/

FUNCTION DebUnLoadDLL()
   
   #ifdef __XHARBOUR__
   IF hDLL <> 0
   #else
   IF !empty(hDll)
   #endif   
      FreeLibrary( hDLL )
   ENDIF
   
RETURN

/*--------------------------------------------------------------*/
#ifdef __HARBOUR__
#ifndef __XHARBOUR__
function FreeLibrary(hDll)
return DllUnload(hDll)  
function LoadLibrary(cDll)
return DllLoad(cDll)
function GetLastError()
return WAPI_GETLASTERROR()     
#endif
#endif

/*
  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);
  
*/

/*
IF DebLoadDLL()
cLicense := "jx4aq86h5ou5mk9i86644936y"
xId := DllCall( hDLL,nil,"DPLCreateLibrary" )
xRet := DllCall( hDLL,nil,"DPLUnlockKey",StrPtr(cLicense) )
DllCall( hDLL,nil,"DPLReleaseLibrary",xId )
ENDIF
*/
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Testing Debenu Quick PDF Library

Post by Antonio Linares »

Carlos,

Code: Select all

nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKey", nInstanceID, AnsiToWide(cLicense1) )
Excellent! :-)

We did not considered this possibility, that a wide string was expected. Very good!
regards, saludos

Antonio Linares
www.fivetechsoft.com
Klaas den Dekker
Posts: 23
Joined: Sat Oct 22, 2005 8:22 pm

Re: Testing Debenu Quick PDF Library

Post by Klaas den Dekker »

Hi Antonio and Carlos,

Indeed, DPLUnlockKeyA works, thanks very much!

nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKeyA", nInstanceID, cLicenseUSD ) -> this works
nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKey", nInstanceID, AnsiToWide(cLicenseUSD) ) -> this does not work

Now I can continue with the conversion of EMF to PDF with this lib.

Best regards,
Klaas den Dekker
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Testing Debenu Quick PDF Library

Post by nageswaragunupudi »

Now I can continue with the conversion of EMF to PDF with this lib.
Does the library provide for direct conversion of EMF to PDF ?
Regards

G. N. Rao.
Hyderabad, India
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Testing Debenu Quick PDF Library

Post by Antonio Linares »

Klaas,
nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKeyA", nInstanceID, cLicenseUSD ) -> this works
That seems the right one as usually "A" stands for Ansi and "W" for wide. Thats the way Microsoft uses to name the Windows API functions.

A very good finding from Carlos, as we did not considered that possibility :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply