jsvine / pdfplumber

Plumb a PDF for detailed information about each char, rectangle, line, et cetera — and easily extract text and tables.
MIT License
6.1k stars 625 forks source link

page.rects get wrong results #860

Closed NextGuido closed 1 year ago

NextGuido commented 1 year ago

## Describe the bug

page.rects get wrong results!

Code to reproduce the problem

import pdfplumber

pdf = pdfplumber.open('EVENT-5918-8ac0a93d87736d370187753417bf0df2.pdf')
page = pdf.pages[0]
page.to_image().draw_rects(page.rects).save('rects.png')

PDF file

Please attach any PDFs necessary to reproduce the problem. EVENT-5918-8ac0a93d87736d370187753417bf0df2.pdf

If you need to redact text in a sensitive PDF, you can run it through JoshData/pdf-redactor.

Expected behavior

What did you expect the result should have been? just like this! Not the same file to the demo! rects

Actual behavior

What actually happened, instead? rects

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

Additional context

Add any other context/notes about the problem [here.](url)