ArkPDF is a multi-tool PDF platform built with Next.js 14 (App Router) for intelligent document transformation. The platform provides modular tools that can be composed into custom document processing pipelines.
- Upload PDF files and normalize all embedded images to a consistent canvas size
- Preserve aspect ratios while padding with white backgrounds
- Configurable target dimensions (default: 1200 × 1200px)
- High-quality LANCZOS resampling for optimal image quality
- PDF Compressor: Smart compression profiles for print, web, and archival workflows
- PDF Merger: Deterministic merging with page range selection
- OCR Extractor: Extract structured text from scanned documents
- Frontend: Next.js 14 (App Router), React 19, Tailwind CSS
- Backend: Next.js API Routes (Route Handlers)
- Python Processing: PyMuPDF (fitz), Pillow (PIL)
- TypeScript: Full type safety throughout
- Node.js 18+ and npm/yarn/pnpm
- Python 3.8+ with pip
- Python Dependencies: PyMuPDF and Pillow
npm install
# or
yarn install
# or
pnpm installpip install -r requirements.txtOr install manually:
pip install PyMuPDF>=1.23.0 Pillow>=10.0.0chmod +x scripts/normalize_images.pynpm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 in your browser.
ArkPdf/
├── src/
│ └── app/
│ ├── page.tsx # Homepage with tools dashboard
│ ├── layout.tsx # Root layout
│ ├── tools/
│ │ ├── layout.tsx # Tools navigation sidebar
│ │ ├── image-size-normalizer/
│ │ │ └── page.tsx # Image Size Normalizer UI
│ │ ├── pdf-compressor/
│ │ │ └── page.tsx # PDF Compressor placeholder
│ │ ├── pdf-merger/
│ │ │ └── page.tsx # PDF Merger placeholder
│ │ └── ocr-extractor/
│ │ └── page.tsx # OCR Extractor placeholder
│ └── api/
│ └── tools/
│ └── image-normalizer/
│ └── route.ts # API endpoint for image normalization
├── scripts/
│ └── normalize_images.py # Python script for PDF image processing
├── requirements.txt # Python dependencies
└── package.json # Node.js dependencies
- Navigate to
/tools/image-size-normalizeror click the tool from the homepage - Upload a PDF file using the file input
- Set target width and height (default: 1200 × 1200px)
- Click "Process PDF" to start normalization
- Download the processed PDF once complete
The tool will:
- Extract all embedded images from the PDF
- Resize each image to fit within target dimensions (preserving aspect ratio)
- Pad images with white backgrounds to match exact target size
- Rebuild the PDF with normalized images
Request:
- Method:
POST - Content-Type:
multipart/form-data - Body:
pdf: PDF file (File)width: Target width in pixels (number, default: 1200)height: Target height in pixels (number, default: 1200)
Response:
- Success (200): Processed PDF file (application/pdf)
- Error (400/500): JSON error message
The scripts/normalize_images.py script can also be run standalone:
python3 scripts/normalize_images.py <input_pdf> <output_pdf> <target_width> <target_height>Example:
python3 scripts/normalize_images.py input.pdf output.pdf 1200 1200npm run build
npm startnpm run lint- Modular Design: Each tool is self-contained in its own route, making it easy to add new tools without refactoring
- Separation of Concerns: Frontend UI, API routes, and Python processing are cleanly separated
- Error Handling: Comprehensive error handling at all layers with user-friendly messages
- Progress Tracking: Real-time upload and processing progress feedback
- Type Safety: Full TypeScript coverage for maintainability
To add a new tool:
- Create a new route:
src/app/tools/your-tool-name/page.tsx - Add navigation link in
src/app/tools/layout.tsx - Add tool card to
src/app/page.tsxtools array - Create API route if needed:
src/app/api/tools/your-tool-name/route.ts - Add any Python scripts to
scripts/directory
- Ensure
scripts/normalize_images.pyexists and is executable - Check that Python 3 is available:
python3 --version
- Verify Python dependencies:
pip list | grep -E "(PyMuPDF|Pillow)" - Reinstall if needed:
pip install -r requirements.txt
- Check file size limits (default Next.js limit applies)
- Ensure PDF files are valid and not corrupted
- Large PDFs with many images may take longer
- API route has a 60-second timeout (configurable in
route.ts)
Private project - All rights reserved.
This is a private project. For questions or issues, please contact the development team.