ABCocr Reference Guide

ABCocr .NET Reference Guide

ABCocr .NET lets you OCR documents to extract text from raster images. Simple to use. Effective analysis. WebSupergoo - sticking the web together.

© 2016 WebSupergoo

Every effort has been made to ensure that the information in this manual is accurate. However WebSupergoo makes no guarantees about the accuracy or quality of this manual or any software it describes.

Apple®, Mac®, Macintosh®, QuickDraw®, and QuickTime® are trademarks of Apple Computer, Inc. Windows®, Windows NT®, Visual Basic® and Visual Studio® are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Adobe®, Acrobat®, Adobe PDF®, PostScript® and Photoshop® are trademarks of Adobe Systems Incorporated or its subsidiaries. Macromedia®, Flash™ and Macromedia Flash™ are trademarks or registered trademarks of Macromedia, Inc. in the United States and/or other countries. The use of these trademarks does not imply any sponsorship or endorsement by the owners of these trademarks.


What is ABCocr?

What is ABCocr .NET?

Use ABCocr .NET to extract text from images.

You can use ABCocr .NET from languages like C# or Visual Basic .NET.

ABCocr .NET runs on all Windows versions since Windows XP. This includes Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008, Windows 8, and Windows Server 2012.


How does it work?

ABCocr .NET is based around industry standard software. At its heart is a custom version of the Tesseract 3 engine.

The Tesseract OCR engine was originally developed by Hewlett-Packard UK. It was one of the top three engines in the 1995 UNLV Accuracy test and is probably one of the most accurate open source OCR engines available. Since then it has been extensively revised with sponsorship from Google.

Tesseract supports Arabic, English, Bulgarian, Catalan, Czech, Chinese (Simplified and Traditional), Danish (standard and Fraktur script), German, Greek, Finnish, French, Hebrew, Croatian, Hungarian, Indonesian, Italian, Japanese, Korean, Latvian, Lithuanian, Dutch, Norwegian, Polish, Portuguese, Romanian, Russian, Slovak (standard and Fraktur script), Slovenian, Spanish, Serbian, Swedish, Tagalog, Thai, Turkish, Ukrainian and Vietnamese. Tesseract can be trained to work in other languages as well.

So why wouldn't I just use Tesseract? What does ABCocr .NET add?

  • 100% Stable. Tesseract is based around a command line process which means that it does not matter if it occasionally terminates, crashes or leaks memory. If you are running a modern in-process application you absolutely cannot have this type of behavior. ABCocr resolves these issues and presents you with a 100% stable platform.
  • 100% Performant. Because Tesseract was based around a command line process it cannot multithread. ABCocr adds multithread support so you can spread load over multiple CPUs or cores and you can use it safely from multithreaded APIs like ASP.NET.
  • 100% Compatibile. Tesseract is 32 bit process and cannot be used in 64 bit applications. This is a significant issue when so many operating systems are now based around 64 bit address space. ABCocr eliminates this restriction and allows you to run in either x86 or x64 mode completely automatically.
  • 100% Consistent. Tesseract is somewhat idiosyncratic. If you've ever seen error messages telling you that your TIFF tags are in the wrong order you will know what we mean. ABCocr eliminates this idiosyncrasy and provides a simple and uniform way of dealing with OCR.
  • 100% Simple. We only have one example. Why is this? Well because it's so simple to use we couldn't think of anything else that you would need.


Acknowledgements

ABCocr incorporates a variety of freely available and open source software. Many thanks to the authors and contributors.

If you are planning to redistribute ABCocr you should reproduce these acknowledgments in your documentation.

Tesseract 3 - Apache License 2.0

Apache License

Version 2.0, January 2004

http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.

"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:

  1. You must give any other recipients of the Work or Derivative Works a copy of this License; and

  2. You must cause any modified files to carry prominent notices stating that You changed the files; and

  3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and

  4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

Leptonica - Creative Commons Attribution 3.0 United States License.

Leptonica (Dan Bloomberg) / CC BY 3.0

License

THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.

BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.

1. Definitions

  1. "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with one or more other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
  2. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
  3. "Licensor" means the individual, individuals, entity or entities that offers the Work under the terms of this License.
  4. "Original Author" means the individual, individuals, entity or entities who created the Work.
  5. "Work" means the copyrightable work of authorship offered under the terms of this License.
  6. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.

2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.

3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:

  1. to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
  2. to create and reproduce Derivative Works provided that any such Derivative Work, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";;
  3. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
  4. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.

  5. For the avoidance of doubt, where the Work is a musical composition:

    1. Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or, in the event that Licensor is a member of a performance rights society (e.g. ASCAP, BMI, SESAC), via that society, royalties for the public performance or public digital performance (e.g. webcast) of the Work.
    2. Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
  6. Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).

The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.

4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:

  1. You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of a recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. When You distribute, publicly display, publicly perform, or publicly digitally perform the Work, You may not impose any technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by Section 4(b), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by Section 4(b), as requested.
  2. If You distribute, publicly display, publicly perform, or publicly digitally perform the Work (as defined in Section 1 above) or any Derivative Works (as defined in Section 1 above) or Collective Works (as defined in Section 1 above), You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, consistent with Section 3(b) in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(b) may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear, if a credit for all contributing authors of the Derivative Work or Collective Work appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.

5. Representations, Warranties and Disclaimer

UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND ONLY TO THE EXTENT OF ANY RIGHTS HELD IN THE LICENSED WORK BY THE LICENSOR. THE LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MARKETABILITY, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.

6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. Termination

  1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works (as defined in Section 1 above) or Collective Works (as defined in Section 1 above) from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
  2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.

8. Miscellaneous

  1. Each time You distribute or publicly digitally perform the Work (as defined in Section 1 above) or a Collective Work (as defined in Section 1 above), the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
  2. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
  3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
  4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
  5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.

Creative Commons Notice

Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.

Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of the License.

Creative Commons may be contacted at http://creativecommons.org/.

LibPNG

COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:

If you modify libpng you may insert additional notices immediately following
this sentence.

This code is released under the libpng license.

libpng versions 1.0.7, July 1, 2000, through 1.6.21, January 15, 2016, are
Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are
derived from libpng-1.0.6, and are distributed according to the same
disclaimer and license as libpng-1.0.6 with the following individuals
added to the list of Contributing Authors:

Simon-Pierre Cadieux
Eric S. Raymond
Mans Rullgard
Cosmin Truta
Gilles Vollant
James Yu

and with the following additions to the disclaimer:

There is no warranty against interference with your enjoyment of the
library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is with
the user.

libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
libpng-0.96, and are distributed according to the same disclaimer and
license as libpng-0.96, with the following individuals added to the list
of Contributing Authors:

Tom Lane
Glenn Randers-Pehrson
Willem van Schaik

libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
and are distributed according to the same disclaimer and license as
libpng-0.88, with the following individuals added to the list of
Contributing Authors:

John Bowler
Kevin Bracey
Sam Bushell
Magnus Holmgren
Greg Roelofs
Tom Tanner

libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.

For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:

Andreas Dilger
Dave Martindale
Guy Eric Schalnat
Paul Schmidt
Tim Wegner

The PNG Reference Library is supplied "AS IS". The Contributing Authors
and Group 42, Inc. disclaim all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and of
fitness for any purpose. The Contributing Authors and Group 42, Inc.
assume no liability for direct, indirect, incidental, special, exemplary,
or consequential damages, which may result from the use of the PNG
Reference Library, even if advised of the possibility of such damage.

Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:

1. The origin of this source code must not be misrepresented.

2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source.

3. This Copyright notice may not be removed or altered from any
source or altered source distribution.

The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.

END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.

LibJPEG

The authors make NO WARRANTY or representation, either express or implied,
with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.

This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below.

Permission is hereby granted to use, copy, modify, and distribute this
software (or portions thereof) for any purpose, without fee, subject to these
conditions:
(1) If any part of the source code for this software is distributed, then this
README file must be included, with this copyright and no-warranty notice
unaltered; and any additions, deletions, or changes to the original files
must be clearly indicated in accompanying documentation.
(2) If only executable code is distributed, then the accompanying
documentation must state that "this software is based in part on the work of
the Independent JPEG Group".
(3) Permission for use of this software is granted only if the user accepts
full responsibility for any undesirable consequences; the authors accept
NO LIABILITY for damages of any kind.

These conditions apply to any software derived from or based on the IJG code,
not just to the unmodified library. If you use our work, you ought to
acknowledge us.

Permission is NOT granted for the use of any IJG author's name or company name
in advertising or publicity relating to this software or products derived from
it. This software may be referred to only as "the Independent JPEG Group's
software".

We specifically permit and encourage the use of this software as the basis of
commercial products, provided that all warranty or liability claims are
assumed by the product vendor.

The Unix configuration script "configure" was produced with GNU Autoconf.
It is copyright by the Free Software Foundation but is freely distributable.
The same holds for its supporting scripts (config.guess, config.sub,
ltmain.sh). Another support script, install-sh, is copyright by X Consortium
but is also freely distributable.

The IJG distribution formerly included code to read and write GIF files.
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
support has been removed altogether, and the GIF writer has been simplified
to produce "uncompressed GIFs". This technique does not use the LZW
algorithm; the resulting GIF files are larger than usual, but are readable
by all standard GIF decoders.

LibTIFF

Use and Copyright
-----------------
Silicon Graphics has seen fit to allow us to give this work away. It
is free. There is no support or guarantee of any sort as to its
operations, correctness, or whatever. If you do anything useful with
all or parts of it you need to honor the copyright notices. I would
also be interested in knowing about it and, hopefully, be acknowledged.

The legal way of saying that is:

Copyright (c) 1988-1997 Sam Leffler
Copyright (c) 1991-1997 Silicon Graphics, Inc.

Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that (i) the above copyright notices and this permission notice appear in
all copies of the software and related documentation, and (ii) the names of
Sam Leffler and Silicon Graphics may not be used in any advertising or
publicity relating to the software without the specific, prior written
permission of Sam Leffler and Silicon Graphics.

THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.


.NET Essentials

DLLs

ABCocr.dll is the main .NET assembly.

When the assembly is loaded, it locates and loads two other DLLs - Tesseract.dll and liblept168.dll.

When the assembly runs it locates data files in the tessdata folder. These data files let ABCocr recognize specific characters and words. Because different languages have different characters and words there are different data files for different languages.

For more details see the Manual Installation section of the documentation.

Refs

You need to add a reference to ABCocr from your Visual Studio Project. This tells Visual Studio to link the ABCocr assembly into the build.

If you are not using Visual Studio, you will need to consult the documentation for your chosen development environment.

Names

There is one public namespace in ABCocr. You can reference it using the following directives.

[C#]
using WebSupergoo.ABCocr3;

[Visual Basic]
Imports WebSupergoo.ABCocr3

The ABCocr3 namespace contains the classes you will use for OCR.

There is an OCR class which provides methods for assigning images to be processed. The results come back as a Page object which contains a list of Word objects. Each Word object contains a list of Blob objects which, broadly speaking, correspond to characters. All these objects have text and bounds so that you can work out where they are in the image.

Example

This is some simple example code. All it does is to report the ABCocr license information.

[C#]
Response.Write("License: " + XSettings.License + "<br>");

[Visual Basic]
Response.Write("License: " & XSettings.License & "<br>")


Simple Example

Intro

OCRing an image is a simple process. First you create an ABCocr Ocr object and you assign it an image. When it has finished processing the image you look at the results.

Code

First we create an ABCocr Ocr object and assign it an image that we want to OCR.

[C#]
Bitmap bitmap = (Bitmap)Bitmap.FromFile(inPath);
Ocr ocr = new Ocr();
ocr.SetBitmap(bitmap);

[Visual Basic]
Dim bm As Bitmap = DirectCast(Bitmap.FromFile(inPath), Bitmap)
Dim ocr As New Ocr()
ocr.SetBitmap(bm)

Code

We iterate through all the words that ABCocr has found. We then draw a rectangle round each word in the image and draw our extracted text in a different color. Finally we save the image.

[C#]
using (Graphics graphics = Graphics.FromImage(bitmap)) {
  graphics.PageUnit = GraphicsUnit.Pixel;
  foreach (Word word in ocr.Page.Words) {
    Font font = new System.Drawing.Font("Arial", word.Bounds.Height, FontStyle.Regular, GraphicsUnit.Pixel);
    TextFormatFlags flags = TextFormatFlags.NoClipping | TextFormatFlags.NoPadding;
    TextRenderer.DrawText(graphics, word.Text, font, word.Bounds, Color.Red, flags);
    graphics.DrawRectangle(Pens.Green, word.Bounds);
  }
}
bitmap.Save(outPath);

[Visual Basic]
Using gr As Graphics = Graphics.FromImage(bm)
  gr.PageUnit = GraphicsUnit.Pixel
  For Each word As Word In ocr.Page.Words
    Dim flags As TextFormatFlags = TextFormatFlags.NoClipping Or TextFormatFlags.NoPadding
    TextRenderer.DrawText(gr, word.Text, font, word.Bounds, Color.Red, flags)
    gr.DrawRectangle(Pens.Green, word.Bounds)
  Next
End Using
bm.Save(outPath)

Results

1-report.png

output.png


Manual Installation

Under most circumstances, you will want to install ABCocr .NET using the standard installer and register your license using the OCRSettings control panel.

Occasionally, you may wish to install ABCocr manually. To do this, you will need the files listed below.

File Name Notes
ABCocr.dll

The Assembly used by .NET.

The installer places this assembly in the GAC to allow global access from any .NET application. It installs a second reference copy at the following location:

%ProgramFiles%\WebSupergoo\ABCocr3 .NET\Common\

However, if you are installing manually you can just place this file in the bin directory of your application.
Tesseract.dll

The Tesseract core engine.

This DLL contains the core OCR engine, typically placed at:

%windir%\system32 [x86 systems]
%windir%\SysWow64\system32 [x64 systems]

However if you are installing manually you can just place this file in the bin directory of your application.

The fact that the DLL is 32 bit is not important as ABCocr will perform any 64 to 32 bit thunks automatically.
liblept168.dll

The Leptonica core engine.

This DLL contains the core graphics engine, typically placed at:

%windir%\system32 [x86 systems]
%windir%\SysWow64\system32 [x64 systems]

However if you are installing manually you can just place this file in the bin directory of your application.

The fact that the DLL is 32 bit is not important as ABCocr will perform any 64 to 32 bit thunks automatically.

tessdata
(directory)

This directory contains the training data files that Tesseract needs to be able to recognise different scripts.

ABCocr comes with a variety of different data files, designed to cover a wide variety of languages. It is designed to work out of the box. However if you have specific requirements you can generate your own Tesseract 3 compliant files and use these instead or as well. Equally, if you want to redistribute and you don't want the overhead of all the languages that come included with ABCocr you can strip the directory down to basics.

The ABCocr installer creates a tessdata folder at:

%ProgramFiles%\WebSupergoo\ABCocr3 .NET\Common\

If you are installing manually you can just place a copy of this folder in the bin directory of your application.

Typically you will want to locate this folder in the same folder as ABCocr.dll.

Most calls to ABCocr will result in a trial license being installed if it is found that no license has yet been installed. At minimum, all that is required is to query the value of the XSettings.License property.

[C#]
using WebSupergoo.ABCocr3;
MessageBox.Show("New License: " + XSettings.License);

[Visual Basic]
Imports WebSupergoo.ABCocr3
MessageBox.Show("New License: " + XSettings.License)

You can use a full license key as provided to you when you purchase, or you can use a trial license key copied from the PDFSettings application. To enter a license key, call XSettings.InstallLicense at application startup before any ABCocr objects have been created.

[C#]
using WebSupergoo.ABCocr3;
// Here we use a trial license key as copied from the OCRSettings application.
if (XSettings.InstallLicense("cd9b5c07db69df2bf57c0a04d9bca58b10c44889c9fb197984e592f49addfce5ec5fe85d7b9205bc"))
  MessageBox.Show("License Installed Successfully: " + XSettings.License);
else
  MessageBox.Show("License Installation Failed");

[Visual Basic]
Imports WebSupergoo.ABCocr3
' Here we use a trial license key as copied from the OCRSettings application.
If XSettings.InstallLicense("cd9b5c07db69df2bf57c0a04d9bca58b10c44889c9fb197984e592f49addfce5ec5fe85d7b9205bc") Then
  MessageBox.Show("License Installed Successfully: " + XSettings.License)
Else
  MessageBox.Show("License Installation Failed")
End If

The ABCocr installer performs checks at installation time in order to ensure that a trial license is installed. However, installing a license at other times can be problematic if your code is operating from a reduced permission account such as that associated with ASP.NET.

If this is the case or if you have purchased a Redistribution license, you need to call XSettings.InstallRedistributionLicense at application startup before any ABCocr objects have been created. You only need to call this method once though calling it additional times will not cause problems. The license will remain available to the process until it unloads.


Ocr Class

The base Optical Character Recognition class.

System.Object
   WebSupergoo.ABCocr3.Ocr

Method | Description
Throws Exceptions SetBitmap | Specify an image for OCR.

Property | Description
Language | The default language for the task.
PageSegmentation | The page segmentation to be applied to the task.
State | The State of the current task.
Optimizations | Whether the task should be optimized for accuracy over speed.
Protected | Whether the task should be run in protected mode for stability and performance.
Page | The results of the OCR task.
Timeout | The timeout to be used when processing an image.
Variables | Any custom variables for the OCR engine.
Warnings | Warnings which are raised during the recognition task.


SetBitmap Function

Specify an image for OCR.

Syntax

[C#]
void SetBitmap(Bitmap bitmap)
void SetBitmap(Bitmap bitmap, bool dispose)

[Visual Basic]
Sub Read(bitmap As Bitmap)
Sub Read(bitmap As Bitmap, dispose as Boolean)

Throws Exceptions may throw Exception()

Params
Name | Description
bitmap | The System.Drawing.Bitmap to be processed.
dispose | Whether to dispose of the System.Drawing.Bitmap after use. Default false.

Notes

Use this method to specify an image for OCR.

The image will be processed and the Page property will be updated with the results of the operation. Any existing Page content will be lost. If an error occurs then an exception will be thrown.

You may wish to allow ABCocr to dispose of the image as soon as it has finished with it. This is particularly useful if operating from multiple threads and if each bitmap is large as it will ensure that memory use is kept reasonable.

Performing OCR can be a lengthy and time consuming operation. As such you may wish to specify a Timeout for the operation. If the operation takes longer than the specified time then an exception will be thrown.

Example

None.


Language Property

Type | Default | Read Only | Description
[C#] string [Visual Basic] String | "eng" | No | The language that text is expected to be in.

Notes

This property determines the language for OCR.

Each language has a unique set of characters and words. The set of characters and words is used to train Tesseract in the types of content that it might find. So if Tesseract is looking at documents with an English training it will be expecting to see different content than if it was looking at it from a German perspective.

The language property is a character code that directly relates to training files in the tessdata folder. For example if the language is "eng" then Tesseract will be looking for files such as "eng.traineddata" in the tessdata folder. The language codes are generally taken from the ISO 639 standard. For example:

  • eng - English
  • chi_sim - Simplified Chinese (Mainland China)
  • chi_tra - Traditional Chinese (Hong Kong and Taiwan)
  • deu - German
  • fra - French
  • heb - Hebrew
  • ita - Italian
  • jpn - Japanese
  • kor - Korean
  • pol - Polish
  • por - Portuguese
  • rus - Russian
  • spa - Spanish
  • tha - Thai

ABCocr ships with setups for many languages - see the tessdata folder for details. However to save space we do not include the Chinese, Japanese, Korean, Thai, Vietnamese, Arabic and Hindi trained data. If you need these files you can download them from the Tesseract web site.

If you wish you can create your own training files for your own languages and text. See the Tesseract web site for details of how to do this.

Example

None.


Segmentation Property

Type | Default | Read Only | Description
[C#] Segmentation [Visual Basic] Segmentation | Auto | No | The page segmentation mode.

Notes

This property determines the page segmentation mode for OCR.

The page segmentation defines how a page is broken up into pieces before OCR is applied to each of these sections.

The Segmentation enum can take the following values:

  • OsdOnly - Orientation and script detection only
  • AutoOsd - Automatic page segmentation with orientation and script detection
  • AutoOnly - Automatic page segmentation but no orientation and script detection or OCR
  • Auto - Fully automatic page segmentation, but no OSD (default)
  • SingleColumn - A single column of text of variable sizes
  • SingleBlockVerticalText - A single uniform block of vertically aligned text
  • SingleBlock - A single uniform block of text
  • SingleLine - A single text line
  • SingleWord - A single word
  • CircleWord - A single word in a circle
  • SingleChar - A single character
  • SparseText - As much text as possible in no particular order
  • SparseTextOsd - Sparse text with orientation and script detection
  • RawLine - A single text line in raw format

Single word or character segmentation can increase the reliability of OCR when very small numbers of characters are involved. OSD options are appropriate when the language and orientation is unknown.

Example

None.


Optimizations Property

Type | Default | Read Only | Description
[C#] Optimizations [Visual Basic] Optimizations | n/a | Yes | The optimizations to be applied to the OCR process.

Notes

How the task should be optimized for speed, accuracy and memory use.

ABCocr operates a variety of techniques to improve the accuracy of text recognition. This setting allows you to select the optimizations that should be applied.

Example

None.


Page Property

Type | Default | Read Only | Description
[C#] Page [Visual Basic] Page | n/a | Yes | The results of the OCR task.

Notes

This property holds the results of the OCR task.

The property is a Page which contains a sequence of Words. Each Word consists of a sequence of Blobs.

Broadly speaking a Blob corresponds with a character.

Example

None.


Protected Property

Type | Default | Read Only | Description
[C#] bool [Visual Basic] Boolean | true | No | Whether the task should be run in protected mode for stability and performance.

Notes

Whether the task should be run in protected mode for stability and performance.

Running in unprotected mode is useful only for certain kinds of low level debugging operations. As such it is unlikely that you will want to change the value of this property.

Example

None.


State Property

Type | Default | Read Only | Description
[C#] State [Visual Basic] State | n/a | Yes | The State of the current task.

Notes

The state of the current task, typically accessed from a different thread.

By accessing this property from a different thread one can implement a progress bar and cancel features.

Example

None.


Timeout Property

Type | Default | Read Only | Description
[C#] TimeSpan [Visual Basic] TimeSpan | 0 ms | No | The timeout to be used when processing an image as a System.TimeSpan.

Notes

This property determines the timeout to be used when processing an image.

If the operation takes longer than the timeout then an exception will be thrown and no results returned.

A zero timeout is taken as no timeout.

Example

None.


Variables Property

Type | Default | Read Only | Description
[C#] Dictionary<string, string> [Visual Basic] Dictionary<string, string> | null | No | Any custom variables that should be passed to the Optical Character Recognition engine.

Notes

Any custom variables that should be passed to the Optical Character Recognition (OCR) engine.

For example the Tesseract OCR engine accepts a variable named "tessedit_char_whitelist" which can be used to specify a reduced range of characters to recognize. This can be useful if, say, you wish to restrict the character set to numeric digits.

If the value of this property is null then no variables will be passed.

Example

None.


Warnings Property

Type | Default | Read Only | Description
[C#] string [Visual Basic] String | "eng" | No | Warnings which are raised during the recognition task.

Notes

Warnings which are raised during the recognition task.

In general character recognition processes do not really either fail or succeed. It is true that sometimes they are more successful than others, that sometimes things run smoothly, that sometimes they hit problems. However it is quite normal to find that parts of a document can be recognized fairly well but that other parts are more troublesome.

In the event of an exceptional failure ABCpdf will indeed throw an exception. However if it simply hits some rough patches but manages to extract a useful amount of text then any problems will be reported via this property rather than via an exception.

Example

None.


Ocr Class

Optimizations Class

The optimizations to be applied to the OCR process.

System.Object
   WebSupergoo.ABCocr3.Optimizations

Method | Description
none | none

Property | Description
ScaleFactor | By what factor the image should be scaled before processing.


Progress Property

ScaleFactor Property

Type | Default | Read Only | Description
[C#] double [Visual Basic] double | 1.0 | No | By what factor the image should be scaled before processing.

Notes

Selecting an appropriate scale factor is useful for both speed and accuracy.

If images are very large they may take a long time to process. Reducing the size of an image can result in dramatic speed improvements without any loss in accuracy. In general you should be aiming at text with a height of about twenty pixels. So if your test is scanned at a resolution which results in a character height of forty pixels, a scale factor of 0.5 might be appropriate.

If text is very small, increasing the size of the image can result in dramatic improvements in accuracy of recognition. A scale factor of two results in major improvements. A scale factor of four results in further small improvements. Factors greater than this are not effective. Note that this type of upscaling is only appropriate in cases where the original image is available in grayscale or color - not in black and white.

Example

None.


Ocr Class

State Class

The state of an Optical Character Recognition task.

System.Object
   WebSupergoo.ABCocr3.State

Method | Description
Cancel | Cancel an ongoing OCR task.
Reset | Reset the state of an OCR task after it has been finished.

Property | Description
Progress | The progress of the current OCR task as a percentage.
Cancelled | Whether the current OCR task has been cancelled.
Complete | Whether the current OCR task has been completed.


Cancel Function

Cancel an ongoing OCR task.

Syntax

[C#]
void Cancel()

[Visual Basic]
Sub Cancel()

Params
Name | Description
return | None.

Notes

Use this method to cancel an ongoing OCR task.

After cancellation the Progress will no longer increment and both the Complete and Cancelled properties will be set to true.

Partial OCR results may or may not be available depending on when the operation was cancelled.

Example

None.


Reset Function

Reset the state of an OCR task.

Syntax

[C#]
void Reset()

[Visual Basic]
Sub Reset()

Params
Name | Description
return | None.

Notes

Use this method to reset the state of an OCR task after it has been finished.

On reset the Cancelled and Complete properties will be set to false and the Progress property will be set to zero.

Example

None.


Cancelled Property

Type | Default | Read Only | Description
[C#] bool [Visual Basic] Boolean | false | Yes | Whether the current OCR task has been cancelled.

Notes

Whether the current OCR task has been cancelled.

Calling Cancel will cancel the current OCR task and cause this property to be set to true.

Example

None.


Complete Property

Type | Default | Read Only | Description
[C#] bool [Visual Basic] Boolean | false | Yes | Whether the current OCR task has been completed.

Notes

Whether the current OCR task has been completed.

This property does not indicate the success of the task - both cancelled tasks and failed tasks are marked as complete. The property simply indicates whether the task is still processing or not.

Example

None.


Progress Property

Type | Default | Read Only | Description
[C#] int [Visual Basic] int | 0 | Yes | The progress of the current OCR task as a percentage.

Notes

The progress of the current OCR task as a percentage.

The progress starts at zero and then increments up to one hundred. This property should not be used to determine if the task is complete or not - for that you should use the Complete property.

Example

None.


Page Class

An object encapsulating a page of an image.

System.Object
   WebSupergoo.ABCocr3.Page

Method | Description
none | none

Property | Description
Bounds | The bounds of the image.
Text | The text found in the image.
Words | The words found in the image.


Bounds Property

Type | Default | Read Only | Description
[C#] Rectangle [Visual Basic] Rectangle | n/a | Yes | The bounds of the image as a System.Drawing.Rectangle.

Notes

The bounds of the image as a System.Drawing.Rectangle.

Example

None.


Text Property

Type | Default | Read Only | Description
[C#] string [Visual Basic] String | n/a | Yes | The text found in the image.

Notes

The text found in the image, represented as one string.

We attempt to add spaces and carriage returns as appropriate to provide a meaningfully extraction of text. However if your documents contain complex structures such as columns or tables then you may wish to do your own analysis using the Words property.

Example

None.


Words Property

Type | Default | Read Only | Description
[C#] ReadOnlyCollection<Word> [Visual Basic] ReadOnlyCollection<Word> | n/a | Yes | The words found in the image.

Notes

This property holds all the words in the image.

Example

None.


Word Class

An object encapsulating a word on a page.

System.Object
   WebSupergoo.ABCocr3.Word

Method | Description
none | none

Property | Description
Bounds | The bounds of the word.
Blobs | The blobs that make up the word.
Confidence | The confidence of the match as a percentage.
Text | The text of the word.


Blobs Property

Type | Default | Read Only | Description
[C#] ReadOnlyCollection<Blob> [Visual Basic] ReadOnlyCollection<Blob> | n/a | Yes | The blobs that make up the word.

Notes

The blobs that make up the word.

A blob typically corresponds to a single character. However if two characters are joined together then a blob may correspond to more than one character.

Example

None.


Bounds Property

Type | Default | Read Only | Description
[C#] Rectangle [Visual Basic] Rectangle | n/a | Yes | The bounds of the word as a System.Drawing.Rectangle.

Notes

The bounds of the word as a System.Drawing.Rectangle.

Example

None.


Confidence Property

Type | Default | Read Only | Description
[C#] int [Visual Basic] Integer | n/a | Yes | The confidence of the match as a percentage.

Notes

Some words are clearer than others. Some text is ambiguous. In these cases we may have to decide between multiple possible interpretations.

This property reflects the level of confidence we have in the Text assigned to the word.

Example

None.


Text Property

Type | Default | Read Only | Description
[C#] string [Visual Basic] String | n/a | Yes | The text of the word.

Notes

The text of the word.

The level of certainty that the text is correct is reflected in the Confidence property.

Example

None.


Blob Class

An object encapsulating a small part of a word such as a character.

System.Object
   WebSupergoo.ABCocr3.Blob

Method | Description
none | none

Property | Description
Bounds | The bounds of the blob.
Text | The text of the blob.


Bounds Property

Type | Default | Read Only | Description
[C#] Rectangle [Visual Basic] Rectangle | n/a | Yes | The bounds of the blob as a System.Drawing.Rectangle.

Notes

The bounds of the blob as a System.Drawing.Rectangle.

Example

None.


Text Property

Type | Default | Read Only | Description
[C#] string [Visual Basic] String | n/a | Yes | The text of the blob.

Notes

The text of the blob.

Example

None.


XSettings Object

Global setting class.

This static class is used to access global information about ABCocr and to control the way ABCocr works. This class cannot be instantiated.

System.Object
   WebSupergoo.ABCocr3.XSettings

Method | Description
InstallLicense | Install a license.
InstallRedistributionLicense | Install a redistribution license.
InstallSystemLicense | Install a system license.
InstallTrialLicense | Install a trial license.
Register | Register and install trial license.

Property | Description
License | The current license for the software.
Licensee | The current licensee for the software.
LicenseValid | Whether the current license is valid.
PoolSize | The pool size for multithreaded operation.
PoolTimeout | The timeout for the pool for multithreaded operation.
TessData | The location of the tessdata directory.
TessVersion | The current Tesseract version.
TrialKey | A trial license key used for remote deployment.
Version | The software version.


InstallLicense Method

Install a license.

Syntax

[C#]
bool InstallLicense(string license)

[Visual Basic]
Function InstallLicense(license As String) As Boolean

Params
Name | Description
license | The license to install.
return | True if a license is installed, otherwise false.

Notes

Use this method to install a license. Call this method at application startup before any ABCocr objects have been created. You only need to call this method once though calling it additional times will not cause problems.

Any license installed using this method will remain available to the current process (or application pool) until it unloads.

Example

See Manual Installation.


InstallRedistributionLicense Method

Install a redistribution license.

Syntax

[C#]
bool InstallRedistributionLicense(string license)

[Visual Basic]
Function InstallRedistributionLicense(license As String) As Boolean

Params
Name | Description
license | The license to install.
return | True if a license is installed, otherwise false.

Notes

Use this method to install a redistribution license. Call this method at application startup before any ABCocr objects have been created. You only need to call this method once though calling it additional times will not cause problems.

Any license installed using this method will remain available to the current process (or application pool) until it unloads.

Example

See Manual Installation.


InstallSystemLicense Method

Install a system license.

Syntax

[C#]
bool InstallSystemLicense(string license)

[Visual Basic]
Function InstallSystemLicense(license As String) As Boolean

Params
Name | Description
license | The license to install.
return | True if a license is installed, otherwise false.

Notes

Use this method to install a system license. Call this method at application startup before any ABCocr objects have been created.

This method saves the license for use on a system-wide basis. So, once a license is successfully installed, it will stay on the system and be picked up by ABCocr automatically.

Licenses are specific to the process model so licenses installed for 32-bit ABCocr will not be available to 64-bit ABCocr and vice versa. Indeed, a license may be installed successfully without being valid for the current process so it is a good idea to check LicenseValid after installing a system license.

For security reasons, you should not use this method unless you have complete control of the system on which you are installing.

Example

See Manual Installation.


InstallTrialLicense Method

Install a trial license

Syntax

[C#]
bool InstallTrialLicense(string license)

[Visual Basic]
Function InstallTrialLicense(license As String) As Boolean

Params
Name | Description
license | The license to install.
return | True if a license is installed, otherwise false.

Notes

Use this method to install a trial license. Call this method at application startup before any ABCocr objects have been created. You only need to call this method once though calling it additional times will not cause problems.

Any license installed using this method will remain available to the current process (or application pool) until it unloads.

Example

See Manual Installation.


Register Method

Register and install a trial license.

Syntax

[C#]
void Register()

[Visual Basic]
Sub Register()

Params
Name | Description
return | None.

Notes

Use this method to register ABCocr and install a trial license if no license is installed.

You should never need to call this method as both the process of installing and the process of running the OCRSettings application will automatically register ABCocr.

If for some reason the registration fails, all you need to do is run the OCRSettings application as Administrator.

Example

None.


License Property

Type | Default Value | Read Only | Description
[C#] string [Visual Basic] String | None | Yes | The current license for the software.

Notes

This property describes the current license for the software in human readable format. Typically, this will be trial, standard or professional.

Example

None.


Licensee Property

Type | Default Value | Read Only | Description
[C#] string [Visual Basic] String | None | Yes | The current licensee for the software.

Notes

This property retrieves the licensee for the software and presents it in a human readable format.

The licensee is the legal entity to which ABCocr is registered. The licensee is selected at the point at which a license is purchased and that license is specific to that entity. Licensees are normally companies but may be individuals.

Example

None.


LicenseType Property

Type | Default | Read Only | Description
[C#] LicenseType [Visual Basic] LicenseType | n/a | Yes | The current feature level for the software.

Notes

The LicenseType enumeration may take the following values:

  • None
  • TimePeriod
  • Standard
  • Professional

Example

None.


LicenseValid Property

Type | Default Value | Read Only | Description
[C#] bool [Visual Basic] Boolean | None | Yes | Whether the current license is valid.

Notes

This property determines whether the current license is valid.

After installing a license, you may wish to check that it is installed and valid using this property.

Example

None.


PoolSize Property

Type | Default Value | Read Only | Description
[C#] int [Visual Basic] Integer | None | Yes | The pool size.

Notes

The pool size for multithreaded operation.

ABCocr operates a pool of worker processes for OCR tasks. This setting determines the maximum number of workers in the pool.

Example

None.


PoolTimeout Property

Type | Default | Read Only | Description
[C#] TimeSpan [Visual Basic] TimeSpan | 0 ms | No | The pool timeout to be used when processing an image.

Notes

This property determines the timeout to be used when processing an image.

If an operation takes longer than the timeout then an exception will be thrown and the pool restarted. This value should be greater than the Ocr.Timeout.

A zero timeout is taken as no timeout.

Example

None.


TessData Property

Type | Default Value | Read Only | Description
[C#] string [Visual Basic] String | n/a | No | The location of the tessdata directory.

Notes

This property contains the location of the tessdata directory. You may wish to check the location or you may wish to change it from the default.

On load ABCocr will perform an exhaustive search to find the tessdata directory.

It looks in the ABCocr Common directory - typically at "%ProgramFiles%\WebSupergoo\ABCocr3 .NET\Common\".

Then it starts at the location of the ABCocr assembly moving up the directory tree looking for either a tessdata directory or a tesseract/tessdata directory.

Then it repeats the process starting at the current working directory and moving up the directory tree.

Then it looks at the value of the %TESSDATA_PREFIX% environment variable in case that provides a tessdata directory.

Finally it looks at "C:\Program Files\Tesseract-OCR" and "C:\Program Files (x86)\Tesseract-OCR".

If it is still unable to locate the files then it will throw an exception.

Example

None.


TessVersion Property

Type | Default Value | Read Only | Description
[C#] string [Visual Basic] String | None | Yes | The current Tesseract version.

Notes

This property describes the current version of Tesseract.

Example

None.


TrialKey Property

Type | Default Value | Read Only | Description
[C#] string [Visual Basic] String | None | Yes | A trial license key used for remote deployment.

Notes

This property contains a trial license that you can use for remote deployment.

If ABCocr has not yet been registered, this property will be empty.

Example

None.


Version Property

Type | Default Value | Read Only | Description
[C#] int [Visual Basic] Integer | None | Yes | The software version.

Notes

This property gets the software version.

Example

None.