2018-08-28 15:28:41 +01:00
|
|
|
# mutool
|
|
|
|
|
2024-02-14 20:24:47 +00:00
|
|
|
> Convert, query information and extract data from PDF files.
|
2023-05-20 22:10:05 +01:00
|
|
|
> More information: <https://mupdf.readthedocs.io/en/latest/mupdf-command-line.html>.
|
2018-08-28 15:28:41 +01:00
|
|
|
|
2024-02-14 20:24:47 +00:00
|
|
|
- Convert a range of pages to PNGs (Note: `%nd` in the output placeholder must be replaced with a print modifier like `%d` or `%2d`):
|
2018-08-28 15:28:41 +01:00
|
|
|
|
2023-05-20 22:10:05 +01:00
|
|
|
`mutool convert -o {{path/to/output%nd.png}} {{path/to/input.pdf}} {{1-10}}`
|
2018-08-28 15:28:41 +01:00
|
|
|
|
2024-02-14 20:24:47 +00:00
|
|
|
- Convert one or more pages of a PDF into text in `stdout`:
|
2018-08-28 15:28:41 +01:00
|
|
|
|
2024-02-14 20:24:47 +00:00
|
|
|
`mutool draw -F txt {{path/to/input.pdf}} {{2,3,5,...}}`
|
2018-08-28 15:28:41 +01:00
|
|
|
|
2023-05-20 22:10:05 +01:00
|
|
|
- Concatenate multiple PDF files:
|
2018-08-28 15:28:41 +01:00
|
|
|
|
2023-05-20 22:10:05 +01:00
|
|
|
`mutool merge -o {{path/to/output.pdf}} {{path/to/input1.pdf path/to/input2.pdf ...}}`
|
2018-08-28 15:28:41 +01:00
|
|
|
|
|
|
|
- Query information about all content embedded in a PDF:
|
|
|
|
|
2023-05-20 22:10:05 +01:00
|
|
|
`mutool info {{path/to/input.pdf}}`
|
2018-08-28 15:28:41 +01:00
|
|
|
|
2024-02-14 20:24:47 +00:00
|
|
|
- Extract all images, fonts and resources embedded in a PDF to the current directory:
|
2018-08-28 15:28:41 +01:00
|
|
|
|
2023-05-20 22:10:05 +01:00
|
|
|
`mutool extract {{path/to/input.pdf}}`
|
2021-02-21 21:12:32 +00:00
|
|
|
|
2024-02-14 20:24:47 +00:00
|
|
|
- Show the outline (table of contents) of a PDF:
|
2021-02-21 21:12:32 +00:00
|
|
|
|
2023-05-20 22:10:05 +01:00
|
|
|
`mutool show {{path/to/input.pdf}} outline`
|