pdf_to_docx icon indicating copy to clipboard operation
pdf_to_docx copied to clipboard

merge doc in a wrong way

Open BaiYouShiWo opened this issue 8 months ago • 1 comments

In the file “pdf_recovery_doc.py”, function "merge_docx_v1" and “merge_docx_v2” use sort() simply like

docx_files_list = sorted(docx_files_list)

I don't think this can achieve the expected results, the correct way may be

      import re
      docx_files_list = sorted(
      docx_files_list,
      key=lambda x: int(re.search(r'_(\d+)_', x).group(1))
      )

If possible, I can submit a pull request later

BaiYouShiWo avatar Apr 24 '25 06:04 BaiYouShiWo

ok

jiangnanboy avatar Apr 24 '25 13:04 jiangnanboy