GroupDocs.Parser for .NET 22.11 Release Notes
This page contains release notes for GroupDocs.Parser for .NET 22.11
Full List of Issues Covering all Changes in this Release
Key | Summary | Category |
---|---|---|
PARSERNET-1961 | Implement the ability to use OCR for images and PDF documents | New Feature |
PARSERNET-1935 | Document info has 0 pages during reading JPEG file content | Bug |
Public API and Backward Incompatible Changes
Implement the ability to use OCR for images and PDF documents
Description
This feature provides the ability to extract a text and text areas using OCR.
Public API changes
GroupDocs.Parser.Options.Features public class was updated with changes as follows:
GroupDocs.Parser.Options.PageTextAreaOptions public class was updated with changes as follows:
- Added PageTextAreaOptions(bool) and PageTextAreaOptions(bool, OcrOptions) constructors;
- Added UseOcr and OcrOptions properties.
GroupDocs.Parser.Options.TextOptions public class was updated with changes as follows:
- Added TextOptions(bool, bool) and TextOptions(bool, bool, OcrOptions) constructors;
- Added UseOcr and OcrOptions properties.
GroupDocs.Parser.Options.ParserSettings public class was updated with changes as follows:
- Added ParserSettings(OcrConnectorBase) and ParserSettings(ILogger, OcrConnectorBase) constructors;
- Added OcrConnector property.
GroupDocs.Parser.Options.Parser public class was updated with changes as follows:
OcrConnectorBase, OcrEventHandler, OcrOptions classes were added into GroupDocs.Parser.Options namespace.
Usage
The following example shows how to extract a text from the image file:
// Create an instance of ParserSettings class with OCR Connector
ParserSettings settings = new ParserSettings(new AsposeOcrOnPremise());
// Create an instance of Parser class with settings
using (Parser parser = new Parser(Constants.SampleScan, settings))
{
// Create an instance of TextOptions to use OCR
TextOptions options = new TextOptions(false, true);
// Extract a text using OCR
using(TextReader reader = parser.GetText(options))
{
// Print a text or 'not supported' message
Console.WriteLine(reader == null ? "Text extraction isn't supported" : reader.ReadToEnd());
}
}
See OCR Usage Basics for more details.