Re: Just getting started with CEF4
Posted: Fri Feb 01, 2019 4:34 pm
That's correct. You can generate PDF files using the TChromium.PrintToPDF procedure.RedOctober2019 wrote: Fri Feb 01, 2019 3:03 pmUsing Chromium gives me some advantages over TWebBrowser because it can produce .Pdf pages (If I understand correctly).
The situation with all the component packages capable of embedding a Chromium browser in a Delphi/Lazarus application is a little confusing.RedOctober2019 wrote: Fri Feb 01, 2019 3:03 pmI've struggled for days to obtain and correctly install and configure a CEF framework that (finally) doesn't complain about a missing resource or a wrong DLL version number.
All of them are wrappers of a C++ framework called "Chromium Embedded Framework (CEF)" available here :
https://bitbucket.org/chromiumembedded/cef
The CEF version used by all the component packages is CEF3 but CEF is constantly evolving and releasing new branches and builds because they have to adapt to every Chromium change.
As far as I know, there are 3 component packages capable of embedding a Chromium browser using CEF3 :
- fpCEF3 : https://github.com/dliw/fpCEF3
- DCEF3 : https://github.com/hgourvest/dcef3 https://code.google.com/archive/p/delph ... membedded/
- CEF4Delphi : https://github.com/salvadordf/CEF4Delphi
fpCEF3 works with Lazarus/FPC and supports Windows, Linux and MacOS. The project has a "development" branch which was updated a month ago to CEF3.3538 and the link you posted explains how to use fpCEF3 with Lazarus.
DCEF3
DCEF3 works with Delphi and supports Windows. It's the oldest project. The first commit in the Google repository was in 2010 and later it moved to Github. The latest DCEF3 branch uses CEF3.2924 and it was updated 2 years ago. Most of the tutorials about embedding Chromium in Delphi apps use DCEF3.
CEF4Delphi
CEF4Delphi works with Delphi and Lazarus/FPC, and supports Windows. CEF4Delphi uses CEF3.3626 and I updated it today. I created CEF4Delphi because I needed to use the Blink rendering engine in BriskBard and I needed frequent updates. It's based in DCEF3 but it has quite a few changes.
If you need to use Lazarus then you can install fpCEF3 or CEF4Delphi. Both of them can do all you need in your application.
If you decide to try CEF4Delphi then read this :
https://www.briskbard.com/index.php?lang=en&pageid=cef
CEF4Delphi has more than 40 demos but only 2 of them use Lazarus : SimpleLazarusBrowser and SimpleLazOSRBrowser.
The rest of the demos should be easily converted to Lazarus but according to your description, most of the things that you need can be done with SimpleLazarusBrowser using only 2 components : TCEFWindowParent and TChromium
Download the latest CEF4Delphi version from GitHub and the 64 bit CEF3 binaries linked in the "Readme.md" file :
https://github.com/salvadordf/CEF4Delph ... master.zip
http://opensource.spotify.com/cefbuilds ... 64.tar.bz2
Follow these steps :
- Decompress "master.zip" and install it in Lazarus following this step-by-step guide : https://www.briskbard.com/index.php?lan ... stallation
- Decompress cef_binary_3.3626.1881.g628f810_windows64.tar.bz2 and copy the contents of the "Release" and "Resources" directories to the "bin" directory inside CEF4Delphi.

An old example of some ready to use demos is here :
https://www.briskbard.com/SimpleBrowser.zip