Let’s convert a pdf file to a docx file. It’s simple, first we need a simple platform to build the app — streamlit. Then we need an upload button that takes in a file and creates a stream. This stream should be converted to .docx and be ready for download.
import streamlit as st
from pdf2docx import Converter
import io
st.write("hello world")
uploaded_file = st.file_uploader("Choose a file")
if uploaded_file is not None:
# To read file as bytes:
bytes_data = uploaded_file.getvalue()
cv =…