Compare commits

..

1 Commits

Author SHA1 Message Date
wsg1873
303d55c8a1 solve the concatenate error. 2024-10-15 15:42:35 +00:00

View File

@@ -712,7 +712,9 @@ def _merge_pdfs_ng(pdf1_path, pdf2_path, output_path):
# 内部链接:跳转到文档中的某个页面
dest = action.get("/D") # 目标页或目标位置
# if dest and annot.idnum in page2_annot_id:
if dest in pdf2_reader.named_destinations:
# if dest in pdf2_reader.named_destinations:
if dest and page2.annotations:
if annot in page2.annotations:
# 获取原始文件中跳转信息,包括跳转页面
destination = pdf2_reader.named_destinations[
dest
@@ -781,8 +783,9 @@ def _merge_pdfs_ng(pdf1_path, pdf2_path, output_path):
}
)
# if dest and annot.idnum in page1_annot_id:
if dest in pdf1_reader.named_destinations:
# if dest in pdf1_reader.named_destinations:
if dest and page1.annotations:
if annot in page1.annotations:
# 获取原始文件中跳转信息,包括跳转页面
destination = pdf1_reader.named_destinations[
dest