LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

mutool

muPDF command-line tool

TLDR

Convert PDF to images
$ mutool draw -o [page%d.png] [input.pdf]
copy
Extract text from PDF
$ mutool draw -F txt [input.pdf]
copy
Show PDF info
$ mutool info [input.pdf]
copy
Merge PDFs
$ mutool merge -o [output.pdf] [file1.pdf] [file2.pdf]
copy
Extract pages
$ mutool merge -o [output.pdf] [input.pdf] [1-5]
copy
Clean PDF
$ mutool clean [input.pdf] [output.pdf]
copy

SYNOPSIS

mutool command [options] files

DESCRIPTION

mutool is the MuPDF command-line tool for manipulating PDF and other document formats. It can render pages to images, extract text and images, merge and split PDFs, and run JavaScript programs with MuPDF bindings. Lightweight and fast.

PARAMETERS

COMMAND

Operation to perform.
draw
Render document to image/text.
info
Show document information.
merge
Merge/extract pages.
clean
Rewrite PDF file.
convert
Transform files between formats.
extract
Retrieve images and font files from a PDF.
pages
Output page size and orientation information.
poster
Divide pages into tiles for large-format printing.
show
Print specified objects and streams to stdout.
run
Execute a JavaScript program with MuPDF access.
create
Generate a new PDF from graphics command input.
-o FILE
Output file (used by draw, merge, and other subcommands).
-r RESOLUTION
Rendering resolution in DPI (default: 72, for draw).
-F FORMAT
Enforce specific output format (for draw).
-w WIDTH
Page rendering width in pixels (for draw).
-h HEIGHT
Page rendering height in pixels (for draw).
-p PASSWORD
Password for encrypted files.

CAVEATS

Part of MuPDF. Some features require specific builds. Limited editing capabilities.

HISTORY

mutool is part of MuPDF, a lightweight PDF renderer created by Artifex Software.

SEE ALSO

pdftk(1), gs(1), qpdf(1)

Copied to clipboard
Kai