Class Resources

Class Resources

Namespace: Aspose.OCR
Assembly: Aspose.OCR.dll (25.2.0)

Manage downloadable resources that enhance Aspose.OCR recognition capabilities.

public class Resources

Inheritance

objectResources

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

Resources()

public Resources()

Methods

AllowAutomaticDownloads(bool)

Allow (true) or block (false) automatic downloading of required resources from the online repository. By default, a resource is automatically downloaded when a method that depends on it is called.

public static void AllowAutomaticDownloads(bool allow)

Parameters

allow bool

Boolean value to allow or block automatic downloading of required resources.

FetchAll()

Download all compatible resources from the online repository. The existing resource files will be overwritten.

public static void FetchAll()

FetchResource(string)

Download the resource specified in the name parameter from the online repository. If the resource is already downloaded, it will be overwritten. You can omit the .OCR extension and use file name only.

public static void FetchResource(string name)

Parameters

name string

String with resource name. See the ListRemote method.

FetchResources(string[])

Download the resources specified in the names parameter from the online repository. If one or more resources are already downloaded, they will be overwritten. You can omit the .OCR extension and use file names only.

public static void FetchResources(string[] names)

Parameters

names string[]

Array with resources names. See the ListRemote method.

GetLocalPath()

Return the full path to the directory where the resources will be downloaded.

public static string GetLocalPath()

Returns

string

String with the path to the resources directory.

GetRepository()

Return the URL of the online repository from which Aspose.OCR resources are downloaded.

public static string GetRepository()

Returns

string

URL of the online repository.

ListLocal()

List all Aspose.OCR resources stored in the local directory.

public static List<string> ListLocal()

Returns

List<string&gt;

List all Aspose.OCR resources stored in the local directory.

ListRemote()

List all compatible resources from the online repository.

public static List<string> ListRemote()

Returns

List<string&gt;

List of resources names.

ReleaseMemory()

Unload OCR modules to free up memory. The downloaded module files will remain intact.

public static void ReleaseMemory()

RemoveLocal(string)

Removes the locally stored Aspose.OCR resource.

public static void RemoveLocal(string name)

Parameters

name string

String with resource name. See the ListRemote method.

SetLocalPath(string)

Specify an absolute or relative path to the directory where the resources will be downloaded. If the directory does not exist, it will be created automatically. By default, the resources are downloaded to aspose_data directory in the application’s working directory.

public static void SetLocalPath(string path)

Parameters

path string

Absolute or relative path to the directory.

SetLocalPath(string, bool)

Specify an absolute or relative path to the directory where the resources will be downloaded. Pass false to the create parameter to prevent the directory from being created automatically. If the provided directory does not exist and creation is not allowed, the resources will be loaded into the aspose_data directory in the application’s working directory.

public static void SetLocalPath(string path, bool create)

Parameters

path string

Absolute or relative path to the directory.

create bool

Parameter to prevent the directory from being created automatically.

SetRepository(string)

Specify the URL of the online repository from which Aspose.OCR resources will be downloaded. By default, the resources are downloaded from https://github.com/aspose-ocr/resources/.

public static void SetRepository(string url)

Parameters

url string

URL of the online repository.

 English