We're pleased to announce the release of Spire.OCR 2.2.10. This version supports integration with cloud AI models (such as Doubao, Qwen, DeepSeek, etc.) for image text recognition. (Note: Users are required to obtain their own API Keys from the respective AI platforms.) More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | SPIREOCR-125 | Supports integration with cloud AI models (such as Doubao, Qwen, DeepSeek, etc.) for image text recognition.
static void Main(string[] args)
{
string filename = "1.png";
string outputFile = "scan.txt";
string filePath = "F:\\3.3.0AI\\AI\\"+"ocr.xml";
string newModel = "AIModel";
string newApiKey = "ApiKey";
string newApiUrl = "ApiUrl";
UpdateOcrConfig(filePath, newModel, newApiKey, newApiUrl);
ScanImg(filename, outputFile);
}
public static void ScanImg(string filename, string outputFile)
{
OcrScanner scanner = new OcrScanner();
ConfigureOptions configureOptions = new ConfigureOptions();
configureOptions.ModelPath = "F:\\3.3.0AI\\AI";
configureOptions.Language = "English";
scanner.ConfigureDependencies(configureOptions);
scanner.Scan(filename);
File.WriteAllText(outputFile, scanner.Text.ToString());
}
public static void UpdateOcrConfig(string filePath, string model, string apiKey, string apiUrl)
{
XmlDocument doc = new XmlDocument();
doc.Load(filePath);
XmlNode modelNode = doc.SelectSingleNode("/ocr/configs/model");
XmlNode apiKeyNode = doc.SelectSingleNode("/ocr/configs/apiKey");
XmlNode apiUrlNode = doc.SelectSingleNode("/ocr/configs/apiUrl");
if (modelNode != null) modelNode.InnerText = model;
if (apiKeyNode != null) apiKeyNode.InnerText = apiKey;
if (apiUrlNode != null) apiUrlNode.InnerText = apiUrl;
doc.Save(filePath);
Console.WriteLine("XML file updated!");
}
|
Click the link to download Spire.OCR 2.2.10:
More information of Spire.OCR new release or hotfix: