This PDF to Word Converter project allows users to upload a PDF file and convert it into a Word document (.docx). The application consists of a frontend built with React and a backend built using Flask. It is deployed on Render and Netlify to provide a seamless online document conversion experience, which can further be leveraged as Software as a Service (SaaS).
- PDF to Word Conversion: Upload a PDF and download a Word (.docx) version.
- Real-Time Progress Indicator: Loading bar displaying percentage completion.
- Simple Interface: User-friendly design for ease of use.
- Responsive Design: Supports both mobile and desktop views.
- Backend API Integration: Seamless interaction between frontend and backend for conversion.
-
Frontend:
- App.js: Entry point for the React application that renders the
Dashboard
component. - Dashboard.js: Component handling file input, PDF conversion request, and downloading the Word file.
- Dashboard.css: Styling for the
Dashboard
component to ensure a consistent and appealing user interface. - index.js: Renders the main
App
component and initializes the frontend.
- App.js: Entry point for the React application that renders the
-
Backend:
- server.py: Handles the backend logic using Flask, allowing the conversion from PDF to Word using the
pdf2docx
library. - requirements.txt: Lists all dependencies for the backend (e.g., Flask, pdf2docx).
- server.py: Handles the backend logic using Flask, allowing the conversion from PDF to Word using the
-
General:
- package.json: Manages project dependencies and scripts for the frontend.
- index.html: The main HTML template for the React application.
- Frontend:
- Backend:
- Hosting:
- Node.js and npm: Install Node.js.
- Python 3: Install Python.
- Flask: Install Flask using
pip install Flask
. - pdf2docx: Install the library for PDF to Word conversion with
pip install pdf2docx
.
-
Clone the repository:
git clone https://github.com/karanbagle/PDFtoWord.git cd PDFtoWord
-
Install frontend dependencies:
npm install
-
Run the frontend locally:
npm start
-
Backend setup:
- Navigate to the backend directory and create a virtual environment:
python3 -m venv env source env/bin/activate
- Install backend dependencies:
pip install Flask pdf2docx flask-cors
- Run the Flask server:
python server.py
- Navigate to the backend directory and create a virtual environment:
- Deploy the frontend by connecting the GitHub repository to Netlify.
- Set the build command to
npm run build
and publish directory tobuild
.
- Deploy the backend by connecting the GitHub repository to Render.
- Set up a Python environment, configure the
server.py
file to run as the entry point, and open port5000
.
This application can be used as a SaaS by providing the following features:
- Authentication and User Accounts: Add a login and registration system to manage user sessions.
- Subscription Plans: Integrate a payment gateway to allow users to subscribe for different usage plans (e.g., number of conversions per month).
- API Access: Provide API access to users who want to use the document conversion service programmatically in their own applications.
- Custom Domains: Allow users to use the service on custom domains for businesses or private use.
This project is open source and available under the MIT License.
For questions or collaboration, reach out at [email protected].