[英]Navigate through a pdf file to find specific pages and extract tabular data from image with python
[英]how to extract tabular data from pdf properly when a row data is divided in two separate pages?
我的任务是解析来自 pdf 的表格数据。 我在 python 中使用“tika”库,这很好,但有一个问题如下:
Pdf 具有表格格式的文本,行的一半在第二页结束,这将表的键和值数据划分为两个不同的页面,我认为 tika 将这一行视为两个单独的行。
output 将在不正确的键之间添加值。
例如:
str = "这是长键数据xxxxxxx值xxxxxxxxx剩余键数据"
有什么建议么?
您可以尝试使用 tesseract psm: Pytesseract OCR multiple config options
To set the different psm in tika (1 is default value) you can either: use the header: X-Tika-OCRPageSegMode: xx or use the tesseract config: https://tika.apache.org/1.24/api/org/ apache/tika/parser/ocr/TesseractOCRConfig.html#setPageSegMode-java.lang.String-
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.