Skip to content

mosaddiqdev/onepdf

Repository files navigation

1PDF

1PDF Logo

Combine PDF Pages | Save Paper | Save Money

A modern web application for merging multiple PDF pages onto single sheets, built for students and professionals who want to optimize their printing.

Next.js TypeScript Tailwind CSS PWA

Live Demo Install as App


πŸ’‘ Why 1PDF?

Perfect For

  • πŸŽ“ Students printing lecture notes
  • πŸ’Ό Professionals optimizing documents
  • 🏒 Offices reducing paper costs
  • 🌱 Eco-conscious users saving trees

Key Benefits

  • πŸ’° Save up to 75% on printing costs
  • πŸ”’ 100% private - no file uploads
  • ⚑ Lightning fast browser processing
  • πŸ“‘ Works offline as PWA

✨ Features

Core Features
  • πŸ“„ Smart PDF Combining - Merge 2, 3, 4, or 6 pages per sheet
  • 🎨 Visual Customization - Apply grayscale, color inversion, and background options
  • 🎯 Quality Control - Adjustable DPI settings (150-300 DPI) for perfect print quality
  • πŸ”„ Drag & Drop Interface - Intuitive file management with reordering capabilities
  • βš™οΈ Real-time Processing - Instant preview and processing feedback
Privacy & Security
  • πŸ›‘οΈ Privacy First - All processing happens locally in your browser
  • 🚫 No Uploads - Your files never leave your device
  • βœ… Secure - No server-side storage or data collection
  • 🌐 Offline Ready - Works without internet connection when installed
Progressive Web App
  • πŸ“± Install on Any Device - Works on desktop, mobile, and tablet
  • 🎭 App-like Experience - Native feel with smooth animations
  • πŸ”„ Background Processing - Continue processing when switching tabs
  • πŸ”” Smart Notifications - Get notified when processing completes
  • πŸ“΄ Offline Support - Use the app without internet connection

πŸ“Έ Screenshots

Desktop Experience

1PDF Home Page - Upload Interface
Clean, modern interface for uploading PDF files
1PDF Combine Page - Processing Interface
Intuitive controls for configuring PDF settings

Mobile Experience

1PDF Mobile Interface
Responsive design optimized for mobile devices and touch interactions

πŸš€ Quick Start

Prerequisites
  • Node.js 18+ or Bun runtime
  • Modern web browser with PDF support (Chrome, Firefox, Safari, Edge)

Installation

# Clone the repository
git clone https://github.com/mosaddiqdev/onepdf.git
cd onepdf

# Install dependencies
bun install
# or npm install

# Set up environment variables
cp .env.example .env.local

# Start development server
bun run dev
# or npm run dev

# Open your browser
# http://localhost:3000
Configuration Options

Environment variables can be configured in .env.local:

# File size limits (in MB)
NEXT_PUBLIC_MAX_FILE_SIZE=50
NEXT_PUBLIC_MAX_TOTAL_SIZE=200

# Processing limits
NEXT_PUBLIC_MAX_FILES=20
NEXT_PUBLIC_MAX_PAGES_PER_FILE=500

# Timeout settings (in milliseconds)
NEXT_PUBLIC_PROCESSING_TIMEOUT=1800000
NEXT_PUBLIC_FILE_LOAD_TIMEOUT=60000

πŸ“± PWA Installation

Install 1PDF as an App

πŸ’»

Desktop

Look for the install icon in your browser's address bar
πŸ“±

Mobile

Use "Add to Home Screen" from your browser menu
πŸ–₯️

Automatic

The app will prompt you to install after 30 seconds

πŸ› οΈ Built With

Category Technology Purpose
Framework Next.js 16 React framework with App Router
Language TypeScript Type-safe JavaScript
Styling Tailwind CSS 4 Utility-first CSS framework
PDF Processing PDF-lib PDF manipulation library
PDF Rendering PDF.js Mozilla's PDF rendering engine
Animations Framer Motion Smooth animations and transitions
File Upload React Dropzone Drag & drop file upload
Notifications Sonner Beautiful toast notifications
Project Structure
onepdf/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ combine/           # PDF combining page
β”‚   β”œβ”€β”€ layout.tsx         # Root layout with PWA setup
β”‚   └── page.tsx          # Landing page
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ combine/          # Combine-specific components
β”‚   β”œβ”€β”€ ui/               # Reusable UI components (shadcn/ui)
β”‚   └── pwa/              # PWA components & install prompts
β”œβ”€β”€ hooks/                # Custom React hooks
β”‚   β”œβ”€β”€ use-processing.ts # PDF processing logic
β”‚   β”œβ”€β”€ use-file-manager.ts # File management
β”‚   └── use-background-notifications.ts # PWA notifications
β”œβ”€β”€ lib/                  # Utility functions & core logic
β”‚   β”œβ”€β”€ pdf-processor.ts  # Main PDF processing engine
β”‚   β”œβ”€β”€ pdf-render.worker.ts # Web Worker for background processing
β”‚   β”œβ”€β”€ validation.ts     # Input validation & sanitization
β”‚   └── utils.ts         # General utilities
└── public/               # Static assets
    β”œβ”€β”€ icons/           # PWA icons & favicons
    β”œβ”€β”€ images/          # Screenshots & showcase images
    └── pdfjs/           # PDF.js worker & WASM files

🚒 Deployment

Vercel (Recommended)
  1. Push your code to GitHub
  2. Connect your repository to Vercel
  3. Deploy automatically on every push

Deploy with Vercel

Other Deployment Options
  • Netlify - Connect GitHub repo for automatic deployments
  • Docker - Use the included Dockerfile for containerized deployment
  • Self-hosted - Deploy on any Node.js hosting provider

See DEPLOYMENT.md for detailed instructions.

🀝 Contributing

We welcome contributions from the community!

πŸ›

Bug Reports

Found an issue? Let us know!
πŸ’‘

Feature Requests

Have an idea? We'd love to hear it!
🀝

Code Contributions

Want to contribute code? Awesome!
How to Contribute
  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Bug Reports & Community Feedback

  • Raghav Sharma - Reported critical background processing bug that led to implementing Web Worker architecture for uninterrupted PDF processing.
  • Almas - Identified JPEG 2000 rendering issues with black/corrupted images, leading to implementation of proper WASM support for OpenJPEG decoding in PDF.js.

⭐ this repo if you find it useful!

Website β€’ Report Bug β€’ Request Feature β€’ Discussions

Built for students who print lecture notes

About

Combine PDF Pages | Save Paper | Save Money - A modern web app for merging multiple PDF pages onto single sheets

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors