Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

更新了para_split

liukaiwen9528a839c8ac
diff --git a/magic_pdf/para/para_split_v2.py b/magic_pdf/para/para_split_v2.py
index 9fab6aac..304b0880 100644
--- a/magic_pdf/para/para_split_v2.py
+++ b/magic_pdf/para/para_split_v2.py
@@ -517,6 +517,8 @@ def __connect_para_inter_page(pre_page_paras, next_page_paras, pre_page_layout_b
next_first_block = next_page_paras[0][0]
if pre_last_block["type"] != BlockType.Text or next_first_block["type"] != BlockType.Text:
return False
+ if len(pre_last_block["lines"]) == 0 or len(next_first_block["lines"]) == 0:
+ return False
pre_last_para = pre_last_block["lines"]
next_first_para = next_first_block["lines"]
pre_last_line = pre_last_para[-1]