This project is a comprehensive full‑stack web app for doing simple, local file manipulations:
PDF Tools:
- Convert PDF pages to PNG (single page, range, or all pages)
- Merge multiple PDF files into one document
- Split a PDF by extracting a page range into a new document
- Convert PDF to DOCX
- Convert DOCX to PDF
- Rotate or flip PDF pages
- Add watermarks to PDFs
- Sign PDFs
Image Tools:
- Convert images to WebP, JPG, PNG, and SVG
- Compress images with adjustable quality
- Resize images
- Rotate or flip images
- Remove the background from images
- Upscale images
- Convert to grayscale
- Convert image DPI for print-ready output
- Add watermarks to images
- View, copy and strip image EXIF metadata
- Extract text from images (OCR)
- Convert images to Base64
MD tools
- Convert Markdown files to HTML with optional theme styling
The backend is a Flask API and the frontend is a React app (Vite).
These rules define how this project must be implemented and extended:
-
No data can be stored in the backend.
The server must only process files in memory for the current request and immediately return the result. No files or metadata may be written to disk, databases, or any external storage. -
No external API usage.
All functionality must be implemented locally using libraries in this repository. Do not call third‑party web APIs or hosted services. -
Only file‑manipulation features.
New features are welcome as long as they are related to local file manipulation (e.g., format conversion, compression, resizing, merging, splitting, optimizing) and obey Rules 1 and 2.
If you contribute to this repository, you must respect all the rules above.
- Backend:
Python,Flask,Flask‑CORS,PyMuPDF (fitz),Pillow,rembg,python-docx,pdf2docx,OpenCV,pytesseract,markdown2 - Frontend: React, React Router, Vite, PDF.js
pdfToPng/
├── backend/
│ ├── main.py
│ ├── requirements.txt
│ ├── Dockerfile
│ ├── app/
│ │ └── __init__.py
│ ├── blueprints/
│ │ ├── __init__.py
│ │ ├── pdf.py
│ │ ├── image.py
│ │ ├── removebg.py
│ │ ├── rotate_flip.py
│ │ ├── metadata_viewer.py
│ │ ├── dpi_converter.py
│ │ ├── merge_pdf.py
│ │ ├── split_pdf.py
│ │ ├── pdf_to_docx.py
│ │ ├── docx_to_pdf.py
│ │ ├── watermark.py
│ │ ├── md2html.py
│ │ └── markdown.py
| |
│ └── utils/
│ ├── __init__.py
│ ├── helpers.py
│ └── decorators.py
├── frontend/
│ ├── package.json
│ ├── vite.config.js
│ ├── eslint.config.js
│ ├── index.html
│ ├── Dockerfile
│ ├── README.md
│ ├── vercel.json
│ ├── public/
│ └── src/
│ ├── main.jsx
│ ├── App.jsx
│ ├── App.css
│ ├── index.css
│ ├── ErrorBoundary.jsx
│ ├── components/
│ │ ├── FileUploadArea.jsx
│ │ ├── ScrollToTop.jsx
│ │ ├── ToolPageTemplate.jsx
│ │ ├── Layout/
│ │ │ └── Layout.jsx
│ │ ├── Sidebar/
│ │ │ └── Sidebar.jsx
│ │ └── Landing/
│ │ ├── FeatureCard.jsx
│ │ ├── FeatureSection.jsx
│ │ ├── Footer.jsx
│ │ ├── HeroSection.jsx
│ │ ├── Navbar.jsx
│ │ ├── ToolCard.jsx
│ │ ├── ToolCard.css
│ │ ├── ToolsGrid.jsx
│ │ └── TrustBanner.jsx
│ ├── data/
│ │ └── toolsData.jsx
│ ├── hooks/
│ │ └── useFileUpload.js
│ ├── pages/
│ │ ├── LandingPage.jsx
│ │ ├── NotFound.jsx
│ │ ├── PdfPng.jsx
│ │ ├── PdfMerge.jsx
│ │ ├── PdfSplit.jsx
│ │ ├── PdfDocx.jsx
│ │ ├── DocxPdf.jsx
│ │ ├── PdfRotateFlip.jsx
│ │ ├── PDFWatermark.jsx
│ │ ├── PdfSign.jsx
│ │ ├── MdToHtml.jsx
│ │ ├── ImageWbp.jsx
│ │ ├── ImageJpg.jsx
│ │ ├── ImagePdf.jsx
│ │ ├── ImageCompress.jsx
│ │ ├── ImageDpi.jsx
│ │ ├── ImageResize.jsx
│ │ ├── ImageGrayScale.jsx
│ │ ├── ImageMetadata.jsx
│ │ ├── ImageOCR.jsx
│ │ ├── ImageToSVG.jsx
│ │ ├── ImageUpscale.jsx
│ │ ├── ImageWatermark.jsx
│ │ ├── ImageBase64.jsx
│ │ ├── RemoveBg.jsx
│ │ ├── RotateFlip.jsx
│ │ └── ImageWatermark.css
│ └── styles/
│ └── ImageWatermark.css
├── docker-compose.yml
├── CONTRIBUTING.md
├── LICENSE
└── README.md
Backend (backend/)
main.py– Entry point for the Flask server; initializes the app and registers blueprintsrequirements.txt– Python dependencies for the backendDockerfile– Docker configuration for containerizing the backendapp/– Flask app configuration and initializationblueprints/– Modular route handlers for each feature:pdf.py– PDF to PNG conversion endpointimage.py– Image format conversions and compression (WebP, JPG, PNG, SVG, Base64)dpi_converter.py– Image DPI converter endpointmetadata_viewer.py– View and strip metadata endpointremovebg.py– Background removal endpointrotate_flip.py– Rotate/flip endpoint for imagesmerge_pdf.py– Merge multiple PDFs into one endpointsplit_pdf.py– Split PDF by page range endpointpdf_to_docx.py– Convert PDF to DOCX endpointdocx_to_pdf.py– Convert DOCX to PDF endpointwatermark.py– Add watermarks to PDFs and images endpointmd2html.py- Converts MD to HTML with built-in css
utils/– Helper functions and utilities used across blueprints:helpers.py– Common utility functionsdecorators.py– Custom decorators for request handling
Frontend (frontend/)
package.json– Node.js dependencies and scriptsvite.config.js– Vite bundler configurationeslint.config.js– ESLint linting rulesindex.html– HTML entry pointDockerfile– Docker configuration for containerizing the frontendvercel.json– Vercel deployment configurationsrc/– React source code:main.jsx– React app entry pointApp.jsx– Root React componentErrorBoundary.jsx– Error boundary component for error handlingcomponents/– Reusable UI components:FileUploadArea.jsx– File upload area componentScrollToTop.jsx– Scroll to top button componentToolPageTemplate.jsx– Template for tool pagesLayout/– Main page layout wrapperSidebar/– Navigation sidebar componentLanding/– Landing page components:FeatureCard.jsx– Feature card componentFeatureSection.jsx– Feature section componentFooter.jsx– Footer componentHeroSection.jsx– Hero section componentNavbar.jsx– Navigation bar componentToolCard.jsx– Tool card componentToolsGrid.jsx– Tools grid componentTrustBanner.jsx– Trust banner component
data/– Data files:toolsData.jsx– Tool configurations and metadata
hooks/– Custom React hooks:useFileUpload.js– Hook for file upload functionality
pages/– Page components for each feature:LandingPage.jsx– Main landing pageNotFound.jsx– 404 page- PDF Tools:
PdfPng.jsx– PDF to PNG converter pagePdfMerge.jsx– PDF merge pagePdfSplit.jsx– PDF split pagePdfDocx.jsx– PDF to DOCX converter pageDocxPdf.jsx– DOCX to PDF converter pagePdfRotateFlip.jsx– PDF rotate/flip pagePDFWatermark.jsx– PDF watermark pagePdfSign.jsx– PDF signing page
- Image Tools:
ImageWbp.jsx– Image to WebP converter pageImageJpg.jsx– Image to JPG converter pageImagePdf.jsx– Image to PDF converter pageImageCompress.jsx– Image compression pageImageDpi.jsx– Image DPI converter pageImageResize.jsx– Image resize pageImageGrayScale.jsx– Convert image to grayscale pageImageMetadata.jsx– View/strip metadata pageImageOCR.jsx– Optical Character Recognition (OCR) pageImageToSVG.jsx– Convert image to SVG pageImageUpscale.jsx– Image upscale pageImageWatermark.jsx– Add watermark to image pageImageBase64.jsx– Convert image to Base64 pageRemoveBg.jsx– Background removal pageRotateFlip.jsx– Rotate/flip image page
- MD Tools:
MdToHtml.jsx- converts MD to HTML
styles/– Global stylesheets:ImageWatermark.css– Image watermark styles
public/– Static assets
git clone https://github.com/Durgeshwar-AI/pdfToPng.git
cd pdfToPngFrom the backend folder:
cd backend
python -m venv venv
venv\Scripts\activate # On Windows
pip install -r requirements.txt
python main.pyThe Flask server will run at http://localhost:5000.
Available endpoints:
PDF Endpoints:
POST /convertPng– Convert PDF pages to PNG (single page, range, or all pages)POST /merge-pdf– Merge multiple PDFs into onePOST /split-pdf– Extract a page range from a PDFPOST /pdf-to-docx– Convert PDF to DOCXPOST /docx-to-pdf– Convert DOCX to PDFPOST /rotate-flip-pdf– Rotate or flip PDF pagesPOST /watermark-pdf– Add watermarks to PDF
Image Endpoints:
POST /convertWebP– Convert an image to WebPPOST /convertJpeg– Convert an image to JPGPOST /imageToPdf– Convert image to PDFPOST /compress– Compress an image with a quality settingPOST /rotateFlip– Rotate or flip an imagePOST /convert-dpi– Convert image DPI (JPEG, PNG, TIFF, BMP, WebP)POST /check-dpi– Check current DPI of an imagePOST /view-metadata– View image metadataPOST /strip-metadata– Strip metadata from imagePOST /removeBg– Remove the background from an imagePOST /watermark-image– Add watermarks to an imagePOST /image-to-base64– Convert image to Base64
Mark Down Endpoints
POST /convertMdToHtml– Converts MD to HTML
Health Check:
GET /health– Health check endpoint
All endpoints:
- Process the file in memory
- Do not persist any data on the server
Note: The PDF to PNG tool runs in the browser using PDF.js and supports single page, range, or all pages (ZIP for multi‑page output). The backend still includes /convertPng for server‑side PDF conversion, but the UI uses client‑side rendering by default.
From the frontend folder:
cd frontend
npm install
npm run devBy default, Vite will start the frontend at http://localhost:5173.
Make sure your frontend API calls target http://localhost:5000 for the backend.
The easiest way to get started is using Docker and Docker Compose. This ensures all dependencies (including system tools like poppler-utils) are correctly installed.
From the root directory, run:
docker-compose up --build- Frontend: http://localhost:5173
- Backend: http://localhost:5000
- Health Check: http://localhost:5000/health
The docker-compose.yml is configured for development:
- Hot Reloading: Changes in
backend/orfrontend/will automatically reload the application. - Persistent Models: The
rembgAI models are stored in a Docker volume calledrembg_modelsto avoid re-downloading on every restart.
Contributions are welcome! Before opening an issue or pull request, please read CONTRIBUTING.md.
If this project helped you, please star the repo on GitHub.
Key points:
- Do not add any persistent storage (files, DB, cloud storage, etc.).
- Do not integrate external web APIs or online services.
- New features should be strictly about local file manipulation.
This project is open‑sourced under the MIT License. See LICENSE for details.