From c49f9819e12aab85520eea75a1307bcc72ab599e Mon Sep 17 00:00:00 2001 From: xiaoxue_admin <9283713@qq.com> Date: Mon, 22 Jun 2026 13:07:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E5=8C=BA=E4=B8=8A?= =?UTF-8?q?=E7=95=8C=E6=81=A2=E5=A4=8D=E5=88=B0150px=EF=BC=88500px?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E8=BF=87=E5=A4=9A=E5=99=AA=E5=A3=B0=EF=BC=89?= =?UTF-8?q?=20=E5=90=8C=E6=97=B6=E4=B9=9F=E5=8E=BB=E6=8E=89y=5Fend?= =?UTF-8?q?=E7=9A=84=E5=90=88=E8=AE=A1=E8=A3=81=E5=89=AA=EF=BC=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8C=BA=E4=B8=80=E7=9B=B4=E5=BB=B6=E4=BC=B8=E5=88=B0?= =?UTF-8?q?=E9=A1=B5=E5=B0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/parser.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/core/parser.py b/core/parser.py index 4b24229..0689e82 100644 --- a/core/parser.py +++ b/core/parser.py @@ -118,17 +118,9 @@ class K3VoucherParser: if text.strip() in ('借方', '贷方', '科目', '摘要'): y_headers.append(cy) y_start = min(y_headers) if y_headers else 0 - # 数据区上界:列头上方500px(兼容科目代码在列头上方的布局) - y_data_start = max(0, y_start - 500) + # 数据区上界:列头上方150px + y_data_start = max(0, y_start - 150) y_end = 999999 - # 找数据区下方的"合计"行(排除顶部大写合计:带中文数字的) - import re as _re - heji_positions = [cy for text, conf, cx, cy, box in lines - if '合计' in text - and cy > y_data_start - and not _re.search(r'[壹贰叁肆伍陆柒捌玖拾佰仟万亿]', text)] - if heji_positions: - y_end = max(heji_positions) # 取最靠下的合计行 # === 2. 获取图像宽度 === all_xs = []