25 lines
799 B
Python
25 lines
799 B
Python
|
import json
|
||
|
|
||
|
from flask_app.货物标.货物标截取pdf import truncate_pdf_main
|
||
|
from flask_app.main.format_change import docx2pdf, pdf2docx
|
||
|
|
||
|
|
||
|
#获取采购清单
|
||
|
def fetch_purchasing_list(file_path,output_folder,file_type):
|
||
|
if file_type==1:
|
||
|
docx_path=file_path
|
||
|
pdf_path = docx2pdf(file_path)
|
||
|
elif file_type==2:
|
||
|
pdf_path=file_path
|
||
|
docx_path=pdf2docx(file_path)
|
||
|
else:
|
||
|
print("未传入指定格式的文件!")
|
||
|
return None
|
||
|
truncate_path=truncate_pdf_main(pdf_path,output_folder,1)
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
output_folder = "C:\\Users\\Administrator\\Desktop\\货物标\\货物标output"
|
||
|
file_path="C:\\Users\\Administrator\\Desktop\\货物标\\zbfiles\\磋商文件.doc"
|
||
|
fetch_purchasing_list(file_path,output_folder,1)
|
||
|
|