Pular para o conteúdo principal

Gerando Optical Character Recognition

Com as imagens aprimoradas, agora é possível fazer o reconhecimento de caracteres e converte-los para texto.

Para isso são utilizados os endpoints:

→ POST Imagem para Texto

Este endpoint converte um arquivo de imagem fornecida em texto usando OCR após combiná-los em PDFs. O arquivo de imagem deve ser enviado como uma carga JSON codificado no formato Base64.

Request Body:

{
"File":
{
"FileBase64": "string",
"FileName": "string"
}
}

Response Body:

200 Success - Image successfully converted to text.
{
"data": {
"Base64Result": "string",
"FileName": "string"
},
"msg": "Image converted successfully",
"status": true
}
400 Bad Request
"Bad request, when the the Base64 format of the image is invalid"
401 Unauthorized
"Unauthorized, occurs when authentication is required but not provided."
415 Unsupported Media Type
"Unsupported media type, occurs when the file is not a JPEG/JPG or PNG."
422 Unprocessable Entity
"Unprocessable entity, occurs when OCR cannot extract text from the image."
500 Internal Server Error
"Internal Server Error indicating a failure in schema validation."

→ POST PDF para Texto

Este endpoint converte um arquivo PDF fornecido no formato base64 em texto usando OCR.

Request Body:

{
"File":
{
"FileBase64": "string",
"FileName": "string"
}
}

Response Body:

200 Success - PDF successfully converted to text.
{
"data": {
"Base64Result": "string",
"FileName": "string"
},
"msg": "PDF converted successfully",
"status": true
}
400 Bad Request
"Bad request. This response is returned when more than one file is uploaded, as only a single file is allowed."
415 Unsupported Media Type
"Bad request, when the file is not a PDF."
422 Unprocessable Entity
"Unprocessable entity, when OCR cannot extract text from the PDF."
500 Internal Server Error
"Internal Server Error indicating a failure in schema validation."