Convert pdf to docx in Memory using streamlit and publish the app

D
Apr 17, 2024

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 =…

--

--

D

An aspiring Robotics Researcher. I am currently in my 4th year of undergraduate studies. I am working on optimising the ROS navigation packages. Follow 4 more!