comparison mupdf-source/docs/tools/mutool-show.rst @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 mutool show
2 ===========
3
4 The ``show`` command will print the specified objects and streams to ``stdout``.
5 Streams are decoded and non-printable characters are represented with a period
6 by default.
7
8 .. code-block::
9
10 mutool show [options] input.pdf ...
11
12 ``[options]``
13 Options are as follows:
14
15 ``-p`` password
16 Use the specified password if the file is encrypted.
17 ``-o`` output
18 The output file name instead of using ``stdout``. Should be a plain text file format.
19 ``-e``
20 Leave stream contents in their original form.
21 ``-b``
22 Print only stream contents, as raw binary data.
23 ``-g``
24 Print only object, one line per object, suitable for grep.
25 ``-r``
26 Force repair before showing any objects.
27 ``-L``
28 Show object labels (how to reach an object from the root)
29
30 ``input.pdf``
31 Input file name. Must be a PDF file.
32
33 ``...``
34 Specify what to show by using one of the following keywords, or a path to an object:
35
36 ``trailer``
37 Print the trailer dictionary.
38
39 ``xref``
40 Print the cross reference table.
41
42 ``pages``
43 List the object numbers for every page.
44
45 ``grep``
46 Print all the objects in the file in a compact one-line format
47 suitable for piping to grep.
48
49 ``outline``
50 Print the outline (also known as "table of contents" or
51 "bookmarks").
52
53 ``js``
54 Print document level Javascript.
55
56 ``form``
57 Print form objects.
58
59 ``<path>``
60 A path starts with either an object number, a property in the
61 trailer dictionary, or the keyword "trailer" or "pages".
62 Separate elements with a period '.' or slash '/'. Select a page
63 object by using pages/N where N is the page number. The first
64 page is number 1.
65
66 ``*``
67 You can use ``*`` as an element to iterate over all array
68 indices or dictionary properties in an object. Thus you can
69 have multiple keywords with for your ``mutool show`` query.
70
71 Examples
72 --------
73
74 Find the number of pages in a document:
75
76 .. code-block:: bash
77
78 mutool show input.pdf trailer/Root/Pages/Count
79
80 Print the content stream data of the first page:
81
82 .. code-block:: bash
83
84 mutool show -b input.pdf pages/1/Contents
85
86 Print the names of all the font resources on all the pages:
87
88 .. code-block:: bash
89
90 mutool show input.pdf pages/*/Resources/Font/*/BaseFont
91
92 Show all JPEG compressed stream objects:
93
94 .. code-block:: bash
95
96 mutool show input.pdf grep | grep '/Filter/DCTDecode'