我正在使用 ABBYY OCR SDK 将文本图像转换为 Python 中的 xml。我的目标是保留文本的格式,所以我一直在尝试使用xml:writeFormatting
如下参数:
ocr_engine = CloudOCR(application_id='', password='')
jpg = open('pic16.JPG', 'rb')
file = {jpg.name: jpg}
result = ocr_engine.process_and_download(file,
exportFormat='xml&xml:writeFormatting=true', language='English')
result
for format, content in result.items():
with open('converted.xml', 'wb') as output_file:
output_file.write(content.read())
output_file.close()
并弹出以下错误:
HTTPError:450 客户端错误:未知格式 xmlwriteFormatting=true 用于 url:http ://cloud-eu.ocrsdk.com/processImage?exportFormat=xmlwriteFormatting%3Dtrue&language=English