Skip to content

Commit

Permalink
Merge pull request #1075 from myhloli/dev
Browse files Browse the repository at this point in the history
test: batch process demo PDFs- Update test block to iterate through multiple demo PDF files
  • Loading branch information
myhloli authored Nov 25, 2024
2 parents ea94a35 + e11e6b3 commit 4f13c28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions demo/magic_pdf_parse_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,8 @@ def pdf_parse_main(

# 测试
if __name__ == '__main__':
file_path = r'D:\project\20240617magicpdf\Magic-PDF\demo\demo1.pdf'
pdf_parse_main(file_path)
current_script_dir = os.path.dirname(os.path.abspath(__file__))
demo_names = ['demo1', 'demo2', 'small_ocr']
for name in demo_names:
file_path = os.path.join(current_script_dir, f'{name}.pdf')
pdf_parse_main(file_path)
Loading

0 comments on commit 4f13c28

Please sign in to comment.