Commit e11e6b32 authored by myhloli's avatar myhloli
Browse files

test: batch process demo PDFs- Update test block to iterate through multiple demo PDF files

- Use os.path.join to construct file paths for better cross-platform compatibility
- Remove hardcoded file path
parent 17ef5c0f
...@@ -139,5 +139,8 @@ def pdf_parse_main( ...@@ -139,5 +139,8 @@ def pdf_parse_main(
# 测试 # 测试
if __name__ == '__main__': if __name__ == '__main__':
file_path = r'D:\project\20240617magicpdf\Magic-PDF\demo\demo1.pdf' current_script_dir = os.path.dirname(os.path.abspath(__file__))
pdf_parse_main(file_path) 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)
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment