Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

'Rect' object has no attribute 'get_area' #4742

Open
@fareshan

Description

Description of the bug

get_area became not working

I get this error: AttributeError: 'Rect' object has no attribute 'get_area'

How to reproduce the bug

Open Google Colab and put this script:

%pip install pymupdf
import fitz # PyMuPDF
# Create a dummy PDF document
doc = fitz.open()
page = doc.new_page()
# Test the get_area() function
area_in_inches = page.rect.get_area("in")
print(f"Area of the page in square inches: {area_in_inches}")

=> Error:

AttributeError: 'Rect' object has no attribute 'get_area'

Documentation:
https://pymupdf.readthedocs.io/en/latest/rect.html#Rect.get_area

The problem exists even in older versions of pymupdf.
I was not getting the problem with the same code before. I don't know what has changed recently so that get_area became not usable

PyMuPDF version

1.26.5

Operating system

MacOS

Python version

3.11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /