IRPCScanningAndOCR.OCROperation_BeginAfterUpload
Vault API / standard write session idempotent returns metadata structure version
Starts an OCR job on a file that the caller uploaded with UploadTempFile.
| Service | Scanning and OCR MFiles.IRPCScanningAndOCR |
|---|---|
| gRPC method | /MFiles.IRPCScanningAndOCR/OCROperation_BeginAfterUpload |
| HTTP (mf-http-grpc) | POST /grpc/v1/ocroperation_-begin-after-upload |
| Request | OCROperation_BeginAfterUploadRequest |
| Response | OCROperation_BeginAfterUploadResponse |
| 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
- Upload the file with UploadTempFile and
pass its
upload_idand size here. Do not commit the upload with UploadTempFileCommit: this call commits it itself, and an upload that is already committed fails with "File size mismatch.". - The upload is consumed, also when the call fails.
- Fails with "OCR feature is disabled by license or settings." when server OCR is not available.
- Returns at once; poll OCROperation_Status and finish with OCROperation_EndWithDownload.
Request: OCROperation_BeginAfterUploadRequest
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. |
upload_session | int32 | The upload_id of an uploaded, not committed file. |
upload_file_size | int64 | The size of the uploaded file in bytes; must match the uploaded bytes. |
source_file_extension | string | The file name extension of the uploaded file, without the dot, for example pdf or tif. |
pages | OCRPageArray | For ..._RECOGNIZE_SPECIFIC_BLOCKS types, the areas to recognize, per page. Otherwise leave 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_BeginAfterUploadResponse
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
- IRPCObjectOperations.UploadTempFile -- Uploads a block of a file to a temporary upload session on the server. The upload can then be used as the content of a new object.
- IRPCObjectOperations.UploadTempFileCommit -- Completes an upload made with UploadTempFile.
- OCROperation_Status -- Gets the progress of an OCR job, and optionally cancels it.
- OCROperation_EndWithDownload -- Ends an OCR job and returns its results: the recognized texts and a download of the PDF.
- OCROperation_Begin -- Starts an OCR job on a file of a document that the caller has checked out.
- OCROperation_End -- Ends an OCR job started with OCROperation_Begin and replaces the document's file with the resulting PDF.