GdPicture.NET.14
GdPicture14 Namespace / GdPictureDocumentUtilities Class / FetchLatestChromeHeadlessShellAsync Method
The folder where the executable will be downloaded
Example





In This Topic
FetchLatestChromeHeadlessShellAsync Method
In This Topic
Download the latest version of chrome headless shell and save it to the specified path, if the latest version is already present it'll return the path of the existing browser path.
Syntax
'Declaration
 
<AsyncStateMachineAttribute(GdPicture14.GdPictureDocumentUtilities/d__12)> 
Public Shared Function FetchLatestChromeHeadlessShellAsync( _ 
   ByVal path As String _ 
) As Task(Of String)
[AsyncStateMachine(GdPicture14.GdPictureDocumentUtilities/d__12)] 
public static Task<string> FetchLatestChromeHeadlessShellAsync( 
   string path 
)
public function FetchLatestChromeHeadlessShellAsync( 
    path: String
): Task; static; 
AsyncStateMachineAttribute(GdPicture14.GdPictureDocumentUtilities/d__12) 
public static function FetchLatestChromeHeadlessShellAsync( 
   path : String 
) : Task;
[AsyncStateMachine(GdPicture14.GdPictureDocumentUtilities/d__12)] 
public: static Task<string*>* FetchLatestChromeHeadlessShellAsync( 
   string* path 
) 
[AsyncStateMachine(GdPicture14.GdPictureDocumentUtilities/d__12)] 
public: 
static Task<String^>^ FetchLatestChromeHeadlessShellAsync( 
   String^ path 
) 

Parameters

path
The folder where the executable will be downloaded

Return Value

The full path of the downloaded executable
Remarks
In order to ensure the use of the latest revision of Chrome, we strongly advise to run this method regularly. See more here.
Example
var latestChromeDownloadPath = await GdPictureDocumentUtilities.GetLatestChromeHeadlessShellAsync(Environment.CurrentDirectory);
GdPictureDocumentUtilities.SetWebBrowserPath(latestChromeDownloadPath);
            
using GdPictureDocumentConverter conv = new();
            
var status = conv.LoadFromHttp(new Uri("https://avepdf.com/"));
    if (status != GdPictureStatus.OK)
{
    throw new Exception($"Convert from http Failed ! ({status})");
}
            
status = conv.SaveAsPDF("output.pdf");
if (status != GdPictureStatus.OK)
{
    throw new Exception($"Saved from http Failed ! ({status})");
}
See Also