text: #Creating and Manipulating PDFs with pdfrw
  # https://www.blog.pythonlibrary.org/2018/06/06/creating-and-manipulating-pdfs-with-pdfrw/
  # Extract certain types of information from a PDF
  # Splitting PDFs
  # Merging / Concatenating PDFs
  # Rotating pages
  # Creating overlays or watermarks
  # Scaling pages
  # Combining the use of pdfrw and ReportLab
  
  import base64
  import tempfile
  from pdf2docx import Converter
  
  import streamlit as st
  from pdf2image import convert_from_path
  
  from pathlib import Path
  
  def show_pdf(file_path:str):
      """Show the PDF in Streamlit
      That returns as html component
  
      Parameters
      ----------
      file_path : [str]
          Uploaded PDF file path
      """
  
      with open(file_path, "rb") as f:
          base64_pdf = base64.b64encode(f.read()).decode("utf-8")
      pdf_display = f'<embed src="data:application/pdf;base64,{base64_pdf}" width="100%" height="1000" type="application/pdf">'
      st.markdown(pdf_display, unsafe_allow_html=True)
  
  
  def show_path(file_path:str):
      with open(file_path, "rb") as f:
          base64_file = base64.b64encode(f.read()).decode("utf-8")
      return base64_file
  
  
  def main():
      """Streamlit application
      """
  
      st.title("PDF file uplodaer")
      uploaded_file = st.file_uploader("Choose your .pdf file", type="pdf")
  
      if uploaded_file is not None:
          # Make temp file path from uploaded file
          with tempfile.NamedTemporaryFile(delete=False) as tmp_file:
              st.markdown("## Original PDF file")
              fp = Path(tmp_file.name)
              fp.write_bytes(uploaded_file.getvalue())
              st.write(tmp_file.name)
              #st.write(show_pdf(tmp_file.name)) 
  
              imgs = Converter(tmp_file.name)
              docx = imgs.convert(start=0, end=None)
              st.markdown(f"Converted images from PDF")
              st.write(tmp_file.name)
              st.write(imgs)
              #st.image(imgs)
  
  
  if __name__ == "__main__":
      main()