comparison mupdf-source/docs/tools/mutool-draw.rst @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 mutool draw
2 ===========
3
4 The ``draw`` command will render a document to image files, convert to another vector format, or extract the text content.
5
6 - The supported input document formats are: ``pdf``, ``xps``, ``cbz``, and ``epub``.
7
8 - The supported output image formats are: ``pbm``, ``pgm``, ``ppm``, ``pam``, ``png``, ``pwg``, ``pcl`` and ``ps``.
9
10 - The supported output vector formats are: ``svg``, ``pdf``, and ``debug trace`` (as ``xml``).
11
12 - The supported output text formats are: ``plain text``, ``html``, and structured text (as ``xml`` or ``json``).
13
14 .. code-block:: bash
15
16 mutool draw [options] file [pages]
17
18 ``[options]``
19 Options are as follows:
20
21 ``-p`` password
22 Use the specified password if the file is encrypted.
23 ``-o`` output
24 The 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 to ``stdout`` for text output formats, for image output formats nothing is outputted.
25 ``-F`` format
26 Enforce a specific output format. Only necessary when outputting to ``stdout`` since normally the output filename is used to infer the output format.
27 ``-q``
28 Be quiet, do not print progress messages.
29 ``-R`` angle
30 Rotate clockwise by given number of degrees.
31 ``-r`` resolution
32 Render the page at the specified resolution. The default resolution is 72 dpi.
33 ``-w`` width
34 Render the page at the specified width (or, if the ``-r`` flag is used, render with a maximum width).
35 ``-h`` height
36 Render the page at the specified height (or, if the ``-r`` flag is used, render with a maximum height).
37 ``-f``
38 Fit exactly; ignore the aspect ratio when matching specified width/heights.
39 ``-b`` box
40 Use named page box (``MediaBox``, ``CropBox``, ``BleedBox``, ``TrimBox``, or ``ArtBox``).
41 ``-B`` bandheight
42 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. Banded rendering and md5 checksumming may not be used at the same time.
43 ``-T`` threads
44 Number of threads to use for rendering (banded mode only).
45 ``-W`` width
46 Page width in points for EPUB layout.
47 ``-H`` height
48 Page height in points for EPUB layout.
49 ``-S`` size
50 Font size in points for EPUB layout.
51 ``-U`` filename
52 User CSS stylesheet for EPUB layout.
53 ``-X``
54 Disable document styles for EPUB layout.
55 ``-a``
56 Disable usage of accelerator file.
57 ``-c`` colorspace
58 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.
59 ``-e`` filename
60 Proof ICC profile filename for rendering.
61 ``-G`` gamma
62 Apply gamma correction. Some typical values are 0.7 or 1.4 to thin or darken text rendering.
63 ``-I``
64 Invert colors.
65 ``-s`` [mft5]
66 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.
67 ``-A`` bits
68 Specify 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.
69 ``-A`` graphics-bits/text-bits
70 Specify separate numbers of bits for anti-aliasing for graphics and for text, use a slash ``/`` as separator.
71 ``-l`` width
72 Minimum stroke line width (in pixels).
73 ``-K``
74 Do not draw text.
75 ``-KK``
76 Only draw text.
77 ``-D``
78 Disable use of display lists. May cause slowdowns, but should reduce the amount of memory used.
79 ``-i``
80 Ignore errors.
81 ``-m`` limit
82 Limit memory usage in bytes.
83 ``-L``
84 Low memory mode (avoid caching objects by clearing cache after each page).
85 ``-P``
86 Run interpretation and rendering at the same time.
87 ``-N``
88 Disable ICC workflow.
89 ``-O`` overprint
90 Control spot/overprint rendering: ``0`` for no spot rendering, ``1`` for Overprint simulation (default), or ``2`` for full spot rendering.
91 ``-t`` language
92 Specify language/script for OCR (default: eng)
93 ``-d`` ocr-file-path
94 Specify path for OCR files (default: rely on ``TESSDATA_PREFIX`` environment variable.
95 ``-k`` correction
96 Set the skew correction, either one of ``auto``, ``0`` for increase size, ``1`` for maintain size, or ``2`` for decrease size.
97 ``-k`` correction,angle
98 Set the skew correction as well as the angle.
99 ``-y l``
100 Print the layer configs to stderr.
101 ``-y`` layer-number
102 Select layer config (by number from ``-y l``).
103 ``-y`` layer-number,item1,item2,...
104 Select layer config (by number from ``-y l``) and toggle the listed items.
105 ``-Y``
106 Print the individual layers to stderr.
107 ``-z`` layer-number
108 Hide individual layer.
109 ``-Z`` layer-number
110 Show individual layer.
111
112 ``file``
113 Input file name.
114
115 ``[pages]``
116 Comma separated list of page ranges. The first page is "1", and the last page is "N". The default is "1-N".