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
,pcl
andps
.The supported output vector formats are:
svg
,pdf
, anddebug trace
(asxml
).The supported output text formats are:
plain text
,html
, and structured text (asxml
orjson
).
mutool draw [options] file [pages]
Note
Command line parameters within square brackets []
are optional.
[options]
Options are as follows:
-p
passwordUse the specified password if the file is encrypted.
-o
outputThe output file name. 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 tostdout
for text output formats, for image output formats nothing is outputted.-F
formatEnforce a specific output format. Only necessary when outputting to
stdout
since normally the output filename is used to infer the output format.-q
Be quiet, do not print progress messages.
-R
angleRotate clockwise by given number of degrees.
-r
resolutionRender the page at the specified resolution. The default resolution is 72 dpi.
-w
widthRender the page at the specified width (or, if the
-r
flag is used, render with a maximum width).-h
heightRender the page at the specified height (or, if the
-r
flag is used, render with a maximum height).-f
Fit exactly; ignore the aspect ratio when matching specified width/heights.
-b
boxUse named page box (
MediaBox
,CropBox
,BleedBox
,TrimBox
, orArtBox
), see defined boxes.-B
bandheightRender 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
andpng
output formats. Banded rendering and md5 checksumming may not be used at the same time.-T
threadsNumber of threads to use for rendering (banded mode only).
-W
widthPage width in points for EPUB layout.
-H
heightPage height in points for EPUB layout.
-S
sizeFont size in points for EPUB layout.
-U
filenameUser CSS stylesheet for EPUB layout.
-X
Disable document styles for EPUB layout.
-a
Disable usage of accelerator file.
-c
colorspaceRender 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
filenameProof ICC profile filename for rendering.
-G
gammaApply 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, and5
for md5 checksums of rendered images that can be used to check if rendering has changed.-A
bitsSpecify how many bits of anti-aliasing to use. The default is
8
.0
means no anti-aliasing,9
means no anti-aliasing, centre-of-pixel rule,10
means no anti-aliasing, any-part-of-a-pixel rule.-A
graphics-bits/text-bitsSpecify separate numbers of bits for anti-aliasing for graphics and for text, use a slash
/
as separator.-l
widthMinimum stroke 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.
-m
limitLimit 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.
-O
overprintControl spot/overprint rendering:
0
for no spot rendering,1
for Overprint simulation (default), or2
for full spot rendering.-t
languageSpecify language/script for OCR (default: eng)
-d
ocr-file-pathSpecify path for OCR files (default: rely on
TESSDATA_PREFIX
environment variable.-k
correctionSet the skew correction, either one of
auto
,0
for increase size,1
for maintain size, or2
for decrease size.-k
correction,angleSet the skew correction as well as the angle.
-y l
Print the layer configs to stderr.
-y
layer-numberSelect 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-numberHide individual layer.
-Z
layer-numberShow individual layer.
file
Input file name. The input can be any of the document formats supported by MuPDF.
[pages]
Comma separated list of page ranges. The first page is “1”, and the last page is “N”. The default is “1-N”.