IRPCScanningAndOCR.OCROperation_EndWithDownload
Vault API / standard write session returns metadata structure version
Ends an OCR job and returns its results: the recognized texts and a download of the PDF.
| Service | Scanning and OCR MFiles.IRPCScanningAndOCR |
|---|---|
| gRPC method | /MFiles.IRPCScanningAndOCR/OCROperation_EndWithDownload |
| HTTP (mf-http-grpc) | POST /grpc/v1/ocroperation_-end-with-download |
| Request | OCROperation_EndWithDownloadRequest |
| Response | OCROperation_EndWithDownloadResponse |
| Book and level | Vault API, standard |
| Kind | write |
| Session | Required: the session ID from LogIn in the mfiles-session-id-bin metadata. |
| Idempotent | no |
| Returns metadata structure version | yes (in the mfiles-metadata-version-bin trailer) |
| Streaming | none (unary) |
Remarks
- Call after OCROperation_Status
reports
done. The job is released; the ID cannot be used again. - For the types that produce a PDF, read the file with
DownloadFile_ReadBlock using
download_session, and release the download with DownloadFile_Stop. For the recognize-only typesdownload_file_sizeis 0. - If the job failed, the call fails with the job's error.
Request: OCROperation_EndWithDownloadRequest
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. |
Response: OCROperation_EndWithDownloadResponse
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 |
|---|---|---|
page_results[] | repeated OCRPageResult | The recognized areas and their texts, per page. Empty for the types that only produce a PDF. |
page_results[].number | uint32 | Page number of this page. |
page_results[].blocks[] | repeated OCRBlockResult | An array of OCR block results. |
page_results[].blocks[].id | int32 | Id of the OCR block. Negative value if there was no request block. |
page_results[].blocks[].dimension_unit | OCRBlockDimUnitType | Defines the unit of the block rectangle dimensions. Default is pixels.Values: OCRBLOCK_DIM_UNIT_TYPE_PIXELS (0), OCRBLOCK_DIM_UNIT_TYPE_MILLIMETERS_X10 (1), OCRBLOCK_DIM_UNIT_TYPE_INCHES_X100 (2). |
page_results[].blocks[].left | uint32 | Distance from the left of the image. |
page_results[].blocks[].top | uint32 | Distance from the top of the image. |
page_results[].blocks[].width | uint32 | Width of the block rectangle. |
page_results[].blocks[].height | uint32 | Height of the block rectangle. |
page_results[].blocks[].confidence | int32 | Confidence level (0 = most confident, 255 = least confident). |
page_results[].blocks[].page | uint32 | One-based number of the page on which this result was recognized. 0 means no recognition. |
page_results[].blocks[].value | TypedValue | The recognized value. |
download_session | int32 | The download ID of the resulting PDF. |
download_file_size | int64 | The size of the resulting PDF in bytes; 0 if none. |
Related methods
- OCROperation_Status -- Gets the progress of an OCR job, and optionally cancels it.
- IRPCObjectOperations.DownloadFile_ReadBlock -- Reads a block of a file from a download session.
- IRPCObjectOperations.DownloadFile_Stop -- Closes a download session.
- OCROperation_BeginAfterUpload -- Starts an OCR job on a file that the caller uploaded with UploadTempFile.
- 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.