You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/page.rst
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,7 @@ In a nutshell, this is what you can do with PyMuPDF:
62
62
:meth:`Page.annot_xrefs` PDF only: a list of annotation (and widget) xrefs
63
63
:meth:`Page.annots` return a generator over the annots on the page
64
64
:meth:`Page.apply_redactions` PDF only: process the redactions of the page
65
+
:meth:`Page.clip_to_rect` PDF only: remove page content outside a rectangle
65
66
:meth:`Page.bound` rectangle of the page
66
67
:meth:`Page.cluster_drawings` PDF only: bounding boxes of vector graphics
67
68
:meth:`Page.delete_annot` PDF only: delete an annotation
@@ -1961,6 +1962,16 @@ In a nutshell, this is what you can do with PyMuPDF:
1961
1962
1962
1963
These changes are **permanent** and cannot be reverted.
1963
1964
1965
+
.. method:: clip_to_rect(rect)
1966
+
1967
+
PDF only: Permanently remove page content outside the given rectangle. This is similar to :meth:`Page.set_cropbox`, but the page's rectangle will not be changed, only the content outside the rectangle will be removed.
1968
+
1969
+
:arg rect_like rect: The rectangle to clip to. Must be finite and its intersection with the page must not be empty.
1970
+
1971
+
The method works best for text: All text on the page will be removed (decided by single character) that has no intersection with the rectangle. For vector graphics, the method will remove all paths that have no intersection with the rectangle. For images, the method will remove all images that have no intersection with the rectangle. Vectors and images **having** an intersection with the rectangle, will be kept in their entirety.
1972
+
1973
+
The method roughly has the same effect as if four redactions had been applied that cover the rectangle's outside.
1974
+
1964
1975
.. method:: remove_rotation()
1965
1976
1966
1977
PDF only: Set page rotation to 0 while maintaining appearance and page content.
Copy file name to clipboardExpand all lines: docs/version.rst
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
+
.. include:: header.rst
2
+
1
3
----
2
4
3
-
This documentation covers **PyMuPDF v1.26.3**.
5
+
This documentation covers PyMuPDF |version|.
4
6
5
7
The major and minor versions of |PyMuPDF| and |MuPDF| will always be the same. Only the third qualifier (patch level) may deviate from that of |MuPDF|.
0 commit comments