comparison mupdf-source/docs/tools/mutool-trim.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 trim
2 ===========
3
4 This command allows you to make a modified version of a PDF with content that falls inside or outside of various "boxes" removed.
5
6 See :doc:`/tools/mutool-pages` for how to list out the boxes used on a page.
7
8 .. code-block:: bash
9
10 mutool trim [options] input.pdf
11
12 ``[options]``
13 Options are as follows:
14
15 ``-b`` box
16 Which :term:`page box` to trim to (``mediabox`` (default), ``cropbox``, ``bleedbox``, ``trimbox``, ``artbox``).
17
18 ``-m`` margins
19 Add margins to box (positive for inwards, negative for outwards).
20
21 *<All>* or *<V>,<H>* or *<T>,<R>,<B>,<L>*
22
23 ``-e``
24 Exclude contents of box, rather than include them.
25
26 ``-f``
27 Fallback to ``mediabox`` if specified box not available.
28
29 ``-o`` filename
30 Output file.
31
32 Examples
33 --------
34
35 Trim a document by trimming the MediaBox elements with a margin of 200 points inwards:
36
37 .. code-block::
38
39 mutool trim -b mediabox -m 200 -o out.pdf in.pdf
40
41 Trim a document by trimming the MediaBox elements with a margin of 20 points from the top & bottom (vertical) and 30 points from the left & right (horizontal):
42
43 .. code-block::
44
45 mutool trim -b mediabox -m 20,30 -o out.pdf in.pdf
46
47 Trim a document by trimming the MediaBox elements to a box offset 10 points from the top & right, 50 points from the bottom and 20 points in from the left:
48
49 .. code-block::
50
51 mutool trim -b mediabox -m 10,10,50,20 -o out.pdf in.pdf
52
53 Exclude the contents of the ArtBox element:
54
55 .. code-block::
56
57 mutool trim -b artbox -e -o out.pdf in.pdf