IRPCScanningAndOCR.OCROperation_Begin
Vault API / standard write session idempotent returns metadata structure version
Starts an OCR job on a file of a document that the caller has checked out.
| Service | Scanning and OCR MFiles.IRPCScanningAndOCR |
|---|---|
| gRPC method | /MFiles.IRPCScanningAndOCR/OCROperation_Begin |
| HTTP (mf-http-grpc) | POST /grpc/v1/ocroperation_-begin |
| Request | OCROperation_BeginRequest |
| Response | OCROperation_BeginResponse |
| Book and level | Vault API, standard |
| Kind | write |
| Session | Required: the session ID from LogIn in the mfiles-session-id-bin metadata. |
| Idempotent | yes |
| Returns metadata structure version | yes (in the mfiles-metadata-version-bin trailer) |
| Streaming | none (unary) |
Remarks
- The document must be checked out to the caller, and the caller needs read and edit access to it. The initial checked-out version of a new document (version 1) is rejected: it has no checked-in version.
- Nothing is uploaded: the content is read from the file in the latest checked-in version of the document.
- Finish with OCROperation_End to replace the file in the checked-out version with the PDF, then check the document in.
Request: OCROperation_BeginRequest
Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.
| Field | Type | Description |
|---|---|---|
type | OCROperationType | What to produce. See the service overview.Values: OCROPERATION_TYPE_NONE (0), OCROPERATION_TYPE_CONVERT_TO_SEARCHABLE_PDF (1), OCROPERATION_TYPE_RECOGNIZE_SPECIFIC_BLOCKS (2), OCROPERATION_TYPE_RECOGNIZE_ANY_BLOCKS (3), OCROPERATION_TYPE_CONVERT_TO_SEARCHABLE_PDF_AND_RECOGNIZE_SPECIFIC_BLOCKS (4), OCROPERATION_TYPE_CONVERT_TO_SEARCHABLE_PDF_AND_RECOGNIZE_ANY_BLOCKS (5), OCROPERATION_TYPE_CONVERT_TO_SEARCHABLE_ARCHIVE_PDF (6), OCROPERATION_TYPE_CONVERT_TO_SEARCHABLE_ARCHIVE_PDF_AND_RECOGNIZE_SPECIFIC_BLOCKS (7), OCROPERATION_TYPE_CONVERT_TO_SEARCHABLE_ARCHIVE_PDF_AND_RECOGNIZE_ANY_BLOCKS (8). |
options | OCROptions | Recognition languages and automatic language detection. Unset uses the defaults. |
options.languages[] | repeated OCRLanguageType | Languages/character sets/dictionaries to be used as recognition hints. Can be unset. |
options.ocr_automatic_language_detection | bool | True if the OCR automatic language detection is to be used. |
obj_or_file_ver | ObjOrFileVer | The checked-out version (obj_ver) and the file (file_ver) to process. |
obj_or_file_ver.obj_ver | ObjVer | Object version. The version part can be -1 to indicate the latest version. |
obj_or_file_ver.obj_ver.obj_id | ObjID | The object. |
obj_or_file_ver.obj_ver.version | ObjVerVersion | The version. Usually OBJ_VER_VERSION_TYPE_SPECIFIC with internal_version. |
obj_or_file_ver.file_ver | FileVer | File version. Valid only if bIsFile is true. |
obj_or_file_ver.file_ver.file_id | FileID | The file. |
obj_or_file_ver.file_ver.type | FileVerType | FILE_VER_TYPE_SPECIFIC for a file version number.Values: FILE_VER_TYPE_UNINITIALIZED (0), FILE_VER_TYPE_LATEST (1), FILE_VER_TYPE_ANY (2), FILE_VER_TYPE_SPECIFIC (3). |
obj_or_file_ver.file_ver.internal_version | int32 | The file version number. |
obj_or_file_ver.file_ver.external_repository_version | string | Used only for files in external repositories. Leave empty. |
obj_or_file_ver.file_ver.external_repository_sort_key | int64 | Used only for files in external repositories. Leave 0. |
source_file_extension | string | The file name extension, without the dot. |
pages | OCRPageArray | For ..._RECOGNIZE_SPECIFIC_BLOCKS types, the areas to recognize. Otherwise unset. |
pages.value[] | repeated OCRPage | An array of OCR pages, should be ordered by the page number. |
pages.value[].number | uint32 | Page number of this page. |
pages.value[].blocks[] | repeated OCRBlock | An array of OCR blocks. |
Response: OCROperation_BeginResponse
Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.
| Field | Type | Description |
|---|---|---|
background_op_id | uint32 | The ID of the job. |
Related methods
- OCROperation_End -- Ends an OCR job started with OCROperation_Begin and replaces the document's file with the resulting PDF.
- OCROperation_Status -- Gets the progress of an OCR job, and optionally cancels it.
- OCROperation_BeginAfterUpload -- Starts an OCR job on a file that the caller uploaded with UploadTempFile.
- OCROperation_EndWithDownload -- Ends an OCR job and returns its results: the recognized texts and a download of the PDF.