pdfminer.six icon indicating copy to clipboard operation
pdfminer.six copied to clipboard

Rect has not close loop flag, but it really is rect

Open ChandlerBent opened this issue 2 years ago • 0 comments

Bug report

the shape is "mlll". the pts is: [(424.45999145, 690.52001953), (306.14199065, 690.52001953), (306.14199065, 691.0870195), (424.45999145, 691.0870195)]

Although it is not close. But the pts seem it should closed. So I think that should it run into rect's code try to parse it?

sample code. converter.py 158 line

            elif shape in {"mlllh", "mllll", "mlll"}:
                (x0, y0), (x1, y1), (x2, y2), (x3, y3), *_ = pts
                
                if shape == 'mlll':
                    last_pts = pts[0]
                else:
                    last_pts = pts[4]

                is_closed_loop = pts[0] == last_pts
                ......

This is sample pdf. You can try it from page 4 [email protected]

ChandlerBent avatar Jul 28 '23 09:07 ChandlerBent