Skip to content

Commit 2aaf94a

Browse files
committed
docu updates
1 parent 31ccaca commit 2aaf94a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

docs/faq.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ To achieve this, we define a rectangle equal to the area we want to appear in th
6969

7070
mat = fitz.Matrix(2, 2) # zoom factor 2 in each direction
7171
rect = page.rect # the page rectangle
72-
mp = rect.tl + (rect.br - rect.tl) * 0.5 # its middle point
72+
mp = (rect.tl + rect.br) * 0.5 # its middle point, becomes top-left of clip
7373
clip = fitz.Rect(mp, rect.br) # the area we want
7474
pix = page.getPixmap(matrix=mat, clip=clip)
7575

docs/page.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -722,9 +722,11 @@ In a nutshell, this is what you can do with PyMuPDF:
722722

723723
Changed in version 1.14.11 By default, the image keeps its aspect ratio.
724724

725-
:arg rect_like rect: where to put the image on the page. Only the rectangle part which is inside the page is used. This intersection must be finite and not empty.
725+
:arg rect_like rect: where to put the image. Must be finite and not empty.
726+
727+
*(Changed in v1.17.6)* Needs no longer have a non-empty intersection with the page's :attr:`Page.CropBox` [#f5]_.
726728

727-
Changed in version 1.14.13 The image is now always placed **centered** in the rectangle, i.e. the center of the image and the rectangle coincide.
729+
*(Changed in version 1.14.13)* The image is now always placed **centered** in the rectangle, i.e. the centers of image and rectangle are equal.
728730

729731
:arg str filename: name of an image file (all formats supported by MuPDF -- see :ref:`ImageFiles`). If the same image is to be inserted multiple times, choose one of the other two options to avoid some overhead.
730732

@@ -1241,3 +1243,5 @@ The page number "pno" is a 0-based integer *-inf < pno < pageCount*.
12411243
.. [#f3] Not all PDF readers display these fonts at all. Some others do, but use a wrong character spacing, etc.
12421244
12431245
.. [#f4] You are generally free to choose any of the :ref:`mupdficons` you consider adequate.
1246+
1247+
.. [#f5] The previous algorithm caused images to be **shrunk** to this intersection. Now the image can be anywhere on :attr:`Page.MediaBox`, potentially being invisible or only partially visible if the cropbox (representing the visible page part) is smaller.

0 commit comments

Comments
 (0)