Introduction
With the release of LEADTOOLS Version 18, also known as LEADTOOLS Anywhere™, LEAD Technologies has expanded its reach as the world’s leading
imaging SDK by providing new multi-platform imaging libraries for iOS, OS X,
Android and Linux. Viewers, annotations and markups, OCR, barcode, PDF, image
formats, compression, image processing and more are just a sampling of what LEADTOOLS
has to offer any developer, not just those targeting Windows.
Programmers using LEADTOOLS can experience a set of
libraries that closely resemble each other on every development platform. This
is a distinct advantage for developers whose goal is to create native versions
of their apps on multiple platforms. Even if your plan is to develop for a
single platform, LEADTOOLS provides a programmer friendly interface for every
major platform out there, and the flexibility and peace of mind to easily expand
in the future.
Key Features in LEADTOOLS Anywhere™ SDKs
-
Image Viewer Controls designed specifically for .NET, HTML5, WinRT,
iOS, OS X and Android
-
Load, convert and save more than 150 image formats
-
Advanced bit depth, color space and compression support for
common formats including PDF, PDF/A, JPEG, JPEG 2000, TIFF, JBIG2 and more
-
OCR to convert images to searchable text, PDF and DOC
-
Barcode reading and writing for QR, PDF417, Data Matrix, UPC/EAN
and more
-
Comprehensive Annotation and Markup including geometric shapes,
sticky note, redact, highlight and rubber stamp
-
Over 200 Image processing functions for enhancing, correcting and
manipulating images
The OCR Code
In the examples that follow, we’ll show how to convert a
platform-native image into a LEADTOOLS RasterImage
, and
then use the OCR engine to extract the searchable text. Alternatively,
developers can use the RasterCodecs
object to load and
save their images. However, using LEAD’s conversion utilities is a powerful
asset for existing applications because it requires minimal changes to your
current code base.
.NET
System.Drawing.Bitmap bitmap = ... RasterImage rasterImage = RasterImageConverter.FromImage(bitmap);
IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineAdvantage, false);
ocrEngine.Startup(null, null, null, Application.CommonAppDataPath);
IOcrDocument ocrDocument = ocrEngine.DocumentManager.CreateDocument();
IOcrPage ocrPage = ocrDocument.Pages.AddPage(rasterImage, null);
string text = ocrPage.RecognizeText(null);
WinRT
Windows.UI.Xaml.Media.ImageSource imageSource = ... RasterImage rasterImage = RasterImageConverter.ConvertFromImageSource(imageSource, ConvertFromImageOptions.None);
IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false);
ocrEngine.Startup(null, null, string.Empty, Package.Current.InstalledLocation.Path);
IOcrDocument ocrDocument = ocrEngine.DocumentManager.CreateDocument();
IOcrPage ocrPage = ocrDocument.Pages.AddPage(rasterImage, null);
string text = ocrPage.RecognizeText(null);
iOS & OS X
UIImage* uiImage = ... LTRasterImage* rasterImage = [LTRasterImageConverter convertFromImage:uiImage
options:LTConvertFromImageOptions_None
error:nil];
[ocrEngine startup:nil workDirectory:nil startupParameters:[[NSBundle mainBundle] bundlePath];
LTOcrDocument* ocrDocument = [ocrEngine.documentManager createDocument];
LTOcrPage* ocrPage = [ocrDocument.pages addPageWithImage:rasterImage
target:nil
selector:nil
error:nil];
NSString* text = [ocrPage recognizeText:nil selector:nil error:nil];
Android
android.graphics.Bitmap bitmap = ... RasterImage rasterImage = RasterImageConverter.convertFromBitmap(bitmap, ConvertFromImageOptions.NONE);
OcrEngine ocrEngine = OcrEngineManager.createEngine(OcrEngineType.Advantage);
ocrEngine.startup(null, "", null, this.getApplicationInfo().dataDir);
OcrDocument document = ocrEngine.getDocumentManager().createDocument();
OcrPage ocrPage = document.getPages().addPage(image, null);
String text = ocrPage.recognizeText(this);
Download the Full Examples
You can download fully functional demos which includes the
features discussed above. To run these examples you will need the following:
Support
Need help getting this sample up and going? Contact
our support team for free technical support! For pricing or licensing
questions, you can contact our sales team (sales@leadtools.com)
or call us at 704-332-5532.