Вы находитесь на странице: 1из 3

Puma.

NET OCR SDK getting started


With Puma.NET recognition can be as simple as the following lines of code:
var pumaPage = new PumaPage("page001.jpg");
using(pumaPage)
{
pumaPage.FileFormat = PumaFileFormat.RtfAnsi;
pumaPage.na!le"peller = false;
pumaPage.#anguage = Puma#anguage.nglis$;
pumaPage.Re%ogni&e'oFile("page001.rtf");
(
You can either download a setup package (.msi file) that contains binar files and reference
documentation in order to faster tr Puma.NET or ou ma download the entire !isual "tudio
#$$% solution containing source codes of the pro&ect. The below description gi'es ou the
general information on Puma.NET and how ou can gain it in our .NET applications.
Puma.NET Runtime Components:
(. Puma.Net.dll ) class librar that contains the classes (actuall one essential * PumaPage)
that should be used in our application to gain +,- functionalit.
#. ,unei/orm binar files (Puma ,+01 233s1 2ictionaries etc.) ) the underlining
recognition engine b ,ogniti'e Technologies.
4. puma.interop.dll ) interoperation assembl consumed b Puma.Net.dll in order to
marshal operation calls to Puma ,+0 "er'er.
5. dibapi.dll ) nati'e Win4# 233 that contains functions necessar to work with data
structures that Puma ,+0 and puma.interop.dll consume. This librar should be
accessible to the application referencing Puma.Net.dll.
"olution (source codes) contains merge module (msm) pro&ect holding all necessar runtime
components that ou ma include in an 0" deploment pro&ect. 6t will ease redistribution of
+,- components with de'eloped applications.
Installing and using Puma.NET
7fter downloading and installing the deploment pro&ect PumaNet.msi the target folder will be
of the following contents:
7ssemblies folder ) contains files Puma.Net.dll1 puma.interop.dll1 dibapi.dll. these three
files are to be accessible to the e8ecutable referencing Puma.Net.dll.
,+0 "er'er folder ) contains binar files of ,unei/orm recognition engine (as well as
Puma ,+0 "er'er file apuma.dll). ,+0 ser'er is automaticall registered during
installation.
,+0 "er'er9-egister folder ) contains batch files that allow to manuall
register:unregister ,+0 ser'er.
;elp folder ) contains PumaNET.chm with generated reference documentation on classes
of Puma.Net.dll. 6t also contains other documentation files (like getting started ou are
reading).
"ample folder ) contains sample Windows /orms application (with source codes) using
Puma.NET.
7t first ou ma re'iew the sample application that demonstrates +,- capabilities of
Puma.NET.
<enerall an application needs to reference Puma.Net.dll in order to access recognition classes.
6t=s also necessar to insure that puma.interop.dll is placed in the same folder as Puma.Net.dll
(that=s true after installing as the are in 7ssemblies folder) in order when adding reference with
the help of !isual "tudio the en'ironment to be capable to find it and cop both files to the
output folder.
6t=s also important that librar dibapi.dll is placed in the same folder as the running application
so it could be found and loaded b it.
"teps to add Puma.NET to our pro&ect:
(. 7dd reference to Puma.Net.dll.
#. 0ake sure that after pro&ect building the output folder (i.e. bin92ebug or bin9-elease)
contains files Puma.Net.dll and puma.interop.dll. 6f the last is not present (62E didn=t
cop it) cop it to the folder manuall.
4. ,op dibapi.dll to the output folder.
7fter all necessar files are accessible to the application ou ma test +,- functionalit.
Note:
7ssemblies Puma.Net.dll and puma.interop.dll are strong named and can be put to <7,.
dibapi.dll can be placed in folder Windows9"stem4#.
6f the abo'e conditions are true it=s not necessar for those files abo'e to be in the same
folder as consuming application.
Puma.NET classes
7s ou can see the class model is simple:
(. PumaPage ) the main class that processes a single image (a page) and produces
recognition results in a form of a file or a string 'alue. 0ost recognition parameters
(language1 output format etc.) are set 'ia public properties of this class.
#. Puma/ont"ettings ) the class groups recognition parameters regarding fonts (boldness1
underline1 font names to produce output etc.).
4. Puma3anguage 1 Puma/ile/ormat ) enumerations for corresponding properties in
PumaPage.
5. 6PumaE8tension ) classes implementing this interface can be aggregated within
PumaPage in order to e8tend its functionalit.
>. -ecognitionProgressE'ent;andler1 -ecognitionE'ent7rgs1 -ecognitionE8ception )
maintaining recognition e'ents and special errors.
"tring literals issued b classes in this assembl are stored in resources thereb can be easil
locali?ed.