You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: info/api/Addon_OCRPro.md
+64-62Lines changed: 64 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ Download(
50
50
```
51
51
52
52
---
53
+
53
54
## IsModuleInstalled
54
55
55
56
**Syntax**
@@ -347,6 +348,7 @@ interface Redaction {
347
348
**Usage notes**
348
349
349
350
A Settings object can be created with the following method.
351
+
350
352
```typescript
351
353
/**
352
354
* Create a new "Settings" object.
@@ -366,29 +368,33 @@ The OCR Professional engine runs as a service. The workflow is like this
366
368
367
369
The following demonstrates the structures of the OCR Request and the Response.
368
370
369
-
### OCRPro.ServerSide.Request
371
+
### OCRPro.ServerSide.Request
370
372
371
-
```javascript
373
+
```javascript
372
374
{
373
375
productKey:"***",
374
376
inputFile: ["d:\\input\\test.tif"],
375
377
outputFile:" d:\\temp\\ocrresult.pdf",
376
-
zones: [[100, 100, 200, 300]],
377
-
settings:
378
-
{
379
-
recognitionModule:"auto", /*optional*/
378
+
zones: [
379
+
[100, 100, 200, 300]
380
+
],
381
+
settings: {
382
+
recognitionModule:"auto",
383
+
/*optional*/
380
384
languages:"eng,arabic",
381
385
recognitionMethod:"File",
382
-
threadCount:"2", /*optional*/
386
+
threadCount:"2",
387
+
/*optional*/
383
388
outputFormat:"IOTPDF",
384
-
pdfVersion:"1.7", /*optional*/
385
-
pdfAVersion:"pdf/a-2a", /*optional*/
386
-
redaction:
387
-
{
389
+
pdfVersion:"1.7",
390
+
/*optional*/
391
+
pdfAVersion:"pdf/a-2a",
392
+
/*optional*/
393
+
redaction: {
388
394
"findText":"TWAIN",
389
395
"findTextFlags":1,
390
396
"findTextAction":0
391
-
}
397
+
}
392
398
}
393
399
}
394
400
```
@@ -397,79 +403,75 @@ The following demonstrates the structures of the OCR Request and the Response.
397
403
|:-|:-|
398
404
|**productKey**| The product key which is generated from an OCR license. |
399
405
|**inputFile**| Specify the files to be OCR'd. This is an array of strings which are absolute paths of the files. The supported formats are BMP, JPG, TIF, PDF, PNG, JBIG2, JPEG2000, PCX, etc. Please note the use of '\\\\' instead of just '\\'. |
400
-
|**outputFile**| Specify where the output file is saved. If the input includes more than one file, all of them will be merged into one file. Otherwise, the result will only be returned in the [OCRPro.ServerSide.Response](#ocrproserversideresponse). |
401
-
|**zones**| Specify which zones are to be OCR'd on an image. There can be multiple zones but it works only when the `recognitionMethod` is `Page`. The coordinates are in the sequence of `[[left, top, right, bottom]]`.|
406
+
|**outputFile**| Specify where the output file is saved. If the input includes more than one file, all of them will be merged into one file. Otherwise, the result will only be returned in the [OCRPro.ServerSide.Response](#ocrproserversideresponse). |
407
+
|**zones**| Specify which zones are to be OCR'd on an image. There can be multiple zones but it works only when the `recognitionMethod` is `Page`. The coordinates are in the sequence of `[[left, top, right, bottom]]`.|
402
408
|**settings**| Configure the OCR. |
403
-
|**.recognitionModule**| Specify which module is to be used for this OCR. Allowed values are: `mostaccurate`, `fastest`, `balanced` and `auto`. `auto` is the default value which means the library will choose one of the 3 modules automatically. |
404
-
|**.languages**|Specify the language for this OCR. For example, English: "eng", Arabic :"arabic". You can also set multiple languages like this "eng,arabic". |
409
+
|**.recognitionModule**| Specify which module is to be used for this OCR. Allowed values are: `mostaccurate`, `fastest`, `balanced` and `auto`. `auto` is the default value which means the library will choose one of the 3 modules automatically. |
410
+
|**.languages**|Specify the language for this OCR. For example, English: "eng", Arabic :"arabic". You can also set multiple languages like this "eng,arabic". |
405
411
|**.recognitionMethod**| Specify how the OCR is done. There are two methods: `Page` is the default value and it means the OCR is performed per page, the other method is `File` which means the OCR is performed per file. The method `File` is faster and it supports multiple threads. But only the method `Page` supports zonal OCR and returning detailed. |
406
-
|**.threadCount**| Specify the maximum number of threads to be used OCRing. The default value is -1 which means all possible threads will be used. This setting is only valid when `recognitionMethod` is set to `File`. |
407
-
|**.outputFormat**| Specify the output format. Allowed values are `TXTS`, `TXTCSV`, `TXTF`, `XML`, `IOTPDF`, `IOTPDF_MRC`|
408
-
|**.pdfVersion**| Specify the version of the PDF file if the `outputFormat` is set to either `IOTPDF` or `IOTPDF_MRC`. The version number allowed ranges from 1.0 to 1.7 and by default it is 1.5. |
409
-
|**.pdfAVersion**| Specify the version of the PDF/A file if the `outputFormat` is set to either `IOTPDF` or `IOTPDF_MRC`. The version number allowed are `pdf/a-1a`, `pdf/a-1b`, `pdf/a-2a`, `pdf/a-2b`, `pdf/a-2u`, `pdf/a-3a `, `pdf/a-3b`, `pdf/a-3u`. |
412
+
|**.threadCount**| Specify the maximum number of threads to be used OCRing. The default value is -1 which means all possible threads will be used. This setting is only valid when `recognitionMethod` is set to `File`. |
413
+
|**.outputFormat**| Specify the output format. Allowed values are `TXTS`, `TXTCSV`, `TXTF`, `XML`, `IOTPDF`, `IOTPDF_MRC`|
414
+
|**.pdfVersion**| Specify the version of the PDF file if the `outputFormat` is set to either `IOTPDF` or `IOTPDF_MRC`. The version number allowed ranges from 1.0 to 1.7 and by default it is 1.5. |
415
+
|**.pdfAVersion**| Specify the version of the PDF/A file if the `outputFormat` is set to either `IOTPDF` or `IOTPDF_MRC`. The version number allowed are `pdf/a-1a`, `pdf/a-1b`, `pdf/a-2a`, `pdf/a-2b`, `pdf/a-2u`, `pdf/a-3a `, `pdf/a-3b`, `pdf/a-3u`. |
410
416
|**.redaction**| Specify how the redaction is done. |
411
417
|**..findText**| A string to specify what to find. |
412
418
|**..findTextFlags**| Specify how the text is found. The allowed values are 1 (WHOLEWORD), 2 (MATCHCASE) amd 4 (FUZZYMATCH). |
413
419
|**..findTextAction**| Specify how redaction is done. The allowed values are 0 (HIGHLIGHT), 1 (STRIKEOUT) and 2 (MARKFORREDACT). |
|**inputFile**|Check out [OCRPro.ServerSide.Request](#ocrproserversiderequest) for more info.|
467
-
|**settings**|Check out [OCRPro.ServerSide.Request](#ocrproserversiderequest) for more info.|
468
-
|**outputFile**|Check out [OCRPro.ServerSide.Request](#ocrproserversiderequest) for more info.|
468
+
|**inputFile**|Check out [OCRPro.ServerSide.Request](#ocrproserversiderequest) for more info.|
469
+
|**settings**|Check out [OCRPro.ServerSide.Request](#ocrproserversiderequest) for more info.|
470
+
|**outputFile**|Check out [OCRPro.ServerSide.Request](#ocrproserversiderequest) for more info.|
469
471
|**ocrTotalCount**|Return the number of pages allowed to be OCR'd by the current license.|
470
472
|**alreadyOCRCount**|Return the number of pages already OCR'd.|
471
-
|**code**|Return the error code for the OCR. If it's not `0`, check `errorList` for more details.|
473
+
|**code**|Return the error code for the OCR. If it's not `0`, check `errorList` for more details.|
472
474
|**message**|Return the overall error message.|
473
475
|**errorList**|Return the detailed error messages for each of the OCR'd files.|
474
-
|**resultFile**|Return the result file encoded as a base64 string. It only works when [OCRPro.ServerSide.Request](#ocrproserversiderequest) doesn't specify an output file path.|
475
-
|**resultDetail**|Return detailed OCR result down to each found letter in JSON format. This is only valid when the `recognitionMethod` is set to `Page`.|
476
+
|**resultFile**|Return the result file encoded as a base64 string. It only works when [OCRPro.ServerSide.Request](#ocrproserversiderequest) doesn't specify an output file path.|
477
+
|**resultDetail**|Return detailed OCR result down to each found letter in JSON format. This is only valid when the `recognitionMethod` is set to `Page`.|
0 commit comments