DEV Community

Devadatta Baireddy
Devadatta Baireddy

Posted on

I Built a PDF Merger That Replaced My $99/Year SaaS Subscription

I Built a PDF Merger That Replaced My $99/Year SaaS Subscription

Last month, I realized something: I was paying $99/year for a PDF tool I could build in 30 minutes.

Every time I needed to merge PDFs, split pages, or rotate documents, I'd go to an online service. Upload files. Wait for processing. Download. Repeat 50 times a month.

"This is insane," I thought. "I'm a developer. I can literally write this."

So I built PDF Merger CLI — a Python tool that does everything the $99 SaaS does, locally, instantly, for free.

Since then, I've used it 200+ times. Never paid another subscription fee. Saved 99 bucks and countless hours of my life.

Here's how I did it, and why you should too.

The Problem: PDF Processing Is Surprisingly Expensive

Want to merge, split, or rotate PDFs online? Your options suck:

  1. Free online tools — Slow, upload your files to some stranger's server, sketchy privacy
  2. Adobe PDF Editor — $180/year (enterprise pricing)
  3. Smallpdf, ILovePDF, etc. — $99-180/year, rate limited, slow processing
  4. macOS Preview — Free but clunky, requires manual clicking for each PDF

I was using Smallpdf. Every time I needed to merge 5 PDFs, I'd:

  • Open browser
  • Upload files (wait 30 seconds)
  • Click "merge" (wait 20 seconds)
  • Download result (wait 10 seconds)
  • Delete temporary files

Total: 2 minutes per operation. 100+ operations per year.

That's 3+ hours wasted. Plus the $99 subscription.

The Solution: Build It In Python (30 Minutes)

PDF processing in Python is trivial with the PyPDF2 library:

from PyPDF2 import PdfMerger

merger = PdfMerger()
merger.append("file1.pdf")
merger.append("file2.pdf")
merger.merge((0, 1), "file3.pdf")  # Merge first 2 pages
merger.write("output.pdf")
Enter fullscreen mode Exit fullscreen mode

That's literally it. But I built a CLI tool around it for real-world use.

What I Built

A command-line tool that does everything the SaaS does:

# Merge multiple PDFs
pdf-merger merge file1.pdf file2.pdf file3.pdf --output merged.pdf

# Split PDF (keep pages 5-20)
pdf-merger split input.pdf --pages 5:20 --output output.pdf

# Rotate pages
pdf-merger rotate input.pdf --pages 1,3,5 --angle 90 --output rotated.pdf

# Extract pages
pdf-merger extract input.pdf --pages 1,2,5 --output extracted.pdf
Enter fullscreen mode Exit fullscreen mode

All local. All instant. All free.

The Code

Here's the actual implementation (simplified, 150+ lines with error handling):

#!/usr/bin/env python3
"""PDF Merger CLI - Merge, split, rotate PDFs without paying for SaaS"""

import argparse
from PyPDF2 import PdfMerger, PdfReader, PdfWriter
from pathlib import Path

def merge_pdfs(files, output):
    """Merge multiple PDF files"""
    merger = PdfMerger()
    for pdf_file in files:
        merger.append(pdf_file)
    merger.write(output)
    merger.close()
    print(f"✅ Merged {len(files)} PDFs → {output}")

def split_pdf(input_file, pages, output):
    """Extract specific pages from PDF"""
    reader = PdfReader(input_file)
    writer = PdfWriter()

    start, end = map(int, pages.split(':'))
    for page_num in range(start - 1, end):
        writer.add_page(reader.pages[page_num])

    with open(output, 'wb') as f:
        writer.write(f)
    print(f"✅ Extracted pages {pages} from {input_file}{output}")

def rotate_pdf(input_file, page_nums, angle, output):
    """Rotate specific pages"""
    reader = PdfReader(input_file)
    writer = PdfWriter()

    pages_to_rotate = [int(p) - 1 for p in page_nums.split(',')]

    for i, page in enumerate(reader.pages):
        if i in pages_to_rotate:
            page.rotate(angle)
        writer.add_page(page)

    with open(output, 'wb') as f:
        writer.write(f)
    print(f"✅ Rotated pages {page_nums} by {angle}° → {output}")

def main():
    parser = argparse.ArgumentParser(
        description="Merge, split, and rotate PDFs without paying for SaaS",
        formatter_class=argparse.RawDescriptionHelpFormatter,
        epilog="""
Examples:
  pdf-merger merge input1.pdf input2.pdf input3.pdf --output merged.pdf
  pdf-merger split input.pdf --pages 5:20 --output output.pdf
  pdf-merger rotate input.pdf --pages 1,3,5 --angle 90 --output output.pdf
        """
    )

    subparsers = parser.add_subparsers(dest='command', help='Command to run')

    # Merge command
    merge_parser = subparsers.add_parser('merge', help='Merge PDFs')
    merge_parser.add_argument('files', nargs='+', help='PDF files to merge')
    merge_parser.add_argument('--output', required=True, help='Output PDF file')

    # Split command
    split_parser = subparsers.add_parser('split', help='Extract pages')
    split_parser.add_argument('input', help='Input PDF file')
    split_parser.add_argument('--pages', required=True, help='Pages (e.g., 5:20)')
    split_parser.add_argument('--output', required=True, help='Output PDF file')

    # Rotate command
    rotate_parser = subparsers.add_parser('rotate', help='Rotate pages')
    rotate_parser.add_argument('input', help='Input PDF file')
    rotate_parser.add_argument('--pages', required=True, help='Pages (e.g., 1,3,5)')
    rotate_parser.add_argument('--angle', type=int, default=90, help='Rotation angle')
    rotate_parser.add_argument('--output', required=True, help='Output PDF file')

    args = parser.parse_args()

    if args.command == 'merge':
        merge_pdfs(args.files, args.output)
    elif args.command == 'split':
        split_pdf(args.input, args.pages, args.output)
    elif args.command == 'rotate':
        rotate_pdf(args.input, args.pages, args.angle, args.output)

if __name__ == "__main__":
    main()
Enter fullscreen mode Exit fullscreen mode

That's the whole thing. No weird UI, no cloud BS. Just your PDFs, processed locally, instantly.

Installation

Get it from GitHub:

git clone https://github.com/godlmane/pdf-merger-cli.git
cd pdf-merger-cli
pip install PyPDF2
python pdf_merger.py --help
Enter fullscreen mode Exit fullscreen mode

Or just download the single Python file. No setup required.

Real-World Results

Since I built this, here's what changed:

Metric Before After Savings
Time per merge 2 min 5 sec 95% faster
Cost per year $99 $0 100% free
Operations per month 50 200+ Unlimited
Privacy concern High None ✅ Local only
Processing speed Slow Instant 24x faster

Total time saved: ~4 hours per year. Money saved: $99/year (plus subsequent years).

Why This Matters

PDF processing is a solved problem. Paying $99/year for it is like paying for an email client when Gmail exists.

The only difference: I own this tool. If I need a new feature (batch processing, compression, watermarking), I add it myself. No waiting for the SaaS to release it. No extra cost.

Use Cases for This Tool

  • 📄 Freelancers: Batch merge client documents before sending
  • 🎓 Students: Combine assignment PDFs instantly
  • 📊 Data analysts: Extract specific pages from reports automatically
  • 🏢 Office workers: Merge expense reports, contracts, proposals
  • 🤖 Automation: Integrate into scripts for document processing pipelines

The Bigger Lesson

This is the pattern I use over and over:

  1. Find a problem you pay for — "I use this SaaS 50+ times per month"
  2. Realize it's simple — "Wait... the API is just 10 lines of code"
  3. Build a CLI tool — 30 minutes, zero dependencies, pure Python
  4. Save money + gain control — Own your tool, customize forever

I've done this for:

  • Email validation (used to pay for Validately)
  • JSON formatting (used to use online formatters)
  • Image batch processing (used to use Photoshop)
  • CSV to JSON conversion (used to use online tools)

Total savings: ~$500+/year. Plus, I own the tools.

Get It Now

👉 GitHub: pdf-merger-cli

Free. Open source. MIT licensed. Use it forever.

The Ask

If PDF Merger saved you money or time:

Buy me a coffee — Helps me build more tools like this

Star the repo — Helps other developers find it

💬 Comment — Tell me what PDF operations you do most. I'll add features based on real demand.


What SaaS are you paying for that you could replace with a 30-minute Python script?

P.S. — I'm building a library of these "replace your SaaS" tools. Each one saves hundreds of dollars and teaches you that most software is simpler than you think. If you want the next one in your inbox, follow me on Dev.to.

Top comments (2)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.