Porting PDF Viewer from Delphi lazarus / 39-Graphics ---------------------------------------------------------------------- domasz · 2025-11-11 10:31 There is a very nice component for Delphi that uses Pdfium. Made by Lasse Markus Rautiainen and Andreas Hausladen. I tried porting to Lazarus but something is off. Attached is full source code from 2 repos: https://github.com/ahausladen/PdfiumLib https://github.com/TextEditorPro/TTextEditor/ License: MIT You'll need to put a DLL in x64 directory from: https://github.com/bblanchon/pdfium- binaries/releases/download/chromium%2F7242/pdfium-win-x64.tgz You don't need to install anything. Lazarus port compiles and runs but renders in a weird way. I don't see any changes in code in how things are rendered between Delphi and Lazarus ---------------------------------------------------------------------- LV · 2025-11-12 10:16 Quote from: domasz on November 11, 2025, 11:31:03 amThere is a very nice component for Delphi that uses Pdfium. Made by Lasse Markus Rautiainen and Andreas Hausladen. I tried porting to Lazarus but something is off. Attached is full source code from 2 repos: https://github.com/ahausladen/PdfiumLib https://github.com/TextEditorPro/TTextEditor/ License: MIT You'll need to put a DLL in x64 directory from: https://github.com/bblanchon/pdfium- binaries/releases/download/chromium%2F7242/pdfium-win-x64.tgz You don't need to install anything. Lazarus port compiles and runs but renders in a weird way. I don't see any changes in code in how things are rendered between Delphi and Lazarus I gathered the courage to make a few adjustments.  P.S. I slightly modified LazarusCode.zip above ---------------------------------------------------------------------- domasz · 2025-11-12 10:43 Damn, you are good! Seems to be fixed, thanks! ---------------------------------------------------------------------- Boleeman · 2025-11-15 11:38 Also came across Pdfium LCL at https://github.com/DomenicoMammola/PdfiumPascal but compilation stops at Uses PdfiumCore  in unit mainfrm2; Attached is the zip from that github page. ---------------------------------------------------------------------- Boleeman · 2025-11-15 17:21 Got it working with these files. Can select between LCL, Graphics32, Image32 Annotate did not work. Need to put pdfium.dll in the example/lcl folder ---------------------------------------------------------------------- domasz · 2025-11-16 20:35 Quote from: Boleeman on November 15, 2025, 12:38:46 pmAlso came across Pdfium LCL at https://github.com/DomenicoMammola/PdfiumPascal That's way worse- it doesn't support continuous scrolling ---------------------------------------------------------------------- domasz · 2025-11-17 10:08 In PDFium.Control.pas, line 2089: 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 procedure TCustomPDFiumControl.PaintWindow(ADC: HDC);var  LIndex: Integer;  LPage: TPDFPage;  LBrush: HBrush;begin  LBrush := CreateSolidBrush(Color);  try    //FillRect(ADC, ClientRect, LBrush); this seems not needed. It draws a weird rectangle visible when scrolling ---------------------------------------------------------------------- Boleeman · 2025-12-27 05:46 Found 3 examples (to View, scroll, Zoom, Fill, Weblink, Read, Save pdf form). It was from kjteng, whch has 4 examples (I could not get example 2 to work): PDF VCL Control using PDFium https://github.com/kjteng/PdfiumLib Some extra files from that Github page: A pdflib.dpk file (and also Tpdfcontrol.lrs) is also included for those who wish to place the TPdfControl to the component palette in Lazarus. Before installing the dpk, please remember to uncomment the line containing {$DEFINE VCL_PALETTE} in pdfiumctrl.pas. You may also need to delete the files in project\lib\ folder to ensure a clean start. The Example1 (PdfiumLibExample) is also originated from Andreas Hausladen's site, with some minor modification for Lazarus.