How do I use/call functions in the DebenuQuickPDF v10.13 DLL? lazarus / 21-General ---------------------------------------------------------------------- RedOctober · 2024-12-07 21:11 OS: Windows Server 2016.  DLL: DebenuPDFLibrary64DLL1013.dll Lazarus 3.4 (rev lazarus_3_4) FPC 3.2.2 x86_64-win64-win32/win64 I have never done this before. I am stuck at how to properly load the library, and also how to use functions in the library. According to the Getting Started: ("DPLDrawText" and "DPLSaveToFile" are just example function calls to demonstrate) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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);  Further from the same document: Sending Strings Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i char * Buffer;char * Content = ...; // pointer to the dataBuffer = DPLCreateBuffer(10000);DPLAddToBuffer(InstanceID, Buffer, Content, 10000);DPLStoreCustomDataFromString(InstanceID,"MyData", Buffer, 1, 0);DPLReleaseBuffer(InstanceID, Buffer);  Further from the same document: Receiving Strings Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unsigned char * Content;int ContentLength;Content = DPLRetrieveCustomDataToString("MyData", 1);ContentLength = DPLAnsiStringResultLength(// copy the data in Content now  This is my own code, so far: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit u_dll_pdf; {$mode ObjFPC}{$H+} interface uses  Classes, SysUtils, u_gv; type   TfunStringBack = function(strIn : string) : PChar;  stdcall;   TfunCreateLibrary = function() : PChar;  stdcall; function GetPgImgStrFromPDF(const fnm: String; const pg, zm: Integer; var pgc: Integer; var img_str: String): Boolean; implementation function GetPgImgStrFromPDF(const fnm: String; const pg, zm: Integer; var pgc: Integer; var img_str: String): Boolean;var LibHandle: THandle; fncPtr: Pointer;  InstanceID: Integer;  funCreateLibrary: TfunCreateLibrary;begin  Result := True;  try    LibHandle := LoadLibrary(PChar(GV.RBI.QPDF_lib_fnm));    if LibHandle = 0 then    begin        Result := False;        Exit;      end;     fncPtr := GetProcAddress(LibHandle, 'DPLCreateLibrary');    if not Assigned(fncPtr) then //-- Error! Unknown data.      begin        Result := False;        Exit;      end;     // Everything is lined up.  Time to call the function   finally    if LibHandle > 0 then      FreeLibrary(LibHandle);  end;end; end.  Ultimately, the function I need to get working is this one: (I need to get a page from the .pdf file, to an HTML string) QuoteRenderPageToString Description This function renders a page from the selected document to a string. The data in the returned string depends on the Options parameter. Syntax Delphi function TDebenuPDFLibrary1013.RenderPageToString(DPI: Double; Page, Options: Integer): AnsiString; DLL char * DPLRenderPageToString(int InstanceID, double DPI, int Page, int Options); Parameters DPI The DPI to use when rendering the page. Values over 300 will cause excessive memory usage. Page The page number to render Options 0 = BMP output 1 = JPEG output 2 = WMF output 3 = EMF output 4 = EPS output 5 = PNG output 6 = GIF output 7 = TIFF output 8 = EMF+ output 9 = HTML5 output 10 = TIFF (G4) output Many thanks to anyone who can get me over this learning curve. ---------------------------------------------------------------------- Fibonacci · 2024-12-07 21:41 Remove GetPgImgStrFromPDF from implementation section, and in interface section change to Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function GetPgImgStrFromPDF(const fnm: String; const pg, zm: Integer; var pgc: Integer; var img_str: String): Boolean; stdcall; external 'DebenuPDFLibrary64DLL1013.dll'; Thats all, add more functions and call them ---------------------------------------------------------------------- RedOctober · 2024-12-08 01:43 I was on the wrong track. Solution: In the folder "/Import/Delphi"  find the library's .pas file:DebenuPDFLibraryDLL1013.pas Place this file in with your project source code. Put {$MODE Delphi}  at the very top line of this Debenu file. Using the Project Inspector, add this file to the Project In your unit, in the uses clause, add the same .pas fileClasses, SysUtils, DebenuPDFLibraryDLL1013; Then see below for the source code Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit u_dll_pdf; {$mode ObjFPC}{$H+} interface uses  Classes, SysUtils, DebenuPDFLibraryDLL1013; const  quick_pdf_license_key: WideString = 'YOUR LICENSE KEY'; // 10.13 function GetPgImgStrFromPDF(const fnm: String; const pg, zm: Integer; var pgc: Integer; var img_str: AnsiString): Boolean; implementation uses u_gv; function GetPgImgStrFromPDF(const fnm: String; const pg, zm: Integer; var pgc: Integer; var img_str: AnsiString): Boolean;var  QwkPDFLib: TDebenuPDFLibraryDLL1013;  ID: LongInt; key_ok: Integer;begin  Result := True;  QwkPDFLib := nil;  try    QwkPDFLib := TDebenuPDFLibraryDLL1013.Create(GV.RBI.QPDF_lib_fnm);    if not Assigned(QwkPDFLib) then      Exit;     key_ok := QwkPDFLib.UnlockKey(quick_pdf_license_key);    if key_ok = 0 then    Exit;    QwkPDFLib.LoadFromFile(fnm, '');    img_str := QwkPDFLib.RenderPageToString(100, 1, 9);  finally    QwkPDFLib.Free;  end;end; end.  The result of the RenderPageToString() call will be a complete HTML document, with a JavaScript function call that uses a bunch of ctx. (canvas) draws and moves and fills, that will render the image in a browser.  Really cool. THANKS to those who replied, it helped get me onto the right track.