Skip to content

uddhavphatak/swan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swan — The PDF Swiss-Army CLI

Swan is a lightweight, fast, and dependency-minimal command-line toolkit for PDF manipulation, built entirely in C on top of PDFio.
It provides a set of powerful subcommands to merge, split, reorder, inspect, and generate PDFs — all under a permissive license.


Features

  • Merge multiple PDF files into one
  • Inspect internal structure, objects, and metadata (pdf-info)
  • Reorder or select specific pages
  • Split a PDF into multiple smaller PDFs
  • Create a PDF from one or more images (imagetopdf)

Quick Start

$ ./swan
swan — PDF Swiss-Army CLI

Usage:
  ./swan <command> [options] [args]

Commands:
  merge       Concatenate multiple PDFs into one
  pdf-info    Debug-print PDF structure
  reorder     Reorder pages within a PDF
  split       Split a PDF into multiple files
  imagetopdf  Create a PDF from images

Run './swan <command> -h' for command-specific help.

Installation Guide:

System Requirements

  • Operating System: Linux (Ubuntu, Debian, Fedora, Arch), or macOS
  • Compiler: GCC ≥ 9.0 or Clang ≥ 10.0
  • Build System: make or cmake
  • Libraries:
    • libjpeg (for image input support)
    • zlib (for compression and streams)
    • pdfio (the core PDF I/O library)

Step 1: Install Build Dependencies

  • Ubuntu / Debian
sudo apt update
sudo apt install -y build-essential cmake git pkg-config \
    libjpeg-dev zlib1g-dev

-- Fedora / RHEL

sudo dnf install -y make gcc cmake git \
    libjpeg-turbo-devel zlib-devel

-- Arch Linux

sudo pacman -S base-devel cmake git libjpeg-turbo zlib

Step 2: Install PDFio

Swan depends on PDFio ≥ 1.6.0. If you don’t have it installed system-wide, build it from source - https://github.com/michaelrsweet/pdfio/releases/tag/v1.6.0

Step 3: clone and run Swan

To build the source, all you have to do is

make

To verify just run

./swan 

About

PDF swiss-army CLI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published