PDF Split & Merge Tool

A web-based tool for splitting and merging PDF files built on Val Town.

Features

  • Split PDF: Extract specific pages or page ranges from a PDF
  • Merge PDFs: Combine multiple PDF files into one
  • Preview: View PDF pages before processing
  • Download: Get processed PDFs instantly

Project Structure

├── backend/
│   ├── index.ts           # Main Hono server with API routes
│   └── README.md          # Backend documentation
├── frontend/
│   ├── components/
│   │   ├── App.tsx        # Main React application
│   │   ├── PdfSplitter.tsx # PDF splitting component
│   │   ├── PdfMerger.tsx  # PDF merging component
│   │   └── PdfViewer.tsx  # PDF preview component
│   ├── index.html         # Main HTML template
│   ├── index.tsx          # Frontend entry point
│   └── style.css          # Custom styles
├── shared/
│   └── types.ts           # Shared TypeScript types
└── README.md              # This file

API Endpoints

  • GET / - Serve the main application
  • POST /api/split - Split a PDF file
  • POST /api/merge - Merge multiple PDF files
  • GET /frontend/* - Serve frontend assets
  • GET /shared/* - Serve shared assets

Usage

  1. Visit the application URL
  2. Choose between Split or Merge mode
  3. Upload your PDF file(s)
  4. Configure split ranges or merge order
  5. Download the processed PDF

Technology Stack

  • Backend: Hono (TypeScript)
  • Frontend: React 18.2.0 with TypeScript
  • PDF Processing: PDF-lib library
  • Styling: TailwindCSS
  • Storage: Client-side file handling (no server storage)