text: from logging import NullHandler
  from pdf2docx import Converter
  import  streamlit as st
  from pdf2docx import parse
  import base64
  
  uploaded_file = st.file_uploader(label="请上传PDF文件",type="pdf")
  docx_file = "./sample.docx"
  #parse(uploaded_file, docx_file)
  
  
  
  base64_pdf = base64.b64encode(pdf_file.read()).decode('utf-8')
  pdf_display = f'<embed src="data:application/pdf;base64,{base64_pdf}" width="700" height="1000" type="application/pdf">' 
  st.markdown(pdf_display, unsafe_allow_html=True)
  
  
  if uploaded_file:
      st.download_button(label="转换完成，请下载docx文件",data=docx_file,file_name="sample.docx")
  
  
  
  
  
  
  
  
  
  
  
  # with st.empty():
  #     if uploaded_file is not None:
  #         parse(uploaded_file, docx_file)
  #         st.download_button(label="转换完成，请下载docx文件",data=docx_file,file_name="sample.docx")
  
  