![](/img/trans.png)
[英]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.