mutool draw¶
The draw command will render a document to image files, convert to another vector format, or extract the text content.
The supported input document formats are:
pdf,xps,cbz, andepub.The supported output image formats are:
pbm,pgm,ppm,pam,png,pwg,pclandps.The supported output vector formats are:
svg,pdf, anddebug trace(asxml).The supported output text formats are:
plain text,html, and structured text (asxmlorjson).
mutool draw [options] file [pages]
[options]Options are as follows:
-ppasswordUse the specified password if the file is encrypted.
-ooutputThe output file name. 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 tostdoutfor text output formats, for image output formats nothing is outputted.-FformatEnforce a specific output format. Only necessary when outputting to
stdoutsince normally the output filename is used to infer the output format.-qBe quiet, do not print progress messages.
-RangleRotate clockwise by given number of degrees.
-rresolutionRender the page at the specified resolution. The default resolution is 72 dpi.
-wwidthRender the page at the specified width (or, if the
-rflag is used, render with a maximum width).-hheightRender the page at the specified height (or, if the
-rflag is used, render with a maximum height).-fFit exactly; ignore the aspect ratio when matching specified width/heights.
-bboxUse named page box (
MediaBox,CropBox,BleedBox,TrimBox, orArtBox).-BbandheightRender in banded mode with each band no taller than the given height. This uses less memory during rendering. Only compatible with
pam,pgm,ppm,pnmandpngoutput formats. Banded rendering and md5 checksumming may not be used at the same time.-TthreadsNumber of threads to use for rendering (banded mode only).
-WwidthPage width in points for EPUB layout.
-HheightPage height in points for EPUB layout.
-SsizeFont size in points for EPUB layout.
-UfilenameUser CSS stylesheet for EPUB layout.
-XDisable document styles for EPUB layout.
-aDisable usage of accelerator file.
-ccolorspaceRender 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.-efilenameProof ICC profile filename for rendering.
-GgammaApply gamma correction. Some typical values are 0.7 or 1.4 to thin or darken text rendering.
-IInvert 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.-AbitsSpecify how many bits of anti-aliasing to use. The default is
8.0means no anti-aliasing,9means no anti-aliasing, centre-of-pixel rule,10means no anti-aliasing, any-part-of-a-pixel rule.-Agraphics-bits/text-bitsSpecify separate numbers of bits for anti-aliasing for graphics and for text, use a slash
/as separator.-lwidthMinimum stroke line width (in pixels).
-KDo not draw text.
-KKOnly draw text.
-DDisable use of display lists. May cause slowdowns, but should reduce the amount of memory used.
-iIgnore errors.
-mlimitLimit memory usage in bytes.
-LLow memory mode (avoid caching objects by clearing cache after each page).
-PRun interpretation and rendering at the same time.
-NDisable ICC workflow.
-OoverprintControl spot/overprint rendering:
0for no spot rendering,1for Overprint simulation (default), or2for full spot rendering.-tlanguageSpecify language/script for OCR (default: eng)
-docr-file-pathSpecify path for OCR files (default: rely on
TESSDATA_PREFIXenvironment variable.-kcorrectionSet the skew correction, either one of
auto,0for increase size,1for maintain size, or2for decrease size.-kcorrection,angleSet the skew correction as well as the angle.
-y lPrint the layer configs to stderr.
-ylayer-numberSelect layer config (by number from
-y l).-ylayer-number,item1,item2,…Select layer config (by number from
-y l) and toggle the listed items.-YPrint the individual layers to stderr.
-zlayer-numberHide individual layer.
-Zlayer-numberShow individual layer.
fileInput file name.
[pages]Comma separated list of page ranges. The first page is “1”, and the last page is “N”. The default is “1-N”.