Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

block_no and block_type are switched in get_text("block") #1946

Closed
Ulipenitz opened this issue Oct 5, 2022 · 2 comments
Closed

block_no and block_type are switched in get_text("block") #1946

Ulipenitz opened this issue Oct 5, 2022 · 2 comments
Assignees
Labels
documentation issue resolved fixed / implemented / answered

Comments

@Ulipenitz
Copy link

Ulipenitz commented Oct 5, 2022

Please provide all mandatory information!

Describe the bug (mandatory)

A clear and concise description of what the bug is.
get_text("block") should give (x0, y0, x1, y1, "lines in block", block_type, block_no) (according to https://pymupdf.readthedocs.io/en/latest/app1.html), but gives back (x0, y0, x1, y1, "lines in block", block_no, block_type)

To Reproduce (mandatory)

Explain the steps to reproduce the behavior, For example, include a minimal code snippet, example files, etc.

        with fitz.open(path) as document:
                for page in document:
                    paragraphs = page.get_text("blocks")
                    for paragraph in paragraphs:
                        print(paragraph)

Expected behavior (optional)

Describe what you expected to happen (if not obvious).

Screenshots (optional)

If applicable, add screenshots to help explain your problem.

Your configuration (mandatory)

  • Operating system, potentially version and bitness
  • Python version, bitness
  • PyMuPDF version, installation method (wheel or generated from source).

windows10 home
python3.7
PyMuPDF-1.20.2-cp37-cp37m-win_amd64.whl

For example, the output of print(sys.version, "\n", sys.platform, "\n", fitz.__doc__) would be sufficient (for the first two bullets).

Additional context (optional)

Add any other context about the problem here.

@JorjMcKie
Copy link
Collaborator

We will correct the documentation.

@julian-smith-artifex-com
Copy link
Collaborator

Fixed in 1.21.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation issue resolved fixed / implemented / answered
Projects
None yet
Development

No branches or pull requests

3 participants