Skip to content

Instantly share code, notes, and snippets.

@douglasmiranda
Last active October 3, 2024 18:05
Show Gist options
  • Save douglasmiranda/50cbdaad80f3c46af87d302bafea6e20 to your computer and use it in GitHub Desktop.
Save douglasmiranda/50cbdaad80f3c46af87d302bafea6e20 to your computer and use it in GitHub Desktop.
Clean and output all pages but the first one.

Today (2024-10-02) the docs for mutool clean just doesn't include proper info for this.

mutool clean a.pdf b.pdf 2-N

In the Ubuntu page, there's a better description:

From Ubuntu Man pages:

pages: Comma separated list of page numbers and ranges (for example: 1,5,10-15,20-N), where the character N denotes the last page. If no pages are specified, then all pages will be included.

https://manpages.ubuntu.com/manpages/jammy/man1/mutool.1.html#clean

Another place that refers to this usage:

https://pymupdf.readthedocs.io/en/latest/module.html#cleaning-and-copying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment