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. π
-ofilename β 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.-Ooptions β A comma-separated list of PDF options. SeePDF OUTPUT OPTIONSbelow.
π BARCODE π
mutool barcode -d [options] file1.pdf [pages1] [file2.pdf] [pages2]
Decodes a barcode from an image or a document. πΈ
-ppassword β Use the specified password if the file is encrypted.-ooutput β The output filename. If no output is specified, any text from decoded barcodes will go tostdout.-rangle β 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 characterNdenotes 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. β¨
-ooutput β The output format is inferred from the output filename, eitherPNGorPDF. If no output is specified, the default isout.png-Fformat β The desired output barcode format:azteccodabarcode39code93code128databardatabarexpandeddatamatrixean8ean13itfmaxicodepdf417qrcodeupcaupcemicroqrcodermqrcodedxfilmedgedatabarlimited
-ssize β 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.-tlevel β 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.
-ppassword β 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.-Emethod β Save file with desired encryption method, one of:rc4-40,rc40-128,aes-128, oraes-256.-Opassword β Owner password used when encrypting output file. This is required to edit the output file.-Upassword β User password used when encrypting output file. This is required to view the output file.-Ppermissions β 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-dand-ior-fto 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.
- If combined with
-eeffort β Configure how much effort is spent compressing the output file.0is default amount, otherwise a percentage of the maximum effort,1for minimum and100for maximum effort.-fβ Toggle decompression of font streams. Use in conjunction with-dto leave fonts compressed.-iβ Toggle decompression of image streams. Use in conjunction with-dto 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 theRoot.-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 (averageorbicubic) for the desired image types, for examplecolor-lossyandbitonal-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 ofnever,same,lossless,jpeg,j2k,fax, orjbig2.--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 characterNdenotes 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. π
-ppassword β Use the specified password if the file is encrypted.-ooutput β The output format is inferred from the output filename. Embed%din 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 tostdout.-Fformat β Enforce a specific output format. Only necessary when outputting tostdoutsince normally the output filename is used to infer the output format.-Ooptions β Comma-separated list of format specific output options, seePDF OUTPUT OPTIONSandOUTPUT OPTIONSbelow.-bbox β Use named page box (MediaBox,CropBox,BleedBox,TrimBox, orArtBox).-Abits β Specify how many bits of anti-aliasing to use. The default is8.-Wwidth β Page width in points for EPUB layout.-Hheight β Page height in points for EPUB layout.-Ssize β Font size in points for EPUB layout.-Ufilename β 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 characterNdenotes 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 asout.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 ofLatin(for ISO-8859-1),Greek(for ISO-8859-7) orCyrillic(for KOI-8).%%Font Name Language WMode Style Languageβ makes a CID font resource for CJK scripts, using the declared Name. Language is one ofzh-Hant,zh-Hans,ja, orko. Wmode is one ofH, orV. Style isserif, orsans.%%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%din 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-rflag, render with a maximum width.-h heightβ render the page at the specified height. Or, if you're using the-rflag, 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, orArtBox.-B bandheightβ render in banded mode, with each band no taller than the given height. This uses less memory during rendering. β οΈ Only compatible withpam,pgm,ppm,pnmandpngoutput 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 are0.7or1.4, to thin or darken text rendering.-Iβ invert colors π.-s [mft5]β show various bits of information:mfor glyph cache and total memory usage,ffor page features such as whether the page is grayscale or color,tfor per page rendering times as well statistics, and5for 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:0for no spot rendering,1for Overprint simulation Overprint simulation (default), or2for full spot rendering.-t languageβ specify language/script for OCR (default:eng).-d ocr-file-pathβ specify path for OCR files (default: rely onTESSDATA_PREFIXenvironment variable.-k correctionβ set the skew correction, either one ofauto,0for increase size,1for maintain size, or2for 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 characterNdenotes 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 characterNdenotes 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 characterNdenotes 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. π¦
-ppassword β use the specified password if the file is encrypted. locked doors need keys, periodt.-mmargin β margin (overlap) between pages, in points or percent. overlap is your friend so nothing gets lost in the glue.-xfactor β split the page into this many horizontal pieces.-yfactor β 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. π
-ccolorspace β desired output colorspace, choose one ofgray(default),rgb, orcmyk. that's it, those three, no custom ones, don't try it.-ofilename β 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. π΅οΈββοΈ
-ppassword β use the specified password if the file is encrypted.-ofile β 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 forgrep. 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 togrep.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 keywordtrailerorpages. separate elements with a period.or slash/. select a page object by usingpages/Nwhere N is the page number. the first page is number1. (yes,1, not0, 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. ποΈ
-ppassword β 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.-scertificate-filename β read a certificate from the given filename and use it to sign all, or just the specified signature.-Pcertificate-password β use the specified password when opening the certificate.-ofilename β 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. π₯
-ppassword β use the specified password if the file is encrypted.-bbox β which box to trim to, either one of: (MediaBox(default),CropBox,BleedBox,TrimBox, orArtBox).-Wwidth β page width in points for EPUB layout.-Hheight β page height in points for EPUB layout.-Ssize β font size in points for EPUB layout.-Ufilename β 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 characterNdenotes 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 βοΈ
-bbox β which box to trim to, either one of: (MediaBox(default),CropBox,BleedBox,TrimBox, orArtBox).-fβ fallback to mediabox if specified box not available.-mall β add same margins to all sides of the box, where all is positive for inwards, negative for outwards.-mvertical,horizontal β add specific margins for vertical and horizontal sides of the box, where vertical and horizontal are positive for inwards, negative for outwards.-mtop,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 π-ofilename β 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 pagessNdegrees 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 toNpixels 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 fitNpixels wide (ignore resolution option).height=Nβ Render pages to fitNpixels 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)andtext=(aaN|cop|app)β Set the rasterizer to use for graphics or text respectively:aaNβ Antialias withNbits (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>Yand 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 (default16).
π PWG options
These apply only to: pwg.
media_class=stringβ Set themedia_classfield.media_color=stringβ Set themedia_colorfield.media_type=stringβ Set themedia_typefield.output_type=stringβ Set theoutput_typefield.rendering_intent=stringβ Set therendering_intentfield.page_size_name=stringβ Set thepage_size_namefield.advance_distance=intβ Set theadvance_distancefield.advance_media=intβ Set theadvance_mediafield.collate=intβ Set thecollatefield.cut_media=intβ Set thecut_mediafield.duplex=intβ Set theduplexfield.insert_sheet=intβ Set theinsert_sheetfield.jog=intβ Set thejogfield.leading_edge=intβ Set theleading_edgefield.manual_feed=intβ Set themanual_feedfield.media_position=intβ Set themedia_positionfield.media_weight=intβ Set themedia_weightfield.mirror_print=intβ Set themirror_printfield.negative_print=intβ Set thenegative_printfield.num_copies=intβ Set thenum_copiesfield.orientation=intβ Set theorientationfield.output_face_up=intβ Set theoutput_face_upfield.page_size_x=intβ Set thepage_size_xfield.page_size_y=intβ Set thepage_size_yfield.separations=intβ Set theseparationsfield.tray_switch=intβ Set thetray_switchfield.tumble=intβ Set thetumblefield.media_type_num=intβ Set themedia_type_numfield.compression=intβ Set thecompressionfield.row_count=intβ Set therow_countfield.row_feed=intβ Set therow_feedfield.row_step=intβ Set therow_stepfield.
π 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 applyActualTextreplacements.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 (exceptcompress-fonts/compress-images).compress=(yes|flate|brotli)β Compress all streams, if no value is given, or the value isyesthe default is to useflate.compress-fontsβ Compress object stream for embedded fonts.compress-imagesβ Compress object streams for images.compress-effort=(0|percentage)β Effort spent compressing,0is 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 ofdecryptuseencrypt=none.encrypt=(none|keep|rc4-40|rc4-128|aes-128|aes-256)β Write encrypted document using specified encryption method. The default value iskeep.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 (defaultyes).reproducible=(yes|no)β Attempt to make produced documents reproducible (defaultno).
π¨ Heads up bestie:linearizeis no longer supported β don't come for me, it's right there in the source. Anddecryptis deprecated, so swap it forencrypt=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
- arch rolling: mupdf-tools 1.28.5-2 Β· AGPL-3.0-or-later
- fedora 44: mupdf 1.28.2-1.fc44
- fedora 44: mupdf 1.28.2-3.fc44 Β· AGPL-3.0-or-later
- nixpkgs unstable: mupdf 1.28.5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms