Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10792,6 +10792,7 @@ def clip_to_rect(self, rect):
pdfpage = _as_pdf_page(self)
pclip = JM_rect_from_py(clip)
mupdf.pdf_clip_page(pdfpage, pclip)
JM_refresh_links(pdfpage)

def get_layout(self):
"""Try to access layout information."""
Expand Down
Binary file added tests/resources/test_4942.pdf
Binary file not shown.
9 changes: 9 additions & 0 deletions tests/test_4942.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import pymupdf, os


def test_4942():
path = os.path.abspath(f"{__file__}/../../tests/resources/test_4942.pdf")
document = pymupdf.Document(path)
page = document[0]
page.clip_to_rect(page.rect)
page.get_links()
Loading