The show command will print the specified objects and streams to stdout. Streams are decoded and non-printable characters are represented with a period by default.
mutool show [options] file.pdf ( xref | outline | grep | <path> ) *
- -p password
- Use the specified password if the file is encrypted.
- -o file
- Write output to file instead of stdout.
- Print streams in their original encoded (or compressed) form.
- Print streams as binary data, and omit the object.
- Print objects in a one-line form suitable for grep, and omit stream data.
Specify what to show by using one of the following keywords, or specify a path to an object:
- Print the cross reference table.
- Print the outline (table of contents).
- List the object numbers for every page.
- Print all the objects in the file in a compact one-line format suitable for piping to grep.
A path starts with either an object number, a property in the trailer dictionary, or the keyword "trailer" or "pages". Separate elements with a period '.' or slash '/'. Select a page object by using pages/N where N is the page number. The first page is number 1. You can also use '*' as an element to iterate over all array indices or dictionary properties in an object.
- Find the number of pages in a document:
- mutool show $FILE trailer/Pages/Count
- Print the raw content stream of the first page:
- mutool show -b $FILE pages/1/Contents
- Show all JPEG compressed stream objects:
- mutool show $FILE grep | grep '/Filter/DCTDecode'