Spire.OCR 2.1.6 supports Linux-ARM and text coordinate extraction

Spire.OCR 2.1.6 supports Linux-ARM and text coordinate extraction

2025-07-29 05:50:14

We’re excited to announce the release of Spire.OCR 2.1.6. This version adds support for the Linux-ARM platform, enables control over image rotation and text output positioning, and supports extracting text coordinates. It also upgrades the SkiaSharp dependency and fixes issues related to text recognition accuracy and language model configuration. More details are as follows:

Here is a list of changes made in this release

Category ID Description
New feature Supports the Linux-ARM platform.
New feature Upgrades the dependent SkiaSharp version to 3.116.1 (requires Ubuntu 20.04, CentOS 9 or later).
New feature SPIREOCR-5 SPIREOCR-10 SPIREOCR-32 SPIREOCR-42 SPIREOCR-51 SPIREOCR-88 Supports setting whether the image should be rotated and whether the text should be output according to the image position.
// Initialize OCR scanner object
OcrScanner scanner = new OcrScanner();

// Create configuration options object
ConfigureOptions configureOptions = new ConfigureOptions();
// Set model path for win-x64 platform
configureOptions.ModelPath = "win-x64";
// Set recognition language to Chinese
configureOptions.Language = "Chinese";
// Enable auto-rotation feature
configureOptions.AutoRotate = true;

// Apply configuration options
scanner.ConfigureDependencies(configureOptions);
// Perform scanning operation, 'input' is the source image
scanner.Scan(input);

// Create text aligner to process scan results
VisualTextAligner visualText = new VisualTextAligner(scanner.Text);
// Get aligned text string
string scannnedText = visualText.ToString();

// Use StringBuilder to construct final text
StringBuilder builder = new StringBuilder();
builder.Append(scannnedText);
// Write recognition results to output file
File.WriteAllText(outputfile, builder.ToString());
New feature SPIREOCR-110 Supports obtaining text coordinates.
IOCRTextBlock[] blocks = scanner.Text.Blocks;
		string scannnedText = PrintTextBlocks(blocks);
		private static string PrintTextBlocks(IOCRTextBlock[] blocks, StringBuilder sb = null)
		{
			if (sb == null || sb.Length == 0) sb = new StringBuilder();
			if (blocks != null && blocks.Count() > 0)
			{
				foreach (var block in blocks)
				{
					Rectangle rectangle = block.Box;                    
					string t1 = string.Format("Rectangle : [{0}, {1}, {2}, {3}] , ",
						rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);                   
					string t2 = string.Format("Level ({0}): {1}", block.Level.ToString(), block.Text);                 
					string text = t1 + t2;
					text = text + "\n";                  
					sb.Append(text);                 
					PrintTextBlocks(block.TextBlock, sb);                   
					if (block.Level == TextBlockType.Line) sb.Append("\n");
				}
			}
			return sb.ToString();
		}
Bug SPIREOCR-6 Fixes the issue where text was recognized incorrectly.
Bug SPIREOCR-101 Fixes the issue where the language model used "Japan" instead of "Japanese".
Click the link to download Spire.OCR 2.1.6: