Skip to content

Commit

Permalink
Updated for CEF 88.1.4 (Chromium 88.0.4324.96)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Grange committed Jan 22, 2021
1 parent 3a1150b commit 0aa4ac4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
8 changes: 8 additions & 0 deletions cefHtmlSnapshot.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ program cefHtmlSnapshot;

{$I cef.inc}

{.$define USE_BUNDLE}

{$APPTYPE CONSOLE}

{$IFDEF WIN32}
Expand All @@ -58,6 +60,7 @@ uses
SysUtils,
{$ENDIF }
uCEFApplication, uCEFApplicationCore,
{$ifdef USE_BUNDLE} UChromiumBundle,{$endif}
uEncapsulatedBrowser in 'uEncapsulatedBrowser.pas',
uCEFBrowserThread in 'uCEFBrowserThread.pas',
uCEFSnapshotParameters in 'uCEFSnapshotParameters.pas';
Expand Down Expand Up @@ -134,7 +137,12 @@ begin
end;
try
try
{$ifdef USE_BUNDLE}
vChromiumBundleQuickCheck := True;
CreateGlobalCEFApp(parameters, ChromiumUnBundledPath);
{$else}
CreateGlobalCEFApp(parameters);
{$endif}
if WaitForMainAppEvent then
WriteResult;
except
Expand Down
3 changes: 2 additions & 1 deletion cefHtmlSnapshot.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_MajorVer>0</VerInfo_MajorVer>
<VerInfo_MinorVer>1</VerInfo_MinorVer>
<VerInfo_Keys>CompanyName=delphitools.info;FileDescription=$(MSBuildProjectName);FileVersion=0.1.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<VerInfo_Keys>CompanyName=delphitools.info;FileDescription=$(MSBuildProjectName);FileVersion=0.1.88.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<VerInfo_Release>88</VerInfo_Release>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
Expand Down
Binary file modified cefHtmlSnapshot.res
Binary file not shown.
6 changes: 3 additions & 3 deletions uCEFSnapshotParameters.pas
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface
uCEFTypes, uCEFMiscFunctions;

const
cChromiumSubFolder = 'Chromium87';
cChromiumSubFolder = 'Chromium88';
cDLLSubfolder = 'Libraries';

type
Expand Down Expand Up @@ -46,8 +46,8 @@ implementation
uses LibTurboJPEG, Vcl.Imaging.pngimage, System.StrUtils;

const
cHelp = 'cefHtmlSnaphot utility v0.1 - Html to image or pdf coversion using Chromium Embedded Framework'#10
+ 'Using CEF 87.1.12.0, CEF4Delphi, TurboJPEG see https://github.com/EricGrange/cefHtmlSnapshot'#10#10
cHelp = 'cefHtmlSnaphot utility v0.1.88 - Html to image or pdf coversion using Chromium Embedded Framework'#10
+ 'Using CEF 88.0.4324.96, CEF4Delphi, TurboJPEG see https://github.com/EricGrange/cefHtmlSnapshot'#10#10
+ 'cefHtmlSnapshot.exe url_or_file [-arg1 value1] [-arg2 value2] ... output_file'#10
+ #10
+ ' -?, -h, --help This inline documentation'#10
Expand Down
9 changes: 5 additions & 4 deletions uEncapsulatedBrowser.pas
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ TEncapsulatedBrowser = class
property ErrorText : ustring read FErrorText;
end;

procedure CreateGlobalCEFApp(const parameters : TSnapshotParameters);
procedure CreateGlobalCEFApp(const parameters : TSnapshotParameters; const chromiumPath : String = '');
function WaitForMainAppEvent : boolean;
procedure WriteResult;

Expand Down Expand Up @@ -111,7 +111,7 @@ procedure WriteResult;
WriteLn('Snapshot saved successfully as ' + EncapsulatedBrowser.Parameters.OutputFilePath);
end;

procedure CreateGlobalCEFApp(const parameters : TSnapshotParameters);
procedure CreateGlobalCEFApp(const parameters : TSnapshotParameters; const chromiumPath : String = '');
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.WindowlessRenderingEnabled := True;
Expand All @@ -124,7 +124,9 @@ procedure CreateGlobalCEFApp(const parameters : TSnapshotParameters);
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
GlobalCEFApp.BrowserSubprocessPath := 'cefHtmlSnapshot.exe'; // This is the other EXE for the CEF subprocesses. It's on the same directory as this app.

SetCurrentDir(ExtractFilePath(ParamStr(0)) + cChromiumSubFolder);
if chromiumPath = '' then
SetCurrentDir(ExtractFilePath(ParamStr(0)) + cChromiumSubFolder)
else SetCurrentDir(chromiumPath);
vParameters := parameters;

GlobalCEFApp.EnableGPU := False;
Expand All @@ -134,7 +136,6 @@ procedure CreateGlobalCEFApp(const parameters : TSnapshotParameters);
GlobalCEFApp.EnablePrintPreview := False;
GlobalCEFApp.DisableJavascriptAccessClipboard := True;
GlobalCEFApp.DisableSpellChecking := True;
GlobalCEFApp.FlashEnabled := False;
GlobalCEFApp.MuteAudio := True;
GlobalCEFApp.AllowFileAccessFromFiles := True;
GlobalCEFApp.EnableMediaStream := False;
Expand Down

0 comments on commit 0aa4ac4

Please sign in to comment.