From 4cff547be8adad8cf294b433ff217e0d01e0117b Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Thu, 4 Sep 2025 11:30:20 +0100 Subject: [PATCH 1/3] changes.txt: some updates after recent changes. --- changes.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/changes.txt b/changes.txt index f97b33a2a..1ed7e8911 100644 --- a/changes.txt +++ b/changes.txt @@ -4,6 +4,23 @@ Change Log **Changes in version 1.26.5** +* Fixed issues: + +* Other: + + * Partially address `2883 `_: Improve the Python type annotations for fitz_new + + We now define all class methods explicitly instead of with dynamic assignment. + + * Removed `pymupdf.utils.Shape` class, was duplicate of `pymupdf.Shape`. + + * Allow use of cibuildwheel to build and test on Pyodide. + + * In documentation, added section about Linux wheels and glibc compatibility. + + * Retrospectively mark #4544 as fixed in 1.26.4. + + **Changes in version 1.26.4** * Use MuPDF-1.26.7. @@ -20,6 +37,7 @@ Change Log * **Fixed** `4590 `_: TypeError in utils.py scrub(): annot.update_file(buffer=...) is invalid * **Fixed** `4614 `_: Intercept bad widgets when inserting to another PDF * **Fixed** `4639 `_: pymupdf.mupdf.FzErrorGeneric: code=1: Director error: : 'JM_new_bbox_device_Device' object has no attribute 'layer_name' + * **Fixed** `4544 `_: About pdf_clip_page * Other: From 76829de4fb74013f821897b25e44dcf24866c0f3 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Thu, 4 Sep 2025 11:30:50 +0100 Subject: [PATCH 2/3] docs/page.rst: mark clip_to_rect() as new in v1.26.4. --- docs/page.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/page.rst b/docs/page.rst index a01bd0d10..54b4b7e23 100644 --- a/docs/page.rst +++ b/docs/page.rst @@ -1971,6 +1971,8 @@ In a nutshell, this is what you can do with PyMuPDF: 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. The method roughly has the same effect as if four redactions had been applied that cover the rectangle's outside. + + * New in v1.26.4. .. method:: remove_rotation() From e6d26e43d6773eea497f82422c12940e87f087e7 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Fri, 5 Sep 2025 11:39:43 +0100 Subject: [PATCH 3/3] src/__init__.py: Document.scrub(): added an assert. --- src/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/__init__.py b/src/__init__.py index 63abf48b6..16905771b 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -6646,7 +6646,9 @@ def remove_hidden(cont_lines): if not page.get_contents(): continue if hidden_text: - xref = page.get_contents()[0] # only one b/o cleaning! + xrefs = page.get_contents() + assert len(xrefs) == 1 # only one because of cleaning. + xref = xrefs[0] cont = doc.xref_stream(xref) cont_lines = remove_hidden(cont.splitlines()) # remove hidden text if cont_lines: # something was actually removed