2.17 增加读文件pdf接口测试1

This commit is contained in:
zy123 2025-02-17 16:10:38 +08:00
parent f9460d7db5
commit 08947c0258
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
from PyPDF2 import PdfReader
from pypdf import PdfReader
from flask_app.general.读取文件.clean_pdf import extract_common_header, clean_page_content, create_get_text_function
import fitz # PyMuPDF

View File

@ -5,7 +5,7 @@ import uuid
import time
from flask_app.ConnectionLimiter import require_execution_timeout
from flask_app.general.format_change import download_file
from flask_app.general.读取文件.按页读取pdf import read_pdf_main, extract_text_by_page
from flask_app.general.读取文件.按页读取pdf import read_pdf_main
from flask_app.routes.utils import validate_and_setup_logger
from flask_app.routes.货物标解析main import preprocess_files
@ -30,11 +30,11 @@ def process_file():
file_path,file_type=download_file(file_url, filename)
# print(file_path)
# 调用预处理函数
# result = read_pdf_main(pdf_path=file_path)
extract_text_by_page(file_path)
result = read_pdf_main(pdf_path=file_path)
# 处理结果
# if not result:
# return jsonify({'error': 'File processing failed'})
if not result:
return jsonify({'error': 'File processing failed'})
response_data={
"处理结果":"yes"
}