An interactive web application built with React and TypeScript for splitting a single PDF into multiple smaller PDF files. Users can visually select pages, group them into named "lessons," and download all the created lessons conveniently bundled into a single ZIP archive.
This tool runs entirely in the browser, ensuring user privacy as no files are uploaded to a server.
- File Upload: Drag-and-drop or click to upload a PDF file from your computer.
- URL Loading: Load PDFs directly from URLs without downloading them first.
- Direct Fetch: Fast loading from CORS-friendly URLs.
- CORS Proxy Support: Optional proxy mode to bypass CORS restrictions.
- Smart Error Handling: Automatic detection of CORS issues with helpful suggestions.
- Progress Tracking: Real-time progress bar shows download percentage.
- Visual Page Selection: View thumbnails of all PDF pages and click to select them.
- Lesson Grouping: Group selected pages into distinct lessons with customizable names.
- Color Coding: Each lesson is assigned a unique color for easy visual identification.
- Smart Naming: Automatically increments lesson numbers for sequential lesson creation (e.g.,
1-1,1-2). - Download as ZIP: Extracts all defined lessons into separate PDF files and downloads them as a single
.ziparchive.
- Client-Side Processing: All PDF processing happens in your browser - no server uploads.
- Privacy Warnings: Clear warnings when using CORS proxy mode.
- No Data Storage: Your PDFs are never stored or sent to any server (except when using proxy mode).
- Frontend: React, TypeScript, Vite
- PDF Manipulation:
pdf-lib&pdfjs-dist - Styling: TailwindCSS
- Deployment: GitHub Pages with GitHub Actions
Follow these steps to get the project running on your local machine.
Prerequisites:
1. Clone the repository:
git clone https://github.com/shaaa4t/pdf.extractor.io.git
cd pdf.extractor.io2. Install dependencies:
npm install3. Run the development server:
npm run devThe application should now be running on the local address shown in your terminal.
- Click the Upload File tab
- Drag and drop a PDF file or click to browse
- Wait for page thumbnails to generate
- Click the Load from URL tab
- Paste a direct PDF URL (e.g.,
https://example.com/document.pdf) - Click Load PDF to fetch the file
- If CORS error occurs:
- A suggestion box will appear
- Click "Enable proxy and retry" or check "Use CORS proxy"
- Try loading again (proxy mode is slower but bypasses restrictions)
- Click on page thumbnails to select them
- Selected pages will be highlighted in blue
- Click Add Lesson to create a lesson from selected pages
- Rename lessons by clicking on the lesson name
- Delete lessons using the trash icon
- Click Extract & Download to get your ZIP file
This repository is pre-configured for automated deployment to GitHub Pages using GitHub Actions. The workflow file at .github/workflows/deploy.yml will automatically build and deploy the application whenever you push changes to the main branch.
Setup Steps:
- Push your code to your GitHub repository.
- In your repository, go to Settings > Pages.
- Under "Build and deployment", set the Source to GitHub Actions.
- Save the changes. The site will be deployed automatically on your next push to
main.
Your site will be available at: https://[your-username].github.io/[repository-name]/
CORS (Cross-Origin Resource Sharing) is a browser security feature that prevents websites from fetching resources from different domains. Many PDF hosting services don't allow direct access from web applications.
-
✅ Use Direct Fetch when:
- Loading from your own servers
- Public CDNs and CORS-friendly services
- Educational resources (like w3.org)
-
⚠️ Use Proxy Mode when:- You get CORS errors
- Loading from Google Drive, Dropbox, or similar services
- Academic papers from university servers
- Note: Avoid using proxy for sensitive/private documents
When enabled, your PDF URL is routed through a public CORS proxy service (corsproxy.io). This service fetches the PDF on your behalf and sends it to your browser, bypassing CORS restrictions.
Problem: "Network error. This may be due to CORS restrictions"
- Solution: Enable "Use CORS proxy" checkbox and try again
Problem: "PDF not found (404)"
- Solution: Verify the URL points directly to a PDF file
- Make sure the URL ends with
.pdfor returns a PDF file - Test the URL in your browser first
Problem: "The URL does not point to a PDF file"
- Solution: Some URLs redirect or serve HTML instead of PDFs
- Try copying the direct PDF link (right-click → Copy Link Address)
Problem: Proxy mode is slow
- Solution: This is normal - proxy adds extra network hop
- For better performance, download the PDF and use Upload tab
Problem: Thumbnails not generating
- Solution: Ensure the PDF is not corrupted or password-protected
- Try a different PDF to verify the application works
Problem: Build fails locally
- Solution:
- Delete
node_modulesand runnpm installagain - Make sure you have Node.js v18+ installed
- Check that all Tailwind config files exist
- Delete
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
- Built with React and TypeScript
- PDF processing powered by pdf-lib and PDF.js
- Styled with Tailwind CSS
- CORS proxy provided by corsproxy.io
Made with ❤️ by the community