Available in pre-release 3.7
You can run
sumatrapdf-tool.exe <tool> to perform operations on PDF and other files.Convert, extract, compress and more.
sumatrapdf-tool.exeis a small console program installed next toSumatraPDF.exe. The command-line tools only work after SumatraPDF has been installed (not in the single-file portable build). See Installation.
I want to… #
| Goal | Tool / doc |
|---|---|
| Delete specific pages | clean — Delete pages from PDF |
| Delete the last page without knowing the count | clean input.pdf out.pdf 1-N-1 (N = last page) |
| Extract pages into a new PDF | clean — Extract pages from PDF |
| Merge PDFs | merge — Tool merge |
| Search text in one or many PDFs | grep — Tool grep |
| Extract plain text | draw -tt or grep — Extract text from PDF |
| Extract embedded images | extract — Extract images from PDF |
| Compress / rewrite PDF | clean — Compress a PDF |
| Remove compression streams | clean — Decompress a PDF |
| Password-protect a PDF | clean — Encrypt a PDF |
| Remove password | clean — Decrypt a PDF |
| Convert images / other formats to PDF | convert / draw — Tool convert |
| Inspect PDF structure | info, show, pages — Tool info |
| Run JavaScript on PDFs | run — Tool run |
The same page-delete operations are also available in the app:
Ctrl + K → Delete Pages From PDF, or context menu Document → Delete Pages From PDF.sumatrapdf-tool.exe <command> [options]
draw -- convert document
convert -- convert document (with simpler options)
audit -- produce usage stats from PDF files
bake -- bake PDF form into static content
clean -- rewrite PDF file
create -- create PDF document
extract -- extract font and image resources
info -- show information about PDF resources
merge -- merge pages from multiple PDF sources into a new PDF
pages -- show information about PDF pages
poster -- split large PDF page into many tiles
recolor -- change colorspace of PDF document
show -- show internal PDF objects
trim -- trim PDF page contents
grep -- search for text
trace -- trace device calls
run -- run a MuPDF JavaScript program
Tools: