1MUTOOL(1)                   General Commands Manual                  MUTOOL(1)
2
3
4

NAME

6       mutool - all purpose tool for dealing with PDF files
7
8

SYNOPSIS

10       mutool <sub-command> [options]
11
12

DESCRIPTION

14       mutool is a tool based on MuPDF for dealing with document files in
15       various manners.  There are several sub commands available, as
16       described below.
17
18

DRAW

20       mutool draw [options] file [pages]
21
22       The draw command will render a document to image files, convert to
23       another vector format, or extract the text content.
24
25       The supported input document formats are: pdf, xps, cbz, and epub.
26
27       The supported output image formats are: pbm, pgm, ppm, pam, png, pwg,
28       pcl and ps.  The supported output vector formats are: svg, pdf, and
29       debug trace (as xml).  The supported output text formats are: plain
30       text, html, and structured text (as xml).
31
32       -p password
33              Use the specified password if the file is encrypted.
34
35       -o output
36              The output format is inferred from the output filename.  Embed
37              %d in the name to indicate the page number (for example:
38              "page%d.png").  Printf modifiers are supported, for example
39              "%03d".  If no output is specified, the output will go to
40              stdout.
41
42       -F format
43              Enforce a specific output format. Only necessary when outputting
44              to stdout since normally the output filename is used to infer
45              the output format.
46
47       -R angle
48              Rotate clockwise by given number of degrees.
49
50       -r resolution
51              Render the page at the specified resolution.  The default
52              resolution is 72 dpi.
53
54       -w width
55              Render the page at the specified width (or, if the -r flag is
56              used, render with a maximum width).
57
58       -h height
59              Render the page at the specified height (or, if the -r flag is
60              used, render with a maximum height).
61
62       -f     Fit exactly; ignore the aspect ratio when matching specified
63              width/heights.
64
65       -B bandheight
66              Render in banded mode with each band no taller than the given
67              height. This uses less memory during rendering. Only compatible
68              with pam, pgm, ppm, pnm and png output formats. Banded rendering
69              and md5 checksumming may not be used at the same time.
70
71       -W width
72              Page width in points for EPUB layout.
73
74       -H height
75              Page height in points for EPUB layout.
76
77       -S size
78              Font size in points for EPUB layout.
79
80       -U filename
81              User CSS stylesheet for EPUB layout.
82
83       -c colorspace
84              Render in the specified colorspace.  Supported colorspaces are:
85              mono, gray, grayalpha, rgb, rgbalpha, cmyk, cmykalpha.  Some
86              abbreviations are allowed: m, g, ga, rgba, cmyka.  The default
87              is chosen based on the output format.
88
89       -G gamma
90              Apply gamma correction.  Some typical values are 0.7 or 1.4 to
91              thin or darken text rendering.
92
93       -I     Invert colors.
94
95       -s [mft5]
96              Show various bits of information: m for glyph cache and total
97              memory usage, f for page features such as whether the page is
98              grayscale or color, t for per page rendering times as well
99              statistics, and 5 for md5 checksums of rendered images that can
100              be used to check if rendering has changed.
101
102       -A bits
103              Specify how many bits of anti-aliasing to use. The default is 8.
104
105       -D     Disable use of display lists. May cause slowdowns, but should
106              reduce the amount of memory used.
107
108       -i     Ignore errors.
109
110       -L     Low memory mode (avoid caching objects by clearing cache after
111              each page).
112
113       -P     Run interpretation and rendering at the same time.
114
115       pages  Comma separated list of page numbers and ranges (for example:
116              1,5,10-15).  If no pages are specified, then all pages will be
117              rendered.
118
119

CLEAN

121       mutool clean [options] input.pdf [output.pdf] [pages]
122
123       The clean command pretty prints and rewrites the syntax of a PDF file.
124       It can be used to repair broken files, expand compressed streams,
125       filter out a range of pages, etc.
126
127       If no output file is specified, it will write the cleaned PDF to
128       "out.pdf" in the current directory.
129
130       -p password
131              Use the specified password if the file is encrypted.
132
133       -g     Garbage collect objects that have no references from other
134              objects.  Give the option twice to renumber all objects and
135              compact the cross reference table.  Give it three times to merge
136              and reuse duplicate objects.
137
138       -s     Rewrite content streams.
139
140       -d     Decompress streams. This will make the output file larger, but
141              provides easy access for reading and editing the contents with a
142              text editor.
143
144       -l     Linearize output. Create a "Web Optimized" output file.
145
146       -i     Toggle decompression of image streams. Use in conjunction with
147              -d to leave images compressed.
148
149       -f     Toggle decompression of font streams. Use in conjunction with -d
150              to leave fonts compressed.
151
152       -a     ASCII Hex encode binary streams. Use in conjunction with -d and
153              -i or -f to ensure that although the images and/or fonts are
154              compressed, the resulting file can still be viewed and edited
155              with a text editor.
156
157       -z     Deflate uncompressed streams.  If combined with -d, any
158              decompressed streams will be recompressed.  If combined with -a,
159              the streams will also be hex encoded after compression.
160
161       pages  Comma separated list of page numbers and ranges to include.
162
163

EXTRACT

165       mutool extract [options] file.pdf [object numbers]
166
167       The extract command can be used to extract images and font files from a
168       PDF.  If no object numbers are given on the command line, all images
169       and fonts will be extracted.
170
171       -p password
172              Use the specified password if the file is encrypted.
173
174       -r     Convert images to RGB when extracting them.
175
176

INFO

178       mutool info [options] file.pdf [pages]
179
180       The info command lists the resources used on each page in a PDF file.
181       The default is to list all resource types, but if one or more flags are
182       given, only the flagged types will be shown.
183
184       -p password
185              Use the specified password if the file is encrypted.
186
187       -F     List fonts.
188
189       -I     List images.
190
191       -M     List page dimensions.
192
193       -S     List shadings.
194
195       -P     List patterns.
196
197       -X     List form and postscript XObjects.
198
199       pages  Comma separated list of page numbers and ranges to include.
200
201

CREATE

203       mutool create [-o output.pdf] [options] page1.txt [page2.txt ...]
204
205       The create command creates a new PDF file with the contents created
206       from one or more input files containing graphics commands.
207
208       -o output
209              If no output file is specified, it will write the created PDF to
210              "out.pdf" in the current directory.
211
212       page.txt
213              A page is created for each input file, with the contents of the
214              file copied into the content stream. Special comments in the
215              input files are parsed to define the page dimensions and font
216              and image resources:
217
218       %%MediaBox 0 0 500 800
219       %%Rotate 90
220       %%Font Tm Times-Roman
221       %%Font Fn0 path/to/font/file.ttf
222       %%Image Im0 path/to/image.png
223
224       -O     Comma separated list of format specific output options:
225
226              decompress
227              Decompress all object streams.
228
229              compress
230              Compress all object streams.
231
232              compress-fonts
233              Compress object streams for embedded fonts.
234
235              compress-images
236              Compress object streams for images.
237
238              ascii
239              Encode object streams using ASCII hex encoding.
240
241              pretty
242              Pretty-print objects with indentation.
243
244              linearize
245              Optimize document for progressive loading in viewers.
246
247              sanitize
248              Clean up graphics command in content streams.
249
250              garbage[=compact|deduplicate]
251              Garbage collect unused objects. With compact the cross-reference
252              table will also be compacted. With deduplicate duplicate objects
253              will also be recombined.
254
255

PAGES

257       mutool pages [options] input.pdf [pages ...]
258
259       The pages command dumps information about the size and orientation of
260       pages within the document.
261
262       -p password
263              Use the specified password if the file is encrypted.
264
265       pages  Comma separated list of page numbers and ranges to include.
266
267

POSTER

269       mutool poster [options] input.pdf [output.pdf]
270
271       The poster command splits each page into tiles, and puts each tile on a
272       page of its own. It's useful for printing a large page onto smaller
273       pieces of paper that can then be glued together to create a large
274       poster.
275
276       -p password
277              Use the specified password if the file is encrypted.
278
279       -x factor
280              Split the page into this many horizontal pieces.
281
282       -y factor
283              Split the page into this many vertical pieces.
284
285       The output will have x times y number of pages for each input page.
286
287

SHOW

289       mutool show [options] file.pdf [object numbers ...]
290
291       The show command will print the specified objects and streams to
292       stdout.  Streams are decoded and non-printable characters are
293       represented with a period by default.
294
295       -p password
296              Use the specified password if the file is encrypted.
297
298       -o file
299              Write output to file instead of stdout.
300
301       -b     Print streams as binary data and omit the object header.
302
303       -e     Print streams in their original encoded (or compressed) form.
304
305       Specify objects by number, or use one of the following special names:
306
307       'xref' or 'x'
308              Print the cross reference table.
309
310       'trailer' or 't'
311              Print the trailer dictionary.
312
313       'encrypt' or 'e'
314              Print the encryption dictionary.
315
316       'pagetree' or 'p'
317              List the object numbers for every page.
318
319       'grep' or 'g'
320              Print all the objects in the file in a compact one-line format
321              suitable for piping to grep.
322
323       'outline' or 'o'
324              Print the outline (table of contents).
325
326

RUN

328       mutool run script.js [arguments]
329
330       Executes a Javascript program which has access to most of the features
331       of the MuPDF library. The command supports ECMAScript 5 syntax in
332       strict mode. All of the MuPDF constructors and function live in the
333       global object, and the command line arguments are accessible from the
334       global argv object.
335
336       If invoke without any arguments, it will drop you into an interactive
337       REPL (read-eval-print-loop). On the interactive prompt, if you prefix a
338       line with an equal character it will automatically print the results of
339       the line.
340
341       See the MuPDF documentation for details about the Javascript
342       interfaces.
343
344

CONVERT

346       mutool convert [options] file [pages]
347
348       The convert command is used to convert a file from one format to
349       another.
350
351       -p password
352              Use the specified password if the file is encrypted.
353
354       -A bits
355              Specify how many bits of anti-aliasing to use. The default is 8.
356
357       -W width
358              Page width in points for EPUB layout.
359
360       -H height
361              Page height in points for EPUB layout.
362
363       -S size
364              Font size in points for EPUB layout.
365
366       -U filename
367              User CSS stylesheet for EPUB layout.
368
369       -o output
370              The output format is inferred from the output filename.  Embed
371              %d in the name to indicate the page number (for example:
372              "page%d.png").  Printf modifiers are supported, for example
373              "%03d".  If no output is specified, the output will go to
374              stdout.
375
376       -F format
377              Enforce a specific output format. Only necessary when outputting
378              to stdout since normally the output filename is used to infer
379              the output format.
380
381       -O     Comma separated list of format specific output options:
382
383

MERGE

385       mutool merge [options] file1 [pages] file2 [pages] ...
386
387       The merge command is used to pick out pages from two or more files and
388       merge them in order into a new output file.
389
390       -o output
391              The output filename.
392
393       -O     See mutool create for details on this option.
394
395

SEE ALSO

397       mupdf(1),
398
399

AUTHOR

401       MuPDF is Copyright 2006-2017 Artifex Software, Inc.
402
403
404
405                               January 12, 2016                      MUTOOL(1)
Impressum