mutool show¶
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] input.pdf ...
[options]Options are as follows:
-ppasswordUse the specified password if the file is encrypted.
-ooutputThe output file name instead of using
stdout. Should be a plain text file format.-eLeave stream contents in their original form.
-bPrint only stream contents, as raw binary data.
-gPrint only object, one line per object, suitable for grep.
-rForce repair before showing any objects.
-LShow object labels (how to reach an object from the root)
input.pdfInput file name. Must be a PDF file.
...Specify what to show by using one of the following keywords, or a path to an object:
trailerPrint the trailer dictionary.
xrefPrint the cross reference table.
pagesList the object numbers for every page.
grepPrint all the objects in the file in a compact one-line format suitable for piping to grep.
outlinePrint the outline (also known as “table of contents” or “bookmarks”).
jsPrint document level Javascript.
formPrint form objects.
<path>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 use
*as an element to iterate over all array indices or dictionary properties in an object. Thus you can have multiple keywords with for yourmutool showquery.
Examples¶
Find the number of pages in a document:
mutool show input.pdf trailer/Root/Pages/Count
Print the content stream data of the first page:
mutool show -b input.pdf pages/1/Contents
Print the names of all the font resources on all the pages:
mutool show input.pdf pages/*/Resources/Font/*/BaseFont
Show all JPEG compressed stream objects:
mutool show input.pdf grep | grep '/Filter/DCTDecode'