MUTOOL(1)

✨ MUTOOL(1) β€” General Commands Manual ✨

okay bestie, this is MUTOOL(1) from the General Commands Manual, and it's literally the all-purpose tool for dealing with PDF files πŸ’–. no cap, it's giving main character energy in your terminal. 🫢


πŸŽ€ NAME πŸŽ€

mutool β€” all purpose tool for dealing with PDF files ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

mutool sub-command [options]

🌸 DESCRIPTION 🌸

mutool is a tool based on MuPDF for dealing with document files in various manners. There are several sub commands available, as described below. πŸ’…


⭐ VERSION ⭐

mutool -v

Shows the MuPDF version used to build mutool. 🫢


πŸ” AUDIT πŸ”

mutool audit [options] file1.pdf [file2.pdf ...]

Outputs a report of operator and space usage for each given PDF file. πŸ‘‘

  • -o filename β€” The output filename for the report.

🧁 BAKE 🧁

mutool bake [options] input.pdf [output.pdf]

Normally annotations and form field widgets are separate content streams that get drawn on top of the page contents. This command bakes annotations and/or widgets into the page contents, making them inseparable. After baking in annotations and widgets they are just visual representations of what the original annotation/widget looked like, their properties can no longer be edited since they no longer exist as proper annotation/widgets. 😭

  • -A β€” Do not bake in annotations.
  • -F β€” Do not bake in form field widgets.
  • -O options β€” A comma-separated list of PDF options. See PDF OUTPUT OPTIONS below.

πŸ’… BARCODE πŸ’…

mutool barcode -d [options] file1.pdf [pages1] [file2.pdf] [pages2]

Decodes a barcode from an image or a document. πŸ“Έ

  • -p password β€” Use the specified password if the file is encrypted.
  • -o output β€” The output filename. If no output is specified, any text from decoded barcodes will go to stdout.
  • -r angle β€” How much to rotate the input pages in degrees (0-360), before trying to decode any barcodes.
  • pages β€” Comma-separated list of page numbers and ranges (for example: 1,5,10-15,20-N), where the character N denotes the last page. If no pages are specified, then all pages will be processed.

mutool barcode -c [options] text

Creates a new barcode containing text argument and formatted according to options specified. ✨

  • -o output β€” The output format is inferred from the output filename, either PNG or PDF. If no output is specified, the default is out.png
  • -F format β€” The desired output barcode format:
    • aztec
    • codabar
    • code39
    • code93
    • code128
    • databar
    • databarexpanded
    • datamatrix
    • ean8
    • ean13
    • itf
    • maxicode
    • pdf417
    • qrcode
    • upca
    • upce
    • microqrcode
    • rmqrcode
    • dxfilmedge
    • databarlimited
  • -s size β€” Set size in pixels for the output barcode. If not specified the smallest size that can be decoded is chosen.
  • -q β€” Add quiet zones around the barcode. This puts an empty margin around created barcodes.
  • -t β€” Add human-readable text, when available. Some barcodes, e.g. EAN-13, may have the barcode contents printed in human-readable text next to the barcode, which is enabled by this flag.
  • -t level β€” Set error correction level (0-8). Some barcodes, e.g. QR-codes, support several levels of error correction, which can be customized through this option.
  • text β€” The text to be encoded into a barcode.

🧼 CLEAN 🧼

mutool clean [options] input.pdf [output.pdf] [pages ...]

The clean command pretty prints and rewrites the syntax of a PDF file. It can be used to repair broken files, expand compressed streams, filter out a range of pages, etc. πŸ› οΈ

If no output file is specified, it will write the cleaned PDF to "out.pdf" in the current directory.

  • -p password β€” Use the specified password if the file is encrypted.
  • -g β€” Garbage collect objects that have no references from other objects.
  • -gg β€” In addition to -g, also renumber all objects and compact the cross reference table.
  • -ggg β€” In addition to -gg, also merge and reuse duplicate objects.
  • -gggg β€” In addition to -ggg, also merge and reuse duplicate streams.
  • -l β€” No longer supported! Linearize output. Used to create a "Web Optimized" output file.
  • -D β€” Save file without encryption.
  • -E method β€” Save file with desired encryption method, one of: rc4-40, rc40-128, aes-128, or aes-256.
  • -O password β€” Owner password used when encrypting output file. This is required to edit the output file.
  • -U password β€” User password used when encrypting output file. This is required to view the output file.
  • -P permissions β€” Permissions used when encrypting output file. These are the permissions that apply when the output file is viewed.
  • -a β€” ASCII Hex encode binary streams. Use in conjunction with -d and -i or -f to ensure that although the images and/or fonts are compressed, the resulting file can still be viewed and edited with a text editor.
  • -d β€” Decompress streams. This will make the output file larger, but provides easy access for reading and editing the contents with a text editor.
  • -z β€” Deflate uncompressed streams.
    • If combined with -d, any decompressed streams will be recompressed.
    • If combined with -a, the streams will also be hex encoded after compression.
  • -e effort β€” Configure how much effort is spent compressing the output file. 0 is default amount, otherwise a percentage of the maximum effort, 1 for minimum and 100 for maximum effort.
  • -f β€” Toggle decompression of font streams. Use in conjunction with -d to leave fonts compressed.
  • -i β€” Toggle decompression of image streams. Use in conjunction with -d to leave images compressed.
  • -c β€” Pretty-print graphics commands in content streams.
  • -s β€” Sanitize graphics commands in content streams, this means, for example, removing invalid or redundant commands.
  • -t β€” Use compact PDF object syntax. This saves space.
  • -tt β€” Use indented PDF object syntax. This is more human-readable.
  • -L β€” Print comments containing labels showing how each object can be reached from the Root.
  • -v β€” Transform all text into vector graphics commands.
  • -A β€” Create appearance streams for annotations that are missing appearance streams.
  • -AA β€” Recreate appearance streams for all annotations.
  • -m β€” Preserve metadata.
  • -S β€” Subset fonts if possible. (EXPERIMENTAL!)
  • -Z β€” Use object streams cross reference streams for extra compression.
  • --(color|gray|bitonal)-(|lossy-|lossless-)image-subsample-method=method β€” Set the subsampling method (average or bicubic) for the desired image types, for example color-lossy and bitonal-lossless.
  • --(color|gray|bitonal)-(|lossy-|lossless-)image-subsample-dpi=dpi[,dpi] β€” Set the resolution at which to subsample.
  • --(color|gray|bitonal)-(|lossy-|lossless-)image-recompress-method=quality β€” Set the recompression quality to either of never, same, lossless, jpeg, j2k, fax, or jbig2.
  • --recompress-images-when=(smaller|always) β€” Recompress images when the rewritten images by the subsampling- or recompression methods above are smaller (default), or always recompress them.
  • --structure=(keep|drop) β€” Keep or drop the structure tree.
  • pages β€” Comma-separated list of page numbers and ranges (for example: 1,5,10-15,20-N), where the character N denotes the last page. If no pages are specified, then all pages will be included.

πŸ”„ CONVERT πŸ”„

mutool convert [options] input.pdf [pages ...]

The convert command is used to convert a file from one format to another. 🌈

  • -p password β€” Use the specified password if the file is encrypted.
  • -o output β€” The output format is inferred from the output filename. Embed %d in the name to indicate the page number (for example: "page%d.png"). Printf modifiers are supported, for example "%03d". If no output is specified, the output will go to stdout.
  • -F format β€” Enforce a specific output format. Only necessary when outputting to stdout since normally the output filename is used to infer the output format.
  • -O options β€” Comma-separated list of format specific output options, see PDF OUTPUT OPTIONS and OUTPUT OPTIONS below.
  • -b box β€” Use named page box (MediaBox, CropBox, BleedBox, TrimBox, or ArtBox).
  • -A bits β€” Specify how many bits of anti-aliasing to use. The default is 8.
  • -W width β€” Page width in points for EPUB layout.
  • -H height β€” Page height in points for EPUB layout.
  • -S size β€” Font size in points for EPUB layout.
  • -U filename β€” User CSS stylesheet for EPUB layout.
  • -X β€” Disable document styles for EPUB layout.
  • pages β€” Comma-separated list of page numbers and ranges (for example: 1,5,10-15,20-N), where the character N denotes the last page. If no pages are specified, then all pages will be rendered.

🎨 CREATE 🎨

mutool create [-o output.pdf] [options] page.txt [page2.txt ...]

Okay so the create command is your little PDF bakery bestie 🧁 β€” it builds a brand new PDF file out of the stuff you feed it, and that stuff is one or more input files full of graphics commands. You bring the content, it brings the container.

  • -o output β€” where the PDF goes. And if you literally don't say, it's gonna drop it in the current directory as out.pdf. No cap, that's just where it lands.
  • -O options β€” a comma-separated list of format-specific output options. Peep PDF OUTPUT OPTIONS down below for the whole menu.
  • page.txt β€” this is the moment πŸ’…. A page gets created for each input file you hand over, and the contents of that file get copied straight into the content stream. But also β€” there are special comments in those input files that get parsed to define the page dimensions and the font and image resources. So the comments are doing real work, they're the main characters:
    • %%MediaBox LLX LLY URX URY β€” sets the page size. Default is A4, if you don't say anything.
    • %%Rotate Angle β€” sets the page rotation. Default is 90 degrees.
    • %%Font Name Filename Encoding β€” makes a simple font resource using the declared Name. Filename can be either an actual font file or one of the Base-14 font names (Times-Roman, etc). Encoding is one of Latin (for ISO-8859-1), Greek (for ISO-8859-7) or Cyrillic (for KOI-8).
    • %%Font Name Language WMode Style Language β€” makes a CID font resource for CJK scripts, using the declared Name. Language is one of zh-Hant, zh-Hans, ja, or ko. Wmode is one of H, or V. Style is serif, or sans.
    • %%Image Im0 path/to/image.png β€” makes an image resource. Yes it's literally that easy, obsessed.

✨ COMPLETE EXAMPLE ✨

This one adds an image, a triangle and some text to a page β€” it's giving full demo energy 🌈:

%%MediaBox 0 0 595 842
%%Font TmRm Times-Roman
%%Font Helv-C Helvetica Cyrillic
%%Font Helv-G Helvetica Greek
%%CJKFont Song zh-Hant
%%CJKFont Mincho ja
%%CJKFont Batang ko
%%Image I0 docs/examples/huntingofthesnark.png

% Draw an image.
q
480 0 0 480 50 250 cm
/I0 Do
Q

% Draw a triangle.
q
1 0 0 rg
50 50 m
100 200 l
200 50 l
f
Q

% Show some text.
q
0 0 1 rg
BT /TmRm 24 Tf 50 760 Td (Hello, world!) Tj ET
BT /Helv-C 24 Tf 50 730 Td <fac4d2c1d7d3d4d7d5cad4c521> Tj ET
BT /Helv-G 24 Tf 50 700 Td <eae1ebe7ecddf1e1> Tj ET
BT /Song 24 Tf 50 670 Td <4F60 597D> Tj ET
BT /Mincho 24 Tf 50 640 Td <3053 3093 306b 3061 306f> Tj ET
BT /Batang 24 Tf 50 610 Td <c548 b155 d558 c138 c694> Tj ET
Q

πŸ–ΌοΈ DRAW πŸ–ΌοΈ

mutool draw [options] file [pages ...]

Bestie, draw is the multitasker πŸ‘‘. It will render a document to image files, convert it to another vector format, or extract the text content. Three jobs, one command, main character energy fr fr.

Here's what it can eat as input: pdf, xps, cbz, md, and epub.

Here's what it can spit out as images: pbm, pgm, ppm, pam, png, pwg, pcl, and ps.

As vector: svg,pdf, and debug trace (as xml).

As text: plain text ,html, and structured text (as xml or json).

  • -p password β€” use the specified password if the file is encrypted. Locked doors only, bestie πŸ”.
  • -o output β€” the output format gets inferred from the output filename. Pop a %d in the name to indicate the page number (for example: "page%d.png"). Printf modifiers are supported too, for example "%03d". And if you specify no output at all? It goes to stdout.
  • -F format β€” force a specific output format. You only actually need this when you're outputting to stdout, because normally the output filename is doing the inferring for you.
  • -q β€” be quiet. No progress messages, just vibes 🀫.
  • -R angle β€” rotate clockwise by the given number of degrees.
  • -r resolution β€” render the page at the specified resolution. Default resolution is 72 dpi.
  • -w width β€” render the page at the specified width. Or, if you're using the -r flag, render with a maximum width.
  • -h height β€” render the page at the specified height. Or, if you're using the -r flag, render with a maximum height.
  • -f β€” fit exactly 🎯. Ignore the aspect ratio when matching the specified width/heights.
  • -b box β€” use a named page box: MediaBox, CropBox, BleedBox, TrimBox, or ArtBox.
  • -B bandheight β€” render in banded mode, with each band no taller than the given height. This uses less memory during rendering. ⚠️ Only compatible with pam, pgm, ppm, pnm and png output formats. And heads up β€” banded rendering and md5 checksumming may not be used at the same time.
  • -T threads β€” number of threads to use for rendering (banded mode only).
  • -W width β€” page width in points for EPUB layout.
  • -H height β€” page height in points for EPUB layout.
  • -S size β€” font size in points for EPUB layout.
  • -U filename β€” user CSS stylesheet for EPUB layout.
  • -X β€” disable document styles for EPUB layout.
  • -a β€” disable usage of the accelerator file.
  • -c colorspace β€” render in the specified colorspace. Supported colorspaces are: mono, gray, grayalpha, rgb, rgbalpha, cmyk, cmykalpha. Some abbreviations are allowed: m, g, ga, rgba, cmyka. The default is chosen based on the output format.
  • -e filename β€” proof ICC profile filename to use for rendering.
  • -G gamma β€” apply gamma correction. Some typical values are 0.7 or 1.4, to thin or darken text rendering.
  • -I β€” invert colors πŸ”„.
  • -s [mft5] β€” show various bits of information: m for glyph cache and total memory usage, f for page features such as whether the page is grayscale or color, t for per page rendering times as well statistics, and 5 for md5 checksums of rendered images that can be used to check if rendering has changed.
  • -A bits β€” specify how many bits of anti-aliasing to use. The default is 8.
  • -A bits/bits β€” specify how many bits of anti-aliasing to use. The default is 8. Bits for graphics is before the slash, bits for text after the slash. So like, two different numbers, one little slash, big brain 🧠.
  • -l width β€” minimum stroked line width (in pixels).
  • -K β€” do not draw text.
  • -KK β€” only draw text.
  • -D β€” disable use of display lists. May cause slowdowns, but should reduce the amount of memory used.
  • -i β€” ignore errors. We simply do not see them πŸ’€.
  • -m limit β€” limit memory usage, in bytes.
  • -L β€” low memory mode (avoid caching objects by clearing cache after each page).
  • -P β€” run interpretation and rendering at the same time.
  • -N β€” disable ICC workflow.
  • -M overprint β€” control spot/overprint rendering: 0 for no spot rendering, 1 for Overprint simulation Overprint simulation (default), or 2 for full spot rendering.
  • -t language β€” specify language/script for OCR (default: eng).
  • -d ocr-file-path β€” specify path for OCR files (default: rely on TESSDATA_PREFIX environment variable.
  • -k correction β€” set the skew correction, either one of auto, 0 for increase size, 1 for maintain size, or 2 for decrease size.
  • -k correction,angle β€” set the skew correction as well as the angle.
  • -y l β€” print the layer configs to stderr.
  • -y layer-number β€” select layer config (by number from -y l).
  • -y layer-number,item1,item2, ... β€” select layer config (by number from -y l) and toggle the listed items.
  • -Y β€” print the individual layers to stderr.
  • -z layer-number β€” hide individual layer πŸ™ˆ.
  • -Z layer-number β€” show individual layer ✨.
  • pages β€” comma-separated list of page numbers and ranges (for example: 1,5,10-15,20-N), where the character N denotes the last page. If no pages are specified, then all pages will be rendered. All of them. Every single one 🫢.

πŸ“¦ EXTRACT πŸ“¦

mutool extract [options] file.pdf [object-number ...]

The extract command is here to pull images and font files out of a PDF. If you don't give it any object numbers on the command line, it's gonna extract all images and fonts β€” the whole haul, no picking and choosing 🎁.

  • -p password β€” use the specified password if the file is encrypted.
  • -r β€” convert images to RGB when extracting them.
  • -a β€” Embed SMasks as alpha channel..
  • -N β€” do not use ICC color conversions.

πŸ” INFO πŸ”

mutool info [options] file.pdf [pages ...]

The info command lists the resources used on each page in a PDF file. By default it lists all resource types, but the second you give it one or more flags, only the flagged types get shown. So the flags are like, a filter, and the filter is giving very selective πŸ’….

  • -p password β€” use the specified password if the file is encrypted.
  • -F β€” list fonts.
  • -I β€” list images.
  • -M β€” list page dimensions.
  • -P β€” list patterns.
  • -S β€” list shadings.
  • -X β€” list form and postscript XObjects.
  • -Z β€” list ZUGFeRD info.
  • pages β€” comma-separated list of page numbers and ranges (for example: 1,5,10-15,20-N), where the character N denotes the last page. If no pages are specified, then all pages will be included.

🧬 MERGE 🧬

mutool merge [options] file1 [pages1] [file2 [pages2] ...]

The merge command is the ultimate bestie behaviour: it picks out pages from two or more files and merges them in order into a brand new PDF output file. Two friend groups, one group chat πŸ«‚.

  • -o output β€” the output filename.
  • -O options β€” comma-separated list of format specific output options, see PDF OUTPUT OPTIONS below.

πŸ“ PAGES πŸ“

mutool pages [options] input.pdf [pages ...]

The pages command dumps information about the size and orientation of pages within the document. It's the vibe check for your pages πŸ“βœ¨.

  • -p password β€” use the specified password if the file is encrypted.
  • pages β€” comma-separated list of page numbers and ranges (for example: 1,5,10-15,20-N), where the character N denotes the last page. If no pages are specified, then all pages will be included.

πŸŽ€ POSTER πŸŽ€

mutool poster [options] input.pdf [output.pdf]

okay so bestie, this one is SO fun. poster takes every page and chops it into little tiles, and each tile gets its own page. it's giving "print a giant page on a bunch of smol papers and glue them together into a poster" energy. arts and crafts but make it PDF. πŸ¦‹

  • -p password β€” use the specified password if the file is encrypted. locked doors need keys, periodt.
  • -m margin β€” margin (overlap) between pages, in points or percent. overlap is your friend so nothing gets lost in the glue.
  • -x factor β€” split the page into this many horizontal pieces.
  • -y factor β€” split the page into this many vertical pieces.
  • -r β€” splits hoirzontally from right to left (default splits from left to right). yep, that's the spelling in the original and I'm not touching it, iykyk.

The output will have x times y number of pages for each input page. so like… do the math before you hit print, bestie. 😭


🌈 RECOLOR 🌈

mutool recolor [options] input.pdf

changes the color space used in a PDF to a desired one. this command can, for example, change a color PDF to be grayscale. glow-down on purpose. iconic. πŸ’…

  • -c colorspace β€” desired output colorspace, choose one of gray (default), rgb, or cmyk. that's it, those three, no custom ones, don't try it.
  • -o filename β€” the output filename.
  • -r β€” remove any output intents. bye bye, output intents πŸ’€

✨ RUN ✨

mutool run script.js [arguments]

executes a Javascript program which has access to most of the features of the MuPDF library. the command supports ECMAScript 5 syntax in strict mode. all of the MuPDF constructors and function live in the global object, and the command line arguments are accessible from the global argv object. main character scripting energy fr fr. 🧚

if invoked without any arguments, it will drop you into an interactive REPL (read-eval-print-loop). on the interactive prompt, if you prefix a line with an equal character it will automatically print the results of the line. little quality of life moment.

see the MuPDF documentation at https://mupdf.readthedocs.io for details about the Javascript interfaces. go read it, bestie, it's literally right there. πŸ“š

πŸ” SHOW πŸ”

mutool show [options] file.pdf [object-number ...]

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. detective mode: activated. πŸ•΅οΈβ€β™€οΈ

  • -p password β€” use the specified password if the file is encrypted.
  • -o file β€” write output to file instead of stdout.
  • -e β€” print streams in their original encoded (or compressed) form.
  • -b β€” print streams as binary data and omit the object header.
  • -g β€” print each object on a single line, suitable for grep. one line, no scrolling forever, we love that.
  • -r β€” force repair before showing any objects.
  • -L β€” show object labels (how to reach an object from the root).

specify what to show by using one of the following keywords, or a path to an object:

  • trailer β€” print the trailer dictionary.
  • xref β€” print the cross reference table.
  • pages β€” list the object numbers for every page.
  • grep β€” print all the objects in the file in a compact one-line format suitable for piping to grep.
  • outline β€” print the outline (also known as "table of contents" or "bookmarks").
  • js β€” print document level Javascript.
  • form β€” print 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. (yes, 1, not 0, don't @ me.)
  • * β€” you can use * as an element to iterate over all array indices or dictionary properties in an object. the little wildcard that could πŸ’«

πŸ‘‘ SIGN πŸ‘‘

mutool sign [options] input.pdf [signature-object-number ...]

reads a PDF file and prints information about each signature field object. with suitable options all or specified signatures can be verified, cleared or signed. legal-ish business, but make it glamorous. πŸ–‹οΈ

  • -p password β€” use the specified password if the file is encrypted.
  • -v β€” verify all signatures, or only the specified signature.
  • -c β€” clear all signatures, or only the specified signature.
  • -s certificate-filename β€” read a certificate from the given filename and use it to sign all, or just the specified signature.
  • -P certificate-password β€” use the specified password when opening the certificate.
  • -o filename β€” the output filename. signature object numbers a list of PDF object number for signatures to verify/clear/sign. if no such object numbers are given, all signatures will be processed.

πŸ¦‹ TRACE πŸ¦‹

mutool trace [options] file1 [pages1] [file2 [pages2] ...]

prints a trace of device calls needed to render the desired pages from the given document. it's the receipts for every single draw call. the way that it just tells you everything… obsessed. πŸ”₯

  • -p password β€” use the specified password if the file is encrypted.
  • -b box β€” which box to trim to, either one of: (MediaBox (default), CropBox, BleedBox, TrimBox, or ArtBox).
  • -W width β€” page width in points for EPUB layout.
  • -H height β€” page height in points for EPUB layout.
  • -S size β€” font size in points for EPUB layout.
  • -U filename β€” user CSS stylesheet for EPUB layout.
  • -X β€” disable document styles for EPUB layout.
  • -d β€” enable use of display lists.
  • pages β€” comma-separated list of page numbers and ranges (for example: 1,5,10-15,20-N), where the character N denotes the last page. if no pages are specified, then all pages will be rendered.

🌸 TRIM 🌸

mutool trim [options] input.pdf

makes a modified version of a PDF with content that falls inside (or outside) of the given box removed. scissors but for geometry βœ‚οΈ

  • -b box β€” which box to trim to, either one of: (MediaBox (default), CropBox, BleedBox, TrimBox, or ArtBox).
  • -f β€” fallback to mediabox if specified box not available.
  • -m all β€” add same margins to all sides of the box, where all is positive for inwards, negative for outwards.
  • -m vertical,horizontal β€” add specific margins for vertical and horizontal sides of the box, where vertical and horizontal are positive for inwards, negative for outwards.
  • -m top,right,bottom,left β€” add specific margins for top, right, bottom and left sides of the box, where top, right, bottom, and left each are positive for inwards, negative for outwards.
  • -e β€” exclude contents of box rather than include them. uno reverse card πŸƒ
  • -o filename β€” the output filename.

✨ OUTPUT OPTIONS ✨

Okay bestie, so you wanna control how your stuff comes out? πŸ’… Configuring output is done by a comma-separated list of output options. Comma. Separated. Like a lil list of vibes you hand over all at once. πŸŽ€


πŸ–ΌοΈ Raster output options

These apply to output formats: cbz, png, pnm, pgm, ppm, pam, pbm, pkm.

  • rotate=N β€” Rotate rendered pagess N degrees counterclockwise. (Yes, "pagess" β€” that's literally how it's spelled here, and honestly? iconic typo energy. Not fixing it. πŸ™ˆ)
  • resolution=N β€” Set both X and Y resolution to N pixels per inch.
  • x-resolution=N β€” Set X resolution of rendred pages in pixels per inch.
  • y-resolution=N β€” Set Y resolution of rendred pages in pixels per inch.
  • width=N β€” Render pages to fit N pixels wide (ignore resolution option).
  • height=N β€” Render pages to fit N pixels tall (ignore resolution option).
  • colorspace=(gray|rgb|cmyk) β€” Render pages using the specified colorspace.
  • alpha β€” Render pages with alpha channel and transparent background. πŸ¦‹
  • graphics=(aaN|cop|app) and text=(aaN|cop|app) β€” Set the rasterizer to use for graphics or text respectively:
    • aaN β€” Antialias with N bits (0 to 8).
    • cop β€” Center of pixel.
    • app β€” Any part of pixel.

πŸ–¨οΈ PCL options

These apply to print-raster output formats: pcl, pclm, ps, pwg.

  • colorspace=(mono|rgb) β€” Render 1-bit black and white or a full color page.
  • preset=(generic|ljet4|dj500|fs600|lj|lj2|lj3|lj4|lj4pl|lj4d|lp2563b|oce9050) β€” Render 1-bit black and white or a full color page.
  • spacing=(0|1|2|3) β€” Set vertical spacing to none, PCL 3 (<ESC>*p+<n>Y), PCL 5 (<ESC>*b<n>Y), or PCL 6 (<ESC>*b<n>Y and clear seed row).
  • mode2 β€” Enable mode 2 graphics compression.
  • mode3 β€” Enable mode 3 graphics compression.
  • eog_reset β€” End of graphics (<ESC>+rB) resets all parameters.
  • has_duplex β€” Duplex supported (<ESC>&l<duplex>S).
  • has_papersize β€” Papersize setting supported (<ESC>&l<sizecode>A).
  • has_copies β€” Number of copies supported (<ESC>&l<copies>X).
  • is_ljet4pjl β€” Disable/enable HP 4PJL model-specific output.
  • is_oce9050 β€” Disable/enable Oce 9050 models-specific output.

πŸ“„ PCLm options

These apply only to: pclm.

  • compression=(none|flate) β€” No compression (default), or enable flate compression.
  • strip-height=N β€” Strip height (default 16).

πŸŽ€ PWG options

These apply only to: pwg.

  • media_class=string β€” Set the media_class field.
  • media_color=string β€” Set the media_color field.
  • media_type=string β€” Set the media_type field.
  • output_type=string β€” Set the output_type field.
  • rendering_intent=string β€” Set the rendering_intent field.
  • page_size_name=string β€” Set the page_size_name field.
  • advance_distance=int β€” Set the advance_distance field.
  • advance_media=int β€” Set the advance_media field.
  • collate=int β€” Set the collate field.
  • cut_media=int β€” Set the cut_media field.
  • duplex=int β€” Set the duplex field.
  • insert_sheet=int β€” Set the insert_sheet field.
  • jog=int β€” Set the jog field.
  • leading_edge=int β€” Set the leading_edge field.
  • manual_feed=int β€” Set the manual_feed field.
  • media_position=int β€” Set the media_position field.
  • media_weight=int β€” Set the media_weight field.
  • mirror_print=int β€” Set the mirror_print field.
  • negative_print=int β€” Set the negative_print field.
  • num_copies=int β€” Set the num_copies field.
  • orientation=int β€” Set the orientation field.
  • output_face_up=int β€” Set the output_face_up field.
  • page_size_x=int β€” Set the page_size_x field.
  • page_size_y=int β€” Set the page_size_y field.
  • separations=int β€” Set the separations field.
  • tray_switch=int β€” Set the tray_switch field.
  • tumble=int β€” Set the tumble field.
  • media_type_num=int β€” Set the media_type_num field.
  • compression=int β€” Set the compression field.
  • row_count=int β€” Set the row_count field.
  • row_feed=int β€” Set the row_feed field.
  • row_step=int β€” Set the row_step field.

🌈 SVG options

These apply only to: svg.

  • text=text β€” Emit text as <text> elements (inaccurate fonts).
  • text=path β€” Emit text as <path> elements (accurate fonts).
  • no-reuse-images β€” Do not reuse image using <symbol> definitions.

πŸ’¬ Text options

These apply to output formats: html, xhtml, text, stext.

  • preserve-images β€” Keep imagess in output. (Another lil spelling moment, keeping it fr fr. 🫢)
  • preserve-ligatures β€” Do not expand ligature into constituent characters.
  • preserve-spans β€” Do not merge spans on the same line.
  • preserve-whitespace β€” Do not convert all whitespace into space characters.
  • inhibit-spaces β€” Do not add spaces between gaps in the text.
  • paragraph-break β€” Break blocks at paragraph boundaries.
  • dehyphenate β€” Attempts to join up hyphenated words.
  • ignore-actualtext β€” Do not apply ActualText replacements.
  • use-cid-for-unknown-unicode β€” Use character code if unicode mapping fails.
  • use-gid-for-unknown-unicode β€” Use glyph index if unicode mapping fails.
  • accurate-bboxes β€” Calculate bboxes from the outlines.
  • accurate-ascenders β€” Calculate ascender/descender from font glyphs.
  • accurate-side-bearings β€” Expand character bboxes to completely include width of glyphs.
  • collect-styles β€” Attempt to detect text features (fake bold, strikeout, underlined, etc.)
  • clip β€” Do not include text that is completely clipped.
  • clip-rect=x0:y0:x1:y1 β€” Specify clipping rectangle within which to collect content.
  • structured β€” Collect structure markup.
  • vectors β€” Include vector bboxes in output.
  • lazy-vectors β€” Delay vectors in the extraction that would otherwise split a text line.
  • fuzzy-vectors β€” Merge abutting horizontal and vertical vectors.
  • segment β€” Attempt to segment the page.
  • table-hunt β€” Hunt for tables within a (segmented) page.
  • vertically-collapse-bordered-cells (experimental) β€” If true, consider the contents of completely bordered super-cells as being vertically collapsible.

πŸ“• PDF OUTPUT OPTIONS

These apply only to: PDF.

  • decompress β€” Decompress all streams (except compress-fonts/compress-images).
  • compress=(yes|flate|brotli) β€” Compress all streams, if no value is given, or the value is yes the default is to use flate.
  • compress-fonts β€” Compress object stream for embedded fonts.
  • compress-images β€” Compress object streams for images.
  • compress-effort=(0|percentage) β€” Effort spent compressing, 0 is default, otherwise percentage of max effort.
  • ascii β€” Encode object streams using ASCII hex encoding.
  • pretty β€” Pretty-print objects with indentation.
  • labels β€” Print object labels.
  • linearize β€” No longer supported! Optimize document for progressive loading in viewers. 😭
  • clean β€” Pretty-print graphics commands in content streams.
  • sanitize β€” Clean up graphics command in content streams.
  • garbage β€” Garbage collect unused objects.
  • garbage=compact β€” Garbage collect unused object, and compact cross reference table.
  • garbage=deduplicate β€” Garbage collect unused objects, compact cross reference table, and recombine duplicate objects.
  • incremental β€” Write changes as incremental update.
  • objstms β€” Use object streams and cross reference streams.
  • appearance=(yes|all) β€” Synthesize just missing, or all, annotation/widget appearance streams.
  • continue-on-error β€” Continue saving the document even if there is an error.
  • decrypt β€” This option is deprecated: instead of decrypt use encrypt=none.
  • encrypt=(none|keep|rc4-40|rc4-128|aes-128|aes-256) β€” Write encrypted document using specified encryption method. The default value is keep.
  • permissions=number β€” Document permissions to grant when encrypting.
  • user-password=password β€” Password required to read document.
  • owner-password=password β€” Password required to edit document.
  • regenerate-id=(yes|no) β€” Regenerate document id (default yes).
  • reproducible=(yes|no) β€” Attempt to make produced documents reproducible (default no).
🚨 Heads up bestie: linearize is no longer supported β€” don't come for me, it's right there in the source. And decrypt is deprecated, so swap it for encrypt=none. Periodt. πŸ’…

🚦 EXIT STATUS

The exit status is 0 upon successful execution and non-zero upon error. So like β€” zero means slay, anything else means something went sideways. πŸ”₯


πŸ‘€ SEE ALSO


πŸ‘‘ AUTHOR

MuPDF is Copyright 2004-2026 Artifex Software, Inc.


And that's a wrap on the whole page, bestie! πŸŽ€ This one's from June 3, 2026 β€” a true icon, and we stan. Go forth and mutool your lil heart out. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from